diff --git a/public/locales/en-US.json b/public/locales/en-US.json index 265638768..81dad17b0 100644 --- a/public/locales/en-US.json +++ b/public/locales/en-US.json @@ -17,6 +17,7 @@ "dateLabel": "Date", "coresLabel": "Cores", "socketsLabel": "Sockets", + "cloudSocketsLabel": "Public cloud", "hypervisorCoresLabel": "Virtualized cores", "hypervisorSocketsLabel": "Virtualized {{product}}", "physicalCoresLabel": "Physical cores", diff --git a/src/components/i18n/__tests__/__snapshots__/i18n.test.js.snap b/src/components/i18n/__tests__/__snapshots__/i18n.test.js.snap index 99d1c5668..e44c9fefb 100644 --- a/src/components/i18n/__tests__/__snapshots__/i18n.test.js.snap +++ b/src/components/i18n/__tests__/__snapshots__/i18n.test.js.snap @@ -15,7 +15,7 @@ msgstr \\"\\" \\"Content-Type: text/plain; charset=UTF-8\\\\n\\" #: src/components/openshiftView/openshiftView.js:92 -#: src/components/rhelView/rhelView.js:47 +#: src/components/rhelView/rhelView.js:49 msgid \\"curiosity-graph.cardHeading\\" msgstr \\"\\" diff --git a/src/components/rhelView/__tests__/__snapshots__/rhelView.test.js.snap b/src/components/rhelView/__tests__/__snapshots__/rhelView.test.js.snap index 6cb744c3e..bdb67ef2b 100644 --- a/src/components/rhelView/__tests__/__snapshots__/rhelView.test.js.snap +++ b/src/components/rhelView/__tests__/__snapshots__/rhelView.test.js.snap @@ -30,6 +30,11 @@ exports[`RhelView Component should have a fallback title: title 1`] = ` "id": "hypervisorSockets", "stroke": "#009596", }, + Object { + "fill": "#b2b0ea", + "id": "cloudSockets", + "stroke": "#5752d1", + }, Object { "id": "thresholdSockets", }, @@ -79,6 +84,11 @@ exports[`RhelView Component should render a non-connected component: non-connect "id": "hypervisorSockets", "stroke": "#009596", }, + Object { + "fill": "#b2b0ea", + "id": "cloudSockets", + "stroke": "#5752d1", + }, Object { "id": "thresholdSockets", }, diff --git a/src/components/rhelView/rhelView.js b/src/components/rhelView/rhelView.js index ebbdf5fd5..1417f85a6 100644 --- a/src/components/rhelView/rhelView.js +++ b/src/components/rhelView/rhelView.js @@ -4,7 +4,9 @@ import { chart_color_blue_100 as chartColorBlueLight, chart_color_blue_300 as chartColorBlueDark, chart_color_cyan_100 as chartColorCyanLight, - chart_color_cyan_300 as chartColorCyanDark + chart_color_cyan_300 as chartColorCyanDark, + chart_color_purple_100 as chartColorPurpleLight, + chart_color_purple_300 as chartColorPurpleDark } from '@patternfly/react-tokens'; import { PageLayout, PageHeader, PageSection, PageToolbar } from '../pageLayout/pageLayout'; import { RHSM_API_QUERY_GRANULARITY_TYPES as GRANULARITY_TYPES, rhsmApiTypes } from '../../types/rhsmApiTypes'; @@ -86,6 +88,7 @@ RhelView.defaultProps = { initialFilters: [ { id: 'physicalSockets', fill: chartColorBlueLight.value, stroke: chartColorBlueDark.value }, { id: 'hypervisorSockets', fill: chartColorCyanLight.value, stroke: chartColorCyanDark.value }, + { id: 'cloudSockets', fill: chartColorPurpleLight.value, stroke: chartColorPurpleDark.value }, { id: 'thresholdSockets' } ], t: helpers.noopTranslate, diff --git a/src/redux/selectors/__tests__/__snapshots__/graphCardSelectors.test.js.snap b/src/redux/selectors/__tests__/__snapshots__/graphCardSelectors.test.js.snap index 9323ca1ce..75aa9ed09 100644 --- a/src/redux/selectors/__tests__/__snapshots__/graphCardSelectors.test.js.snap +++ b/src/redux/selectors/__tests__/__snapshots__/graphCardSelectors.test.js.snap @@ -16,6 +16,57 @@ Object { "errorStatus": undefined, "fulfilled": true, "graphData": Object { + "cloudCores": Array [ + Object { + "date": 2019-09-04T00:00:00.000Z, + "x": 0, + "y": 0, + }, + Object { + "date": 2019-09-05T00:00:00.000Z, + "x": 1, + "y": 0, + }, + Object { + "date": 2019-09-06T00:00:00.000Z, + "x": 2, + "y": 0, + }, + ], + "cloudInstanceCount": Array [ + Object { + "date": 2019-09-04T00:00:00.000Z, + "x": 0, + "y": 0, + }, + Object { + "date": 2019-09-05T00:00:00.000Z, + "x": 1, + "y": 0, + }, + Object { + "date": 2019-09-06T00:00:00.000Z, + "x": 2, + "y": 0, + }, + ], + "cloudSockets": Array [ + Object { + "date": 2019-09-04T00:00:00.000Z, + "x": 0, + "y": 0, + }, + Object { + "date": 2019-09-05T00:00:00.000Z, + "x": 1, + "y": 0, + }, + Object { + "date": 2019-09-06T00:00:00.000Z, + "x": 2, + "y": 0, + }, + ], "cores": Array [ Object { "date": 2019-09-04T00:00:00.000Z, @@ -135,6 +186,57 @@ Object { "y": 4, }, ], + "thresholdCloudCores": Array [ + Object { + "date": 2019-09-04T00:00:00.000Z, + "x": 0, + "y": 0, + }, + Object { + "date": 2019-09-05T00:00:00.000Z, + "x": 1, + "y": null, + }, + Object { + "date": 2019-09-06T00:00:00.000Z, + "x": 2, + "y": null, + }, + ], + "thresholdCloudInstanceCount": Array [ + Object { + "date": 2019-09-04T00:00:00.000Z, + "x": 0, + "y": 0, + }, + Object { + "date": 2019-09-05T00:00:00.000Z, + "x": 1, + "y": null, + }, + Object { + "date": 2019-09-06T00:00:00.000Z, + "x": 2, + "y": null, + }, + ], + "thresholdCloudSockets": Array [ + Object { + "date": 2019-09-04T00:00:00.000Z, + "x": 0, + "y": 0, + }, + Object { + "date": 2019-09-05T00:00:00.000Z, + "x": 1, + "y": null, + }, + Object { + "date": 2019-09-06T00:00:00.000Z, + "x": 2, + "y": null, + }, + ], "thresholdCores": Array [ Object { "date": 2019-09-04T00:00:00.000Z, @@ -278,6 +380,27 @@ Object { "errorStatus": undefined, "fulfilled": true, "graphData": Object { + "cloudCores": Array [ + Object { + "date": 2019-09-04T00:00:00.000Z, + "x": 0, + "y": 0, + }, + ], + "cloudInstanceCount": Array [ + Object { + "date": 2019-09-04T00:00:00.000Z, + "x": 0, + "y": 0, + }, + ], + "cloudSockets": Array [ + Object { + "date": 2019-09-04T00:00:00.000Z, + "x": 0, + "y": 0, + }, + ], "cores": Array [ Object { "date": 2019-09-04T00:00:00.000Z, @@ -327,6 +450,27 @@ Object { "y": 2, }, ], + "thresholdCloudCores": Array [ + Object { + "date": 2019-09-04T00:00:00.000Z, + "x": 0, + "y": 0, + }, + ], + "thresholdCloudInstanceCount": Array [ + Object { + "date": 2019-09-04T00:00:00.000Z, + "x": 0, + "y": 0, + }, + ], + "thresholdCloudSockets": Array [ + Object { + "date": 2019-09-04T00:00:00.000Z, + "x": 0, + "y": 0, + }, + ], "thresholdCores": Array [ Object { "date": 2019-09-04T00:00:00.000Z, @@ -387,6 +531,27 @@ Object { "errorStatus": undefined, "fulfilled": true, "graphData": Object { + "cloudCores": Array [ + Object { + "date": 2019-09-04T00:00:00.000Z, + "x": 0, + "y": 0, + }, + ], + "cloudInstanceCount": Array [ + Object { + "date": 2019-09-04T00:00:00.000Z, + "x": 0, + "y": 0, + }, + ], + "cloudSockets": Array [ + Object { + "date": 2019-09-04T00:00:00.000Z, + "x": 0, + "y": 0, + }, + ], "cores": Array [ Object { "date": 2019-09-04T00:00:00.000Z, @@ -436,6 +601,27 @@ Object { "y": 2, }, ], + "thresholdCloudCores": Array [ + Object { + "date": 2019-09-04T00:00:00.000Z, + "x": 0, + "y": 0, + }, + ], + "thresholdCloudInstanceCount": Array [ + Object { + "date": 2019-09-04T00:00:00.000Z, + "x": 0, + "y": 0, + }, + ], + "thresholdCloudSockets": Array [ + Object { + "date": 2019-09-04T00:00:00.000Z, + "x": 0, + "y": 0, + }, + ], "thresholdCores": Array [ Object { "date": 2019-09-04T00:00:00.000Z, @@ -496,6 +682,27 @@ Object { "errorStatus": undefined, "fulfilled": true, "graphData": Object { + "cloudCores": Array [ + Object { + "date": 2019-09-04T00:00:00.000Z, + "x": 0, + "y": 0, + }, + ], + "cloudInstanceCount": Array [ + Object { + "date": 2019-09-04T00:00:00.000Z, + "x": 0, + "y": 0, + }, + ], + "cloudSockets": Array [ + Object { + "date": 2019-09-04T00:00:00.000Z, + "x": 0, + "y": 0, + }, + ], "cores": Array [ Object { "date": 2019-09-04T00:00:00.000Z, @@ -545,6 +752,27 @@ Object { "y": 2, }, ], + "thresholdCloudCores": Array [ + Object { + "date": 2019-09-04T00:00:00.000Z, + "x": 0, + "y": 0, + }, + ], + "thresholdCloudInstanceCount": Array [ + Object { + "date": 2019-09-04T00:00:00.000Z, + "x": 0, + "y": 0, + }, + ], + "thresholdCloudSockets": Array [ + Object { + "date": 2019-09-04T00:00:00.000Z, + "x": 0, + "y": 0, + }, + ], "thresholdCores": Array [ Object { "date": 2019-09-04T00:00:00.000Z, @@ -605,6 +833,57 @@ Object { "errorStatus": undefined, "fulfilled": true, "graphData": Object { + "cloudCores": Array [ + Object { + "date": 2019-09-04T00:00:00.000Z, + "x": 0, + "y": 0, + }, + Object { + "date": 2019-09-05T00:00:00.000Z, + "x": 1, + "y": 0, + }, + Object { + "date": 2019-09-06T00:00:00.000Z, + "x": 2, + "y": 0, + }, + ], + "cloudInstanceCount": Array [ + Object { + "date": 2019-09-04T00:00:00.000Z, + "x": 0, + "y": 0, + }, + Object { + "date": 2019-09-05T00:00:00.000Z, + "x": 1, + "y": 0, + }, + Object { + "date": 2019-09-06T00:00:00.000Z, + "x": 2, + "y": 0, + }, + ], + "cloudSockets": Array [ + Object { + "date": 2019-09-04T00:00:00.000Z, + "x": 0, + "y": 0, + }, + Object { + "date": 2019-09-05T00:00:00.000Z, + "x": 1, + "y": 0, + }, + Object { + "date": 2019-09-06T00:00:00.000Z, + "x": 2, + "y": 0, + }, + ], "cores": Array [ Object { "date": 2019-09-04T00:00:00.000Z, @@ -724,6 +1003,57 @@ Object { "y": 4, }, ], + "thresholdCloudCores": Array [ + Object { + "date": 2019-09-04T00:00:00.000Z, + "x": 0, + "y": 0, + }, + Object { + "date": 2019-09-05T00:00:00.000Z, + "x": 1, + "y": 0, + }, + Object { + "date": 2019-09-06T00:00:00.000Z, + "x": 2, + "y": 0, + }, + ], + "thresholdCloudInstanceCount": Array [ + Object { + "date": 2019-09-04T00:00:00.000Z, + "x": 0, + "y": 0, + }, + Object { + "date": 2019-09-05T00:00:00.000Z, + "x": 1, + "y": 0, + }, + Object { + "date": 2019-09-06T00:00:00.000Z, + "x": 2, + "y": 0, + }, + ], + "thresholdCloudSockets": Array [ + Object { + "date": 2019-09-04T00:00:00.000Z, + "x": 0, + "y": 0, + }, + Object { + "date": 2019-09-05T00:00:00.000Z, + "x": 1, + "y": 0, + }, + Object { + "date": 2019-09-06T00:00:00.000Z, + "x": 2, + "y": 0, + }, + ], "thresholdCores": Array [ Object { "date": 2019-09-04T00:00:00.000Z, @@ -854,6 +1184,27 @@ Object { "errorStatus": undefined, "fulfilled": true, "graphData": Object { + "cloudCores": Array [ + Object { + "date": 2019-09-04T00:00:00.000Z, + "x": 0, + "y": 0, + }, + ], + "cloudInstanceCount": Array [ + Object { + "date": 2019-09-04T00:00:00.000Z, + "x": 0, + "y": 0, + }, + ], + "cloudSockets": Array [ + Object { + "date": 2019-09-04T00:00:00.000Z, + "x": 0, + "y": 0, + }, + ], "cores": Array [ Object { "date": 2019-09-04T00:00:00.000Z, @@ -903,6 +1254,27 @@ Object { "y": 2, }, ], + "thresholdCloudCores": Array [ + Object { + "date": 2019-09-04T00:00:00.000Z, + "x": 0, + "y": 0, + }, + ], + "thresholdCloudInstanceCount": Array [ + Object { + "date": 2019-09-04T00:00:00.000Z, + "x": 0, + "y": 0, + }, + ], + "thresholdCloudSockets": Array [ + Object { + "date": 2019-09-04T00:00:00.000Z, + "x": 0, + "y": 0, + }, + ], "thresholdCores": Array [ Object { "date": 2019-09-04T00:00:00.000Z, diff --git a/src/services/rhsmServices.js b/src/services/rhsmServices.js index 754dda8a6..7c0becc40 100644 --- a/src/services/rhsmServices.js +++ b/src/services/rhsmServices.js @@ -87,98 +87,112 @@ const getApiVersion = () => * "sockets": 50, * "physical_sockets": 50, * "hypervisor_sockets": 0, - * "has_data": true + * "has_data": true, + * "cloud_sockets": 20 * }, * { * "date": "2018-07-20T00:00:00Z", * "sockets": 50, * "physical_sockets": 50, * "hypervisor_sockets": 0, - * "has_data": true + * "has_data": true, + * "cloud_sockets": 20 * }, * { * "date": "2019-07-20T00:00:00Z", * "sockets": 0, * "physical_sockets": 0, * "hypervisor_sockets": 0, - * "has_data": true + * "has_data": true, + * "cloud_sockets": 20 * }, * { * "date": "2019-07-21T00:00:00Z", * "sockets": 24, * "physical_sockets": 24, * "hypervisor_sockets": 0, - * "has_data": true + * "has_data": true, + * "cloud_sockets": 20 * }, * { * "date": "2019-07-22T00:00:00Z", * "sockets": 0, * "physical_sockets": 0, * "hypervisor_sockets": 0, - * "has_data": false + * "has_data": false, + * "cloud_sockets": 0 * }, * { * "date": "2019-07-23T00:00:00Z", * "sockets": 0, * "physical_sockets": 0, * "hypervisor_sockets": 0, - * "has_data": false + * "has_data": false, + * "cloud_sockets": 0 * }, * { * "date": "2019-07-24T00:00:00Z", * "sockets": 76, * "physical_sockets": 36, * "hypervisor_sockets": 40, - * "has_data": true + * "has_data": true, + * "cloud_sockets": 0 * }, * { * "date": "2019-07-25T00:00:00Z", * "sockets": 90, * "physical_sockets": 40, * "hypervisor_sockets": 50, - * "has_data": true + * "has_data": true, + * "cloud_sockets": 0 * }, * { * "date": "2019-07-26T00:00:00Z", * "sockets": 104, * "physical_sockets": 44, * "hypervisor_sockets": 60, - * "has_data": true + * "has_data": true, + * "cloud_sockets": 0 * }, * { * "date": "2019-07-27T00:00:00Z", * "sockets": 78, * "physical_sockets": 48, * "hypervisor_sockets": 30, - * "has_data": true + * "has_data": true, + * "cloud_sockets": 0 * }, * { * "date": "2019-07-28T00:00:00Z", * "sockets": 82, * "physical_sockets": 52, * "hypervisor_sockets": 30, - * "has_data": true + * "has_data": true, + * "cloud_sockets": 0 * }, * { * "date": "2019-07-29T00:00:00Z", * "sockets": 86, * "physical_sockets": 56, * "hypervisor_sockets": 30, - * "has_data": true + * "has_data": true, + * "cloud_sockets": 60 * }, * { * "date": "2019-07-30T00:00:00Z", * "sockets": 90, * "physical_sockets": 60, * "hypervisor_sockets": 30, - * "has_data": true + * "has_data": true, + * "cloud_sockets": 40 * }, * { * "date": "2019-07-31T00:00:00Z", * "sockets": 144, * "physical_sockets": 64, * "hypervisor_sockets": 80, - * "has_data": true + * "has_data": true, + * "cloud_sockets": 40 * } * ], * "links": { diff --git a/src/types/__tests__/__snapshots__/rhsmApiTypes.test.js.snap b/src/types/__tests__/__snapshots__/rhsmApiTypes.test.js.snap index 40741f369..0b8f954e7 100644 --- a/src/types/__tests__/__snapshots__/rhsmApiTypes.test.js.snap +++ b/src/types/__tests__/__snapshots__/rhsmApiTypes.test.js.snap @@ -34,6 +34,9 @@ Object { "RHSM_API_QUERY_START_DATE": "beginning", "RHSM_API_RESPONSE_CAPACITY_DATA": "data", "RHSM_API_RESPONSE_CAPACITY_DATA_TYPES": Object { + "CLOUD_CORES": "cloud_cores", + "CLOUD_INSTANCES": "cloud_instance_count", + "CLOUD_SOCKETS": "cloud_sockets", "CORES": "cores", "DATE": "date", "HAS_INFINITE": "has_infinite_quantity", @@ -49,6 +52,9 @@ Object { }, "RHSM_API_RESPONSE_PRODUCTS_DATA": "data", "RHSM_API_RESPONSE_PRODUCTS_DATA_TYPES": Object { + "CLOUD_CORES": "cloud_cores", + "CLOUD_INSTANCES": "cloud_instance_count", + "CLOUD_SOCKETS": "cloud_sockets", "CORES": "cores", "DATE": "date", "HAS_DATA": "has_data", @@ -95,6 +101,9 @@ Object { "RHSM_API_QUERY_START_DATE": "beginning", "RHSM_API_RESPONSE_CAPACITY_DATA": "data", "RHSM_API_RESPONSE_CAPACITY_DATA_TYPES": Object { + "CLOUD_CORES": "cloud_cores", + "CLOUD_INSTANCES": "cloud_instance_count", + "CLOUD_SOCKETS": "cloud_sockets", "CORES": "cores", "DATE": "date", "HAS_INFINITE": "has_infinite_quantity", @@ -110,6 +119,9 @@ Object { }, "RHSM_API_RESPONSE_PRODUCTS_DATA": "data", "RHSM_API_RESPONSE_PRODUCTS_DATA_TYPES": Object { + "CLOUD_CORES": "cloud_cores", + "CLOUD_INSTANCES": "cloud_instance_count", + "CLOUD_SOCKETS": "cloud_sockets", "CORES": "cores", "DATE": "date", "HAS_DATA": "has_data", @@ -157,6 +169,9 @@ Object { "RHSM_API_QUERY_START_DATE": "beginning", "RHSM_API_RESPONSE_CAPACITY_DATA": "data", "RHSM_API_RESPONSE_CAPACITY_DATA_TYPES": Object { + "CLOUD_CORES": "cloud_cores", + "CLOUD_INSTANCES": "cloud_instance_count", + "CLOUD_SOCKETS": "cloud_sockets", "CORES": "cores", "DATE": "date", "HAS_INFINITE": "has_infinite_quantity", @@ -172,6 +187,9 @@ Object { }, "RHSM_API_RESPONSE_PRODUCTS_DATA": "data", "RHSM_API_RESPONSE_PRODUCTS_DATA_TYPES": Object { + "CLOUD_CORES": "cloud_cores", + "CLOUD_INSTANCES": "cloud_instance_count", + "CLOUD_SOCKETS": "cloud_sockets", "CORES": "cores", "DATE": "date", "HAS_DATA": "has_data", @@ -223,6 +241,9 @@ Object { "RHSM_API_QUERY_START_DATE": "beginning", "RHSM_API_RESPONSE_CAPACITY_DATA": "data", "RHSM_API_RESPONSE_CAPACITY_DATA_TYPES": Object { + "CLOUD_CORES": "cloud_cores", + "CLOUD_INSTANCES": "cloud_instance_count", + "CLOUD_SOCKETS": "cloud_sockets", "CORES": "cores", "DATE": "date", "HAS_INFINITE": "has_infinite_quantity", @@ -238,6 +259,9 @@ Object { }, "RHSM_API_RESPONSE_PRODUCTS_DATA": "data", "RHSM_API_RESPONSE_PRODUCTS_DATA_TYPES": Object { + "CLOUD_CORES": "cloud_cores", + "CLOUD_INSTANCES": "cloud_instance_count", + "CLOUD_SOCKETS": "cloud_sockets", "CORES": "cores", "DATE": "date", "HAS_DATA": "has_data", diff --git a/src/types/rhsmApiTypes.js b/src/types/rhsmApiTypes.js index fefc5a0b4..826ad724b 100644 --- a/src/types/rhsmApiTypes.js +++ b/src/types/rhsmApiTypes.js @@ -13,6 +13,9 @@ const RHSM_API_RESPONSE_CAPACITY_DATA = 'data'; * HYPERVISOR_CORES: string, HAS_INFINITE: string, PHYSICAL_CORES: string}} */ const RHSM_API_RESPONSE_CAPACITY_DATA_TYPES = { + CLOUD_CORES: 'cloud_cores', + CLOUD_INSTANCES: 'cloud_instance_count', + CLOUD_SOCKETS: 'cloud_sockets', CORES: 'cores', DATE: 'date', HYPERVISOR_CORES: 'hypervisor_cores', @@ -55,6 +58,9 @@ const RHSM_API_RESPONSE_PRODUCTS_DATA = 'data'; * PHYSICAL_SOCKETS: string, HYPERVISOR_CORES: string, PHYSICAL_CORES: string}} */ const RHSM_API_RESPONSE_PRODUCTS_DATA_TYPES = { + CLOUD_CORES: 'cloud_cores', + CLOUD_INSTANCES: 'cloud_instance_count', + CLOUD_SOCKETS: 'cloud_sockets', CORES: 'cores', DATE: 'date', HYPERVISOR_CORES: 'hypervisor_cores',