Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(config): sw-2357 replace public cloud display copy #1306

Merged
merged 1 commit into from
Apr 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 2 additions & 18 deletions src/components/i18n/__tests__/__snapshots__/i18n.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -726,11 +726,7 @@ exports[`I18n Component should generate a predictable locale key output snapshot
},
{
"key": "curiosity-inventory.label",
"match": "translate('curiosity-inventory.label', { context: [INVENTORY_TYPES.CATEGORY, category] })",
},
{
"key": "curiosity-inventory.label",
"match": "translate('curiosity-inventory.label', { context: [INVENTORY_TYPES.CLOUD_PROVIDER, cloudProvider] })",
"match": "translate('curiosity-inventory.label', { context: (cloudProvider && [INVENTORY_TYPES.CLOUD_PROVIDER, cloudProvider])",
},
{
"key": "curiosity-inventory.measurement",
Expand Down Expand Up @@ -918,11 +914,7 @@ exports[`I18n Component should generate a predictable locale key output snapshot
},
{
"key": "curiosity-inventory.label",
"match": "translate('curiosity-inventory.label', { context: [INVENTORY_TYPES.CATEGORY, category] })",
},
{
"key": "curiosity-inventory.label",
"match": "translate('curiosity-inventory.label', { context: [INVENTORY_TYPES.CLOUD_PROVIDER, cloudProvider] })",
"match": "translate('curiosity-inventory.label', { context: (cloudProvider && [INVENTORY_TYPES.CLOUD_PROVIDER, cloudProvider])",
},
{
"key": "curiosity-inventory.measurement",
Expand Down Expand Up @@ -1140,10 +1132,6 @@ exports[`I18n Component should have locale keys that exist in the default langua
"file": "src/config/product.rhel.js",
"key": "curiosity-inventory.label",
},
{
"file": "src/config/product.rhel.js",
"key": "curiosity-inventory.label",
},
{
"file": "src/config/product.rhelElsPayg.js",
"key": "curiosity-graph.label_axisY",
Expand Down Expand Up @@ -1192,10 +1180,6 @@ exports[`I18n Component should have locale keys that exist in the default langua
"file": "src/config/product.satellite.js",
"key": "curiosity-inventory.label",
},
{
"file": "src/config/product.satellite.js",
"key": "curiosity-inventory.label",
},
]
`;

Expand Down
56 changes: 12 additions & 44 deletions src/config/__tests__/__snapshots__/product.config.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -3913,7 +3913,7 @@ exports[`Product specific configurations should apply variations in inventory fi
"isSort": true,
"label": [Function],
"metric": "category",
"width": 20,
"width": 15,
},
{
"cell": [Function],
Expand Down Expand Up @@ -3966,20 +3966,12 @@ exports[`Product specific configurations should apply variations in inventory fi
"width": 15,
},
{
"content": <React.Fragment>
t(curiosity-inventory.label, {"context":"category"})

<Label
color="purple"
>
t(curiosity-inventory.label_cloud_provider, {"context":"dolor sit"})
</Label>
</React.Fragment>,
"content": "t(curiosity-inventory.label_cloud_provider, {"context":"dolor sit"})",
"dataLabel": "t([curiosity-inventory.header_category,curiosity-inventory.guestsHeader_category], {"context":"RHEL for x86"})",
"header": [Function],
"isSort": true,
"metric": "category",
"width": 20,
"width": 15,
},
{
"content": "t(curiosity-inventory.measurement, {"testId":{"type":"span","key":null,"ref":null,"props":{"data-test":"instances-cell-Sockets","data-value":"undefined"},"_owner":null,"_store":{}}})",
Expand Down Expand Up @@ -4354,7 +4346,7 @@ exports[`Product specific configurations should apply variations in inventory fi
"isSort": true,
"label": [Function],
"metric": "category",
"width": 20,
"width": 15,
},
{
"cell": [Function],
Expand Down Expand Up @@ -4407,20 +4399,12 @@ exports[`Product specific configurations should apply variations in inventory fi
"width": 15,
},
{
"content": <React.Fragment>
t(curiosity-inventory.label, {"context":"category"})

<Label
color="purple"
>
t(curiosity-inventory.label_cloud_provider, {"context":"dolor sit"})
</Label>
</React.Fragment>,
"content": "t(curiosity-inventory.label_cloud_provider, {"context":"dolor sit"})",
"dataLabel": "t([curiosity-inventory.header_category,curiosity-inventory.guestsHeader_category], {"context":"Satellite Server"})",
"header": [Function],
"isSort": true,
"metric": "category",
"width": 20,
"width": 15,
},
{
"content": "t(curiosity-inventory.measurement, {"testId":{"type":"span","key":null,"ref":null,"props":{"data-test":"instances-cell-Sockets","data-value":"undefined"},"_owner":null,"_store":{}}})",
Expand Down Expand Up @@ -4912,7 +4896,7 @@ exports[`Product specific configurations should apply variations in inventory fi
"isSort": true,
"label": [Function],
"metric": "category",
"width": 20,
"width": 15,
},
{
"cell": [Function],
Expand Down Expand Up @@ -4958,20 +4942,12 @@ exports[`Product specific configurations should apply variations in inventory fi
"width": 15,
},
{
"content": <React.Fragment>
t(curiosity-inventory.label, {"context":"category"})

<Label
color="purple"
>
t(curiosity-inventory.label_cloud_provider, {"context":"dolor sit"})
</Label>
</React.Fragment>,
"content": "t(curiosity-inventory.label_cloud_provider, {"context":"dolor sit"})",
"dataLabel": "t([curiosity-inventory.header_category,curiosity-inventory.guestsHeader_category], {"context":"RHEL for x86"})",
"header": [Function],
"isSort": true,
"metric": "category",
"width": 20,
"width": 15,
},
{
"content": "t(curiosity-inventory.measurement, {"testId":{"type":"span","key":null,"ref":null,"props":{"data-test":"instances-cell-Sockets","data-value":"undefined"},"_owner":null,"_store":{}}})",
Expand Down Expand Up @@ -5346,7 +5322,7 @@ exports[`Product specific configurations should apply variations in inventory fi
"isSort": true,
"label": [Function],
"metric": "category",
"width": 20,
"width": 15,
},
{
"cell": [Function],
Expand Down Expand Up @@ -5392,20 +5368,12 @@ exports[`Product specific configurations should apply variations in inventory fi
"width": 15,
},
{
"content": <React.Fragment>
t(curiosity-inventory.label, {"context":"category"})

<Label
color="purple"
>
t(curiosity-inventory.label_cloud_provider, {"context":"dolor sit"})
</Label>
</React.Fragment>,
"content": "t(curiosity-inventory.label_cloud_provider, {"context":"dolor sit"})",
"dataLabel": "t([curiosity-inventory.header_category,curiosity-inventory.guestsHeader_category], {"context":"Satellite Server"})",
"header": [Function],
"isSort": true,
"metric": "category",
"width": 20,
"width": 15,
},
{
"content": "t(curiosity-inventory.measurement, {"testId":{"type":"span","key":null,"ref":null,"props":{"data-test":"instances-cell-Sockets","data-value":"undefined"},"_owner":null,"_store":{}}})",
Expand Down
24 changes: 9 additions & 15 deletions src/config/product.rhel.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
chart_color_purple_100 as chartColorPurpleLight,
chart_color_purple_300 as chartColorPurpleDark
} from '@patternfly/react-tokens';
import { Button, Label as PfLabel } from '@patternfly/react-core';
import { Button } from '@patternfly/react-core';
import { DateFormat } from '@redhat-cloud-services/frontend-components/DateFormat';
import moment from 'moment';
import {
Expand Down Expand Up @@ -248,21 +248,15 @@ const config = {
},
{
metric: INVENTORY_TYPES.CATEGORY,
cell: ({ [INVENTORY_TYPES.CLOUD_PROVIDER]: cloudProvider, [INVENTORY_TYPES.CATEGORY]: category } = {}) => (
<React.Fragment>
{translate('curiosity-inventory.label', { context: [INVENTORY_TYPES.CATEGORY, category] })}{' '}
{(cloudProvider && (
<PfLabel color="purple">
{translate('curiosity-inventory.label', {
context: [INVENTORY_TYPES.CLOUD_PROVIDER, cloudProvider]
})}
</PfLabel>
)) ||
''}
</React.Fragment>
),
cell: ({ [INVENTORY_TYPES.CLOUD_PROVIDER]: cloudProvider, [INVENTORY_TYPES.CATEGORY]: category } = {}) =>
translate('curiosity-inventory.label', {
context: (cloudProvider && [INVENTORY_TYPES.CLOUD_PROVIDER, cloudProvider]) || [
INVENTORY_TYPES.CATEGORY,
category
]
}),
isSort: true,
width: 20
width: 15
},
{
metric: RHSM_API_PATH_METRIC_TYPES.SOCKETS,
Expand Down
24 changes: 9 additions & 15 deletions src/config/product.satellite.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
chart_color_purple_100 as chartColorPurpleLight,
chart_color_purple_300 as chartColorPurpleDark
} from '@patternfly/react-tokens';
import { Button, Label as PfLabel } from '@patternfly/react-core';
import { Button } from '@patternfly/react-core';
import { DateFormat } from '@redhat-cloud-services/frontend-components/DateFormat';
import {
RHSM_API_PATH_METRIC_TYPES,
Expand Down Expand Up @@ -225,21 +225,15 @@ const config = {
},
{
metric: INVENTORY_TYPES.CATEGORY,
cell: ({ [INVENTORY_TYPES.CLOUD_PROVIDER]: cloudProvider, [INVENTORY_TYPES.CATEGORY]: category } = {}) => (
<React.Fragment>
{translate('curiosity-inventory.label', { context: [INVENTORY_TYPES.CATEGORY, category] })}{' '}
{(cloudProvider && (
<PfLabel color="purple">
{translate('curiosity-inventory.label', {
context: [INVENTORY_TYPES.CLOUD_PROVIDER, cloudProvider]
})}
</PfLabel>
)) ||
''}
</React.Fragment>
),
cell: ({ [INVENTORY_TYPES.CLOUD_PROVIDER]: cloudProvider, [INVENTORY_TYPES.CATEGORY]: category } = {}) =>
translate('curiosity-inventory.label', {
context: (cloudProvider && [INVENTORY_TYPES.CLOUD_PROVIDER, cloudProvider]) || [
INVENTORY_TYPES.CATEGORY,
category
]
}),
isSort: true,
width: 20
width: 15
},
{
metric: RHSM_API_PATH_METRIC_TYPES.SOCKETS,
Expand Down
2 changes: 2 additions & 0 deletions src/services/rhsm/rhsmServices.js
Original file line number Diff line number Diff line change
Expand Up @@ -1714,6 +1714,7 @@ const getInstancesInventoryGuests = (id, params = {}, options = {}) => {
* "number_of_guests": 70,
* "category": "cloud",
* "billing_provider": "red hat",
* "cloud_provider": "aws",
* "billing_account_id": "xxxxx-xxxx-xxxx-xxxx-xxxx01",
* "inventory_id": "d6214a0b-b344-4778-831c-d53dcacb2da3",
* "instance_id": "i-831cd53dcacb2da3",
Expand All @@ -1731,6 +1732,7 @@ const getInstancesInventoryGuests = (id, params = {}, options = {}) => {
* {
* "category": "cloud",
* "billing_provider": "azure",
* "cloud_provider": "azure",
* "billing_account_id": "xxxxx-xxxx-xxxx-xxxx-xxxx02",
* "inventory_id": "XXXXXX-b344-4778-831c-XXXXXXXX",
* "instance_id": "i-831cXXXXXXXX",
Expand Down
Loading