Skip to content

Commit

Permalink
fix(rhosak): ent-4689 none, unknown billing provider (#936)
Browse files Browse the repository at this point in the history
* config, rhosak, none context for empty provider
* rhsmConstants, disable unused gcp, azure, oracle
  • Loading branch information
cdcabrera committed May 25, 2022
1 parent 1996de2 commit 6d8bdc6
Show file tree
Hide file tree
Showing 8 changed files with 13 additions and 77 deletions.
3 changes: 2 additions & 1 deletion public/locales/en-US.json
Original file line number Diff line number Diff line change
Expand Up @@ -153,10 +153,11 @@
"header_Transfer-gibibytes": "Data transfer",
"header_tooltip_Storage-gibibytes": "Measurements in binary gigabyte hours",
"header_tooltip_Transfer-gibibytes": "Measurements in binary gigabytes",
"measurement_billing_provider": "{{context}}",
"measurement_billing_provider": "Unknown",
"measurement_billing_provider_aws": "AWS",
"measurement_billing_provider_azure": "Azure",
"measurement_billing_provider_gcp": "GCP",
"measurement_billing_provider_none": "None",
"measurement_billing_provider_oracle": "Oracle",
"measurement_billing_provider_red hat": "Red Hat",
"measurement_Instance-hours": "{{total}} hours",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -650,7 +650,7 @@ Array [
},
Object {
"key": "",
"match": "translate(\`curiosity-inventory.measurement_\${INVENTORY_TYPES.BILLING_PROVIDER}\`, { context: provider?.value })",
"match": "translate(\`curiosity-inventory.measurement_\${INVENTORY_TYPES.BILLING_PROVIDER}\`, { context: provider?.value || 'none' })",
},
Object {
"key": "curiosity-inventory.header",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,21 +12,6 @@ Array [
"title": "t(curiosity-toolbar.billing_provider, {\\"context\\":\\"aws\\"})",
"value": "aws",
},
Object {
"selected": false,
"title": "t(curiosity-toolbar.billing_provider, {\\"context\\":\\"gcp\\"})",
"value": "gcp",
},
Object {
"selected": false,
"title": "t(curiosity-toolbar.billing_provider, {\\"context\\":\\"azure\\"})",
"value": "azure",
},
Object {
"selected": false,
"title": "t(curiosity-toolbar.billing_provider, {\\"context\\":\\"oracle\\"})",
"value": "oracle",
},
Object {
"selected": false,
"title": "t(curiosity-toolbar.billing_provider, {\\"context\\":\\"none\\"})",
Expand Down Expand Up @@ -96,21 +81,6 @@ exports[`ToolbarFieldBillingProvider Component should render a basic component:
"title": "t(curiosity-toolbar.billing_provider, {\\"context\\":\\"aws\\"})",
"value": "aws",
},
Object {
"selected": false,
"title": "t(curiosity-toolbar.billing_provider, {\\"context\\":\\"gcp\\"})",
"value": "gcp",
},
Object {
"selected": false,
"title": "t(curiosity-toolbar.billing_provider, {\\"context\\":\\"azure\\"})",
"value": "azure",
},
Object {
"selected": false,
"title": "t(curiosity-toolbar.billing_provider, {\\"context\\":\\"oracle\\"})",
"value": "oracle",
},
Object {
"selected": false,
"title": "t(curiosity-toolbar.billing_provider, {\\"context\\":\\"none\\"})",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -182,21 +182,6 @@ Array [
"title": "t(curiosity-toolbar.billing_provider, {\\"context\\":\\"aws\\"})",
"value": "aws",
},
Object {
"selected": false,
"title": "t(curiosity-toolbar.billing_provider, {\\"context\\":\\"gcp\\"})",
"value": "gcp",
},
Object {
"selected": false,
"title": "t(curiosity-toolbar.billing_provider, {\\"context\\":\\"azure\\"})",
"value": "azure",
},
Object {
"selected": false,
"title": "t(curiosity-toolbar.billing_provider, {\\"context\\":\\"oracle\\"})",
"value": "oracle",
},
Object {
"selected": false,
"title": "t(curiosity-toolbar.billing_provider, {\\"context\\":\\"none\\"})",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Object {
"title": "lorem ipsum",
},
Object {
"title": "t(curiosity-inventory.measurement_billing_provider, {})",
"title": "t(curiosity-inventory.measurement_billing_provider, {\\"context\\":\\"none\\"})",
},
Object {
"title": "t(curiosity-inventory.measurement, {\\"context\\":\\"Transfer-gibibytes\\",\\"total\\":\\"0.00035\\"})",
Expand Down Expand Up @@ -119,7 +119,7 @@ Object {
</Button>,
},
Object {
"title": "t(curiosity-inventory.measurement_billing_provider, {})",
"title": "t(curiosity-inventory.measurement_billing_provider, {\\"context\\":\\"none\\"})",
},
Object {
"title": "t(curiosity-inventory.measurement, {\\"context\\":\\"Transfer-gibibytes\\",\\"total\\":\\"0.00035\\"})",
Expand Down
2 changes: 1 addition & 1 deletion src/config/product.rhosak.js
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ const config = {
id: INVENTORY_TYPES.BILLING_PROVIDER,
cell: ({ [INVENTORY_TYPES.BILLING_PROVIDER]: provider }) =>
translate(`curiosity-inventory.measurement_${INVENTORY_TYPES.BILLING_PROVIDER}`, {
context: provider?.value
context: provider?.value || 'none'
}),
isSortable: true,
isWrappable: false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,7 @@ Object {
},
"RHSM_API_QUERY_BILLING_PROVIDER_TYPES": Object {
"AWS": "aws",
"AZURE": "azure",
"GCP": "gcp",
"NONE": "",
"ORACLE": "oracle",
"RED_HAT": "red hat",
},
"RHSM_API_QUERY_GRANULARITY_TYPES": Object {
Expand Down Expand Up @@ -122,10 +119,7 @@ Object {
},
"RHSM_API_RESPONSE_BILLING_PROVIDER_TYPES": Object {
"AWS": "aws",
"AZURE": "azure",
"GCP": "gcp",
"NONE": "",
"ORACLE": "oracle",
"RED_HAT": "red hat",
},
"RHSM_API_RESPONSE_DATA": "data",
Expand Down Expand Up @@ -224,10 +218,7 @@ Object {
},
"RHSM_API_QUERY_BILLING_PROVIDER_TYPES": Object {
"AWS": "aws",
"AZURE": "azure",
"GCP": "gcp",
"NONE": "",
"ORACLE": "oracle",
"RED_HAT": "red hat",
},
"RHSM_API_QUERY_GRANULARITY_TYPES": Object {
Expand Down Expand Up @@ -316,10 +307,7 @@ Object {
},
"RHSM_API_RESPONSE_BILLING_PROVIDER_TYPES": Object {
"AWS": "aws",
"AZURE": "azure",
"GCP": "gcp",
"NONE": "",
"ORACLE": "oracle",
"RED_HAT": "red hat",
},
"RHSM_API_RESPONSE_DATA": "data",
Expand Down Expand Up @@ -419,10 +407,7 @@ Object {
},
"RHSM_API_QUERY_BILLING_PROVIDER_TYPES": Object {
"AWS": "aws",
"AZURE": "azure",
"GCP": "gcp",
"NONE": "",
"ORACLE": "oracle",
"RED_HAT": "red hat",
},
"RHSM_API_QUERY_GRANULARITY_TYPES": Object {
Expand Down Expand Up @@ -511,10 +496,7 @@ Object {
},
"RHSM_API_RESPONSE_BILLING_PROVIDER_TYPES": Object {
"AWS": "aws",
"AZURE": "azure",
"GCP": "gcp",
"NONE": "",
"ORACLE": "oracle",
"RED_HAT": "red hat",
},
"RHSM_API_RESPONSE_DATA": "data",
Expand Down Expand Up @@ -618,10 +600,7 @@ Object {
},
"RHSM_API_QUERY_BILLING_PROVIDER_TYPES": Object {
"AWS": "aws",
"AZURE": "azure",
"GCP": "gcp",
"NONE": "",
"ORACLE": "oracle",
"RED_HAT": "red hat",
},
"RHSM_API_QUERY_GRANULARITY_TYPES": Object {
Expand Down Expand Up @@ -710,10 +689,7 @@ Object {
},
"RHSM_API_RESPONSE_BILLING_PROVIDER_TYPES": Object {
"AWS": "aws",
"AZURE": "azure",
"GCP": "gcp",
"NONE": "",
"ORACLE": "oracle",
"RED_HAT": "red hat",
},
"RHSM_API_RESPONSE_DATA": "data",
Expand Down
10 changes: 7 additions & 3 deletions src/services/rhsm/rhsmConstants.js
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,10 @@ const RHSM_API_RESPONSE_GRANULARITY_TYPES = {
QUARTERLY: 'Quarterly'
};

/**
* ToDo: Activate available provider type as it becomes available 202205
* (just uncomment)
*/
/**
* RHSM response, query parameters for BILLING_PROVIDER
*
Expand All @@ -175,9 +179,9 @@ const RHSM_API_RESPONSE_GRANULARITY_TYPES = {
const RHSM_API_RESPONSE_BILLING_PROVIDER_TYPES = {
RED_HAT: 'red hat',
AWS: 'aws',
GCP: 'gcp',
AZURE: 'azure',
ORACLE: 'oracle',
// GCP: 'gcp',
// AZURE: 'azure',
// ORACLE: 'oracle',
NONE: ''
};

Expand Down

0 comments on commit 6d8bdc6

Please sign in to comment.