Skip to content

Commit

Permalink
refactor(inventoryCardSubscriptions): ent-5129 camel to snake (#949)
Browse files Browse the repository at this point in the history
* config, products updated to use snake case
* services, constants updated with subscriptions types
  • Loading branch information
cdcabrera committed Jul 11, 2022
1 parent c995348 commit b0f23bc
Show file tree
Hide file tree
Showing 20 changed files with 375 additions and 287 deletions.
18 changes: 9 additions & 9 deletions public/locales/en-US.json
Original file line number Diff line number Diff line change
Expand Up @@ -114,13 +114,13 @@
"tableEmptyInventoryTitle": "No results found",
"tableEmptyInventoryMessage": "No results match the filter criteria. Remove filters or clear all filters to show results.",
"tableSkeletonAriaLabel": "Loading",
"label_hasInfiniteQuantity_cores": "Unlimited cores",
"label_hasInfiniteQuantity_sockets": "Unlimited sockets",
"label_has_infinite_quantity_cores": "Unlimited cores",
"label_has_infinite_quantity_sockets": "Unlimited sockets",
"label_numberOfGuests_one": "<0>{{count}} guest</0>",
"label_numberOfGuests_other": "<0>{{count}} guests</0>",
"label_subscriptionType": "{{context}}",
"label_subscriptionType_Annual": "Annual",
"label_subscriptionType_On-demand": "On-Demand",
"label_subscription_type": "{{context}}",
"label_subscription_type_Annual": "Annual",
"label_subscription_type_On-demand": "On-Demand",
"cloudProvider": "{{context}}",
"cloudProvider_alibaba": "Alibaba",
"cloudProvider_aws": "AWS",
Expand Down Expand Up @@ -153,16 +153,16 @@
"header_sockets_OpenShift-dedicated-metrics": "Sockets",
"header_lastSeen": "Last seen",
"header_last_seen": "Last seen",
"header_nextEventDate": "Next renewal",
"header_productName": "Product",
"header_next_event_date": "Next renewal",
"header_product_name": "Product",
"header_quantity": "Quantity",
"header_serviceLevel": "Service level",
"header_service_level": "Service level",
"header_Storage-gibibytes": "Data storage",
"header_Storage-gibibyte-months": "Data storage",
"header_subscriptions": "Sockets",
"header_subscriptions_cores": "Cores",
"header_subscriptions_sockets": "Sockets",
"header_subscriptionType": "Subscription type",
"header_subscription_type": "Subscription type",
"header_Transfer-gibibytes": "Data transfer",
"header_tooltip_Storage-gibibytes": "Measurements in binary gigabyte hours",
"header_tooltip_Storage-gibibyte-months": "Measurements in binary gigabyte months",
Expand Down
24 changes: 8 additions & 16 deletions src/components/i18n/__tests__/__snapshots__/i18n.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -568,11 +568,11 @@ Array [
},
Object {
"key": "curiosity-inventory.header",
"match": "translate('curiosity-inventory.header', { context: ['subscriptions', data?.uom?.value] })",
"match": "translate('curiosity-inventory.header', { context: ['subscriptions', uom?.value] })",
},
Object {
"key": "curiosity-inventory.label",
"match": "translate('curiosity-inventory.label', { context: ['hasInfiniteQuantity', uom?.value] })",
"key": "",
"match": "translate( \`curiosity-inventory.label_\${SUBSCRIPTIONS_INVENTORY_TYPES.HAS_INFINITE_QUANTITY}\`, { context: uom?.value } )",
},
],
},
Expand Down Expand Up @@ -623,11 +623,11 @@ Array [
},
Object {
"key": "curiosity-inventory.header",
"match": "translate('curiosity-inventory.header', { context: ['subscriptions', data?.uom?.value] })",
"match": "translate('curiosity-inventory.header', { context: ['subscriptions', uom?.value] })",
},
Object {
"key": "curiosity-inventory.label",
"match": "translate('curiosity-inventory.label', { context: ['hasInfiniteQuantity', uom?.value] })",
"key": "",
"match": "translate( \`curiosity-inventory.label_\${SUBSCRIPTIONS_INVENTORY_TYPES.HAS_INFINITE_QUANTITY}\`, { context: uom?.value } )",
},
],
},
Expand Down Expand Up @@ -675,8 +675,8 @@ Array [
"match": "translate('curiosity-inventory.measurement', { context: RHSM_API_PATH_METRIC_TYPES.INSTANCE_HOURS, total: helpers.numberDisplay(total?.value)",
},
Object {
"key": "curiosity-inventory.label_subscriptionType",
"match": "translate('curiosity-inventory.label_subscriptionType', { context: meta?.subscriptionType || EMPTY_CONTEXT })",
"key": "",
"match": "translate(\`curiosity-inventory.label_\${SUBSCRIPTIONS_INVENTORY_META_TYPES.SUBSCRIPTION_TYPE}\`, { context: subscriptionType || EMPTY_CONTEXT })",
},
],
},
Expand Down Expand Up @@ -763,10 +763,6 @@ Array [
"file": "./src/config/product.openshiftContainer.js",
"key": "curiosity-inventory.label",
},
Object {
"file": "./src/config/product.openshiftContainer.js",
"key": "curiosity-inventory.label",
},
Object {
"file": "./src/config/product.openshiftDedicated.js",
"key": "curiosity-inventory.label",
Expand All @@ -779,10 +775,6 @@ Array [
"file": "./src/config/product.rhel.js",
"key": "curiosity-inventory.label",
},
Object {
"file": "./src/config/product.rhel.js",
"key": "curiosity-inventory.label",
},
Object {
"file": "./src/config/product.rhosak.js",
"key": "curiosity-graph.label_axisY",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,13 +84,13 @@ Object {
"initialOption": "cores",
"initialSubscriptionsInventoryFilters": Array [
Object {
"id": "productName",
"id": "product_name",
"isSortable": true,
"isWrappable": true,
},
Object {
"cellWidth": 15,
"id": "serviceLevel",
"id": "service_level",
"isSortable": true,
"isWrappable": true,
},
Expand All @@ -104,14 +104,14 @@ Object {
"cell": [Function],
"cellWidth": 15,
"header": [Function],
"id": "totalCapacity",
"id": "total_capacity",
"isSortable": true,
"isWrappable": true,
},
Object {
"cell": [Function],
"cellWidth": 15,
"id": "nextEventDate",
"id": "next_event_date",
"isSortable": true,
"isWrappable": true,
},
Expand Down Expand Up @@ -207,13 +207,13 @@ Object {
"initialOption": "cores",
"initialSubscriptionsInventoryFilters": Array [
Object {
"id": "productName",
"id": "product_name",
"isSortable": true,
"isWrappable": true,
},
Object {
"cellWidth": 15,
"id": "serviceLevel",
"id": "service_level",
"isSortable": true,
"isWrappable": true,
},
Expand All @@ -227,14 +227,14 @@ Object {
"cell": [Function],
"cellWidth": 15,
"header": [Function],
"id": "totalCapacity",
"id": "total_capacity",
"isSortable": true,
"isWrappable": true,
},
Object {
"cell": [Function],
"cellWidth": 15,
"id": "nextEventDate",
"id": "next_event_date",
"isSortable": true,
"isWrappable": true,
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,13 +97,13 @@ exports[`ProductViewOpenShiftContainer Component should render a basic component
"initialOption": "cores",
"initialSubscriptionsInventoryFilters": Array [
Object {
"id": "productName",
"id": "product_name",
"isSortable": true,
"isWrappable": true,
},
Object {
"cellWidth": 15,
"id": "serviceLevel",
"id": "service_level",
"isSortable": true,
"isWrappable": true,
},
Expand All @@ -117,14 +117,14 @@ exports[`ProductViewOpenShiftContainer Component should render a basic component
"cell": [Function],
"cellWidth": 15,
"header": [Function],
"id": "totalCapacity",
"id": "total_capacity",
"isSortable": true,
"isWrappable": true,
},
Object {
"cell": [Function],
"cellWidth": 15,
"id": "nextEventDate",
"id": "next_event_date",
"isSortable": true,
"isWrappable": true,
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,13 +115,13 @@ Object {
"initialOption": "cores",
"initialSubscriptionsInventoryFilters": Array [
Object {
"id": "productName",
"id": "product_name",
"isSortable": true,
"isWrappable": true,
},
Object {
"cellWidth": 15,
"id": "serviceLevel",
"id": "service_level",
"isSortable": true,
"isWrappable": true,
},
Expand All @@ -135,14 +135,14 @@ Object {
"cell": [Function],
"cellWidth": 15,
"header": [Function],
"id": "totalCapacity",
"id": "total_capacity",
"isSortable": true,
"isWrappable": true,
},
Object {
"cell": [Function],
"cellWidth": 15,
"id": "nextEventDate",
"id": "next_event_date",
"isSortable": true,
"isWrappable": true,
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ Object {
},
Object {
"title": <Tooltip
content="t(curiosity-inventory.label, {\\"context\\":\\"hasInfiniteQuantity\\"})"
content="t(curiosity-inventory.label_has_infinite_quantity, {})"
distance={5}
enableFlip={false}
entryDelay={100}
Expand All @@ -298,7 +298,7 @@ Object {
position="top"
>
<ChartIcon
aria-label="t(curiosity-inventory.label, {\\"context\\":\\"hasInfiniteQuantity\\"})"
aria-label="t(curiosity-inventory.label_has_infinite_quantity, {})"
fill={null}
size="sm"
symbol="infinity"
Expand All @@ -312,11 +312,11 @@ Object {
],
"columnHeaders": Array [
Object {
"title": "t(curiosity-inventory.header, {\\"context\\":\\"productName\\"})",
"title": "t(curiosity-inventory.header, {\\"context\\":\\"product_name\\"})",
"transforms": Array [],
},
Object {
"title": "t(curiosity-inventory.header, {\\"context\\":\\"serviceLevel\\"})",
"title": "t(curiosity-inventory.header, {\\"context\\":\\"service_level\\"})",
"transforms": Array [
[Function],
],
Expand All @@ -334,31 +334,31 @@ Object {
],
},
Object {
"title": "t(curiosity-inventory.header, {\\"context\\":\\"nextEventDate\\"})",
"title": "t(curiosity-inventory.header, {\\"context\\":\\"next_event_date\\"})",
"transforms": Array [
[Function],
],
},
],
"data": Object {
"hasInfiniteQuantity": Object {
"title": "t(curiosity-inventory.header, {\\"context\\":\\"hasInfiniteQuantity\\"})",
"has_infinite_quantity": Object {
"title": "t(curiosity-inventory.header, {\\"context\\":\\"has_infinite_quantity\\"})",
"value": true,
},
"nextEventDate": Object {
"title": "t(curiosity-inventory.header, {\\"context\\":\\"nextEventDate\\"})",
"next_event_date": Object {
"title": "t(curiosity-inventory.header, {\\"context\\":\\"next_event_date\\"})",
"value": "2022-01-01T00:00:00.000Z",
},
"productName": Object {
"title": "t(curiosity-inventory.header, {\\"context\\":\\"productName\\"})",
"product_name": Object {
"title": "t(curiosity-inventory.header, {\\"context\\":\\"product_name\\"})",
"value": "lorem",
},
"serviceLevel": Object {
"title": "t(curiosity-inventory.header, {\\"context\\":\\"serviceLevel\\"})",
"service_level": Object {
"title": "t(curiosity-inventory.header, {\\"context\\":\\"service_level\\"})",
"value": "hello world",
},
"totalCapacity": Object {
"title": "t(curiosity-inventory.header, {\\"context\\":\\"totalCapacity\\"})",
"total_capacity": Object {
"title": "t(curiosity-inventory.header, {\\"context\\":\\"total_capacity\\"})",
"value": 2000,
},
},
Expand All @@ -379,7 +379,7 @@ Object {
},
Object {
"title": <Tooltip
content="t(curiosity-inventory.label, {\\"context\\":\\"hasInfiniteQuantity\\"})"
content="t(curiosity-inventory.label_has_infinite_quantity, {})"
distance={5}
enableFlip={false}
entryDelay={100}
Expand All @@ -388,7 +388,7 @@ Object {
position="top"
>
<ChartIcon
aria-label="t(curiosity-inventory.label, {\\"context\\":\\"hasInfiniteQuantity\\"})"
aria-label="t(curiosity-inventory.label_has_infinite_quantity, {})"
fill={null}
size="sm"
symbol="infinity"
Expand All @@ -402,11 +402,11 @@ Object {
],
"columnHeaders": Array [
Object {
"title": "t(curiosity-inventory.header, {\\"context\\":\\"productName\\"})",
"title": "t(curiosity-inventory.header, {\\"context\\":\\"product_name\\"})",
"transforms": Array [],
},
Object {
"title": "t(curiosity-inventory.header, {\\"context\\":\\"serviceLevel\\"})",
"title": "t(curiosity-inventory.header, {\\"context\\":\\"service_level\\"})",
"transforms": Array [
[Function],
],
Expand All @@ -424,31 +424,31 @@ Object {
],
},
Object {
"title": "t(curiosity-inventory.header, {\\"context\\":\\"nextEventDate\\"})",
"title": "t(curiosity-inventory.header, {\\"context\\":\\"next_event_date\\"})",
"transforms": Array [
[Function],
],
},
],
"data": Object {
"hasInfiniteQuantity": Object {
"title": "t(curiosity-inventory.header, {\\"context\\":\\"hasInfiniteQuantity\\"})",
"has_infinite_quantity": Object {
"title": "t(curiosity-inventory.header, {\\"context\\":\\"has_infinite_quantity\\"})",
"value": true,
},
"nextEventDate": Object {
"title": "t(curiosity-inventory.header, {\\"context\\":\\"nextEventDate\\"})",
"next_event_date": Object {
"title": "t(curiosity-inventory.header, {\\"context\\":\\"next_event_date\\"})",
"value": null,
},
"productName": Object {
"title": "t(curiosity-inventory.header, {\\"context\\":\\"productName\\"})",
"product_name": Object {
"title": "t(curiosity-inventory.header, {\\"context\\":\\"product_name\\"})",
"value": "lorem",
},
"serviceLevel": Object {
"title": "t(curiosity-inventory.header, {\\"context\\":\\"serviceLevel\\"})",
"service_level": Object {
"title": "t(curiosity-inventory.header, {\\"context\\":\\"service_level\\"})",
"value": null,
},
"totalCapacity": Object {
"title": "t(curiosity-inventory.header, {\\"context\\":\\"totalCapacity\\"})",
"total_capacity": Object {
"title": "t(curiosity-inventory.header, {\\"context\\":\\"total_capacity\\"})",
"value": 2000,
},
},
Expand Down
Loading

0 comments on commit b0f23bc

Please sign in to comment.