Skip to content

Commit

Permalink
fix(rhosak,rhacs): sw-47 billing provider for subs inv
Browse files Browse the repository at this point in the history
* config, rhosak, rhacs billing provider column
* services, subscriptions mock

DEV activates same pattern for RHACS
  • Loading branch information
cdcabrera committed Aug 31, 2022
1 parent 6715f05 commit f77913f
Show file tree
Hide file tree
Showing 6 changed files with 67 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/components/i18n/__tests__/__snapshots__/i18n.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -621,6 +621,10 @@ Array [
"key": "curiosity-inventory.measurement",
"match": "translate('curiosity-inventory.measurement', { context: RHSM_API_PATH_METRIC_TYPES.CORES, total: helpers.numberDisplay(total?.value)",
},
Object {
"key": "",
"match": "translate(\`curiosity-inventory.measurement_\${SUBSCRIPTIONS_INVENTORY_TYPES.BILLING_PROVIDER}\`, { context: provider?.value || 'none' })",
},
Object {
"key": "",
"match": "translate(\`curiosity-inventory.label_\${SUBSCRIPTIONS_INVENTORY_META_TYPES.SUBSCRIPTION_TYPE}\`, { context: subscriptionType || EMPTY_CONTEXT })",
Expand Down Expand Up @@ -699,6 +703,10 @@ Array [
"key": "curiosity-inventory.measurement",
"match": "translate('curiosity-inventory.measurement', { context: RHSM_API_PATH_METRIC_TYPES.INSTANCE_HOURS, total: helpers.numberDisplay(total?.value)",
},
Object {
"key": "",
"match": "translate(\`curiosity-inventory.measurement_\${SUBSCRIPTIONS_INVENTORY_TYPES.BILLING_PROVIDER}\`, { context: provider?.value || 'none' })",
},
Object {
"key": "",
"match": "translate(\`curiosity-inventory.label_\${SUBSCRIPTIONS_INVENTORY_META_TYPES.SUBSCRIPTION_TYPE}\`, { context: subscriptionType || EMPTY_CONTEXT })",
Expand Down
18 changes: 18 additions & 0 deletions src/config/__tests__/__snapshots__/product.rhacs.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,9 @@ Object {
Object {
"title": "lorem",
},
Object {
"title": "t(curiosity-inventory.measurement_billing_provider, {\\"context\\":\\"none\\"})",
},
Object {
"title": "hello world",
},
Expand All @@ -181,6 +184,12 @@ Object {
"title": "t(curiosity-inventory.header, {\\"context\\":\\"product_name\\"})",
"transforms": Array [],
},
Object {
"title": "t(curiosity-inventory.header, {\\"context\\":\\"billing_provider\\"})",
"transforms": Array [
[Function],
],
},
Object {
"title": "t(curiosity-inventory.header, {\\"context\\":\\"service_level\\"})",
"transforms": Array [
Expand Down Expand Up @@ -237,6 +246,9 @@ Object {
Object {
"title": "lorem",
},
Object {
"title": "t(curiosity-inventory.measurement_billing_provider, {\\"context\\":\\"none\\"})",
},
Object {
"title": "",
},
Expand All @@ -255,6 +267,12 @@ Object {
"title": "t(curiosity-inventory.header, {\\"context\\":\\"product_name\\"})",
"transforms": Array [],
},
Object {
"title": "t(curiosity-inventory.header, {\\"context\\":\\"billing_provider\\"})",
"transforms": Array [
[Function],
],
},
Object {
"title": "t(curiosity-inventory.header, {\\"context\\":\\"service_level\\"})",
"transforms": Array [
Expand Down
18 changes: 18 additions & 0 deletions src/config/__tests__/__snapshots__/product.rhosak.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,9 @@ Object {
Object {
"title": "lorem",
},
Object {
"title": "t(curiosity-inventory.measurement_billing_provider, {\\"context\\":\\"none\\"})",
},
Object {
"title": "hello world",
},
Expand All @@ -297,6 +300,12 @@ Object {
"title": "t(curiosity-inventory.header, {\\"context\\":\\"product_name\\"})",
"transforms": Array [],
},
Object {
"title": "t(curiosity-inventory.header, {\\"context\\":\\"billing_provider\\"})",
"transforms": Array [
[Function],
],
},
Object {
"title": "t(curiosity-inventory.header, {\\"context\\":\\"service_level\\"})",
"transforms": Array [
Expand Down Expand Up @@ -353,6 +362,9 @@ Object {
Object {
"title": "lorem",
},
Object {
"title": "t(curiosity-inventory.measurement_billing_provider, {\\"context\\":\\"none\\"})",
},
Object {
"title": "",
},
Expand All @@ -371,6 +383,12 @@ Object {
"title": "t(curiosity-inventory.header, {\\"context\\":\\"product_name\\"})",
"transforms": Array [],
},
Object {
"title": "t(curiosity-inventory.header, {\\"context\\":\\"billing_provider\\"})",
"transforms": Array [
[Function],
],
},
Object {
"title": "t(curiosity-inventory.header, {\\"context\\":\\"service_level\\"})",
"transforms": Array [
Expand Down
10 changes: 10 additions & 0 deletions src/config/product.rhacs.js
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,16 @@ const config = {
isSortable: true,
isWrappable: true
},
{
id: SUBSCRIPTIONS_INVENTORY_TYPES.BILLING_PROVIDER,
cell: ({ [SUBSCRIPTIONS_INVENTORY_TYPES.BILLING_PROVIDER]: provider }) =>
translate(`curiosity-inventory.measurement_${SUBSCRIPTIONS_INVENTORY_TYPES.BILLING_PROVIDER}`, {
context: provider?.value || 'none'
}),
isSortable: true,
isWrappable: false,
cellWidth: 15
},
{
id: SUBSCRIPTIONS_INVENTORY_TYPES.SERVICE_LEVEL,
isSortable: true,
Expand Down
10 changes: 10 additions & 0 deletions src/config/product.rhosak.js
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,16 @@ const config = {
isSortable: true,
isWrappable: true
},
{
id: SUBSCRIPTIONS_INVENTORY_TYPES.BILLING_PROVIDER,
cell: ({ [SUBSCRIPTIONS_INVENTORY_TYPES.BILLING_PROVIDER]: provider }) =>
translate(`curiosity-inventory.measurement_${SUBSCRIPTIONS_INVENTORY_TYPES.BILLING_PROVIDER}`, {
context: provider?.value || 'none'
}),
isSortable: true,
isWrappable: false,
cellWidth: 15
},
{
id: SUBSCRIPTIONS_INVENTORY_TYPES.SERVICE_LEVEL,
isSortable: true,
Expand Down
3 changes: 3 additions & 0 deletions src/services/rhsm/rhsmServices.js
Original file line number Diff line number Diff line change
Expand Up @@ -2297,6 +2297,7 @@ const getInstancesInventory = (id, params = {}, options = {}) => {
* {
* "sku": "RH00011",
* "product_name": "Red Hat Enterprise Linux Server, Premium (Physical and 4 Virtual Nodes)(L3 Only)",
* "billing_provider": "red hat",
* "service_level": "Premium",
* "usage": "Production",
* "subscriptions": [
Expand All @@ -2316,6 +2317,7 @@ const getInstancesInventory = (id, params = {}, options = {}) => {
* {
* "sku": "RH00010",
* "product_name": "Red Hat Enterprise Linux Server",
* "billing_provider": "azure",
* "service_level": "Self-Support",
* "usage": "Production",
* "subscriptions": [],
Expand All @@ -2331,6 +2333,7 @@ const getInstancesInventory = (id, params = {}, options = {}) => {
* {
* "sku": "RH00009",
* "product_name": "Red Hat Enterprise Linux Server, Premium",
* "billing_provider": "Unknown",
* "service_level": "Premium",
* "usage": "Production",
* "subscriptions": [
Expand Down

0 comments on commit f77913f

Please sign in to comment.