Skip to content

Commit

Permalink
feat(config): sw-1889 add rhel for x86 els payg
Browse files Browse the repository at this point in the history
  • Loading branch information
cdcabrera committed Nov 1, 2023
1 parent 3d21ec1 commit 6ce3862
Show file tree
Hide file tree
Showing 13 changed files with 1,696 additions and 54 deletions.
2 changes: 2 additions & 0 deletions config/cspell.config.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
"optin",
"ouia",
"patternfly",
"payg",
"pendo",
"perpage",
"qe's",
Expand All @@ -63,6 +64,7 @@
"timeseries",
"typeahead",
"uxui",
"vcpus",
"voronoi",
"wojtekmaj",
"woot",
Expand Down
30 changes: 21 additions & 9 deletions public/locales/en-US.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
"cardHeading_Transfer-gibibytes": "Data transfer",
"cardHeading_Sockets": "CPU socket usage",
"cardHeading_Sockets_OpenShift Container Platform": "$t(curiosity-graph.cardHeading_Cores_OpenShift Container Platform)",
"cardHeading_vCPUs": "$t(curiosity-graph.cardHeading_Cores)",
"cardHeadingDescription": "...",
"cardHeadingDescription_Cores": "vCPU hours usage in hours",
"cardHeadingDescription_Cores_OpenShift Container Platform": "A pre-paid subscription model that offers a designated maximum quota of units within a set time frame.",
Expand All @@ -31,6 +32,7 @@
"cardHeadingDescription_Storage-gibibytes": "Data storage usage in binary gigabyte hours",
"cardHeadingDescription_Storage-gibibyte-months": "Data storage usage in binary gigabyte months",
"cardHeadingDescription_Transfer-gibibytes": "Data transfer usage in binary gigabytes",
"cardHeadingDescription_vCPUs": "$t(curiosity-graph.cardHeadingDescription_Cores)",
"cardHeadingMetric": "Total",
"cardHeadingMetric_dailyTotal": "Daily total",
"cardHeadingMetric_dailyTotal_Cores": "Daily vCPU hours",
Expand All @@ -42,6 +44,7 @@
"cardHeadingMetric_dailyTotal_Storage-gibibytes": "Daily data storage",
"cardHeadingMetric_dailyTotal_Storage-gibibyte-months": "$t(curiosity-graph.cardHeadingMetric_dailyTotal_Storage-gibibytes)",
"cardHeadingMetric_dailyTotal_Transfer-gibibytes": "Daily data transfer",
"cardHeadingMetric_dailyTotal_vCPUs": "$t(curiosity-graph.cardHeadingMetric_dailyTotal_Cores)",
"cardHeadingMetric_monthlyTotal": "Monthly total",
"cardHeadingMetric_monthlyTotal_Cores": "Monthly vCPU hours",
"cardHeadingMetric_monthlyTotal_Cores_OpenShift-dedicated-metrics": "$t(curiosity-graph.cardHeadingMetric_monthlyTotal_Cores_OpenShift-metrics)",
Expand All @@ -50,6 +53,7 @@
"cardHeadingMetric_monthlyTotal_Storage-gibibytes": "Monthly data storage",
"cardHeadingMetric_monthlyTotal_Storage-gibibyte-months": "Monthly data storage",
"cardHeadingMetric_monthlyTotal_Transfer-gibibytes": "Monthly data transfer",
"cardHeadingMetric_monthlyTotal_vCPUs": "$t(curiosity-graph.cardHeadingMetric_monthlyTotal_Cores)",
"cardHeadingMetric_remainingCapacity_Cores_prepaid": "Remaining capacity",
"cardHeadingMetric_remainingCapacity_Instance-hours_prepaid": "Remaining capacity",
"cardBodyMetric": "{{context}}",
Expand All @@ -63,6 +67,7 @@
"cardBodyMetric_total_Storage-gibibytes": "<0>{{total}}</0> Binary gigabyte hours",
"cardBodyMetric_total_Storage-gibibyte-months": "<0>{{total}}</0> Binary gigabyte months",
"cardBodyMetric_total_Transfer-gibibytes": "<0>{{total}}</0> Binary gigabytes",
"cardBodyMetric_total_vCPUs": "$t(curiosity-graph.cardBodyMetric_total_Cores)",
"cardFooterMetric": "Last update {{date}}",
"label": "{{context}}",
"label_axisX_Daily": "Day of the month",
Expand All @@ -73,6 +78,7 @@
"label_axisY_Storage-gibibytes": "Binary gigabyte hours",
"label_axisY_Storage-gibibyte-months": "Binary gigabyte months",
"label_axisY_Transfer-gibibytes": "Binary gigabytes",
"label_axisY_vCPUs": "$t(curiosity-graph.label_axisY_Cores)",
"label_Cores": "vCPU hours",
"label_Cores_OpenShift Container Platform": "Cores",
"label_Cores_OpenShift-metrics": "Core hours",
Expand Down Expand Up @@ -103,6 +109,7 @@
"label_threshold_Instance-hours_rosa": "$t(curiosity-graph.label_threshold_Cores_rosa)",
"label_threshold_Sockets": "Subscription threshold",
"label_Transfer-gibibytes": "Data transfer",
"label_vCPUs": "$t(curiosity-graph.label_Cores)",
"legendTooltip": "{{product}} metric usage",
"legendTooltip_Cores": "vCPU hours usage",
"legendTooltip_Cores_OpenShift Container Platform": "{{product}} CPU usage, per CPU core.",
Expand Down Expand Up @@ -163,6 +170,7 @@
"legendTooltip_threshold_Sockets_rhel-for-x86-ha": "$t(curiosity-graph.legendTooltip_threshold_Sockets_RHEL)",
"legendTooltip_threshold_Sockets_rhel-for-sap-x86": "$t(curiosity-graph.legendTooltip_threshold_Sockets_RHEL)",
"legendTooltip_Transfer-gibibytes": "Data transfer usage",
"legendTooltip_vCPUs": "$t(curiosity-graph.legendTooltip_Cores)",
"tooltipSummary": "Your subscription data facets. With one level of column and row headers."
},
"curiosity-inventory": {
Expand Down Expand Up @@ -317,6 +325,7 @@
"label_groupVariant_RHEL for IBM Power": "RHEL for IBM Power",
"label_groupVariant_RHEL for IBM z": "RHEL for IBM z",
"label_groupVariant_RHEL for x86": "RHEL for x86",
"label_groupVariant_rhel-for-x86-els-payg": "RHEL for x86 ELS On-Demand",
"label_groupVariant_rhel-for-x86-eus": "RHEL for x86 EUS",
"label_groupVariant_rhel-for-x86-ha": "RHEL for x86 HA",
"label_groupVariant_rhel-for-sap-x86": "RHEL for SAP x86",
Expand Down Expand Up @@ -408,28 +417,31 @@
"subtitle_rhel": "$t(curiosity-view.subtitle_RHEL)",
"description_rhel": "$t(curiosity-view.description_RHEL)",
"title_RHEL": "Red Hat Enterprise Linux",
"subtitle_RHEL": "Monitor your Red Hat Enterprise Linux usage by physical, virtual, and public cloud sockets. <0>Learn more about {{appName}} reporting</0>",
"description_RHEL": "Monitor your Red Hat Enterprise Linux usage by physical, virtual, and public cloud sockets.",
"subtitle_RHEL": "Monitor your Red Hat Enterprise Linux usage for both Annual and On-Demand subscriptions. <0>Learn more about {{appName}} reporting</0>",
"description_RHEL": "Monitor your Red Hat Enterprise Linux usage for both Annual and On-Demand subscriptions.",
"title_RHEL for ARM": "$t(curiosity-view.title_RHEL)",
"subtitle_RHEL for ARM": "$t(curiosity-view.title_RHEL)",
"subtitle_RHEL for ARM": "$t(curiosity-view.subtitle_RHEL)",
"description_RHEL for ARM": "$t(curiosity-view.description_RHEL)",
"title_RHEL for IBM Power": "$t(curiosity-view.title_RHEL)",
"subtitle_RHEL for IBM Power": "$t(curiosity-view.title_RHEL)",
"subtitle_RHEL for IBM Power": "$t(curiosity-view.subtitle_RHEL)",
"description_RHEL for IBM Power": "$t(curiosity-view.description_RHEL)",
"title_RHEL for IBM z": "$t(curiosity-view.title_RHEL)",
"subtitle_RHEL for IBM z": "$t(curiosity-view.title_RHEL)",
"subtitle_RHEL for IBM z": "$t(curiosity-view.subtitle_RHEL)",
"description_RHEL for IBM z": "$t(curiosity-view.description_RHEL)",
"title_RHEL for x86": "$t(curiosity-view.title_RHEL)",
"subtitle_RHEL for x86": "$t(curiosity-view.title_RHEL)",
"subtitle_RHEL for x86": "$t(curiosity-view.subtitle_RHEL)",
"description_RHEL for x86": "$t(curiosity-view.description_RHEL)",
"title_rhel-for-x86-els-payg": "Red Hat Enterprise Linux for x86 ELS On-Demand",
"subtitle_rhel-for-x86-els-payg": "$t(curiosity-view.subtitle_rhacs)",
"description_rhel-for-x86-els-payg": "$t(curiosity-view.description_rhacs)",
"title_rhel-for-x86-eus": "$t(curiosity-view.title_RHEL)",
"subtitle_rhel-for-x86-eus": "$t(curiosity-view.title_RHEL)",
"subtitle_rhel-for-x86-eus": "$t(curiosity-view.subtitle_RHEL)",
"description_rhel-for-x86-eus": "$t(curiosity-view.description_RHEL)",
"title_rhel-for-x86-ha": "$t(curiosity-view.title_RHEL)",
"subtitle_rhel-for-x86-ha": "$t(curiosity-view.title_RHEL)",
"subtitle_rhel-for-x86-ha": "$t(curiosity-view.subtitle_RHEL)",
"description_rhel-for-x86-ha": "$t(curiosity-view.description_RHEL)",
"title_rhel-for-sap-x86": "$t(curiosity-view.title_RHEL)",
"subtitle_rhel-for-sap-x86": "$t(curiosity-view.title_RHEL)",
"subtitle_rhel-for-sap-x86": "$t(curiosity-view.subtitle_RHEL)",
"description_rhel-for-sap-x86": "$t(curiosity-view.description_RHEL)",
"title_rosa": "ROSA Hosted Control Planes",
"subtitle_rosa": "Monitor your Red Hat OpenShift Service on AWS Hosted Control Planes usage for monthly pre-paid and On-Demand subscriptions. <0>Learn more about {{appName}} reporting</0>",
Expand Down
105 changes: 105 additions & 0 deletions src/components/i18n/__tests__/__snapshots__/i18n.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -677,6 +677,79 @@ exports[`I18n Component should generate a predictable locale key output snapshot
},
],
},
{
"file": "src/config/product.rhelElsPayg.js",
"keys": [
{
"key": "curiosity-graph.label_axisY",
"match": "translate('curiosity-graph.label_axisY', { context: id })",
},
{
"key": "curiosity-graph.cardHeadingMetric",
"match": "translate('curiosity-graph.cardHeadingMetric', { context: ['dailyTotal', dataSets?.[0]?.display?.chartId], testId: 'graphDailyTotalCard-header' })",
},
{
"key": "curiosity-graph.cardBodyMetric",
"match": "translate( 'curiosity-graph.cardBodyMetric', { context: ['total', dataSets?.[0]?.display?.dailyHasData && dataSets?.[0]?.display?.chartId], testId: 'graphDailyTotalCard-body', total: helpers .numberDisplay(dataSets?.[0]?.display?.dailyValue)",
},
{
"key": "curiosity-graph.cardFooterMetric",
"match": "translate('curiosity-graph.cardFooterMetric', { date: moment .utc(dataSets?.[0]?.display?.dailyDate)",
},
{
"key": "curiosity-graph.cardHeadingMetric",
"match": "translate('curiosity-graph.cardHeadingMetric', { context: ['monthlyTotal', dataSets?.[0]?.display?.chartId], testId: 'graphMonthlyTotalCard-header' })",
},
{
"key": "curiosity-graph.cardBodyMetric",
"match": "translate( 'curiosity-graph.cardBodyMetric', { context: ['total', dataSets?.[0]?.display?.monthlyHasData && dataSets?.[0]?.display?.chartId], testId: 'graphMonthlyTotalCard-body', total: helpers .numberDisplay(dataSets?.[0]?.display?.monthlyValue)",
},
{
"key": "curiosity-graph.cardFooterMetric",
"match": "translate('curiosity-graph.cardFooterMetric', { date: moment .utc(dataSets?.[0]?.display?.monthlyDate)",
},
{
"key": "curiosity-graph.label_axisX",
"match": "translate('curiosity-graph.label_axisX', { context: GRANULARITY_TYPES.DAILY })",
},
{
"key": "curiosity-inventory.label",
"match": "translate('curiosity-inventory.label', { context: 'numberOfGuests', count: numberOfGuests }, [ <PfLabel color="blue" /> ])",
},
{
"key": "curiosity-inventory.label",
"match": "translate('curiosity-inventory.label', { context: [INVENTORY_TYPES.BILLING_PROVIDER, provider || 'none'] })",
},
{
"key": "curiosity-inventory.header",
"match": "translate('curiosity-inventory.header', { context: ['tooltip', RHSM_API_PATH_METRIC_TYPES.TRANSFER_GIBIBYTES] })",
},
{
"key": "curiosity-inventory.measurement",
"match": "translate('curiosity-inventory.measurement', { context: RHSM_API_PATH_METRIC_TYPES.TRANSFER_GIBIBYTES, total: helpers.numberDisplay(total)",
},
{
"key": "curiosity-inventory.header",
"match": "translate('curiosity-inventory.header', { context: ['tooltip', RHSM_API_PATH_METRIC_TYPES.STORAGE_GIBIBYTE_MONTHS] })",
},
{
"key": "curiosity-inventory.measurement",
"match": "translate('curiosity-inventory.measurement', { context: RHSM_API_PATH_METRIC_TYPES.STORAGE_GIBIBYTE_MONTHS, total: helpers.numberDisplay(total)",
},
{
"key": "curiosity-inventory.measurement",
"match": "translate('curiosity-inventory.measurement', { context: RHSM_API_PATH_METRIC_TYPES.INSTANCE_HOURS, total: helpers.numberDisplay(total)",
},
{
"key": "curiosity-inventory.label",
"match": "translate(\`curiosity-inventory.label\`, { context: [SUBSCRIPTIONS_INVENTORY_TYPES.BILLING_PROVIDER, provider || 'none'] })",
},
{
"key": "",
"match": "translate(\`curiosity-inventory.label_\${SUBSCRIPTIONS_INVENTORY_META_TYPES.SUBSCRIPTION_TYPE}\`, { context: subscriptionType || EMPTY_CONTEXT })",
},
],
},
{
"file": "src/config/product.rhods.js",
"keys": [
Expand Down Expand Up @@ -974,6 +1047,38 @@ 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.rhelElsPayg.js",
"key": "curiosity-graph.label_axisY",
},
{
"file": "src/config/product.rhelElsPayg.js",
"key": "curiosity-graph.label_axisX",
},
{
"file": "src/config/product.rhelElsPayg.js",
"key": "curiosity-inventory.label",
},
{
"file": "src/config/product.rhelElsPayg.js",
"key": "curiosity-inventory.label",
},
{
"file": "src/config/product.rhelElsPayg.js",
"key": "curiosity-inventory.measurement",
},
{
"file": "src/config/product.rhelElsPayg.js",
"key": "curiosity-inventory.measurement",
},
{
"file": "src/config/product.rhelElsPayg.js",
"key": "curiosity-inventory.measurement",
},
{
"file": "src/config/product.rhelElsPayg.js",
"key": "curiosity-inventory.label",
},
{
"file": "src/config/product.rhods.js",
"key": "curiosity-graph.label_axisY",
Expand Down
9 changes: 7 additions & 2 deletions src/components/inventoryCard/inventoryCardHelpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -136,10 +136,15 @@ const parseInventoryResponse = ({
dataSetRows.push({ cells: dataSetRow, row: rowData, expandedContent });
});

filters.forEach(({ metric, header, ...rest }) => {
filters.forEach(({ metric, header, info, ...rest }) => {
const updatedHeader = header({ columnData: columnData[metric] }, { ...session }, { ...meta });
const updatedInfo = (info && { ...info }) || undefined;
const updatedRest = { ...rest };

if (updatedInfo?.tooltip && typeof updatedInfo.tooltip === 'function') {
updatedInfo.tooltip = updatedInfo.tooltip({ columnData: columnData[metric] }, { ...session }, { ...meta });
}

if (updatedRest.isSort === true && sortDirection && sortColumn === metric) {
updatedRest.isSortActive = true;
updatedRest.sortDirection = sortDirection;
Expand All @@ -149,7 +154,7 @@ const parseInventoryResponse = ({
updatedRest.modifier = tableHelpers.WrapModifierVariant.wrap;
}

dataSetColumnHeaders.push({ metric, ...updatedRest, content: updatedHeader });
dataSetColumnHeaders.push({ metric, ...updatedRest, content: updatedHeader, info: updatedInfo });
});

return {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ exports[`InventoryCardInstancesContext should expect specific sort properties: s
"STORAGE_GIBIBYTES": "Storage-gibibytes",
"STORAGE_GIBIBYTE_MONTHS": "Storage-gibibyte-months",
"TRANSFER_GIBIBYTES": "Transfer-gibibytes",
"VCPUS": "vCPUs",
}
`;

Expand All @@ -36,6 +37,7 @@ exports[`InventoryCardInstancesContext should handle a store response using sele
{
"cell": [Function],
"content": "t([curiosity-inventory.header_display_name,curiosity-inventory.guestsHeader_display_name], {"context":"lorem"})",
"info": undefined,
"label": [Function],
"metric": "display_name",
"width": undefined,
Expand Down
39 changes: 39 additions & 0 deletions src/config/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@
<dt><a href="#Products.module_RHEL">RHEL</a></dt>
<dd><p>RHEL</p>
</dd>
<dt><a href="#Products.module_RHEL-X86-ELS">RHEL-X86-ELS</a></dt>
<dd><p>RHEL X86 ELS</p>
</dd>
<dt><a href="#Products.module_RHODS">RHODS</a></dt>
<dd><p>RHODS</p>
</dd>
Expand Down Expand Up @@ -213,6 +216,42 @@ Product label. An identifier used for display strings.
RHEL product config

**Kind**: inner constant of [<code>RHEL</code>](#Products.module_RHEL)
<a name="Products.module_RHEL-X86-ELS"></a>

## RHEL-X86-ELS
RHEL X86 ELS


* [RHEL-X86-ELS](#Products.module_RHEL-X86-ELS)
* [~productGroup](#Products.module_RHEL-X86-ELS..productGroup) : <code>string</code>
* [~productId](#Products.module_RHEL-X86-ELS..productId) : <code>string</code>
* [~productLabel](#Products.module_RHEL-X86-ELS..productLabel) : <code>string</code>
* [~config](#Products.module_RHEL-X86-ELS..config) : <code>Object</code>

<a name="Products.module_RHEL-X86-ELS..productGroup"></a>

### RHEL-X86-ELS~productGroup : <code>string</code>
Product group. A variant and dissimilar product configuration grouping identifier.

**Kind**: inner constant of [<code>RHEL-X86-ELS</code>](#Products.module_RHEL-X86-ELS)
<a name="Products.module_RHEL-X86-ELS..productId"></a>

### RHEL-X86-ELS~productId : <code>string</code>
Product ID. The identifier used when querying the API.

**Kind**: inner constant of [<code>RHEL-X86-ELS</code>](#Products.module_RHEL-X86-ELS)
<a name="Products.module_RHEL-X86-ELS..productLabel"></a>

### RHEL-X86-ELS~productLabel : <code>string</code>
Product label. An identifier used for display strings.

**Kind**: inner constant of [<code>RHEL-X86-ELS</code>](#Products.module_RHEL-X86-ELS)
<a name="Products.module_RHEL-X86-ELS..config"></a>

### RHEL-X86-ELS~config : <code>Object</code>
Product configuration

**Kind**: inner constant of [<code>RHEL-X86-ELS</code>](#Products.module_RHEL-X86-ELS)
<a name="Products.module_RHODS"></a>

## RHODS
Expand Down
Loading

0 comments on commit 6ce3862

Please sign in to comment.