Skip to content

Commit

Permalink
refactor(config): sw-2319 separate cores, sockets display (#1297)
Browse files Browse the repository at this point in the history
  • Loading branch information
cdcabrera committed May 14, 2024
1 parent 012b355 commit 49c7ed1
Show file tree
Hide file tree
Showing 9 changed files with 394 additions and 222 deletions.
8 changes: 4 additions & 4 deletions public/locales/en-US.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"cardActionTotal_Cores": "{{total}} core hours used",
"cardHeading": "Usage",
"cardHeading_Cores": "vCPU hours",
"cardHeading_Cores_OpenShift Container Platform": "Annual subscriptions",
"cardHeading_Cores_OpenShift Container Platform": "Core usage",
"cardHeading_Cores_OpenShift-dedicated-metrics": "On-Demand subscriptions",
"cardHeading_Cores_OpenShift-metrics": "Core hours",
"cardHeading_Cores_rosa": "vCPU hour usage",
Expand All @@ -19,7 +19,7 @@
"cardHeading_Storage-gibibyte-months": "Data storage",
"cardHeading_Transfer-gibibytes": "Data transfer",
"cardHeading_Sockets": "CPU socket usage",
"cardHeading_Sockets_OpenShift Container Platform": "$t(curiosity-graph.cardHeading_Cores_OpenShift Container Platform)",
"cardHeading_Sockets_OpenShift Container Platform": "Socket usage",
"cardHeading_vCPUs": "$t(curiosity-graph.cardHeading_Cores)",
"cardHeadingDescription": "...",
"cardHeadingDescription_Cores": "vCPU hours usage in hours",
Expand Down Expand Up @@ -216,8 +216,8 @@
"label_cloud_provider_gcp": "GCP",
"label_cloud_provider_ibm": "IBM",
"label_cloud_provider_oracle": "Oracle",
"label_has_infinite_quantity_cores": "Unlimited cores",
"label_has_infinite_quantity_sockets": "Unlimited sockets",
"label_has_infinite_quantity_Cores": "Unlimited cores",
"label_has_infinite_quantity_Sockets": "Unlimited sockets",
"label_number_of_guests": "{{context}}",
"label_number_of_guests_one": "<0>{{count}} guest</0>",
"label_number_of_guests_other": "<0>{{count}} guests</0>",
Expand Down
34 changes: 27 additions & 7 deletions src/components/i18n/__tests__/__snapshots__/i18n.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -513,8 +513,8 @@ exports[`I18n Component should generate a predictable locale key output snapshot
"match": "translate('curiosity-inventory.label', { context: 'numberOfGuests', count: numberOfGuests }, [ <PfLabel color="blue" /> ])",
},
{
"key": "curiosity-inventory.header",
"match": "translate('curiosity-inventory.header', { context: [uom, productId] })",
"key": "curiosity-inventory.measurement",
"match": "translate('curiosity-inventory.measurement', { context: (total && 'value')",
},
{
"key": "curiosity-inventory.measurement",
Expand All @@ -526,11 +526,23 @@ exports[`I18n Component should generate a predictable locale key output snapshot
},
{
"key": "curiosity-inventory.header",
"match": "translate('curiosity-inventory.header', { context: ['subscriptions', uom] })",
"match": "translate('curiosity-inventory.header', { context: ['subscriptions', RHSM_API_PATH_METRIC_TYPES.CORES] })",
},
{
"key": "curiosity-inventory.label",
"match": "translate(\`curiosity-inventory.label\`, { context: [SUBSCRIPTIONS_INVENTORY_TYPES.HAS_INFINITE_QUANTITY, uom] })",
"match": "translate(\`curiosity-inventory.label\`, { context: [SUBSCRIPTIONS_INVENTORY_TYPES.HAS_INFINITE_QUANTITY, RHSM_API_PATH_METRIC_TYPES.CORES] })",
},
{
"key": "curiosity-inventory.measurement",
"match": "translate('curiosity-inventory.measurement', { context: (total && 'value')",
},
{
"key": "curiosity-inventory.header",
"match": "translate('curiosity-inventory.header', { context: ['subscriptions', RHSM_API_PATH_METRIC_TYPES.SOCKETS] })",
},
{
"key": "curiosity-inventory.label",
"match": "translate(\`curiosity-inventory.label\`, { context: [SUBSCRIPTIONS_INVENTORY_TYPES.HAS_INFINITE_QUANTITY, RHSM_API_PATH_METRIC_TYPES.SOCKETS] })",
},
{
"key": "curiosity-inventory.measurement",
Expand Down Expand Up @@ -730,11 +742,11 @@ exports[`I18n Component should generate a predictable locale key output snapshot
},
{
"key": "curiosity-inventory.header",
"match": "translate('curiosity-inventory.header', { context: ['subscriptions', uom] })",
"match": "translate('curiosity-inventory.header', { context: ['subscriptions', RHSM_API_PATH_METRIC_TYPES.SOCKETS] })",
},
{
"key": "",
"match": "translate( \`curiosity-inventory.label_\${SUBSCRIPTIONS_INVENTORY_TYPES.HAS_INFINITE_QUANTITY}\`, { context: uom } )",
"key": "curiosity-inventory.label",
"match": "translate(\`curiosity-inventory.label\`, { context: [SUBSCRIPTIONS_INVENTORY_TYPES.HAS_INFINITE_QUANTITY, RHSM_API_PATH_METRIC_TYPES.SOCKETS] })",
},
{
"key": "curiosity-inventory.measurement",
Expand Down Expand Up @@ -1060,6 +1072,10 @@ exports[`I18n Component should have locale keys that exist in the default langua
"file": "src/config/product.openshiftContainer.js",
"key": "curiosity-inventory.label",
},
{
"file": "src/config/product.openshiftContainer.js",
"key": "curiosity-inventory.label",
},
{
"file": "src/config/product.openshiftDedicated.js",
"key": "curiosity-graph.label_axisY",
Expand Down Expand Up @@ -1124,6 +1140,10 @@ 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
Original file line number Diff line number Diff line change
Expand Up @@ -40,30 +40,31 @@ exports[`ProductViewContext should apply a hook for retrieving product context:
{
"color": "#06c",
"fill": "#8bc1f7",
"isOptional": true,
"metric": "Cores",
"stroke": "#06c",
},
{
"chartType": "threshold",
"isOptional": true,
"metric": "Cores",
},
],
"isOptional": false,
},
{
"filters": [
{
"color": "#06c",
"fill": "#8bc1f7",
"metric": "Sockets",
"stroke": "#06c",
},
{
"chartType": "threshold",
"metric": "Sockets",
},
],
},
],
"initialGraphSettings": {
"actions": [
{
"id": "uom",
"position": "right",
},
{
"id": "granularity",
"position": "right",
},
],
"isCardTitleDescription": true,
},
"initialGuestsFilters": [
Expand All @@ -90,12 +91,18 @@ exports[`ProductViewContext should apply a hook for retrieving product context:
},
{
"cell": [Function],
"header": [Function],
"isSort": true,
"isWrap": true,
"metric": "Cores",
"width": 15,
},
{
"cell": [Function],
"isSort": true,
"isWrap": true,
"metric": "Sockets",
"width": 15,
},
{
"cell": [Function],
"isSort": true,
Expand All @@ -112,7 +119,6 @@ exports[`ProductViewContext should apply a hook for retrieving product context:
],
"guestContent": [Function],
},
"initialOption": "cores",
"initialSubscriptionsInventoryFilters": [
{
"isSort": true,
Expand All @@ -130,15 +136,21 @@ exports[`ProductViewContext should apply a hook for retrieving product context:
"isSort": true,
"isWrap": true,
"metric": "quantity",
"width": 20,
"width": 10,
},
{
"cell": [Function],
"header": [Function],
"isSort": true,
"isWrap": true,
"metric": "total_capacity",
"width": 15,
"width": 10,
},
{
"cell": [Function],
"header": [Function],
"isWrap": true,
"metric": "total_capacity",
"width": 10,
},
{
"cell": [Function],
Expand All @@ -152,6 +164,11 @@ exports[`ProductViewContext should apply a hook for retrieving product context:
{
"id": "sla",
},
{
"id": "granularity",
"isSecondary": true,
"position": "right",
},
],
"inventoryGuestsQuery": {
"limit": 100,
Expand All @@ -177,7 +194,6 @@ exports[`ProductViewContext should apply a hook for retrieving product context:
"query": {
"beginning": "2019-06-20T00:00:00.000Z",
"ending": "2019-07-20T23:59:59.999Z",
"uom": "cores",
},
"viewId": "viewopenshift",
}
Expand All @@ -201,30 +217,31 @@ exports[`ProductViewContext should apply a hook for retrieving product context:
{
"color": "#06c",
"fill": "#8bc1f7",
"isOptional": true,
"metric": "Cores",
"stroke": "#06c",
},
{
"chartType": "threshold",
"metric": "Cores",
},
],
},
{
"filters": [
{
"color": "#06c",
"fill": "#8bc1f7",
"metric": "Sockets",
"stroke": "#06c",
},
{
"chartType": "threshold",
"isOptional": true,
"metric": "Sockets",
},
],
"isOptional": false,
},
],
"initialGraphSettings": {
"actions": [
{
"id": "uom",
"position": "right",
},
{
"id": "granularity",
"position": "right",
},
],
"isCardTitleDescription": true,
},
"initialGuestsFilters": [
Expand All @@ -251,12 +268,18 @@ exports[`ProductViewContext should apply a hook for retrieving product context:
},
{
"cell": [Function],
"header": [Function],
"isSort": true,
"isWrap": true,
"metric": "Cores",
"width": 15,
},
{
"cell": [Function],
"isSort": true,
"isWrap": true,
"metric": "Sockets",
"width": 15,
},
{
"cell": [Function],
"isSort": true,
Expand All @@ -273,7 +296,6 @@ exports[`ProductViewContext should apply a hook for retrieving product context:
],
"guestContent": [Function],
},
"initialOption": "cores",
"initialSubscriptionsInventoryFilters": [
{
"isSort": true,
Expand All @@ -291,15 +313,21 @@ exports[`ProductViewContext should apply a hook for retrieving product context:
"isSort": true,
"isWrap": true,
"metric": "quantity",
"width": 20,
"width": 10,
},
{
"cell": [Function],
"header": [Function],
"isSort": true,
"isWrap": true,
"metric": "total_capacity",
"width": 15,
"width": 10,
},
{
"cell": [Function],
"header": [Function],
"isWrap": true,
"metric": "total_capacity",
"width": 10,
},
{
"cell": [Function],
Expand All @@ -313,6 +341,11 @@ exports[`ProductViewContext should apply a hook for retrieving product context:
{
"id": "sla",
},
{
"id": "granularity",
"isSecondary": true,
"position": "right",
},
],
"inventoryGuestsQuery": {
"limit": 100,
Expand All @@ -338,7 +371,6 @@ exports[`ProductViewContext should apply a hook for retrieving product context:
"query": {
"beginning": "2019-06-20T00:00:00.000Z",
"ending": "2019-07-20T23:59:59.999Z",
"uom": "cores",
},
"viewId": "viewopenshift",
}
Expand Down
Loading

0 comments on commit 49c7ed1

Please sign in to comment.