diff --git a/public/locales/en-US.json b/public/locales/en-US.json index 34ae681a9..21e24600a 100644 --- a/public/locales/en-US.json +++ b/public/locales/en-US.json @@ -14,7 +14,9 @@ "cardHeading_Cores_OpenShift-metrics": "Core hours", "cardHeading_Cores_rosa": "vCPU hour usage", "cardHeading_Instance-hours": "Instance hours", + "cardHeading_Instance-hours_ansible-aap-managed": "Infrastructure hours", "cardHeading_Instance-hours_rosa": "Control plane hour usage", + "cardHeading_Managed-nodes": "Managed nodes", "cardHeading_Storage-gibibytes": "Data storage", "cardHeading_Storage-gibibyte-months": "Data storage", "cardHeading_Transfer-gibibytes": "Data transfer", @@ -27,7 +29,9 @@ "cardHeadingDescription_Cores_OpenShift-dedicated-metrics": "$t(curiosity-graph.cardHeadingDescription_Cores_OpenShift-metrics)", "cardHeadingDescription_Cores_OpenShift-metrics": "A subscription model that offers purchasing options to match your usage patterns.", "cardHeadingDescription_Instance-hours": "Instance hours usage in hours", + "cardHeadingDescription_Instance-hours_ansible-aap-managed": "Infrastructure hours usage in hours", "cardHeadingDescription_Instance-hours_rosa": "Control plane hours usage in hours", + "cardHeadingDescription_Managed-nodes": "Managed nodes usage", "cardHeadingDescription_Sockets_OpenShift Container Platform": "$t(curiosity-graph.cardHeadingDescription_Cores_OpenShift Container Platform)", "cardHeadingDescription_Storage-gibibytes": "Data storage usage in binary gigabyte hours", "cardHeadingDescription_Storage-gibibyte-months": "Data storage usage in binary gigabyte months", @@ -56,6 +60,7 @@ "cardHeadingMetric_monthlyTotal_vCPUs": "$t(curiosity-graph.cardHeadingMetric_monthlyTotal_Cores)", "cardHeadingMetric_remainingCapacity_Cores_prepaid": "Remaining capacity", "cardHeadingMetric_remainingCapacity_Instance-hours_prepaid": "Remaining capacity", + "cardHeadingMetric_remainingCapacity_Managed-nodes_prepaid": "Remaining capacity", "cardBodyMetric": "{{context}}", "cardBodyMetric_total": "No data", "cardBodyMetric_total_Cores": "<0>{{total}} vCPU hours", @@ -63,7 +68,9 @@ "cardBodyMetric_total_Cores_OpenShift-metrics": "<0>{{total}} Core hours", "cardBodyMetric_total_Cores_prepaid_rosa": "$t(curiosity-graph.cardBodyMetric_total_Cores)", "cardBodyMetric_total_Instance-hours": "<0>{{total}} Instance hours", + "cardBodyMetric_total_Instance-hours_prepaid_ansible-aap-managed": "<0>{{total}} Infrastructure hours", "cardBodyMetric_total_Instance-hours_prepaid_rosa": "<0>{{total}} Control plane hours", + "cardBodyMetric_total_Managed-nodes_prepaid_ansible-aap-managed": "<0>{{total}} Managed nodes", "cardBodyMetric_total_Storage-gibibytes": "<0>{{total}} Binary gigabyte hours", "cardBodyMetric_total_Storage-gibibyte-months": "<0>{{total}} Binary gigabyte months", "cardBodyMetric_total_Transfer-gibibytes": "<0>{{total}} Binary gigabytes", @@ -92,6 +99,9 @@ "label_Instance-hours": "Instance hours", "label_Instance-hours_on-demand": "$t(curiosity-graph.label_Cores_on-demand)", "label_Instance-hours_prepaid": "$t(curiosity-graph.label_Cores_prepaid)", + "label_Instance-hours_prepaid_ansible-aap-managed": "Infrastructure hours", + "label_Managed-nodes_on-demand": "Monthly On-Demand", + "label_Managed-nodes_prepaid": "Managed nodes", "label_Sockets": "Sockets", "label_Sockets_cloud": "Public cloud", "label_Sockets_hypervisor": "Hypervisor", @@ -106,7 +116,8 @@ "label_threshold_infinite": "<0>unlimited", "label_threshold_Cores": "Subscription threshold", "label_threshold_Cores_rosa": "Pre-paid subscription threshold", - "label_threshold_Instance-hours_rosa": "$t(curiosity-graph.label_threshold_Cores_rosa)", + "label_threshold_Instance-hours": "$t(curiosity-graph.label_threshold_Cores_rosa)", + "label_threshold_Managed-nodes": "$t(curiosity-graph.label_threshold_Cores_rosa)", "label_threshold_Sockets": "Subscription threshold", "label_Transfer-gibibytes": "Data transfer", "label_vCPUs": "$t(curiosity-graph.label_Cores)", @@ -121,6 +132,8 @@ "legendTooltip_Instance-hours_OpenShift-dedicated-metrics": "OpenShift Dedicated <0>On-Demand instance hour usage.", "legendTooltip_Instance-hours_on-demand": "Monthly <0>On-Demand control plane hour usage.", "legendTooltip_Instance-hours_prepaid": "Monthly <0>pre-paid control plane hour usage.", + "legendTooltip_Instance-hours_prepaid_ansible-aap-managed": "Monthly <0>pre-paid infrastructure hour usage.", + "legendTooltip_Managed-nodes_prepaid": "Monthly <0>pre-paid managed nodes usage.", "legendTooltip_Sockets": "{{product}} CPU usage, per CPU socket pair.", "legendTooltip_Sockets_cloud": "Public cloud {{product}} CPU usage, per socket. Each instance is considered a single socket.", "legendTooltip_Sockets_hypervisor": "{{product}} CPU socket usage, per socket pair.", @@ -163,6 +176,8 @@ "legendTooltip_Storage-gibibyte-months": "Data storage usage", "legendTooltip_threshold_Cores_OpenShift Container Platform": "Maximum capacity, as CPU cores, based on total {{product}} Annual subscriptions in this account.", "legendTooltip_threshold_Cores_rosa": "Maximum capacity, as vCPU hours, based on total ROSA Hosted Control Planes pre-paid subscriptions in this account.", + "legendTooltip_threshold_Managed-nodes": "Maximum capacity, as managed nodes, based on the amount of pre-paid managed nodes purchased in all subscriptions in this account.", + "legendTooltip_threshold_Instance-hours_ansible-aap-managed": "Maximum capacity, as infrastructure hours, derived from the amount of managed nodes purchased in all subscriptions in this account.", "legendTooltip_threshold_Instance-hours_rosa": "Maximum capacity, as control plane hours, based on total ROSA Hosted Control Planes pre-paid subscriptions in this account.", "legendTooltip_threshold_Sockets": "Maximum capacity, based on total {{product}} subscriptions in this account.", "legendTooltip_threshold_Sockets_OpenShift Container Platform": "Maximum capacity, as CPU sockets, based on total {{product}} Annual subscriptions in this account.", @@ -186,6 +201,7 @@ "tabHeading": "Inventory tabs", "tabSubHeading": "Tab {{count}}", "tabInstances": "Current monthly instances", + "tabInstances_ansible-aap-managed": "Current nodes", "tabInstances_RHEL": "Current instances", "tabInstances_RHEL for ARM": "$t(curiosity-inventory.tabInstances_RHEL)", "tabInstances_RHEL for IBM Power": "$t(curiosity-inventory.tabInstances_RHEL)", @@ -250,9 +266,12 @@ "header_Cores_OpenShift-metrics": "$t(curiosity-inventory.header_Cores_OpenShift Container Platform)", "header_Cores_OpenShift-dedicated-metrics": "Core hours", "header_display_name": "Name", + "header_display_name_ansible-aap-managed": "Host name", "header_display_name_rosa": "Name (control plane)", "header_Instance-hours": "Instance hours", + "header_Instance-hours_ansible-aap-managed": "Infrastructure hours", "header_Instance-hours_rosa": "Control plane hours", + "header_Managed-nodes": "Managed nodes", "header_measurement_type": "Type", "header_number_of_guests": "Guests", "header_Sockets": "Sockets", @@ -443,6 +462,9 @@ "title": "{{appName}}", "subtitle": "Monitor your usage based on your subscription terms. <0>Learn more about {{appName}} reporting", "description": "Monitor your usage based on your subscription terms.", + "title_ansible-aap-managed": "Red Hat Ansible", + "subtitle_ansible-aap-managed": "Monitor your Ansible subscription and contract usage. <0>Learn more about {{appName}} reporting", + "description_ansible-aap-managed": "Monitor your Ansible subscription and contract usage", "title_openshift": "Red Hat OpenShift", "subtitle_openshift": "Monitor your OpenShift usage for both Annual and On-Demand subscriptions. <0>Learn more about {{appName}} reporting", "description_openshift": "Monitor your OpenShift usage for both Annual and On-Demand subscriptions.", diff --git a/src/components/i18n/__tests__/__snapshots__/i18n.test.js.snap b/src/components/i18n/__tests__/__snapshots__/i18n.test.js.snap index c57b25ee6..efe5de572 100644 --- a/src/components/i18n/__tests__/__snapshots__/i18n.test.js.snap +++ b/src/components/i18n/__tests__/__snapshots__/i18n.test.js.snap @@ -545,6 +545,43 @@ exports[`I18n Component should generate a predictable locale key output snapshot }, ], }, + { + "file": "src/config/product.ansible.js", + "keys": [ + { + "key": "curiosity-graph.cardHeadingMetric", + "match": "translate('curiosity-graph.cardHeadingMetric', { context: ['remainingCapacity', dataSets?.[0]?.display?.chartId], testId: 'graphRemainingCapacityCard-header' })", + }, + { + "key": "curiosity-graph.cardBodyMetric", + "match": "translate( 'curiosity-graph.cardBodyMetric', { context: ['total', dataSets?.[0]?.display?.remainingCapacityHasData && dataSets?.[0]?.display?.chartId], testId: 'graphRemainingCapacityCard-body', total: helpers .numberDisplay(dataSets?.[0]?.display?.remainingCapacity)", + }, + { + "key": "curiosity-graph.cardFooterMetric", + "match": "translate('curiosity-graph.cardFooterMetric', { date: moment .utc(dataSets?.[0]?.display?.dailyDate)", + }, + { + "key": "curiosity-graph.label_axisX", + "match": "translate('curiosity-graph.label_axisX', { context: GRANULARITY_TYPES.DAILY })", + }, + { + "key": "curiosity-inventory.guestsHeader", + "match": "translate('curiosity-inventory.guestsHeader', { context: [INVENTORY_TYPES.DISPLAY_NAME] })", + }, + { + "key": "curiosity-inventory.measurement", + "match": "translate('curiosity-inventory.measurement', { context: (total && 'value')", + }, + { + "key": "curiosity-inventory.measurement", + "match": "translate('curiosity-inventory.measurement', { context: (total && 'value')", + }, + { + "key": "curiosity-inventory.measurement", + "match": "translate('curiosity-inventory.measurement', { context: (total && 'value')", + }, + ], + }, { "file": "src/config/product.openshiftContainer.js", "keys": [ @@ -1132,6 +1169,14 @@ exports[`I18n Component should have locale keys that exist in the default langua "file": "src/components/toolbar/toolbarFieldUsage.js", "key": "curiosity-toolbar.label", }, + { + "file": "src/config/product.ansible.js", + "key": "curiosity-graph.label_axisX", + }, + { + "file": "src/config/product.ansible.js", + "key": "curiosity-inventory.guestsHeader", + }, { "file": "src/config/product.openshiftContainer.js", "key": "curiosity-inventory.guestsHeader", diff --git a/src/components/inventoryCardInstances/__tests__/__snapshots__/inventoryCardInstancesContext.test.js.snap b/src/components/inventoryCardInstances/__tests__/__snapshots__/inventoryCardInstancesContext.test.js.snap index 86ddf7ec7..d2c96e002 100644 --- a/src/components/inventoryCardInstances/__tests__/__snapshots__/inventoryCardInstancesContext.test.js.snap +++ b/src/components/inventoryCardInstances/__tests__/__snapshots__/inventoryCardInstancesContext.test.js.snap @@ -21,6 +21,7 @@ exports[`InventoryCardInstancesContext should expect specific sort properties: s "CORE_SECONDS": "Core-seconds", "INSTANCE_HOURS": "Instance-hours", "LAST_SEEN": "last_seen", + "MANAGED_NODES": "Managed-nodes", "NAME": "display_name", "NUMBER_OF_GUESTS": "number_of_guests", "SOCKETS": "Sockets", diff --git a/src/components/router/__tests__/__snapshots__/routerHelpers.test.js.snap b/src/components/router/__tests__/__snapshots__/routerHelpers.test.js.snap index 0080a89ee..95549fee8 100644 --- a/src/components/router/__tests__/__snapshots__/routerHelpers.test.js.snap +++ b/src/components/router/__tests__/__snapshots__/routerHelpers.test.js.snap @@ -53,7 +53,7 @@ exports[`RouterHelpers should return product configuration details from a url, p exports[`RouterHelpers should return product configuration details from a url, path, or path-like id, or alias: detail: closest match 1`] = ` { - "productId": "RHEL for x86", + "productId": "ansible-aap-managed", } `; diff --git a/src/config/README.md b/src/config/README.md index be350a904..6f4d5f23c 100644 --- a/src/config/README.md +++ b/src/config/README.md @@ -1,6 +1,9 @@ ## Modules
+
Ansible
+

Ansible

+
OpenShiftContainer

OpenShift Container

@@ -36,6 +39,42 @@
+ + +## Ansible +Ansible + + +* [Ansible](#Products.module_Ansible) + * [~productGroup](#Products.module_Ansible..productGroup) : string + * [~productId](#Products.module_Ansible..productId) : string + * [~productLabel](#Products.module_Ansible..productLabel) : string + * [~config](#Products.module_Ansible..config) : Object + + + +### Ansible~productGroup : string +Product group. A variant and dissimilar product configuration grouping identifier. + +**Kind**: inner constant of [Ansible](#Products.module_Ansible) + + +### Ansible~productId : string +Product ID. The identifier used when querying the API. + +**Kind**: inner constant of [Ansible](#Products.module_Ansible) + + +### Ansible~productLabel : string +Product label. An identifier used for display strings. + +**Kind**: inner constant of [Ansible](#Products.module_Ansible) + + +### Ansible~config : Object +Product configuration + +**Kind**: inner constant of [Ansible](#Products.module_Ansible) ## OpenShiftContainer diff --git a/src/config/__tests__/__snapshots__/product.config.test.js.snap b/src/config/__tests__/__snapshots__/product.config.test.js.snap index ff78295ec..c3d3c45e5 100644 --- a/src/config/__tests__/__snapshots__/product.config.test.js.snap +++ b/src/config/__tests__/__snapshots__/product.config.test.js.snap @@ -2,6 +2,249 @@ exports[`Product specific configurations should apply graph filters and settings: graph axes 1`] = ` [ + { + "ansible-aap-managed": { + "xAxisChartLabel": "t(curiosity-graph.label_axisX, {"context":"Daily"})", + "xAxisLabelIncrement": 1, + "xAxisTickFormatAvailable": true, + "yAxisTickFormat": { + "0.00001345": "0.00001", + "0.0000269": "0.00003", + "0.00004035": "0.00004", + "0.0000538": "0.00005", + "0.00006725": "0.00007", + "0.0000807": "0.00008", + "0.00009415": "0.00009", + "0.0001076": "0.00011", + "0.00012105": "0.00012", + "0.0001345": "0.00013", + "0.00014795": "0.00015", + "0.0001614": "0.00016", + "0.00017485": "0.00017", + "0.0001883": "0.00019", + "0.00020175": "0.0002", + "0.0002152": "0.00022", + "0.00022865": "0.00023", + "0.0002421": "0.00024", + "0.00025555": "0.00026", + "0.000269": "0.00027", + "0.00028245": "0.00028", + "0.0002959": "0.0003", + "0.00030935": "0.00031", + "0.0003228": "0.00032", + "0.00033625": "0.00034", + "0.001": "0.001", + "0.002": "0.002", + "0.003": "0.003", + "0.004": "0.004", + "0.005": "0.005", + "0.006": "0.006", + "0.007": "0.007", + "0.008": "0.008", + "0.009000000000000001": "0.009", + "0.01": "0.01", + "0.011": "0.011", + "0.012": "0.012", + "0.013000000000000001": "0.013", + "0.014": "0.014", + "0.015": "0.015", + "0.016": "0.016", + "0.017": "0.017", + "0.018000000000000002": "0.018", + "0.019": "0.019", + "0.02": "0.02", + "0.021": "0.021", + "0.022": "0.022", + "0.023": "0.023", + "0.024": "0.024", + "0.025": "0.025", + "1": "1", + "10": "10", + "100": "100", + "1000": "1K", + "10000": "10K", + "100000": "100K", + "1000000": "1M", + "10000000": "10M", + "100000000": "100M", + "1000000000": "1B", + "10000000000": "10B", + "100000000000": "100B", + "1000000000000": "1T", + "10000000000000": "10T", + "11": "11", + "110": "110", + "1100": "1.1K", + "11000": "11K", + "110000": "110K", + "1100000": "1.1M", + "11000000": "11M", + "110000000": "110M", + "1100000000": "1.1B", + "11000000000": "11B", + "110000000000": "110B", + "1100000000000": "1.1T", + "11000000000000": "11T", + "12": "12", + "120": "120", + "1200": "1.2K", + "12000": "12K", + "120000": "120K", + "1200000": "1.2M", + "12000000": "12M", + "120000000": "120M", + "1200000000": "1.2B", + "12000000000": "12B", + "120000000000": "120B", + "1200000000000": "1.2T", + "12000000000000": "12T", + "13": "13", + "130": "130", + "1300": "1.3K", + "13000": "13K", + "130000": "130K", + "1300000": "1.3M", + "13000000": "13M", + "130000000": "130M", + "1300000000": "1.3B", + "13000000000": "13B", + "130000000000": "130B", + "1300000000000": "1.3T", + "13000000000000": "13T", + "14": "14", + "140": "140", + "1400": "1.4K", + "14000": "14K", + "140000": "140K", + "1400000": "1.4M", + "14000000": "14M", + "140000000": "140M", + "1400000000": "1.4B", + "14000000000": "14B", + "140000000000": "140B", + "1400000000000": "1.4T", + "14000000000000": "14T", + "15": "15", + "150": "150", + "1500": "1.5K", + "15000": "15K", + "150000": "150K", + "1500000": "1.5M", + "15000000": "15M", + "150000000": "150M", + "1500000000": "1.5B", + "15000000000": "15B", + "150000000000": "150B", + "1500000000000": "1.5T", + "15000000000000": "15T", + "2": "2", + "20": "20", + "200": "200", + "2000": "2K", + "20000": "20K", + "200000": "200K", + "2000000": "2M", + "20000000": "20M", + "200000000": "200M", + "2000000000": "2B", + "20000000000": "20B", + "200000000000": "200B", + "2000000000000": "2T", + "3": "3", + "30": "30", + "300": "300", + "3000": "3K", + "30000": "30K", + "300000": "300K", + "3000000": "3M", + "30000000": "30M", + "300000000": "300M", + "3000000000": "3B", + "30000000000": "30B", + "300000000000": "300B", + "3000000000000": "3T", + "4": "4", + "40": "40", + "400": "400", + "4000": "4K", + "40000": "40K", + "400000": "400K", + "4000000": "4M", + "40000000": "40M", + "400000000": "400M", + "4000000000": "4B", + "40000000000": "40B", + "400000000000": "400B", + "4000000000000": "4T", + "5": "5", + "50": "50", + "500": "500", + "5000": "5K", + "50000": "50K", + "500000": "500K", + "5000000": "5M", + "50000000": "50M", + "500000000": "500M", + "5000000000": "5B", + "50000000000": "50B", + "500000000000": "500B", + "5000000000000": "5T", + "6": "6", + "60": "60", + "600": "600", + "6000": "6K", + "60000": "60K", + "600000": "600K", + "6000000": "6M", + "60000000": "60M", + "600000000": "600M", + "6000000000": "6B", + "60000000000": "60B", + "600000000000": "600B", + "6000000000000": "6T", + "7": "7", + "70": "70", + "700": "700", + "7000": "7K", + "70000": "70K", + "700000": "700K", + "7000000": "7M", + "70000000": "70M", + "700000000": "700M", + "7000000000": "7B", + "70000000000": "70B", + "700000000000": "700B", + "7000000000000": "7T", + "8": "8", + "80": "80", + "800": "800", + "8000": "8K", + "80000": "80K", + "800000": "800K", + "8000000": "8M", + "80000000": "80M", + "800000000": "800M", + "8000000000": "8B", + "80000000000": "80B", + "800000000000": "800B", + "8000000000000": "8T", + "9": "9", + "90": "90", + "900": "900", + "9000": "9K", + "90000": "90K", + "900000": "900K", + "9000000": "9M", + "90000000": "90M", + "900000000": "900M", + "9000000000": "9B", + "90000000000": "90B", + "900000000000": "900B", + "9000000000000": "9T", + }, + "yAxisTickFormatAvailable": true, + }, + }, { "OpenShift-dedicated-metrics": { "xAxisChartLabel": "t(curiosity-graph.label_axisX, {"context":"Daily"})", @@ -1460,6 +1703,15 @@ exports[`Product specific configurations should apply graph filters and settings exports[`Product specific configurations should apply graph filters and settings: graph cards 1`] = ` [ + { + "ansible-aap-managed": [ + { + "body": "t(curiosity-graph.cardBodyMetric, {"context":"total","testId":"graphRemainingCapacityCard-body"}, [object Object])", + "footer": "t(curiosity-graph.cardFooterMetric, {"date":"09 Mar 2023 00:00 UTC","testId":"graphRemainingCapacityCard-footer"})", + "header": "t(curiosity-graph.cardHeadingMetric, {"context":"remainingCapacity","testId":"graphRemainingCapacityCard-header"})", + }, + ], + }, { "OpenShift-dedicated-metrics": [ { @@ -1539,11 +1791,153 @@ exports[`Product specific configurations should apply graph filters and settings }, ], }, -] -`; - -exports[`Product specific configurations should apply graph filters and settings: graph filters, settings 1`] = ` -[ +] +`; + +exports[`Product specific configurations should apply graph filters and settings: graph filters, settings 1`] = ` +[ + { + "ansible-aap-managed": { + "filtersSettings": [ + { + "settings": { + "cards": [ + { + "body": [Function], + "footer": [Function], + "header": [Function], + }, + ], + "chartType": "line", + "color": "#06c", + "fill": "#8bc1f7", + "groupMetric": [ + "Managed-nodes", + ], + "isCardTitleDescription": true, + "isMetricDisplay": true, + "isMultiMetric": true, + "isStandalone": undefined, + "metric": undefined, + "metrics": [ + { + "chartType": "line", + "color": "#06c", + "fill": "#8bc1f7", + "id": "Managed-nodes_prepaid_ansible-aap-managed", + "isCapacity": false, + "isStacked": true, + "isThreshold": false, + "isToolbarFilter": false, + "metric": "Managed-nodes", + "query": { + "billing_category": "prepaid", + }, + "stroke": "#06c", + "strokeWidth": 2, + }, + { + "chartType": "threshold", + "id": "threshold_Managed-nodes_ansible-aap-managed", + "isCapacity": true, + "isStacked": false, + "isThreshold": true, + "isToolbarFilter": false, + "metric": "Managed-nodes", + "stroke": "#4cb140", + "strokeDasharray": "4,3", + "strokeWidth": 3, + }, + ], + "padding": { + "bottom": 75, + "left": 75, + "right": 45, + "top": 45, + }, + "productId": "ansible-aap-managed", + "query": { + "billing_category": "prepaid", + }, + "stringId": "Managed-nodes_ansible-aap-managed", + "stroke": "#06c", + "xAxisChartLabel": [Function], + "xAxisLabelIncrement": 1, + "xAxisTickFormat": [Function], + "yAxisTickFormat": [Function], + }, + }, + { + "settings": { + "cards": [ + { + "body": [Function], + "footer": [Function], + "header": [Function], + }, + ], + "chartType": "line", + "color": "#06c", + "fill": "#8bc1f7", + "groupMetric": [ + "Instance-hours", + ], + "isCardTitleDescription": true, + "isMetricDisplay": true, + "isMultiMetric": true, + "isStandalone": undefined, + "metric": undefined, + "metrics": [ + { + "chartType": "line", + "color": "#06c", + "fill": "#8bc1f7", + "id": "Instance-hours_prepaid_ansible-aap-managed", + "isCapacity": false, + "isStacked": true, + "isThreshold": false, + "isToolbarFilter": false, + "metric": "Instance-hours", + "query": { + "billing_category": "prepaid", + }, + "stroke": "#06c", + "strokeWidth": 2, + }, + { + "chartType": "threshold", + "id": "threshold_Instance-hours_ansible-aap-managed", + "isCapacity": true, + "isStacked": false, + "isThreshold": true, + "isToolbarFilter": false, + "metric": "Instance-hours", + "stroke": "#4cb140", + "strokeDasharray": "4,3", + "strokeWidth": 3, + }, + ], + "padding": { + "bottom": 75, + "left": 75, + "right": 45, + "top": 45, + }, + "productId": "ansible-aap-managed", + "query": { + "billing_category": "prepaid", + }, + "stringId": "Instance-hours_ansible-aap-managed", + "stroke": "#06c", + "xAxisChartLabel": [Function], + "xAxisLabelIncrement": 1, + "xAxisTickFormat": [Function], + "yAxisTickFormat": [Function], + }, + }, + ], + }, + }, { "OpenShift Container Platform": { "filtersSettings": [ @@ -2373,6 +2767,30 @@ exports[`Product specific configurations should apply graph filters and settings exports[`Product specific configurations should apply query parameters: product query parameters 1`] = ` [ + { + "ansible-aap-managed": { + "graphTallyQuery": { + "granularity": "Daily", + "use_running_totals_format": true, + }, + "inventoryGuestsQuery": { + "limit": 100, + "offset": 0, + }, + "inventoryHostsQuery": { + "dir": "desc", + "limit": 100, + "offset": 0, + "sort": "last_seen", + }, + "inventorySubscriptionsQuery": { + "dir": "desc", + "limit": 100, + "offset": 0, + "sort": "next_event_date", + }, + }, + }, { "OpenShift Container Platform": { "graphTallyQuery": { @@ -2569,6 +2987,76 @@ exports[`Product specific configurations should apply query parameters: product exports[`Product specific configurations should apply variations in inventory filters and settings: guests authorized filters, settings 1`] = ` [ + { + "ansible-aap-managed": { + "dataSetColumnHeaders": [ + { + "cell": [Function], + "content": "t(curiosity-inventory.guestsHeader_display, {"context":"name"})", + "info": undefined, + "label": [Function], + "metric": "display_name", + "width": undefined, + }, + { + "cell": [Function], + "content": "t([curiosity-inventory.header_inventory_id,curiosity-inventory.guestsHeader_inventory_id], {"context":"ansible-aap-managed"})", + "info": undefined, + "label": [Function], + "metric": "inventory_id", + "width": 40, + }, + { + "cell": [Function], + "content": "t([curiosity-inventory.header_last_seen,curiosity-inventory.guestsHeader_last_seen], {"context":"ansible-aap-managed"})", + "info": undefined, + "label": [Function], + "metric": "last_seen", + "width": 15, + }, + ], + "dataSetRows": [ + { + "cells": [ + { + "content": "lorem", + "dataLabel": "t(curiosity-inventory.guestsHeader_display, {"context":"name"})", + "header": [Function], + "metric": "display_name", + "width": undefined, + }, + { + "content": "lorem inventory id", + "dataLabel": "t([curiosity-inventory.header_inventory_id,curiosity-inventory.guestsHeader_inventory_id], {"context":"ansible-aap-managed"})", + "header": [Function], + "metric": "inventory_id", + "width": 40, + }, + { + "content": , + "dataLabel": "t([curiosity-inventory.header_last_seen,curiosity-inventory.guestsHeader_last_seen], {"context":"ansible-aap-managed"})", + "header": [Function], + "metric": "last_seen", + "width": 15, + }, + ], + "expandedContent": undefined, + "row": { + "display_name": "lorem", + "inventory_id": "lorem inventory id", + "last_seen": "2022-01-01T00:00:00.000Z", + "loremIpsum": "hello world", + "subscription_manager_id": "XXXX-XXXX-XXXXX-XXXXX", + }, + }, + ], + "resultsCount": undefined, + "resultsOffset": undefined, + "resultsPerPage": undefined, + }, + }, { "OpenShift Container Platform": { "dataSetColumnHeaders": [ @@ -3015,6 +3503,7 @@ exports[`Product specific configurations should apply variations in inventory fi exports[`Product specific configurations should apply variations in inventory filters and settings: guests filters, available product configs 1`] = ` [ + "ansible-aap-managed", "OpenShift Container Platform", "OpenShift-dedicated-metrics", "OpenShift-metrics", @@ -3026,6 +3515,76 @@ exports[`Product specific configurations should apply variations in inventory fi exports[`Product specific configurations should apply variations in inventory filters and settings: guests filters, settings 1`] = ` [ + { + "ansible-aap-managed": { + "dataSetColumnHeaders": [ + { + "cell": [Function], + "content": "t(curiosity-inventory.guestsHeader_display, {"context":"name"})", + "info": undefined, + "label": [Function], + "metric": "display_name", + "width": undefined, + }, + { + "cell": [Function], + "content": "t([curiosity-inventory.header_inventory_id,curiosity-inventory.guestsHeader_inventory_id], {"context":"ansible-aap-managed"})", + "info": undefined, + "label": [Function], + "metric": "inventory_id", + "width": 40, + }, + { + "cell": [Function], + "content": "t([curiosity-inventory.header_last_seen,curiosity-inventory.guestsHeader_last_seen], {"context":"ansible-aap-managed"})", + "info": undefined, + "label": [Function], + "metric": "last_seen", + "width": 15, + }, + ], + "dataSetRows": [ + { + "cells": [ + { + "content": "lorem", + "dataLabel": "t(curiosity-inventory.guestsHeader_display, {"context":"name"})", + "header": [Function], + "metric": "display_name", + "width": undefined, + }, + { + "content": "lorem inventory id", + "dataLabel": "t([curiosity-inventory.header_inventory_id,curiosity-inventory.guestsHeader_inventory_id], {"context":"ansible-aap-managed"})", + "header": [Function], + "metric": "inventory_id", + "width": 40, + }, + { + "content": , + "dataLabel": "t([curiosity-inventory.header_last_seen,curiosity-inventory.guestsHeader_last_seen], {"context":"ansible-aap-managed"})", + "header": [Function], + "metric": "last_seen", + "width": 15, + }, + ], + "expandedContent": undefined, + "row": { + "display_name": "lorem", + "inventory_id": "lorem inventory id", + "last_seen": "2022-01-01T00:00:00.000Z", + "loremIpsum": "hello world", + "subscription_manager_id": "XXXX-XXXX-XXXXX-XXXXX", + }, + }, + ], + "resultsCount": undefined, + "resultsOffset": undefined, + "resultsPerPage": undefined, + }, + }, { "OpenShift Container Platform": { "dataSetColumnHeaders": [ @@ -3437,7 +3996,115 @@ exports[`Product specific configurations should apply variations in inventory fi "inventory_id": "lorem inventory id", "last_seen": "2022-01-01T00:00:00.000Z", "loremIpsum": "hello world", - "subscription_manager_id": "XXXX-XXXX-XXXXX-XXXXX", + "subscription_manager_id": "XXXX-XXXX-XXXXX-XXXXX", + }, + }, + ], + "resultsCount": undefined, + "resultsOffset": undefined, + "resultsPerPage": undefined, + }, + }, +] +`; + +exports[`Product specific configurations should apply variations in inventory filters and settings: inventory authorized filters, settings 1`] = ` +[ + { + "ansible-aap-managed": { + "dataSetColumnHeaders": [ + { + "cell": [Function], + "content": "t([curiosity-inventory.header_display_name,curiosity-inventory.guestsHeader_display_name], {"context":"ansible-aap-managed"})", + "info": undefined, + "isSort": true, + "label": [Function], + "metric": "display_name", + "width": undefined, + }, + { + "cell": [Function], + "content": "t([curiosity-inventory.header_Managed-nodes,curiosity-inventory.guestsHeader_Managed-nodes], {"context":"ansible-aap-managed"})", + "info": undefined, + "isSort": true, + "isWrap": true, + "label": [Function], + "metric": "Managed-nodes", + "modifier": "wrap", + "width": 15, + }, + { + "cell": [Function], + "content": "t([curiosity-inventory.header_Instance-hours,curiosity-inventory.guestsHeader_Instance-hours], {"context":"ansible-aap-managed"})", + "info": undefined, + "isSort": true, + "isWrap": true, + "label": [Function], + "metric": "Instance-hours", + "modifier": "wrap", + "width": 20, + }, + { + "cell": [Function], + "content": "t([curiosity-inventory.header_last_seen,curiosity-inventory.guestsHeader_last_seen], {"context":"ansible-aap-managed"})", + "info": undefined, + "isSort": true, + "isWrap": true, + "label": [Function], + "metric": "last_seen", + "modifier": "wrap", + "width": 15, + }, + ], + "dataSetRows": [ + { + "cells": [ + { + "content": "lorem", + "dataLabel": "t([curiosity-inventory.header_display_name,curiosity-inventory.guestsHeader_display_name], {"context":"ansible-aap-managed"})", + "header": [Function], + "isSort": true, + "metric": "display_name", + "width": undefined, + }, + { + "content": "t(curiosity-inventory.measurement, {"testId":{"type":"span","key":null,"ref":null,"props":{"data-test":"instances-cell-Managed-nodes","data-value":"undefined"},"_owner":null,"_store":{}}})", + "dataLabel": "t([curiosity-inventory.header_Managed-nodes,curiosity-inventory.guestsHeader_Managed-nodes], {"context":"ansible-aap-managed"})", + "header": [Function], + "isSort": true, + "isWrap": true, + "metric": "Managed-nodes", + "width": 15, + }, + { + "content": "t(curiosity-inventory.measurement, {"testId":{"type":"span","key":null,"ref":null,"props":{"data-test":"instances-cell-Instance-hours","data-value":"undefined"},"_owner":null,"_store":{}}})", + "dataLabel": "t([curiosity-inventory.header_Instance-hours,curiosity-inventory.guestsHeader_Instance-hours], {"context":"ansible-aap-managed"})", + "header": [Function], + "isSort": true, + "isWrap": true, + "metric": "Instance-hours", + "width": 20, + }, + { + "content": , + "dataLabel": "t([curiosity-inventory.header_last_seen,curiosity-inventory.guestsHeader_last_seen], {"context":"ansible-aap-managed"})", + "header": [Function], + "isSort": true, + "isWrap": true, + "metric": "last_seen", + "width": 15, + }, + ], + "expandedContent": undefined, + "row": { + "cloud_provider": "dolor sit", + "display_name": "lorem", + "instance_id": "i-XXXXXXXXXX", + "inventory_id": "XXXX-XXXX-XXXXX-XXXXX", + "last_seen": "2022-01-01T00:00:00.000Z", + "loremIpsum": "hello world", }, }, ], @@ -3446,11 +4113,6 @@ exports[`Product specific configurations should apply variations in inventory fi "resultsPerPage": undefined, }, }, -] -`; - -exports[`Product specific configurations should apply variations in inventory filters and settings: inventory authorized filters, settings 1`] = ` -[ { "OpenShift Container Platform": { "dataSetColumnHeaders": [ @@ -4455,6 +5117,7 @@ exports[`Product specific configurations should apply variations in inventory fi exports[`Product specific configurations should apply variations in inventory filters and settings: inventory filters, available product configs 1`] = ` [ + "ansible-aap-managed", "OpenShift Container Platform", "OpenShift-dedicated-metrics", "OpenShift-metrics", @@ -4469,6 +5132,109 @@ exports[`Product specific configurations should apply variations in inventory fi exports[`Product specific configurations should apply variations in inventory filters and settings: inventory filters, settings 1`] = ` [ + { + "ansible-aap-managed": { + "dataSetColumnHeaders": [ + { + "cell": [Function], + "content": "t([curiosity-inventory.header_display_name,curiosity-inventory.guestsHeader_display_name], {"context":"ansible-aap-managed"})", + "info": undefined, + "isSort": true, + "label": [Function], + "metric": "display_name", + "width": undefined, + }, + { + "cell": [Function], + "content": "t([curiosity-inventory.header_Managed-nodes,curiosity-inventory.guestsHeader_Managed-nodes], {"context":"ansible-aap-managed"})", + "info": undefined, + "isSort": true, + "isWrap": true, + "label": [Function], + "metric": "Managed-nodes", + "modifier": "wrap", + "width": 15, + }, + { + "cell": [Function], + "content": "t([curiosity-inventory.header_Instance-hours,curiosity-inventory.guestsHeader_Instance-hours], {"context":"ansible-aap-managed"})", + "info": undefined, + "isSort": true, + "isWrap": true, + "label": [Function], + "metric": "Instance-hours", + "modifier": "wrap", + "width": 20, + }, + { + "cell": [Function], + "content": "t([curiosity-inventory.header_last_seen,curiosity-inventory.guestsHeader_last_seen], {"context":"ansible-aap-managed"})", + "info": undefined, + "isSort": true, + "isWrap": true, + "label": [Function], + "metric": "last_seen", + "modifier": "wrap", + "width": 15, + }, + ], + "dataSetRows": [ + { + "cells": [ + { + "content": "lorem", + "dataLabel": "t([curiosity-inventory.header_display_name,curiosity-inventory.guestsHeader_display_name], {"context":"ansible-aap-managed"})", + "header": [Function], + "isSort": true, + "metric": "display_name", + "width": undefined, + }, + { + "content": "t(curiosity-inventory.measurement, {"testId":{"type":"span","key":null,"ref":null,"props":{"data-test":"instances-cell-Managed-nodes","data-value":"undefined"},"_owner":null,"_store":{}}})", + "dataLabel": "t([curiosity-inventory.header_Managed-nodes,curiosity-inventory.guestsHeader_Managed-nodes], {"context":"ansible-aap-managed"})", + "header": [Function], + "isSort": true, + "isWrap": true, + "metric": "Managed-nodes", + "width": 15, + }, + { + "content": "t(curiosity-inventory.measurement, {"testId":{"type":"span","key":null,"ref":null,"props":{"data-test":"instances-cell-Instance-hours","data-value":"undefined"},"_owner":null,"_store":{}}})", + "dataLabel": "t([curiosity-inventory.header_Instance-hours,curiosity-inventory.guestsHeader_Instance-hours], {"context":"ansible-aap-managed"})", + "header": [Function], + "isSort": true, + "isWrap": true, + "metric": "Instance-hours", + "width": 20, + }, + { + "content": , + "dataLabel": "t([curiosity-inventory.header_last_seen,curiosity-inventory.guestsHeader_last_seen], {"context":"ansible-aap-managed"})", + "header": [Function], + "isSort": true, + "isWrap": true, + "metric": "last_seen", + "width": 15, + }, + ], + "expandedContent": undefined, + "row": { + "cloud_provider": "dolor sit", + "display_name": "lorem", + "instance_id": "i-XXXXXXXXXX", + "inventory_id": "XXXX-XXXX-XXXXX-XXXXX", + "last_seen": "2022-01-01T00:00:00.000Z", + "loremIpsum": "hello world", + }, + }, + ], + "resultsCount": undefined, + "resultsOffset": undefined, + "resultsPerPage": undefined, + }, + }, { "OpenShift Container Platform": { "dataSetColumnHeaders": [ @@ -5424,6 +6190,92 @@ exports[`Product specific configurations should apply variations in inventory fi exports[`Product specific configurations should apply variations in inventory filters and settings: subscriptions authorized filters, settings 1`] = ` [ + { + "ansible-aap-managed": { + "dataSetColumnHeaders": [ + { + "cell": [Function], + "content": "t([curiosity-inventory.header_product_name,curiosity-inventory.guestsHeader_product_name], {"context":"ansible-aap-managed"})", + "info": undefined, + "isSort": true, + "isWrap": true, + "label": [Function], + "metric": "product_name", + "modifier": "wrap", + "width": undefined, + }, + { + "cell": [Function], + "content": "t([curiosity-inventory.header_quantity,curiosity-inventory.guestsHeader_quantity], {"context":"ansible-aap-managed"})", + "info": undefined, + "isSort": true, + "isWrap": true, + "label": [Function], + "metric": "quantity", + "modifier": "wrap", + "width": 10, + }, + { + "cell": [Function], + "content": "t([curiosity-inventory.header_next_event_date,curiosity-inventory.guestsHeader_next_event_date], {"context":"ansible-aap-managed"})", + "info": undefined, + "isSort": true, + "isWrap": true, + "label": [Function], + "metric": "next_event_date", + "modifier": "wrap", + "width": 15, + }, + ], + "dataSetRows": [ + { + "cells": [ + { + "content": "lorem", + "dataLabel": "t([curiosity-inventory.header_product_name,curiosity-inventory.guestsHeader_product_name], {"context":"ansible-aap-managed"})", + "header": [Function], + "isSort": true, + "isWrap": true, + "metric": "product_name", + "width": undefined, + }, + { + "content": "t(curiosity-inventory.measurement, {"context":"value","total":1,"testId":{"type":"span","key":null,"ref":null,"props":{"data-test":"subscriptions-cell-quantity","data-value":"1"},"_owner":null,"_store":{}}})", + "dataLabel": "t([curiosity-inventory.header_quantity,curiosity-inventory.guestsHeader_quantity], {"context":"ansible-aap-managed"})", + "header": [Function], + "isSort": true, + "isWrap": true, + "metric": "quantity", + "width": 10, + }, + { + "content": "2022-01-01", + "dataLabel": "t([curiosity-inventory.header_next_event_date,curiosity-inventory.guestsHeader_next_event_date], {"context":"ansible-aap-managed"})", + "header": [Function], + "isSort": true, + "isWrap": true, + "metric": "next_event_date", + "width": 15, + }, + ], + "expandedContent": undefined, + "row": { + "Cores": 2000, + "billing_provider": "dolor sit", + "has_infinite_quantity": true, + "loremIpsum": "hello world", + "next_event_date": "2022-01-01T00:00:00.000Z", + "product_name": "lorem", + "quantity": 1, + "service_level": "hello world", + }, + }, + ], + "resultsCount": undefined, + "resultsOffset": undefined, + "resultsPerPage": undefined, + }, + }, { "OpenShift Container Platform": { "dataSetColumnHeaders": [ @@ -6264,6 +7116,7 @@ exports[`Product specific configurations should apply variations in inventory fi exports[`Product specific configurations should apply variations in inventory filters and settings: subscriptions filters, available product configs 1`] = ` [ + "ansible-aap-managed", "OpenShift Container Platform", "rhacs", "RHEL for x86", @@ -6275,6 +7128,92 @@ exports[`Product specific configurations should apply variations in inventory fi exports[`Product specific configurations should apply variations in inventory filters and settings: subscriptions filters, settings 1`] = ` [ + { + "ansible-aap-managed": { + "dataSetColumnHeaders": [ + { + "cell": [Function], + "content": "t([curiosity-inventory.header_product_name,curiosity-inventory.guestsHeader_product_name], {"context":"ansible-aap-managed"})", + "info": undefined, + "isSort": true, + "isWrap": true, + "label": [Function], + "metric": "product_name", + "modifier": "wrap", + "width": undefined, + }, + { + "cell": [Function], + "content": "t([curiosity-inventory.header_quantity,curiosity-inventory.guestsHeader_quantity], {"context":"ansible-aap-managed"})", + "info": undefined, + "isSort": true, + "isWrap": true, + "label": [Function], + "metric": "quantity", + "modifier": "wrap", + "width": 10, + }, + { + "cell": [Function], + "content": "t([curiosity-inventory.header_next_event_date,curiosity-inventory.guestsHeader_next_event_date], {"context":"ansible-aap-managed"})", + "info": undefined, + "isSort": true, + "isWrap": true, + "label": [Function], + "metric": "next_event_date", + "modifier": "wrap", + "width": 15, + }, + ], + "dataSetRows": [ + { + "cells": [ + { + "content": "lorem", + "dataLabel": "t([curiosity-inventory.header_product_name,curiosity-inventory.guestsHeader_product_name], {"context":"ansible-aap-managed"})", + "header": [Function], + "isSort": true, + "isWrap": true, + "metric": "product_name", + "width": undefined, + }, + { + "content": "t(curiosity-inventory.measurement, {"context":"value","total":1,"testId":{"type":"span","key":null,"ref":null,"props":{"data-test":"subscriptions-cell-quantity","data-value":"1"},"_owner":null,"_store":{}}})", + "dataLabel": "t([curiosity-inventory.header_quantity,curiosity-inventory.guestsHeader_quantity], {"context":"ansible-aap-managed"})", + "header": [Function], + "isSort": true, + "isWrap": true, + "metric": "quantity", + "width": 10, + }, + { + "content": "2022-01-01", + "dataLabel": "t([curiosity-inventory.header_next_event_date,curiosity-inventory.guestsHeader_next_event_date], {"context":"ansible-aap-managed"})", + "header": [Function], + "isSort": true, + "isWrap": true, + "metric": "next_event_date", + "width": 15, + }, + ], + "expandedContent": undefined, + "row": { + "Cores": 2000, + "billing_provider": "dolor sit", + "has_infinite_quantity": true, + "loremIpsum": "hello world", + "next_event_date": "2022-01-01T00:00:00.000Z", + "product_name": "lorem", + "quantity": 1, + "service_level": "hello world", + }, + }, + ], + "resultsCount": undefined, + "resultsOffset": undefined, + "resultsPerPage": undefined, + }, + }, { "OpenShift Container Platform": { "dataSetColumnHeaders": [ diff --git a/src/config/__tests__/__snapshots__/products.test.js.snap b/src/config/__tests__/__snapshots__/products.test.js.snap index 6618b3af4..2addb14f1 100644 --- a/src/config/__tests__/__snapshots__/products.test.js.snap +++ b/src/config/__tests__/__snapshots__/products.test.js.snap @@ -386,6 +386,7 @@ exports[`Product configurations should return sorted product configs: sorted 1`] exports[`Product configurations should return specific methods and properties: products 1`] = ` { "configs": [ + "ansible-aap-managed", "OpenShift Container Platform", "OpenShift-dedicated-metrics", "OpenShift-metrics", diff --git a/src/config/product.ansible.js b/src/config/product.ansible.js new file mode 100644 index 000000000..bbd60fc1b --- /dev/null +++ b/src/config/product.ansible.js @@ -0,0 +1,350 @@ +import React from 'react'; +import { + chart_color_blue_100 as chartColorBlueLight, + chart_color_blue_300 as chartColorBlueDark +} from '@patternfly/react-tokens'; +import { Button } from '@patternfly/react-core'; +import { DateFormat } from '@redhat-cloud-services/frontend-components/DateFormat'; +import moment from 'moment/moment'; +import { + RHSM_API_PATH_METRIC_TYPES, + RHSM_API_PATH_PRODUCT_TYPES, + RHSM_API_QUERY_CATEGORY_TYPES as CATEGORY_TYPES, + RHSM_API_QUERY_GRANULARITY_TYPES as GRANULARITY_TYPES, + RHSM_API_QUERY_INVENTORY_SORT_DIRECTION_TYPES as SORT_DIRECTION_TYPES, + RHSM_API_QUERY_INVENTORY_SORT_TYPES as INVENTORY_SORT_TYPES, + RHSM_API_QUERY_INVENTORY_SUBSCRIPTIONS_SORT_TYPES as SUBSCRIPTIONS_SORT_TYPES, + RHSM_API_QUERY_SET_TYPES, + RHSM_API_RESPONSE_INSTANCES_DATA_TYPES as INVENTORY_TYPES, + RHSM_API_RESPONSE_SUBSCRIPTIONS_DATA_TYPES as SUBSCRIPTIONS_INVENTORY_TYPES, + RHSM_INTERNAL_PRODUCT_DISPLAY_TYPES as DISPLAY_TYPES +} from '../services/rhsm/rhsmConstants'; +import { dateHelpers, helpers } from '../common'; +import { ChartTypeVariant } from '../components/chart/chartHelpers'; +import { SelectPosition } from '../components/form/select'; +import { translate } from '../components/i18n/i18n'; + +/** + * Ansible + * + * @memberof Products + * @module Ansible + */ + +/** + * Product group. A variant and dissimilar product configuration grouping identifier. + * + * @type {string} + */ +const productGroup = RHSM_API_PATH_PRODUCT_TYPES.ANSIBLE; + +/** + * Product ID. The identifier used when querying the API. + * + * @type {string} + */ +const productId = RHSM_API_PATH_PRODUCT_TYPES.ANSIBLE; + +/** + * Product label. An identifier used for display strings. + * + * @type {string} + */ +const productLabel = RHSM_API_PATH_PRODUCT_TYPES.ANSIBLE; + +/** + * Product configuration + * + * @type {{productLabel: string, productPath: string, aliases: string[], productId: string, + * inventorySubscriptionsQuery: object, query: object, initialSubscriptionsInventoryFilters: Array, + * initialInventorySettings: object, viewId: string, initialToolbarFilters: Array, productGroup: string, + * graphTallyQuery: object, inventoryHostsQuery: object, productDisplay: string, initialGraphFilters: Array, + * initialGuestsFilters: Array, inventoryGuestsQuery: object, initialGraphSettings: object, + * initialInventoryFilters: Array}} + */ +const config = { + aliases: [], + productGroup, + productId, + productLabel, + productPath: productGroup.toLowerCase(), + productDisplay: DISPLAY_TYPES.CAPACITY, + viewId: `view${productGroup}-${productId}`, + query: { + [RHSM_API_QUERY_SET_TYPES.START_DATE]: dateHelpers.getRangedMonthDateTime('current').value.startDate.toISOString(), + [RHSM_API_QUERY_SET_TYPES.END_DATE]: dateHelpers.getRangedMonthDateTime('current').value.endDate.toISOString() + }, + graphTallyQuery: { + [RHSM_API_QUERY_SET_TYPES.GRANULARITY]: GRANULARITY_TYPES.DAILY, + [RHSM_API_QUERY_SET_TYPES.USE_RUNNING_TOTALS_FORMAT]: true + }, + inventoryGuestsQuery: { + [RHSM_API_QUERY_SET_TYPES.LIMIT]: 100, + [RHSM_API_QUERY_SET_TYPES.OFFSET]: 0 + }, + inventoryHostsQuery: { + [RHSM_API_QUERY_SET_TYPES.SORT]: INVENTORY_SORT_TYPES.LAST_SEEN, + [RHSM_API_QUERY_SET_TYPES.DIRECTION]: SORT_DIRECTION_TYPES.DESCENDING, + [RHSM_API_QUERY_SET_TYPES.LIMIT]: 100, + [RHSM_API_QUERY_SET_TYPES.OFFSET]: 0 + }, + inventorySubscriptionsQuery: { + [RHSM_API_QUERY_SET_TYPES.SORT]: SUBSCRIPTIONS_SORT_TYPES.NEXT_EVENT_DATE, + [RHSM_API_QUERY_SET_TYPES.DIRECTION]: SORT_DIRECTION_TYPES.DESCENDING, + [RHSM_API_QUERY_SET_TYPES.LIMIT]: 100, + [RHSM_API_QUERY_SET_TYPES.OFFSET]: 0 + }, + initialGraphFilters: [ + { + filters: [ + { + metric: RHSM_API_PATH_METRIC_TYPES.MANAGED_NODES, + fill: chartColorBlueLight.value, + stroke: chartColorBlueDark.value, + color: chartColorBlueDark.value, + chartType: ChartTypeVariant.line, + query: { + [RHSM_API_QUERY_SET_TYPES.BILLING_CATEGORY]: CATEGORY_TYPES.PREPAID + } + }, + { + metric: RHSM_API_PATH_METRIC_TYPES.MANAGED_NODES, + chartType: ChartTypeVariant.threshold + } + ] + }, + { + filters: [ + { + metric: RHSM_API_PATH_METRIC_TYPES.INSTANCE_HOURS, + fill: chartColorBlueLight.value, + stroke: chartColorBlueDark.value, + color: chartColorBlueDark.value, + chartType: ChartTypeVariant.line, + query: { + [RHSM_API_QUERY_SET_TYPES.BILLING_CATEGORY]: CATEGORY_TYPES.PREPAID + } + }, + { + metric: RHSM_API_PATH_METRIC_TYPES.INSTANCE_HOURS, + chartType: ChartTypeVariant.threshold + } + ] + } + ], + initialGraphSettings: { + cards: [ + { + header: ({ dataSets = [] } = {}) => + translate('curiosity-graph.cardHeadingMetric', { + context: ['remainingCapacity', dataSets?.[0]?.display?.chartId], + testId: 'graphRemainingCapacityCard-header' + }), + body: ({ dataSets = [] } = {}) => + translate( + 'curiosity-graph.cardBodyMetric', + { + context: ['total', dataSets?.[0]?.display?.remainingCapacityHasData && dataSets?.[0]?.display?.chartId], + testId: 'graphRemainingCapacityCard-body', + total: helpers + .numberDisplay(dataSets?.[0]?.display?.remainingCapacity) + ?.format({ + average: true, + mantissa: 2, + trimMantissa: true, + lowPrecision: false + }) + ?.toUpperCase() + }, + [ + + ] + ), + footer: ({ dataSets = [] } = {}) => + translate('curiosity-graph.cardFooterMetric', { + date: moment + .utc(dataSets?.[0]?.display?.dailyDate) + .format(dateHelpers.timestampUTCTimeFormats.yearTimeShort), + testId: 'graphRemainingCapacityCard-footer' + }) + } + ], + isCardTitleDescription: true, + xAxisLabelIncrement: 1, + xAxisChartLabel: () => translate('curiosity-graph.label_axisX', { context: GRANULARITY_TYPES.DAILY }), + xAxisTickFormat: ({ tick }) => Number.parseInt(tick, 10) + 1 || tick, + yAxisTickFormat: ({ tick } = {}) => { + if (tick > 1) { + return helpers + .numberDisplay(tick) + ?.format({ average: true, mantissa: 1, trimMantissa: true, lowPrecision: false }) + ?.toUpperCase(); + } + return helpers + .numberDisplay(tick) + ?.format({ average: true, mantissa: 5, trimMantissa: true, lowPrecision: true }) + ?.toUpperCase(); + } + }, + initialGuestsFilters: [ + { + metric: INVENTORY_TYPES.DISPLAY_NAME, + header: () => translate('curiosity-inventory.guestsHeader', { context: [INVENTORY_TYPES.DISPLAY_NAME] }), + cell: ({ [INVENTORY_TYPES.DISPLAY_NAME]: displayName, [INVENTORY_TYPES.INVENTORY_ID]: inventoryId } = {}) => { + // FixMe: Disabled, see SWATCH-1209 for resolution + const { inventory: authorized = false } = {}; + + if (!inventoryId) { + return displayName; + } + + let updatedDisplayName = displayName || inventoryId; + + if (authorized) { + updatedDisplayName = ( + + ); + } + + return updatedDisplayName; + } + }, + { + metric: INVENTORY_TYPES.INVENTORY_ID, + width: 40 + }, + { + metric: INVENTORY_TYPES.LAST_SEEN, + cell: ({ [INVENTORY_TYPES.LAST_SEEN]: lastSeen } = {}) => (lastSeen && ) || '', + width: 15 + } + ], + initialInventoryFilters: [ + { + metric: INVENTORY_TYPES.DISPLAY_NAME, + cell: ({ [INVENTORY_TYPES.DISPLAY_NAME]: displayName, [INVENTORY_TYPES.INSTANCE_ID]: instanceId } = {}) => { + const { inventory: authorized } = {}; + + if (!instanceId) { + return displayName; + } + + let updatedDisplayName = displayName || instanceId; + + if (authorized) { + updatedDisplayName = ( + + ); + } + + return updatedDisplayName; + }, + isSort: true + }, + { + metric: RHSM_API_PATH_METRIC_TYPES.MANAGED_NODES, + cell: ({ [RHSM_API_PATH_METRIC_TYPES.MANAGED_NODES]: total } = {}) => + translate('curiosity-inventory.measurement', { + context: (total && 'value') || undefined, + total: (total && Number.parseFloat(total).toFixed(2)) || undefined, + testId: ( + + ) + }), + isSort: true, + isWrap: true, + width: 15 + }, + { + metric: RHSM_API_PATH_METRIC_TYPES.INSTANCE_HOURS, + cell: ({ [RHSM_API_PATH_METRIC_TYPES.INSTANCE_HOURS]: total } = {}) => + translate('curiosity-inventory.measurement', { + context: (total && 'value') || undefined, + total: (total && Number.parseFloat(total).toFixed(2)) || undefined, + testId: ( + + ) + }), + isSort: true, + isWrap: true, + width: 20 + }, + { + metric: INVENTORY_TYPES.LAST_SEEN, + cell: ({ [INVENTORY_TYPES.LAST_SEEN]: lastSeen }) => (lastSeen && ) || '', + isSort: true, + isWrap: true, + width: 15 + } + ], + initialInventorySettings: { + actions: [ + { + id: RHSM_API_QUERY_SET_TYPES.DISPLAY_NAME + } + ], + guestContent: ({ + [INVENTORY_TYPES.NUMBER_OF_GUESTS]: numberOfGuests = {}, + [INVENTORY_TYPES.INSTANCE_ID]: id + } = {}) => (numberOfGuests > 0 && id && { id, numberOfGuests }) || undefined + }, + initialSubscriptionsInventoryFilters: [ + { + metric: SUBSCRIPTIONS_INVENTORY_TYPES.PRODUCT_NAME, + isSort: true, + isWrap: true + }, + { + metric: SUBSCRIPTIONS_INVENTORY_TYPES.QUANTITY, + cell: ({ [SUBSCRIPTIONS_INVENTORY_TYPES.QUANTITY]: total } = {}) => + translate('curiosity-inventory.measurement', { + context: (total && 'value') || undefined, + total, + testId: ( + + ) + }), + isSort: true, + isWrap: true, + width: 10 + }, + { + metric: SUBSCRIPTIONS_INVENTORY_TYPES.NEXT_EVENT_DATE, + cell: ({ [SUBSCRIPTIONS_INVENTORY_TYPES.NEXT_EVENT_DATE]: nextEventDate } = {}) => + (nextEventDate && moment.utc(nextEventDate).format('YYYY-MM-DD')) || '', + isSort: true, + isWrap: true, + width: 15 + } + ], + initialToolbarFilters: [ + { + id: 'rangedMonthly', + isSecondary: true, + position: SelectPosition.right + }, + { + id: 'export', + isItem: true + } + ] +}; + +export { config as default, config, productGroup, productId }; diff --git a/src/services/rhsm/__tests__/__snapshots__/rhsmConstants.test.js.snap b/src/services/rhsm/__tests__/__snapshots__/rhsmConstants.test.js.snap index d6b6268ec..4c9f5c853 100644 --- a/src/services/rhsm/__tests__/__snapshots__/rhsmConstants.test.js.snap +++ b/src/services/rhsm/__tests__/__snapshots__/rhsmConstants.test.js.snap @@ -6,6 +6,7 @@ exports[`RHSM Constants should have specific properties: all exported constants "CORES": "Cores", "CORE_SECONDS": "Core-seconds", "INSTANCE_HOURS": "Instance-hours", + "MANAGED_NODES": "Managed-nodes", "SOCKETS": "Sockets", "STORAGE_GIBIBYTES": "Storage-gibibytes", "STORAGE_GIBIBYTE_MONTHS": "Storage-gibibyte-months", @@ -13,6 +14,7 @@ exports[`RHSM Constants should have specific properties: all exported constants "VCPUS": "vCPUs", }, "RHSM_API_PATH_PRODUCT_TYPES": { + "ANSIBLE": "ansible-aap-managed", "OPENSHIFT": "OpenShift Container Platform", "OPENSHIFT_DEDICATED_METRICS": "OpenShift-dedicated-metrics", "OPENSHIFT_METRICS": "OpenShift-metrics", @@ -84,6 +86,7 @@ exports[`RHSM Constants should have specific properties: all exported constants "CORE_SECONDS": "Core-seconds", "INSTANCE_HOURS": "Instance-hours", "LAST_SEEN": "last_seen", + "MANAGED_NODES": "Managed-nodes", "NAME": "display_name", "NUMBER_OF_GUESTS": "number_of_guests", "SOCKETS": "Sockets", @@ -270,6 +273,7 @@ exports[`RHSM Constants should have specific properties: all exported constants "CORES": "Cores", "CORE_SECONDS": "Core-seconds", "INSTANCE_HOURS": "Instance-hours", + "MANAGED_NODES": "Managed-nodes", "SOCKETS": "Sockets", "STORAGE_GIBIBYTES": "Storage-gibibytes", "STORAGE_GIBIBYTE_MONTHS": "Storage-gibibyte-months", @@ -277,6 +281,7 @@ exports[`RHSM Constants should have specific properties: all exported constants "VCPUS": "vCPUs", }, "RHSM_API_PATH_PRODUCT_TYPES": { + "ANSIBLE": "ansible-aap-managed", "OPENSHIFT": "OpenShift Container Platform", "OPENSHIFT_DEDICATED_METRICS": "OpenShift-dedicated-metrics", "OPENSHIFT_METRICS": "OpenShift-metrics", @@ -348,6 +353,7 @@ exports[`RHSM Constants should have specific properties: all exported constants "CORE_SECONDS": "Core-seconds", "INSTANCE_HOURS": "Instance-hours", "LAST_SEEN": "last_seen", + "MANAGED_NODES": "Managed-nodes", "NAME": "display_name", "NUMBER_OF_GUESTS": "number_of_guests", "SOCKETS": "Sockets", @@ -535,6 +541,7 @@ exports[`RHSM Constants should have specific properties: all exported constants "CORES": "Cores", "CORE_SECONDS": "Core-seconds", "INSTANCE_HOURS": "Instance-hours", + "MANAGED_NODES": "Managed-nodes", "SOCKETS": "Sockets", "STORAGE_GIBIBYTES": "Storage-gibibytes", "STORAGE_GIBIBYTE_MONTHS": "Storage-gibibyte-months", @@ -542,6 +549,7 @@ exports[`RHSM Constants should have specific properties: all exported constants "VCPUS": "vCPUs", }, "RHSM_API_PATH_PRODUCT_TYPES": { + "ANSIBLE": "ansible-aap-managed", "OPENSHIFT": "OpenShift Container Platform", "OPENSHIFT_DEDICATED_METRICS": "OpenShift-dedicated-metrics", "OPENSHIFT_METRICS": "OpenShift-metrics", @@ -613,6 +621,7 @@ exports[`RHSM Constants should have specific properties: all exported constants "CORE_SECONDS": "Core-seconds", "INSTANCE_HOURS": "Instance-hours", "LAST_SEEN": "last_seen", + "MANAGED_NODES": "Managed-nodes", "NAME": "display_name", "NUMBER_OF_GUESTS": "number_of_guests", "SOCKETS": "Sockets", @@ -804,6 +813,7 @@ exports[`RHSM Constants should have specific properties: specific constants 1`] "CORES": "Cores", "CORE_SECONDS": "Core-seconds", "INSTANCE_HOURS": "Instance-hours", + "MANAGED_NODES": "Managed-nodes", "SOCKETS": "Sockets", "STORAGE_GIBIBYTES": "Storage-gibibytes", "STORAGE_GIBIBYTE_MONTHS": "Storage-gibibyte-months", @@ -811,6 +821,7 @@ exports[`RHSM Constants should have specific properties: specific constants 1`] "VCPUS": "vCPUs", }, "RHSM_API_PATH_PRODUCT_TYPES": { + "ANSIBLE": "ansible-aap-managed", "OPENSHIFT": "OpenShift Container Platform", "OPENSHIFT_DEDICATED_METRICS": "OpenShift-dedicated-metrics", "OPENSHIFT_METRICS": "OpenShift-metrics", @@ -882,6 +893,7 @@ exports[`RHSM Constants should have specific properties: specific constants 1`] "CORE_SECONDS": "Core-seconds", "INSTANCE_HOURS": "Instance-hours", "LAST_SEEN": "last_seen", + "MANAGED_NODES": "Managed-nodes", "NAME": "display_name", "NUMBER_OF_GUESTS": "number_of_guests", "SOCKETS": "Sockets", diff --git a/src/services/rhsm/rhsmConstants.js b/src/services/rhsm/rhsmConstants.js index 5f8ec087a..10db550ec 100644 --- a/src/services/rhsm/rhsmConstants.js +++ b/src/services/rhsm/rhsmConstants.js @@ -54,14 +54,15 @@ const RHSM_API_PATH_PRODUCT_VARIANT_SATELLITE_TYPES = { * @type {{RHEL_ARM: string, OPENSHIFT_METRICS: string, RHEL_X86_ELS_UNCONVERTED: string, RHEL_X86_EUS: string, * RHEL_WORKSTATION: string, RHEL_X86_SAP: string, RHODS: string, ROSA: string, RHEL_X86: string, * RHEL_COMPUTE_NODE: string, RHEL_X86_ELS_PAYG: string, OPENSHIFT: string, RHEL_X86_RS: string, SATELLITE_SERVER: - * string, RHEL_X86_ELS_PAYG_ADDON: string, OPENSHIFT_DEDICATED_METRICS: string, RHEL_X86_HA: string, - * SATELLITE_CAPSULE: string, RHEL_IBM_Z: string, RHEL_IBM_POWER: string, RHACS: + * string, RHEL_X86_ELS_PAYG_ADDON: string, OPENSHIFT_DEDICATED_METRICS: string, RHEL_X86_HA: string, ANSIBLE: + * string, SATELLITE_CAPSULE: string, RHEL_IBM_Z: string, RHEL_IBM_POWER: string, RHACS: * string}} */ const RHSM_API_PATH_PRODUCT_TYPES = { ...RHSM_API_PATH_PRODUCT_VARIANT_RHEL_TYPES, ...RHSM_API_PATH_PRODUCT_VARIANT_RHEL_ELS_TYPES, ...RHSM_API_PATH_PRODUCT_VARIANT_SATELLITE_TYPES, + ANSIBLE: 'ansible-aap-managed', RHACS: 'rhacs', RHEL_COMPUTE_NODE: 'RHEL Compute Node', RHEL_WORKSTATION: 'RHEL Workstation', @@ -75,14 +76,15 @@ const RHSM_API_PATH_PRODUCT_TYPES = { /** * RHSM path IDs for metrics. * - * @type {{CORES: string, STORAGE_GIBIBYTES: string, SOCKETS: string, INSTANCE_HOURS: string, + * @type {{CORES: string, STORAGE_GIBIBYTES: string, INSTANCE_HOURS: string, SOCKETS: string, MANAGED_NODES: string, * TRANSFER_GIBIBYTES: string, VCPUS: string, CORE_SECONDS: string, STORAGE_GIBIBYTE_MONTHS: string}} */ const RHSM_API_PATH_METRIC_TYPES = { CORES: 'Cores', - SOCKETS: 'Sockets', CORE_SECONDS: 'Core-seconds', INSTANCE_HOURS: 'Instance-hours', + MANAGED_NODES: 'Managed-nodes', + SOCKETS: 'Sockets', STORAGE_GIBIBYTES: 'Storage-gibibytes', STORAGE_GIBIBYTE_MONTHS: 'Storage-gibibyte-months', TRANSFER_GIBIBYTES: 'Transfer-gibibytes', @@ -433,9 +435,9 @@ const RHSM_INTERNAL_PRODUCT_DISPLAY_TYPES = { * BILLING_CATEGORY: string}, RHSM_API_RESPONSE_DATA: string, RHSM_API_RESPONSE_SUBSCRIPTIONS_META_TYPES: * {MEASUREMENTS: string, PRODUCT: string, SUBSCRIPTION_TYPE: string, COUNT: string}, * RHSM_API_PATH_PRODUCT_VARIANT_SATELLITE_TYPES: {SATELLITE_SERVER: string, SATELLITE_CAPSULE: string}, - * RHSM_API_PATH_METRIC_TYPES: {CORES: string, STORAGE_GIBIBYTES: string, SOCKETS: string, INSTANCE_HOURS: string, - * TRANSFER_GIBIBYTES: string, VCPUS: string, CORE_SECONDS: string, STORAGE_GIBIBYTE_MONTHS: string}, - * RHSM_API_RESPONSE_INSTANCES_META_TYPES: {MEASUREMENTS: string, PRODUCT: string, COUNT: string}, + * RHSM_API_PATH_METRIC_TYPES: {CORES: string, STORAGE_GIBIBYTES: string, INSTANCE_HOURS: string, SOCKETS: string, + * MANAGED_NODES: string, TRANSFER_GIBIBYTES: string, VCPUS: string, CORE_SECONDS: string, STORAGE_GIBIBYTE_MONTHS: + * string}, RHSM_API_RESPONSE_INSTANCES_META_TYPES: {MEASUREMENTS: string, PRODUCT: string, COUNT: string}, * RHSM_API_RESPONSE_INSTANCES_DATA_TYPES: {MEASUREMENTS: string, BILLING_ACCOUNT_ID: string, CATEGORY: string, * SUBSCRIPTION_MANAGER_ID: string, INVENTORY_ID: string, NUMBER_OF_GUESTS: string, BILLING_PROVIDER: string, * DISPLAY_NAME: string, CLOUD_PROVIDER: string, INSTANCE_ID: string, LAST_SEEN: string}, @@ -458,8 +460,8 @@ const RHSM_INTERNAL_PRODUCT_DISPLAY_TYPES = { * {RHEL_ARM: string, OPENSHIFT_METRICS: string, RHEL_X86_ELS_UNCONVERTED: string, RHEL_X86_EUS: string, * RHEL_WORKSTATION: string, RHEL_X86_SAP: string, RHODS: string, ROSA: string, RHEL_X86: string, * RHEL_COMPUTE_NODE: string, RHEL_X86_ELS_PAYG: string, OPENSHIFT: string, RHEL_X86_RS: string, SATELLITE_SERVER: - * string, RHEL_X86_ELS_PAYG_ADDON: string, OPENSHIFT_DEDICATED_METRICS: string, RHEL_X86_HA: string, - * SATELLITE_CAPSULE: string, RHEL_IBM_Z: string, RHEL_IBM_POWER: string, RHACS: string}, + * string, RHEL_X86_ELS_PAYG_ADDON: string, OPENSHIFT_DEDICATED_METRICS: string, RHEL_X86_HA: string, ANSIBLE: + * string, SATELLITE_CAPSULE: string, RHEL_IBM_Z: string, RHEL_IBM_POWER: string, RHACS: string}, * RHSM_API_RESPONSE_BILLING_PROVIDER_TYPES: {AZURE: string, GCP: string, RED_HAT: string, NONE: string, AWS: * string, ORACLE: string}, RHSM_API_RESPONSE_ERRORS_TYPES: {CODE: string}, * RHSM_API_RESPONSE_TALLY_CAPACITY_DATA_TYPES: {DATE: string, HAS_DATA: string, VALUE: string, diff --git a/src/services/rhsm/rhsmServices.js b/src/services/rhsm/rhsmServices.js index 2b8f4ef1c..d54c88c94 100644 --- a/src/services/rhsm/rhsmServices.js +++ b/src/services/rhsm/rhsmServices.js @@ -437,6 +437,186 @@ const getApiVersion = (options = {}) => { * } * } */ +/** + * @apiMock {DelayResponse} 250 + * @apiMock {RandomSuccess} + * @api {get} /api/rhsm-subscriptions/v1/tally/products/:product_id/Managed-nodes Get RHSM graph data + * @apiDescription Retrieve graph data. + * + * @apiSuccessExample {json} DAILY, Success-Response: + * HTTP/1.1 200 OK + * { + * "data": [ + * { + * "date": "2020-07-01T00:00:00Z", + * "value": 25, + * "has_data": true + * }, + * { + * "date": "2020-07-02T00:00:00Z", + * "value": 25, + * "has_data": true + * }, + * { + * "date": "2020-07-03T00:00:00Z", + * "value": 25, + * "has_data": true + * }, + * { + * "date": "2020-07-04T00:00:00Z", + * "value": 25, + * "has_data": true + * }, + * { + * "date": "2020-07-05T00:00:00Z", + * "value": 50, + * "has_data": false + * }, + * { + * "date": "2020-07-06T00:00:00Z", + * "value": 0, + * "has_data": true + * }, + * { + * "date": "2020-07-07T00:00:00Z", + * "value": 50, + * "has_data": false + * }, + * { + * "date": "2020-07-08T00:00:00Z", + * "value": 50, + * "has_data": false + * }, + * { + * "date": "2020-07-09T00:00:00Z", + * "value": 1000, + * "has_data": false + * }, + * { + * "date": "2020-07-10T00:00:00Z", + * "value": 50, + * "has_data": false + * }, + * { + * "date": "2020-07-11T00:00:00Z", + * "value": 50.090125, + * "has_data": true + * }, + * { + * "date": "2020-07-12T00:00:00Z", + * "has_data": null + * }, + * { + * "date": "2020-07-13T00:00:00Z", + * "has_data": false + * }, + * { + * "date": "2020-07-14T00:00:00Z", + * "value": null, + * "has_data": false + * }, + * { + * "date": "2020-07-15T00:00:00Z", + * "value": null, + * "has_data": false + * }, + * { + * "date": "2020-07-16T00:00:00Z", + * "value": null, + * "has_data": false + * }, + * { + * "date": "2020-07-17T00:00:00Z", + * "value": null, + * "has_data": false + * }, + * { + * "date": "2020-07-18T00:00:00Z", + * "value": null, + * "has_data": true + * }, + * { + * "date": "2020-07-19T00:00:00Z", + * "value": null, + * "has_data": true + * }, + * { + * "date": "2020-07-20T00:00:00Z", + * "value": 0, + * "has_data": true + * }, + * { + * "date": "2020-07-21T00:00:00Z", + * "value": 0, + * "has_data": true + * }, + * { + * "date": "2020-07-22T00:00:00Z", + * "value": 0, + * "has_data": true + * }, + * { + * "date": "2020-07-23T00:00:00Z", + * "value": 0, + * "has_data": false + * }, + * { + * "date": "2020-07-24T00:00:00Z", + * "value": 0, + * "has_data": true + * }, + * { + * "date": "2020-07-25T00:00:00Z", + * "value": 90, + * "has_data": true + * }, + * { + * "date": "2020-07-26T00:00:00Z", + * "value": 104, + * "has_data": true + * }, + * { + * "date": "2020-07-27T00:00:00Z", + * "value": 70, + * "has_data": true + * }, + * { + * "date": "2020-07-28T00:00:00Z", + * "value": 82, + * "has_data": true + * }, + * { + * "date": "2020-07-29T00:00:00Z", + * "value": 86, + * "has_data": true + * }, + * { + * "date": "2020-07-30T00:00:00Z", + * "value": 90, + * "has_data": true + * }, + * { + * "date": "2020-07-31T00:00:00Z", + * "value": 144, + * "has_data": true + * } + * ], + * "links": {}, + * "meta": { + * "granularity": "daily", + * "has_cloudigrade_data": false, + * "has_cloudigrade_mismatch": true, + * "metric_id": "Managed-nodes", + * "product": "ansible-aap-managed", + * "service_level": "", + * "total_monthly": { + * "date": "2020-07-31T00:00:00Z", + * "value": 50, + * "has_data": true + * }, + * "usage": "" + * } + * } /** * @apiMock {DelayResponse} 1000 * @apiMock {RandomSuccess} diff --git a/tests/__snapshots__/dist.test.js.snap b/tests/__snapshots__/dist.test.js.snap index 25543700c..7f6010abc 100644 --- a/tests/__snapshots__/dist.test.js.snap +++ b/tests/__snapshots__/dist.test.js.snap @@ -2,6 +2,17 @@ exports[`Build distribution should have a predictable ephemeral navigation based on route configuration: GUI routes expected covered, missing routes 1`] = ` [ + { + "coverage": "FALSE", + "path": "/ansible-aap-managed", + "productGroup": [ + "ansible-aap-managed", + ], + "productId": [ + "ansible-aap-managed", + ], + "productVariants": [], + }, { "coverage": "TRUE", "path": "/openshift",