From 287972c7f4ade645c92fe355f5d946f0e7124da6 Mon Sep 17 00:00:00 2001 From: CD Cabrera Date: Sun, 15 Dec 2019 02:41:53 -0500 Subject: [PATCH] fix(locales): align keys to rhsm types --- public/locales/en-US.json | 4 ++-- .../__snapshots__/rhelGraphCard.test.js.snap | 12 ++++++------ .../rhelGraphCardHelpers.test.js.snap | 16 ++++++++-------- src/components/rhelGraphCard/rhelGraphCard.js | 4 ++-- .../rhelGraphCard/rhelGraphCardHelpers.js | 4 ++-- 5 files changed, 20 insertions(+), 20 deletions(-) diff --git a/public/locales/en-US.json b/public/locales/en-US.json index 3523257b0..13d83308f 100644 --- a/public/locales/en-US.json +++ b/public/locales/en-US.json @@ -8,8 +8,8 @@ "dropdownPlaceholder": "Select date range", "noDataLabel": "No data", "dateLabel": "Date", - "productHypervisorLabel": "Virtualized {{product}}", - "productSocketsLabel": "Physical {{product}}", + "hypervisorSocketsLabel": "Virtualized {{product}}", + "physicalSocketsLabel": "Physical {{product}}", "thresholdLabel": "Subscription threshold" }, "curiosity-tour": { diff --git a/src/components/rhelGraphCard/__tests__/__snapshots__/rhelGraphCard.test.js.snap b/src/components/rhelGraphCard/__tests__/__snapshots__/rhelGraphCard.test.js.snap index 13e652a1a..f275b55ca 100644 --- a/src/components/rhelGraphCard/__tests__/__snapshots__/rhelGraphCard.test.js.snap +++ b/src/components/rhelGraphCard/__tests__/__snapshots__/rhelGraphCard.test.js.snap @@ -61,7 +61,7 @@ exports[`RhelGraphCard Component should render a non-connected component: non-co "fill": "#8bc1f7", "id": "physicalSockets", "isStacked": true, - "legendLabel": "t(curiosity-graph.productSocketsLabel, [object Object])", + "legendLabel": "t(curiosity-graph.physicalSocketsLabel, [object Object])", "stroke": "#06c", }, Object { @@ -75,7 +75,7 @@ exports[`RhelGraphCard Component should render a non-connected component: non-co "fill": "#a2d9d9", "id": "hypervisorSockets", "isStacked": true, - "legendLabel": "t(curiosity-graph.productHypervisorLabel, [object Object])", + "legendLabel": "t(curiosity-graph.hypervisorSocketsLabel, [object Object])", "stroke": "#009596", }, Object { @@ -145,7 +145,7 @@ Object { "fill": "#8bc1f7", "id": "physicalSockets", "isStacked": true, - "legendLabel": "t(curiosity-graph.productSocketsLabel, [object Object])", + "legendLabel": "t(curiosity-graph.physicalSocketsLabel, [object Object])", "stroke": "#06c", }, Object { @@ -159,7 +159,7 @@ Object { "fill": "#a2d9d9", "id": "hypervisorSockets", "isStacked": true, - "legendLabel": "t(curiosity-graph.productHypervisorLabel, [object Object])", + "legendLabel": "t(curiosity-graph.hypervisorSocketsLabel, [object Object])", "stroke": "#009596", }, Object { @@ -268,7 +268,7 @@ exports[`RhelGraphCard Component should render multiple states: fulfilled 1`] = "fill": "#8bc1f7", "id": "physicalSockets", "isStacked": true, - "legendLabel": "t(curiosity-graph.productSocketsLabel, [object Object])", + "legendLabel": "t(curiosity-graph.physicalSocketsLabel, [object Object])", "stroke": "#06c", }, Object { @@ -282,7 +282,7 @@ exports[`RhelGraphCard Component should render multiple states: fulfilled 1`] = "fill": "#a2d9d9", "id": "hypervisorSockets", "isStacked": true, - "legendLabel": "t(curiosity-graph.productHypervisorLabel, [object Object])", + "legendLabel": "t(curiosity-graph.hypervisorSocketsLabel, [object Object])", "stroke": "#009596", }, Object { diff --git a/src/components/rhelGraphCard/__tests__/__snapshots__/rhelGraphCardHelpers.test.js.snap b/src/components/rhelGraphCard/__tests__/__snapshots__/rhelGraphCardHelpers.test.js.snap index 36ff3848d..9a469424c 100644 --- a/src/components/rhelGraphCard/__tests__/__snapshots__/rhelGraphCardHelpers.test.js.snap +++ b/src/components/rhelGraphCard/__tests__/__snapshots__/rhelGraphCardHelpers.test.js.snap @@ -21,20 +21,20 @@ Object { exports[`RhelGraphCardHelpers getTooltips should return a formatted tooltip based on data and granularity: granularity data display 1`] = ` Object { "daily": "t(curiosity-graph.thresholdLabel): 100 -t(curiosity-graph.productSocketsLabel, [object Object]): 50 -t(curiosity-graph.productHypervisorLabel, [object Object]): 50 +t(curiosity-graph.physicalSocketsLabel, [object Object]): 50 +t(curiosity-graph.hypervisorSocketsLabel, [object Object]): 50 t(curiosity-graph.dateLabel): June 1", "monthly": "t(curiosity-graph.thresholdLabel): 100 -t(curiosity-graph.productSocketsLabel, [object Object]): 50 -t(curiosity-graph.productHypervisorLabel, [object Object]): 50 +t(curiosity-graph.physicalSocketsLabel, [object Object]): 50 +t(curiosity-graph.hypervisorSocketsLabel, [object Object]): 50 t(curiosity-graph.dateLabel): June 2019", "quarterly": "t(curiosity-graph.thresholdLabel): 100 -t(curiosity-graph.productSocketsLabel, [object Object]): 50 -t(curiosity-graph.productHypervisorLabel, [object Object]): 50 +t(curiosity-graph.physicalSocketsLabel, [object Object]): 50 +t(curiosity-graph.hypervisorSocketsLabel, [object Object]): 50 t(curiosity-graph.dateLabel): June 2019", "weekly": "t(curiosity-graph.thresholdLabel): 100 -t(curiosity-graph.productSocketsLabel, [object Object]): 50 -t(curiosity-graph.productHypervisorLabel, [object Object]): 50 +t(curiosity-graph.physicalSocketsLabel, [object Object]): 50 +t(curiosity-graph.hypervisorSocketsLabel, [object Object]): 50 t(curiosity-graph.dateLabel): June 1", } `; diff --git a/src/components/rhelGraphCard/rhelGraphCard.js b/src/components/rhelGraphCard/rhelGraphCard.js index 1df2367da..a7747cad1 100644 --- a/src/components/rhelGraphCard/rhelGraphCard.js +++ b/src/components/rhelGraphCard/rhelGraphCard.js @@ -95,7 +95,7 @@ class RhelGraphCard extends React.Component { }, fill: chartColorBlueLight.value, stroke: chartColorBlueDark.value, - legendLabel: t('curiosity-graph.productSocketsLabel', { product: 'RHEL' }), + legendLabel: t('curiosity-graph.physicalSocketsLabel', { product: 'RHEL' }), isStacked: true }, { @@ -107,7 +107,7 @@ class RhelGraphCard extends React.Component { }, fill: chartColorCyanLight.value, stroke: chartColorCyanDark.value, - legendLabel: t('curiosity-graph.productHypervisorLabel', { product: 'RHEL' }), + legendLabel: t('curiosity-graph.hypervisorSocketsLabel', { product: 'RHEL' }), isStacked: true }, { diff --git a/src/components/rhelGraphCard/rhelGraphCardHelpers.js b/src/components/rhelGraphCard/rhelGraphCardHelpers.js index e05182296..529aa8ebd 100644 --- a/src/components/rhelGraphCard/rhelGraphCardHelpers.js +++ b/src/components/rhelGraphCard/rhelGraphCardHelpers.js @@ -66,9 +66,9 @@ const getTooltips = ({ itemsByKey, granularity }) => { let threshold = itemsByKey.threshold && itemsByKey.threshold.y; hypervisor = - (hypervisor && `${translate('curiosity-graph.productHypervisorLabel', { product: 'RHEL' })}: ${hypervisor}`) || ''; + (hypervisor && `${translate('curiosity-graph.hypervisorSocketsLabel', { product: 'RHEL' })}: ${hypervisor}`) || ''; - sockets = (sockets && `${translate('curiosity-graph.productSocketsLabel', { product: 'RHEL' })}: ${sockets}`) || ''; + sockets = (sockets && `${translate('curiosity-graph.physicalSocketsLabel', { product: 'RHEL' })}: ${sockets}`) || ''; threshold = (threshold && `${translate('curiosity-graph.thresholdLabel')}: ${threshold}`) || ''; const date =