From b6e2e7a8cb284e1c4288815bc66cbea48aa3cc4f Mon Sep 17 00:00:00 2001
From: CD Cabrera
Date: Tue, 9 Jun 2020 18:33:05 -0400
Subject: [PATCH 01/16] feat(rhsmServices,redux): issues/10 inventory api,
state (#312)
* build, dotenv host inventory API endpoint
* redux actions, reducers, types for inventory
* rhsmServices, add base host inventory API
* rhsmApiTypes, inventory API response types
---
.env | 1 +
.env.development | 1 +
.env.proxy | 1 +
.../actions/__tests__/rhsmActions.test.js | 16 +++-
src/redux/actions/rhsmActions.js | 15 +++-
.../inventoryReducer.test.js.snap | 61 +++++++++++++
.../__tests__/inventoryReducer.test.js | 73 +++++++++++++++
src/redux/reducers/graphReducer.js | 2 +-
src/redux/reducers/index.js | 8 +-
src/redux/reducers/inventoryReducer.js | 30 +++++++
.../__snapshots__/index.test.js.snap | 4 +
src/redux/types/rhsmTypes.js | 5 +-
src/services/__tests__/rhsmServices.test.js | 5 +-
src/services/rhsmServices.js | 74 +++++++++++++++-
.../__snapshots__/index.test.js.snap | 52 +++++++++++
src/types/rhsmApiTypes.js | 88 +++++++++++++++----
16 files changed, 406 insertions(+), 30 deletions(-)
create mode 100644 src/redux/reducers/__tests__/__snapshots__/inventoryReducer.test.js.snap
create mode 100644 src/redux/reducers/__tests__/inventoryReducer.test.js
create mode 100644 src/redux/reducers/inventoryReducer.js
diff --git a/.env b/.env
index 077655305..fd7448fe8 100644
--- a/.env
+++ b/.env
@@ -28,4 +28,5 @@ REACT_APP_INCLUDE_CONTENT_BODY= {
+ it('should return the initial state', () => {
+ expect(inventoryReducer.initialState).toBeDefined();
+ });
+
+ it('should handle all defined error types', () => {
+ const specificTypes = [types.GET_HOSTS_INVENTORY_RHSM];
+
+ specificTypes.forEach(value => {
+ const dispatched = {
+ type: reduxHelpers.REJECTED_ACTION(value),
+ error: true,
+ payload: {
+ message: 'MESSAGE',
+ response: {
+ status: 0,
+ statusText: 'ERROR TEST',
+ data: {
+ detail: 'ERROR'
+ }
+ }
+ }
+ };
+
+ const resultState = inventoryReducer(undefined, dispatched);
+
+ expect({ type: reduxHelpers.REJECTED_ACTION(value), result: resultState }).toMatchSnapshot(
+ `rejected types ${value}`
+ );
+ });
+ });
+
+ it('should handle all defined pending types', () => {
+ const specificTypes = [types.GET_HOSTS_INVENTORY_RHSM];
+
+ specificTypes.forEach(value => {
+ const dispatched = {
+ type: reduxHelpers.PENDING_ACTION(value)
+ };
+
+ const resultState = inventoryReducer(undefined, dispatched);
+
+ expect({ type: reduxHelpers.PENDING_ACTION(value), result: resultState }).toMatchSnapshot(
+ `pending types ${value}`
+ );
+ });
+ });
+
+ it('should handle all defined fulfilled types', () => {
+ const specificTypes = [types.GET_HOSTS_INVENTORY_RHSM];
+
+ specificTypes.forEach(value => {
+ const dispatched = {
+ type: reduxHelpers.FULFILLED_ACTION(value),
+ payload: {
+ data: {
+ test: 'success'
+ }
+ }
+ };
+
+ const resultState = inventoryReducer(undefined, dispatched);
+
+ expect({ type: reduxHelpers.FULFILLED_ACTION(value), result: resultState }).toMatchSnapshot(
+ `fulfilled types ${value}`
+ );
+ });
+ });
+});
diff --git a/src/redux/reducers/graphReducer.js b/src/redux/reducers/graphReducer.js
index 3706a1165..ee376fb34 100644
--- a/src/redux/reducers/graphReducer.js
+++ b/src/redux/reducers/graphReducer.js
@@ -5,7 +5,7 @@ import { reduxHelpers } from '../common/reduxHelpers';
* Initial state.
*
* @private
- * @type {{reportCapacity: object}}
+ * @type {{reportCapacity: {}, legend: {}}}
*/
const initialState = {
legend: {},
diff --git a/src/redux/reducers/index.js b/src/redux/reducers/index.js
index cd595a3a0..1d00febe7 100644
--- a/src/redux/reducers/index.js
+++ b/src/redux/reducers/index.js
@@ -1,16 +1,18 @@
import { combineReducers } from 'redux';
import { notifications } from '@redhat-cloud-services/frontend-components-notifications';
import graphReducer from './graphReducer';
+import inventoryReducer from './inventoryReducer';
import viewReducer from './viewReducer';
import userReducer from './userReducer';
const reducers = {
notifications,
graph: graphReducer,
- view: viewReducer,
- user: userReducer
+ inventory: inventoryReducer,
+ user: userReducer,
+ view: viewReducer
};
const reduxReducers = combineReducers(reducers);
-export { reduxReducers as default, reduxReducers, graphReducer, viewReducer, userReducer };
+export { reduxReducers as default, reduxReducers, graphReducer, inventoryReducer, userReducer, viewReducer };
diff --git a/src/redux/reducers/inventoryReducer.js b/src/redux/reducers/inventoryReducer.js
new file mode 100644
index 000000000..86627087a
--- /dev/null
+++ b/src/redux/reducers/inventoryReducer.js
@@ -0,0 +1,30 @@
+import { rhsmTypes } from '../types/rhsmTypes';
+import { reduxHelpers } from '../common/reduxHelpers';
+
+/**
+ * Initial state.
+ *
+ * @private
+ * @type {{inventory: {}}}
+ */
+const initialState = {
+ hostsInventory: {}
+};
+
+/**
+ * Apply generated inventory observer/reducer for systemInventory to state, against actions.
+ *
+ * @param {object} state
+ * @param {object} action
+ * @returns {object|{}}
+ */
+const inventoryReducer = (state = initialState, action) =>
+ reduxHelpers.generatedPromiseActionReducer(
+ [{ ref: 'hostsInventory', type: rhsmTypes.GET_HOSTS_INVENTORY_RHSM }],
+ state,
+ action
+ );
+
+inventoryReducer.initialState = initialState;
+
+export { inventoryReducer as default, initialState, inventoryReducer };
diff --git a/src/redux/types/__tests__/__snapshots__/index.test.js.snap b/src/redux/types/__tests__/__snapshots__/index.test.js.snap
index 896053325..8419f8ecb 100644
--- a/src/redux/types/__tests__/__snapshots__/index.test.js.snap
+++ b/src/redux/types/__tests__/__snapshots__/index.test.js.snap
@@ -27,6 +27,7 @@ Object {
"GET_GRAPH_CAPACITY_RHSM": "GET_GRAPH_CAPACITY_RHSM",
"GET_GRAPH_REPORT_CAPACITY_RHSM": "GET_GRAPH_REPORT_CAPACITY_RHSM",
"GET_GRAPH_REPORT_RHSM": "GET_GRAPH_REPORT_RHSM",
+ "GET_HOSTS_INVENTORY_RHSM": "GET_HOSTS_INVENTORY_RHSM",
"SET_GRAPH_GRANULARITY_RHSM": "SET_GRAPH_GRANULARITY_RHSM",
"SET_GRAPH_SLA_RHSM": "SET_GRAPH_SLA_RHSM",
},
@@ -72,6 +73,7 @@ Object {
"GET_GRAPH_CAPACITY_RHSM": "GET_GRAPH_CAPACITY_RHSM",
"GET_GRAPH_REPORT_CAPACITY_RHSM": "GET_GRAPH_REPORT_CAPACITY_RHSM",
"GET_GRAPH_REPORT_RHSM": "GET_GRAPH_REPORT_RHSM",
+ "GET_HOSTS_INVENTORY_RHSM": "GET_HOSTS_INVENTORY_RHSM",
"SET_GRAPH_GRANULARITY_RHSM": "SET_GRAPH_GRANULARITY_RHSM",
"SET_GRAPH_SLA_RHSM": "SET_GRAPH_SLA_RHSM",
},
@@ -88,6 +90,7 @@ Object {
"GET_GRAPH_CAPACITY_RHSM": "GET_GRAPH_CAPACITY_RHSM",
"GET_GRAPH_REPORT_CAPACITY_RHSM": "GET_GRAPH_REPORT_CAPACITY_RHSM",
"GET_GRAPH_REPORT_RHSM": "GET_GRAPH_REPORT_RHSM",
+ "GET_HOSTS_INVENTORY_RHSM": "GET_HOSTS_INVENTORY_RHSM",
"SET_GRAPH_GRANULARITY_RHSM": "SET_GRAPH_GRANULARITY_RHSM",
"SET_GRAPH_SLA_RHSM": "SET_GRAPH_SLA_RHSM",
},
@@ -124,6 +127,7 @@ Object {
"GET_GRAPH_CAPACITY_RHSM": "GET_GRAPH_CAPACITY_RHSM",
"GET_GRAPH_REPORT_CAPACITY_RHSM": "GET_GRAPH_REPORT_CAPACITY_RHSM",
"GET_GRAPH_REPORT_RHSM": "GET_GRAPH_REPORT_RHSM",
+ "GET_HOSTS_INVENTORY_RHSM": "GET_HOSTS_INVENTORY_RHSM",
"SET_GRAPH_GRANULARITY_RHSM": "SET_GRAPH_GRANULARITY_RHSM",
"SET_GRAPH_SLA_RHSM": "SET_GRAPH_SLA_RHSM",
},
diff --git a/src/redux/types/rhsmTypes.js b/src/redux/types/rhsmTypes.js
index f139eccb2..71e4a2aff 100644
--- a/src/redux/types/rhsmTypes.js
+++ b/src/redux/types/rhsmTypes.js
@@ -1,6 +1,7 @@
const GET_GRAPH_CAPACITY_RHSM = 'GET_GRAPH_CAPACITY_RHSM';
const GET_GRAPH_REPORT_RHSM = 'GET_GRAPH_REPORT_RHSM';
const GET_GRAPH_REPORT_CAPACITY_RHSM = 'GET_GRAPH_REPORT_CAPACITY_RHSM';
+const GET_HOSTS_INVENTORY_RHSM = 'GET_HOSTS_INVENTORY_RHSM';
const SET_GRAPH_GRANULARITY_RHSM = 'SET_GRAPH_GRANULARITY_RHSM';
const SET_GRAPH_SLA_RHSM = 'SET_GRAPH_SLA_RHSM';
@@ -8,13 +9,14 @@ const SET_GRAPH_SLA_RHSM = 'SET_GRAPH_SLA_RHSM';
* RHSM API action, reducer types.
*
* @type {{GET_GRAPH_REPORT_CAPACITY_RHSM: string, SET_GRAPH_GRANULARITY_RHSM: string,
- * GET_GRAPH_CAPACITY_RHSM: string, SET_GRAPH_SLA_RHSM: string,
+ * GET_GRAPH_CAPACITY_RHSM: string, SET_GRAPH_SLA_RHSM: string, GET_HOSTS_INVENTORY_RHSM: string,
* GET_GRAPH_REPORT_RHSM: string}}
*/
const rhsmTypes = {
GET_GRAPH_CAPACITY_RHSM,
GET_GRAPH_REPORT_RHSM,
GET_GRAPH_REPORT_CAPACITY_RHSM,
+ GET_HOSTS_INVENTORY_RHSM,
SET_GRAPH_GRANULARITY_RHSM,
SET_GRAPH_SLA_RHSM
};
@@ -25,6 +27,7 @@ export {
GET_GRAPH_CAPACITY_RHSM,
GET_GRAPH_REPORT_RHSM,
GET_GRAPH_REPORT_CAPACITY_RHSM,
+ GET_HOSTS_INVENTORY_RHSM,
SET_GRAPH_GRANULARITY_RHSM,
SET_GRAPH_SLA_RHSM
};
diff --git a/src/services/__tests__/rhsmServices.test.js b/src/services/__tests__/rhsmServices.test.js
index 7faa47d90..c35622365 100644
--- a/src/services/__tests__/rhsmServices.test.js
+++ b/src/services/__tests__/rhsmServices.test.js
@@ -5,7 +5,7 @@ describe('RhsmServices', () => {
beforeEach(() => {
moxios.install();
- moxios.stubRequest(/\/(tally|capacity|version).*?/, {
+ moxios.stubRequest(/\/(tally|capacity|hosts|version).*?/, {
status: 200,
responseText: 'success',
timeout: 1
@@ -17,13 +17,14 @@ describe('RhsmServices', () => {
});
it('should export a specific number of methods and classes', () => {
- expect(Object.keys(rhsmServices)).toHaveLength(3);
+ expect(Object.keys(rhsmServices)).toHaveLength(4);
});
it('should have specific methods', () => {
expect(rhsmServices.getApiVersion).toBeDefined();
expect(rhsmServices.getGraphCapacity).toBeDefined();
expect(rhsmServices.getGraphReports).toBeDefined();
+ expect(rhsmServices.getHostsInventory).toBeDefined();
});
/**
diff --git a/src/services/rhsmServices.js b/src/services/rhsmServices.js
index d41ab6761..e4c5018af 100644
--- a/src/services/rhsmServices.js
+++ b/src/services/rhsmServices.js
@@ -933,11 +933,81 @@ const getGraphCapacity = (id, params = {}) =>
cancel: true
});
-const rhsmServices = { getApiVersion, getGraphCapacity, getGraphReports };
+/**
+ * @api {get} /api/rhsm-subscriptions/v1/hosts/products/:product_id Get RHSM hosts/systems table/inventory data
+ * @apiDescription Retrieve hosts/systems table/inventory data.
+ *
+ * Reference [RHSM for hosts/system table/inventory](https://github.com/RedHatInsights/rhsm-subscriptions/blob/master/api/rhsm-subscriptions-api-spec.yaml)
+ *
+ * @apiSuccessExample {json} Success-Response:
+ * HTTP/1.1 200 OK
+ * {
+ * "data" : [
+ * {
+ * "insights_id": "498cff02-8b4b-46f8-a655-56043XXX0d2f",
+ * "display_name": "ipsum.example.com",
+ * "subscription_manager_id": "b6028fa4-cd26-449a-b122-2e65ad8e7d3e",
+ * "cores": 4,
+ * "sockets": 2,
+ * "hardware_type": "physical",
+ * "number_of_guests": 4,
+ * "last_seen": "2020-04-01T00:00:00Z"
+ * },
+ * {
+ * "insights_id": "499cff02-8b4b-46f8-a6xx-56043FFF0d2e",
+ * "display_name": "lorem.example.com",
+ * "subscription_manager_id": "b6028fa4-cd26-449a-b123-2e25aa8e7d3e",
+ * "cores": 4,
+ * "sockets": 6,
+ * "hardware_type": "physical",
+ * "number_of_guests": 2,
+ * "last_seen": "2020-07-01T00:00:00Z"
+ * }
+ * ],
+ * "links": {
+ * "first": "/api/rhsm-subscriptions/v1/capacity/products/RHEL?offset=0&limit=5",
+ * "last": "/api/rhsm-subscriptions/v1/capacity/products/RHEL?offset=5&limit=5",
+ * "previous": null,
+ * "next": "/api/rhsm-subscriptions/v1/capacity/products/RHEL?offset=5&limit=5"
+ * },
+ * "meta": {
+ * "count": 2
+ * }
+ * }
+ *
+ * @apiError {Array} errors
+ * @apiErrorExample {json} Error-Response:
+ * HTTP/1.1 500 Internal Server Error
+ * {
+ * "errors": [
+ * {
+ * "status": "string",
+ * "code": "string",
+ * "title": "string",
+ * "detail": "string"
+ * }
+ * ]
+ * }
+ */
+/**
+ * Get RHSM API hosts table/inventory data.
+ *
+ * @param {string} id Product ID
+ * @param {object} params Query/search params
+ * @returns {Promise<*>}
+ */
+const getHostsInventory = (id, params = {}) =>
+ serviceCall({
+ url: `${process.env.REACT_APP_SERVICES_RHSM_INVENTORY}${id}`,
+ params,
+ cancel: true
+ });
+
+const rhsmServices = { getApiVersion, getGraphCapacity, getGraphReports, getHostsInventory };
/**
* Expose services to the browser's developer console.
*/
helpers.browserExpose({ rhsmServices });
-export { rhsmServices as default, rhsmServices, getApiVersion, getGraphCapacity, getGraphReports };
+export { rhsmServices as default, rhsmServices, getApiVersion, getGraphCapacity, getGraphReports, getHostsInventory };
diff --git a/src/types/__tests__/__snapshots__/index.test.js.snap b/src/types/__tests__/__snapshots__/index.test.js.snap
index 6f80d3357..5dd1d29e9 100644
--- a/src/types/__tests__/__snapshots__/index.test.js.snap
+++ b/src/types/__tests__/__snapshots__/index.test.js.snap
@@ -81,6 +81,19 @@ Object {
"CODE": "code",
"DETAIL": "detail",
},
+ "RHSM_API_RESPONSE_INVENTORY_DATA": "data",
+ "RHSM_API_RESPONSE_INVENTORY_DATA_TYPES": Object {
+ "CORES": "cores",
+ "HARDWARE": "hardware_type",
+ "ID": "insights_id",
+ "LAST_SEEN": "last_seen",
+ "NAME": "display_name",
+ "SOCKETS": "sockets",
+ },
+ "RHSM_API_RESPONSE_INVENTORY_META": "meta",
+ "RHSM_API_RESPONSE_INVENTORY_META_TYPES": Object {
+ "COUNT": "count",
+ },
"RHSM_API_RESPONSE_PRODUCTS_DATA": "data",
"RHSM_API_RESPONSE_PRODUCTS_DATA_TYPES": Object {
"CLOUD_CORES": "cloud_cores",
@@ -180,6 +193,19 @@ Object {
"CODE": "code",
"DETAIL": "detail",
},
+ "RHSM_API_RESPONSE_INVENTORY_DATA": "data",
+ "RHSM_API_RESPONSE_INVENTORY_DATA_TYPES": Object {
+ "CORES": "cores",
+ "HARDWARE": "hardware_type",
+ "ID": "insights_id",
+ "LAST_SEEN": "last_seen",
+ "NAME": "display_name",
+ "SOCKETS": "sockets",
+ },
+ "RHSM_API_RESPONSE_INVENTORY_META": "meta",
+ "RHSM_API_RESPONSE_INVENTORY_META_TYPES": Object {
+ "COUNT": "count",
+ },
"RHSM_API_RESPONSE_PRODUCTS_DATA": "data",
"RHSM_API_RESPONSE_PRODUCTS_DATA_TYPES": Object {
"CLOUD_CORES": "cloud_cores",
@@ -278,6 +304,19 @@ Object {
"CODE": "code",
"DETAIL": "detail",
},
+ "RHSM_API_RESPONSE_INVENTORY_DATA": "data",
+ "RHSM_API_RESPONSE_INVENTORY_DATA_TYPES": Object {
+ "CORES": "cores",
+ "HARDWARE": "hardware_type",
+ "ID": "insights_id",
+ "LAST_SEEN": "last_seen",
+ "NAME": "display_name",
+ "SOCKETS": "sockets",
+ },
+ "RHSM_API_RESPONSE_INVENTORY_META": "meta",
+ "RHSM_API_RESPONSE_INVENTORY_META_TYPES": Object {
+ "COUNT": "count",
+ },
"RHSM_API_RESPONSE_PRODUCTS_DATA": "data",
"RHSM_API_RESPONSE_PRODUCTS_DATA_TYPES": Object {
"CLOUD_CORES": "cloud_cores",
@@ -380,6 +419,19 @@ Object {
"CODE": "code",
"DETAIL": "detail",
},
+ "RHSM_API_RESPONSE_INVENTORY_DATA": "data",
+ "RHSM_API_RESPONSE_INVENTORY_DATA_TYPES": Object {
+ "CORES": "cores",
+ "HARDWARE": "hardware_type",
+ "ID": "insights_id",
+ "LAST_SEEN": "last_seen",
+ "NAME": "display_name",
+ "SOCKETS": "sockets",
+ },
+ "RHSM_API_RESPONSE_INVENTORY_META": "meta",
+ "RHSM_API_RESPONSE_INVENTORY_META_TYPES": Object {
+ "COUNT": "count",
+ },
"RHSM_API_RESPONSE_PRODUCTS_DATA": "data",
"RHSM_API_RESPONSE_PRODUCTS_DATA_TYPES": Object {
"CLOUD_CORES": "cloud_cores",
diff --git a/src/types/rhsmApiTypes.js b/src/types/rhsmApiTypes.js
index 8e9aba9ab..aa5f8353d 100644
--- a/src/types/rhsmApiTypes.js
+++ b/src/types/rhsmApiTypes.js
@@ -71,6 +71,45 @@ const RHSM_API_RESPONSE_ERROR_DATA_CODE_TYPES = {
OPTIN: 'SUBSCRIPTIONS1004'
};
+/**
+ * RHSM response inventory DATA type.
+ *
+ * @type {string}
+ */
+const RHSM_API_RESPONSE_INVENTORY_DATA = 'data';
+
+/**
+ * RHSM response inventory DATA types.
+ * Schema/map of expected inventory DATA response properties.
+ *
+ * @type {{CORES: string, HARDWARE: string, SOCKETS: string, ID: string, NAME: string, LAST_SEEN: string}}
+ */
+const RHSM_API_RESPONSE_INVENTORY_DATA_TYPES = {
+ ID: 'insights_id',
+ NAME: 'display_name',
+ CORES: 'cores',
+ SOCKETS: 'sockets',
+ HARDWARE: 'hardware_type',
+ LAST_SEEN: 'last_seen'
+};
+
+/**
+ * RHSM response inventory type.
+ *
+ * @type {string}
+ */
+const RHSM_API_RESPONSE_INVENTORY_META = 'meta';
+
+/**
+ * RHSM response inventory META types.
+ * Schema/map of expected Reporting/Tally META response properties.
+ *
+ * @type {{COUNT: string}}
+ */
+const RHSM_API_RESPONSE_INVENTORY_META_TYPES = {
+ COUNT: 'count'
+};
+
/**
* RHSM response Reporting/Tally DATA type.
*
@@ -229,23 +268,30 @@ const RHSM_API_QUERY_END_DATE = 'ending';
/**
* RHSM API types.
*
- * @type {{RHSM_API_QUERY_END_DATE: string, RHSM_API_QUERY_GRANULARITY: string, RHSM_API_QUERY_START_DATE: string,
- * RHSM_API_RESPONSE_ERROR_DATA_CODE_TYPES: {OPTIN: string}, RHSM_API_RESPONSE_CAPACITY_DATA: string,
- * RHSM_API_PATH_ID_TYPES: {RHEL_ARM: string, RHEL_WORKSTATION: string, RHEL_DESKTOP: string, RHEL: string,
- * RHEL_SERVER: string, RHEL_IBM_Z: string, RHEL_COMPUTE_NODE: string, RHEL_IBM_POWER: string,
- * RHEL_X86: string, OPENSHIFT: string}, RHSM_API_RESPONSE_ERROR_DATA_TYPES: {CODE: string, DETAIL: string},
- * RHSM_API_QUERY_OPTIN_TALLY_REPORT: string, RHSM_API_QUERY_OPTIN_TALLY_SYNC: string,
- * RHSM_API_QUERY_SLA: string, RHSM_API_RESPONSE_CAPACITY_META_TYPES: {COUNT: string},
- * RHSM_API_QUERY_OPTIN_CONDUIT_SYNC: string, RHSM_API_QUERY_SLA_TYPES: {PREMIUM: string, SELF: string,
- * NONE: string, STANDARD: string}, RHSM_API_RESPONSE_CAPACITY_DATA_TYPES: {HYPERVISOR_SOCKETS: string,
- * CORES: string, DATE: string, SOCKETS: string, PHYSICAL_SOCKETS: string, HYPERVISOR_CORES: string,
- * HAS_INFINITE: string, PHYSICAL_CORES: string}, RHSM_API_QUERY_LIMIT: string,
- * RHSM_API_RESPONSE_CAPACITY_META: string, RHSM_API_RESPONSE_PRODUCTS_DATA_TYPES: {HYPERVISOR_SOCKETS: string,
- * CORES: string, DATE: string, SOCKETS: string, HAS_DATA: string, PHYSICAL_SOCKETS: string,
- * HYPERVISOR_CORES: string, PHYSICAL_CORES: string}, RHSM_API_RESPONSE_PRODUCTS_META: string,
- * RHSM_API_QUERY_GRANULARITY_TYPES: {WEEKLY: string, QUARTERLY: string, DAILY: string, MONTHLY: string},
- * RHSM_API_RESPONSE_ERROR_DATA: string, RHSM_API_RESPONSE_PRODUCTS_DATA: string,
- * RHSM_API_RESPONSE_PRODUCTS_META_TYPES: {COUNT: string}, RHSM_API_QUERY_OFFSET: string}}
+ * @type {{RHSM_API_QUERY_END_DATE: string, RHSM_API_QUERY_START_DATE: string,
+ * RHSM_API_RESPONSE_ERROR_DATA_CODE_TYPES: {GENERIC: string, OPTIN: string},
+ * RHSM_API_RESPONSE_INVENTORY_DATA: string, RHSM_API_RESPONSE_CAPACITY_DATA: string,
+ * RHSM_API_RESPONSE_ERROR_DATA_TYPES: {CODE: string, DETAIL: string},
+ * RHSM_API_QUERY_OPTIN_TALLY_REPORT: string, RHSM_API_QUERY_OPTIN_TALLY_SYNC: string,
+ * RHSM_API_RESPONSE_CAPACITY_META_TYPES: {COUNT: string},
+ * RHSM_API_RESPONSE_CAPACITY_DATA_TYPES: {HYPERVISOR_SOCKETS: string, CORES: string, DATE: string,
+ * SOCKETS: string, PHYSICAL_SOCKETS: string, HYPERVISOR_CORES: string, HAS_INFINITE: string,
+ * PHYSICAL_CORES: string}, RHSM_API_QUERY_LIMIT: string,
+ * RHSM_API_QUERY_GRANULARITY_TYPES: {WEEKLY: string, QUARTERLY: string, DAILY: string, MONTHLY: string},
+ * RHSM_API_RESPONSE_PRODUCTS_DATA: string, RHSM_API_QUERY_GRANULARITY: string,
+ * RHSM_API_RESPONSE_INVENTORY_META: string, RHSM_API_PATH_ID_TYPES: {RHEL_ARM: string,
+ * RHEL_WORKSTATION: string, RHEL_DESKTOP: string, RHEL: string, RHEL_SERVER: string, RHEL_IBM_Z: string,
+ * RHEL_COMPUTE_NODE: string, RHEL_IBM_POWER: string, RHEL_X86: string, OPENSHIFT: string},
+ * RHSM_API_QUERY_SLA: string, RHSM_API_QUERY_OPTIN_CONDUIT_SYNC: string,
+ * RHSM_API_QUERY_SLA_TYPES: {PREMIUM: string, SELF: string, NONE: string, STANDARD: string},
+ * RHSM_API_RESPONSE_CAPACITY_META: string,
+ * RHSM_API_RESPONSE_PRODUCTS_DATA_TYPES: {HYPERVISOR_SOCKETS: string, CORES: string, DATE: string,
+ * SOCKETS: string, HAS_DATA: string, PHYSICAL_SOCKETS: string, HYPERVISOR_CORES: string,
+ * PHYSICAL_CORES: string}, RHSM_API_RESPONSE_PRODUCTS_META: string, RHSM_API_RESPONSE_ERROR_DATA: string,
+ * RHSM_API_RESPONSE_INVENTORY_META_TYPES: {COUNT: string},
+ * RHSM_API_RESPONSE_PRODUCTS_META_TYPES: {COUNT: string},
+ * RHSM_API_RESPONSE_INVENTORY_DATA_TYPES: {CORES: string, HARDWARE: string, SOCKETS: string, ID: string,
+ * NAME: string, LAST_SEEN: string}, RHSM_API_QUERY_OFFSET: string}}
*/
const rhsmApiTypes = {
RHSM_API_RESPONSE_CAPACITY_DATA,
@@ -255,6 +301,10 @@ const rhsmApiTypes = {
RHSM_API_RESPONSE_ERROR_DATA,
RHSM_API_RESPONSE_ERROR_DATA_TYPES,
RHSM_API_RESPONSE_ERROR_DATA_CODE_TYPES,
+ RHSM_API_RESPONSE_INVENTORY_DATA,
+ RHSM_API_RESPONSE_INVENTORY_DATA_TYPES,
+ RHSM_API_RESPONSE_INVENTORY_META,
+ RHSM_API_RESPONSE_INVENTORY_META_TYPES,
RHSM_API_RESPONSE_PRODUCTS_DATA,
RHSM_API_RESPONSE_PRODUCTS_DATA_TYPES,
RHSM_API_RESPONSE_PRODUCTS_META,
@@ -283,6 +333,10 @@ export {
RHSM_API_RESPONSE_ERROR_DATA,
RHSM_API_RESPONSE_ERROR_DATA_TYPES,
RHSM_API_RESPONSE_ERROR_DATA_CODE_TYPES,
+ RHSM_API_RESPONSE_INVENTORY_DATA,
+ RHSM_API_RESPONSE_INVENTORY_DATA_TYPES,
+ RHSM_API_RESPONSE_INVENTORY_META,
+ RHSM_API_RESPONSE_INVENTORY_META_TYPES,
RHSM_API_RESPONSE_PRODUCTS_DATA,
RHSM_API_RESPONSE_PRODUCTS_DATA_TYPES,
RHSM_API_RESPONSE_PRODUCTS_META,
From e84a03259bf2263491719b6165372956112d0b7a Mon Sep 17 00:00:00 2001
From: CD Cabrera
Date: Wed, 10 Jun 2020 15:26:44 -0400
Subject: [PATCH 02/16] chore(build): npm updates (#313)
---
package.json | 22 +++----
yarn.lock | 170 ++++++++++++++++++++++++++++++++-------------------
2 files changed, 117 insertions(+), 75 deletions(-)
diff --git a/package.json b/package.json
index 13ad2326f..2a337fbe6 100644
--- a/package.json
+++ b/package.json
@@ -88,21 +88,21 @@
"axios": "^0.19.2",
"c3": "^0.7.15",
"classnames": "^2.2.6",
- "i18next": "^19.4.4",
+ "i18next": "^19.4.5",
"i18next-xhr-backend": "^3.2.2",
"js-cookie": "^2.2.1",
"locale-code": "^2.0.2",
"lodash": "^4.17.15",
- "moment": "^2.25.3",
+ "moment": "^2.26.0",
"node-sass": "^4.14.1",
- "numbro": "^2.2.0",
+ "numbro": "^2.3.0",
"prop-types": "^15.7.2",
"react": "^16.13.1",
"react-dom": "^16.13.1",
- "react-i18next": "^11.4.0",
+ "react-i18next": "^11.5.0",
"react-redux": "^7.2.0",
- "react-router": "^5.1.2",
- "react-router-dom": "^5.1.2",
+ "react-router": "^5.2.0",
+ "react-router-dom": "^5.2.0",
"react-scripts": "3.4.1",
"redux": "^4.0.5",
"redux-logger": "^3.0.6",
@@ -117,17 +117,17 @@
"apidoc-mock": "^3.0.2",
"enzyme": "^3.11.0",
"enzyme-adapter-react-16": "^1.15.2",
- "enzyme-to-json": "^3.4.4",
+ "enzyme-to-json": "^3.5.0",
"eslint-config-airbnb": "^18.1.0",
"eslint-config-prettier": "^6.11.0",
- "eslint-plugin-import": "^2.20.2",
- "eslint-plugin-jest": "^23.9.0",
+ "eslint-plugin-import": "^2.21.2",
+ "eslint-plugin-jest": "^23.13.2",
"eslint-plugin-jsdoc": "^24.0.6",
"eslint-plugin-json": "^2.1.1",
"eslint-plugin-jsx-a11y": "^6.2.3",
"eslint-plugin-prettier": "^3.1.3",
- "eslint-plugin-react": "^7.19.0",
- "eslint-plugin-react-hooks": "^4.0.0",
+ "eslint-plugin-react": "^7.20.0",
+ "eslint-plugin-react-hooks": "^4.0.4",
"express": "^4.17.1",
"gettext-extractor": "^3.5.2",
"moxios": "^0.4.0",
diff --git a/yarn.lock b/yarn.lock
index 530f2c6f6..ec909bf00 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -1197,7 +1197,7 @@
dependencies:
regenerator-runtime "^0.13.4"
-"@babel/runtime@^7.0.0", "@babel/runtime@^7.1.2", "@babel/runtime@^7.3.1", "@babel/runtime@^7.3.4", "@babel/runtime@^7.4.0", "@babel/runtime@^7.4.5", "@babel/runtime@^7.5.5", "@babel/runtime@^7.6.3", "@babel/runtime@^7.7.2":
+"@babel/runtime@^7.0.0", "@babel/runtime@^7.1.2", "@babel/runtime@^7.3.1", "@babel/runtime@^7.3.4", "@babel/runtime@^7.4.5", "@babel/runtime@^7.5.5", "@babel/runtime@^7.6.3", "@babel/runtime@^7.7.2":
version "7.8.4"
resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.8.4.tgz#d79f5a2040f7caa24d53e563aad49cbc05581308"
integrity sha512-neAp3zt80trRVBI1x0azq6c57aNBqYZH8KhMm3TaB7wEI5Q4A2SHfBHE8w9gOhI/lrqxtEbXZgQIrHP+wvSGwQ==
@@ -1884,6 +1884,11 @@
resolved "https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.4.tgz#38fd73ddfd9b55abb1e1b2ed578cb55bd7b7d339"
integrity sha512-8+KAKzEvSUdeo+kmqnKrqgeE+LcA0tjYWFY7RPProVYwnqDjukzO+3b6dLD56rYX5TdWejnEOLJYOIeh4CXKuA==
+"@types/json5@^0.0.29":
+ version "0.0.29"
+ resolved "https://registry.yarnpkg.com/@types/json5/-/json5-0.0.29.tgz#ee28707ae94e11d2b827bcbe5270bcea7f3e71ee"
+ integrity sha1-7ihweulOEdK4J7y+UnC86n8+ce4=
+
"@types/minimatch@*":
version "3.0.3"
resolved "https://registry.yarnpkg.com/@types/minimatch/-/minimatch-3.0.3.tgz#3dca0e3f33b200fc7d1139c0cd96c1268cadfd9d"
@@ -5159,10 +5164,10 @@ enzyme-shallow-equal@^1.0.1:
has "^1.0.3"
object-is "^1.0.2"
-enzyme-to-json@^3.4.4:
- version "3.4.4"
- resolved "https://registry.yarnpkg.com/enzyme-to-json/-/enzyme-to-json-3.4.4.tgz#b30726c59091d273521b6568c859e8831e94d00e"
- integrity sha512-50LELP/SCPJJGic5rAARvU7pgE3m1YaNj7JLM+Qkhl5t7PAs6fiyc8xzc50RnkKPFQCv0EeFVjEWdIFRGPWMsA==
+enzyme-to-json@^3.5.0:
+ version "3.5.0"
+ resolved "https://registry.yarnpkg.com/enzyme-to-json/-/enzyme-to-json-3.5.0.tgz#3d536f1e8fb50d972360014fe2bd64e6a672f7dd"
+ integrity sha512-clusXRsiaQhG7+wtyc4t7MU8N3zCOgf4eY9+CeSenYzKlFST4lxerfOvnWd4SNaToKhkuba+w6m242YpQOS7eA==
dependencies:
lodash "^4.17.15"
react-is "^16.12.0"
@@ -5320,7 +5325,7 @@ eslint-config-react-app@^5.2.1:
dependencies:
confusing-browser-globals "^1.0.9"
-eslint-import-resolver-node@^0.3.2:
+eslint-import-resolver-node@^0.3.2, eslint-import-resolver-node@^0.3.3:
version "0.3.3"
resolved "https://registry.yarnpkg.com/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.3.tgz#dbaa52b6b2816b50bc6711af75422de808e98404"
integrity sha512-b8crLDo0M5RSe5YG8Pu2DYBj71tSB6OvXkfzwbJU2w7y8P4/yo0MyF8jU26IEuEuHF2K5/gcAJE3LhQGqBBbVg==
@@ -5347,6 +5352,14 @@ eslint-module-utils@^2.4.1:
debug "^2.6.9"
pkg-dir "^2.0.0"
+eslint-module-utils@^2.6.0:
+ version "2.6.0"
+ resolved "https://registry.yarnpkg.com/eslint-module-utils/-/eslint-module-utils-2.6.0.tgz#579ebd094f56af7797d19c9866c9c9486629bfa6"
+ integrity sha512-6j9xxegbqe8/kZY8cYpcp0xhbK0EgJlg3g9mib3/miLaExuuwc3n5UEfSnU6hWMbT0FAYVvDbL9RrRgpUeQIvA==
+ dependencies:
+ debug "^2.6.9"
+ pkg-dir "^2.0.0"
+
eslint-plugin-flowtype@4.6.0:
version "4.6.0"
resolved "https://registry.yarnpkg.com/eslint-plugin-flowtype/-/eslint-plugin-flowtype-4.6.0.tgz#82b2bd6f21770e0e5deede0228e456cb35308451"
@@ -5372,28 +5385,29 @@ eslint-plugin-import@2.20.1:
read-pkg-up "^2.0.0"
resolve "^1.12.0"
-eslint-plugin-import@^2.20.2:
- version "2.20.2"
- resolved "https://registry.yarnpkg.com/eslint-plugin-import/-/eslint-plugin-import-2.20.2.tgz#91fc3807ce08be4837141272c8b99073906e588d"
- integrity sha512-FObidqpXrR8OnCh4iNsxy+WACztJLXAHBO5hK79T1Hc77PgQZkyDGA5Ag9xAvRpglvLNxhH/zSmZ70/pZ31dHg==
+eslint-plugin-import@^2.21.2:
+ version "2.21.2"
+ resolved "https://registry.yarnpkg.com/eslint-plugin-import/-/eslint-plugin-import-2.21.2.tgz#8fef77475cc5510801bedc95f84b932f7f334a7c"
+ integrity sha512-FEmxeGI6yaz+SnEB6YgNHlQK1Bs2DKLM+YF+vuTk5H8J9CLbJLtlPvRFgZZ2+sXiKAlN5dpdlrWOjK8ZoZJpQA==
dependencies:
- array-includes "^3.0.3"
- array.prototype.flat "^1.2.1"
+ array-includes "^3.1.1"
+ array.prototype.flat "^1.2.3"
contains-path "^0.1.0"
debug "^2.6.9"
doctrine "1.5.0"
- eslint-import-resolver-node "^0.3.2"
- eslint-module-utils "^2.4.1"
+ eslint-import-resolver-node "^0.3.3"
+ eslint-module-utils "^2.6.0"
has "^1.0.3"
minimatch "^3.0.4"
- object.values "^1.1.0"
+ object.values "^1.1.1"
read-pkg-up "^2.0.0"
- resolve "^1.12.0"
+ resolve "^1.17.0"
+ tsconfig-paths "^3.9.0"
-eslint-plugin-jest@^23.9.0:
- version "23.9.0"
- resolved "https://registry.yarnpkg.com/eslint-plugin-jest/-/eslint-plugin-jest-23.9.0.tgz#7f4932eceb7ca487d171898fb9d55c05e6b36701"
- integrity sha512-8mt5xJQIFh33W5nE7vCikkDTE4saTo08V91KjU6yI5sLQ9e8Jkp1OXkWJoIHLheFqY5OXIZdAjZmNYHSJ3IpzQ==
+eslint-plugin-jest@^23.13.2:
+ version "23.13.2"
+ resolved "https://registry.yarnpkg.com/eslint-plugin-jest/-/eslint-plugin-jest-23.13.2.tgz#7b7993b4e09be708c696b02555083ddefd7e4cc7"
+ integrity sha512-qZit+moTXTyZFNDqSIR88/L3rdBlTU7CuW6XmyErD2FfHEkdoLgThkRbiQjzgYnX6rfgLx3Ci4eJmF4Ui5v1Cw==
dependencies:
"@typescript-eslint/experimental-utils" "^2.5.0"
@@ -5445,12 +5459,12 @@ eslint-plugin-react-hooks@^1.6.1:
resolved "https://registry.yarnpkg.com/eslint-plugin-react-hooks/-/eslint-plugin-react-hooks-1.7.0.tgz#6210b6d5a37205f0b92858f895a4e827020a7d04"
integrity sha512-iXTCFcOmlWvw4+TOE8CLWj6yX1GwzT0Y6cUfHHZqWnSk144VmVIRcVGtUAzrLES7C798lmvnt02C7rxaOX1HNA==
-eslint-plugin-react-hooks@^4.0.0:
- version "4.0.0"
- resolved "https://registry.yarnpkg.com/eslint-plugin-react-hooks/-/eslint-plugin-react-hooks-4.0.0.tgz#81196b990043cde339e25c6662aeebe32ac52d01"
- integrity sha512-YKBY+kilK5wrwIdQnCF395Ya6nDro3EAMoe+2xFkmyklyhF16fH83TrQOo9zbZIDxBsXFgBbywta/0JKRNFDkw==
+eslint-plugin-react-hooks@^4.0.4:
+ version "4.0.4"
+ resolved "https://registry.yarnpkg.com/eslint-plugin-react-hooks/-/eslint-plugin-react-hooks-4.0.4.tgz#aed33b4254a41b045818cacb047b81e6df27fa58"
+ integrity sha512-equAdEIsUETLFNCmmCkiCGq6rkSK5MoJhXFPFYeUebcjKgBmWWcgVOqZyQC8Bv1BwVCnTq9tBxgJFgAJTWoJtA==
-eslint-plugin-react@7.19.0, eslint-plugin-react@^7.19.0:
+eslint-plugin-react@7.19.0:
version "7.19.0"
resolved "https://registry.yarnpkg.com/eslint-plugin-react/-/eslint-plugin-react-7.19.0.tgz#6d08f9673628aa69c5559d33489e855d83551666"
integrity sha512-SPT8j72CGuAP+JFbT0sJHOB80TX/pu44gQ4vXH/cq+hQTiY2PuZ6IHkqXJV6x1b28GDdo1lbInjKUrrdUf0LOQ==
@@ -5468,6 +5482,23 @@ eslint-plugin-react@7.19.0, eslint-plugin-react@^7.19.0:
string.prototype.matchall "^4.0.2"
xregexp "^4.3.0"
+eslint-plugin-react@^7.20.0:
+ version "7.20.0"
+ resolved "https://registry.yarnpkg.com/eslint-plugin-react/-/eslint-plugin-react-7.20.0.tgz#f98712f0a5e57dfd3e5542ef0604b8739cd47be3"
+ integrity sha512-rqe1abd0vxMjmbPngo4NaYxTcR3Y4Hrmc/jg4T+sYz63yqlmJRknpEQfmWY+eDWPuMmix6iUIK+mv0zExjeLgA==
+ dependencies:
+ array-includes "^3.1.1"
+ doctrine "^2.1.0"
+ has "^1.0.3"
+ jsx-ast-utils "^2.2.3"
+ object.entries "^1.1.1"
+ object.fromentries "^2.0.2"
+ object.values "^1.1.1"
+ prop-types "^15.7.2"
+ resolve "^1.15.1"
+ string.prototype.matchall "^4.0.2"
+ xregexp "^4.3.0"
+
eslint-scope@^4.0.3:
version "4.0.3"
resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-4.0.3.tgz#ca03833310f6889a3264781aa82e63eb9cfe7848"
@@ -6419,11 +6450,6 @@ growly@^1.3.0:
resolved "https://registry.yarnpkg.com/growly/-/growly-1.3.0.tgz#f10748cbe76af964b7c96c93c6bcc28af120c081"
integrity sha1-8QdIy+dq+WS3yWyTxrzCivEgwIE=
-gud@^1.0.0:
- version "1.0.0"
- resolved "https://registry.yarnpkg.com/gud/-/gud-1.0.0.tgz#a489581b17e6a70beca9abe3ae57de7a499852c0"
- integrity sha512-zGEOVKFM5sVPPrYs7J5/hYEw2Pof8KCyOwyhG8sAF26mCAeUFAcYPu1mwB7hhpIP29zOIBaDqwuHdLp0jvZXjw==
-
gzip-size@5.1.1:
version "5.1.1"
resolved "https://registry.yarnpkg.com/gzip-size/-/gzip-size-5.1.1.tgz#cb9bee692f87c0612b232840a873904e4c135274"
@@ -6776,10 +6802,10 @@ i18next-xhr-backend@^3.2.2:
dependencies:
"@babel/runtime" "^7.5.5"
-i18next@^19.4.4:
- version "19.4.4"
- resolved "https://registry.yarnpkg.com/i18next/-/i18next-19.4.4.tgz#c0a18bc2f2be554da636e67bfbf5200c7948b60d"
- integrity sha512-ofaHtdsDdX3A5nYur1HWblB7J4hIcjr2ACdnwTAJgc8hTfPbyzZfGX0hVkKpI3vzDIgO6Uzc4v1ffW2W6gG6zw==
+i18next@^19.4.5:
+ version "19.4.5"
+ resolved "https://registry.yarnpkg.com/i18next/-/i18next-19.4.5.tgz#f9ea8bbb48d1ec66bc3436f0bb74a16b11821e11"
+ integrity sha512-aLvSsURoupi3x9IndmV6+m3IGhzLzhYv7Gw+//K3ovdliyGcFRV0I1MuddI0Bk/zR7BG1U+kJOjeHFUcUIdEgg==
dependencies:
"@babel/runtime" "^7.3.1"
@@ -8621,14 +8647,13 @@ mimic-fn@^2.0.0, mimic-fn@^2.1.0:
resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-2.1.0.tgz#7ed2c2ccccaf84d3ffcb7a69b57711fc2083401b"
integrity sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==
-mini-create-react-context@^0.3.0:
- version "0.3.2"
- resolved "https://registry.yarnpkg.com/mini-create-react-context/-/mini-create-react-context-0.3.2.tgz#79fc598f283dd623da8e088b05db8cddab250189"
- integrity sha512-2v+OeetEyliMt5VHMXsBhABoJ0/M4RCe7fatd/fBy6SMiKazUSEt3gxxypfnk2SHMkdBYvorHRoQxuGoiwbzAw==
+mini-create-react-context@^0.4.0:
+ version "0.4.0"
+ resolved "https://registry.yarnpkg.com/mini-create-react-context/-/mini-create-react-context-0.4.0.tgz#df60501c83151db69e28eac0ef08b4002efab040"
+ integrity sha512-b0TytUgFSbgFJGzJqXPKCFCBWigAjpjo+Fl7Vf7ZbKRDptszpppKxXH6DRXEABZ/gcEQczeb0iZ7JvL8e8jjCA==
dependencies:
- "@babel/runtime" "^7.4.0"
- gud "^1.0.0"
- tiny-warning "^1.0.2"
+ "@babel/runtime" "^7.5.5"
+ tiny-warning "^1.0.3"
mini-css-extract-plugin@0.9.0:
version "0.9.0"
@@ -8764,10 +8789,10 @@ modify-values@^1.0.0:
resolved "https://registry.yarnpkg.com/modify-values/-/modify-values-1.0.1.tgz#b3939fa605546474e3e3e3c63d64bd43b4ee6022"
integrity sha512-xV2bxeN6F7oYjZWTe/YPAy6MN2M+sL4u/Rlm2AHCIVGfo2p1yGmBHQ6vHehl4bRTZBdHu3TSkWdYgkwpYzAGSw==
-moment@^2.25.3:
- version "2.25.3"
- resolved "https://registry.yarnpkg.com/moment/-/moment-2.25.3.tgz#252ff41319cf41e47761a1a88cab30edfe9808c0"
- integrity sha512-PuYv0PHxZvzc15Sp8ybUCoQ+xpyPWvjOuK72a5ovzp2LI32rJXOiIfyoFoYvG3s6EwwrdkMyWuRiEHSZRLJNdg==
+moment@^2.26.0:
+ version "2.26.0"
+ resolved "https://registry.yarnpkg.com/moment/-/moment-2.26.0.tgz#5e1f82c6bafca6e83e808b30c8705eed0dcbd39a"
+ integrity sha512-oIixUO+OamkUkwjhAVE18rAMfRJNsNe/Stid/gwHSOfHrOtw9EhAY2AHvdKZ/k/MggcYELFCJz/Sn2pL8b8JMw==
moo@^0.5.0:
version "0.5.1"
@@ -9133,10 +9158,10 @@ number-is-nan@^1.0.0:
resolved "https://registry.yarnpkg.com/number-is-nan/-/number-is-nan-1.0.1.tgz#097b602b53422a522c1afb8790318336941a011d"
integrity sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=
-numbro@^2.2.0:
- version "2.2.0"
- resolved "https://registry.yarnpkg.com/numbro/-/numbro-2.2.0.tgz#6e40e21e0eff55553d45a0d0fd4f7bf6cd2ab1ea"
- integrity sha512-qgIU8Zfz2A7Nu9ILL0jV1hfriG5v1G8+b19zyrQNK8spUmJaHcn1YYXzNDRrb7IXBlTrW61ZUsKT/bCijeEGiQ==
+numbro@^2.3.0:
+ version "2.3.0"
+ resolved "https://registry.yarnpkg.com/numbro/-/numbro-2.3.0.tgz#a2cdcf164346833fded1128dfc5056a882b3097a"
+ integrity sha512-KGa4qVveFGC0HgKaJnmKYqyC9CX7jQONxEfREVwc/8UwTJtcEt60F8j/NCKgZH/IFW/Z9uibhCDqpJiRxuXdsA==
dependencies:
bignumber.js "^8.1.1"
@@ -10823,10 +10848,10 @@ react-fast-compare@^2.0.0:
resolved "https://registry.yarnpkg.com/react-fast-compare/-/react-fast-compare-2.0.4.tgz#e84b4d455b0fec113e0402c329352715196f81f9"
integrity sha512-suNP+J1VU1MWFKcyt7RtjiSWUjvidmQSlqu+eHslq+342xCbGTYmC0mEhPCOHxlW0CywylOC1u2DFAT+bv4dBw==
-react-i18next@^11.4.0:
- version "11.4.0"
- resolved "https://registry.yarnpkg.com/react-i18next/-/react-i18next-11.4.0.tgz#dde6bf3a695910af7a4270fea2e111bc331cf151"
- integrity sha512-lyOZSSQkif4H9HnHN3iEKVkryLI+WkdZSEw3VAZzinZLopfYRMHVY5YxCopdkXPLEHs6S5GjKYPh3+j0j336Fg==
+react-i18next@^11.5.0:
+ version "11.5.0"
+ resolved "https://registry.yarnpkg.com/react-i18next/-/react-i18next-11.5.0.tgz#84a9bb535d44c0c1b336b94de164515c2cc2a714"
+ integrity sha512-V6rUT7MzYBdFCgUrhfr78FHRfnY3CFoR75ET9EP5Py5UPHKyaGiK1MvPx03TesLwsmIaVHlRFU/WLzqCedXevA==
dependencies:
"@babel/runtime" "^7.3.1"
html-parse-stringify2 "2.0.1"
@@ -10852,29 +10877,29 @@ react-redux@^7.2.0:
prop-types "^15.7.2"
react-is "^16.9.0"
-react-router-dom@^5.1.2:
- version "5.1.2"
- resolved "https://registry.yarnpkg.com/react-router-dom/-/react-router-dom-5.1.2.tgz#06701b834352f44d37fbb6311f870f84c76b9c18"
- integrity sha512-7BPHAaIwWpZS074UKaw1FjVdZBSVWEk8IuDXdB+OkLb8vd/WRQIpA4ag9WQk61aEfQs47wHyjWUoUGGZxpQXew==
+react-router-dom@^5.2.0:
+ version "5.2.0"
+ resolved "https://registry.yarnpkg.com/react-router-dom/-/react-router-dom-5.2.0.tgz#9e65a4d0c45e13289e66c7b17c7e175d0ea15662"
+ integrity sha512-gxAmfylo2QUjcwxI63RhQ5G85Qqt4voZpUXSEqCwykV0baaOTQDR1f0PmY8AELqIyVc0NEZUj0Gov5lNGcXgsA==
dependencies:
"@babel/runtime" "^7.1.2"
history "^4.9.0"
loose-envify "^1.3.1"
prop-types "^15.6.2"
- react-router "5.1.2"
+ react-router "5.2.0"
tiny-invariant "^1.0.2"
tiny-warning "^1.0.0"
-react-router@5.1.2, react-router@^5.1.2:
- version "5.1.2"
- resolved "https://registry.yarnpkg.com/react-router/-/react-router-5.1.2.tgz#6ea51d789cb36a6be1ba5f7c0d48dd9e817d3418"
- integrity sha512-yjEuMFy1ONK246B+rsa0cUam5OeAQ8pyclRDgpxuSCrAlJ1qN9uZ5IgyKC7gQg0w8OM50NXHEegPh/ks9YuR2A==
+react-router@5.2.0, react-router@^5.2.0:
+ version "5.2.0"
+ resolved "https://registry.yarnpkg.com/react-router/-/react-router-5.2.0.tgz#424e75641ca8747fbf76e5ecca69781aa37ea293"
+ integrity sha512-smz1DUuFHRKdcJC0jobGo8cVbhO3x50tCL4icacOlcwDOEQPq4TMqwx3sY1TP+DvtTgz4nm3thuo7A+BK2U0Dw==
dependencies:
"@babel/runtime" "^7.1.2"
history "^4.9.0"
hoist-non-react-statics "^3.1.0"
loose-envify "^1.3.1"
- mini-create-react-context "^0.3.0"
+ mini-create-react-context "^0.4.0"
path-to-regexp "^1.7.0"
prop-types "^15.6.2"
react-is "^16.6.0"
@@ -11429,6 +11454,13 @@ resolve@^1.10.0, resolve@^1.12.0, resolve@^1.13.1, resolve@^1.15.1, resolve@^1.3
dependencies:
path-parse "^1.0.6"
+resolve@^1.17.0:
+ version "1.17.0"
+ resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.17.0.tgz#b25941b54968231cc2d1bb76a79cb7f2c0bf8444"
+ integrity sha512-ic+7JYiV8Vi2yzQGFWOkiZD5Z9z7O2Zhm9XMaTxdJExKasieFCr+yXZ/WmXsckHiKl12ar0y6XiXDx3m4RHn1w==
+ dependencies:
+ path-parse "^1.0.6"
+
restore-cursor@^3.1.0:
version "3.1.0"
resolved "https://registry.yarnpkg.com/restore-cursor/-/restore-cursor-3.1.0.tgz#39f67c54b3a7a58cea5236d95cf0034239631f7e"
@@ -12634,7 +12666,7 @@ tiny-invariant@^1.0.2:
resolved "https://registry.yarnpkg.com/tiny-invariant/-/tiny-invariant-1.1.0.tgz#634c5f8efdc27714b7f386c35e6760991d230875"
integrity sha512-ytxQvrb1cPc9WBEI/HSeYYoGD0kWnGEOR8RY6KomWLBVhqz0RgTwVO9dLrGz7dC+nN9llyI7OKAgRq8Vq4ZBSw==
-tiny-warning@^1.0.0, tiny-warning@^1.0.2:
+tiny-warning@^1.0.0, tiny-warning@^1.0.3:
version "1.0.3"
resolved "https://registry.yarnpkg.com/tiny-warning/-/tiny-warning-1.0.3.tgz#94a30db453df4c643d0fd566060d60a875d84754"
integrity sha512-lBN9zLN/oAf68o3zNXYrdCt1kP8WsiGW8Oo2ka41b2IM5JL/S1CTyX1rW0mb/zSuJun0ZUrDxx4sqvYS2FWzPA==
@@ -12764,6 +12796,16 @@ ts-pnp@^1.1.6:
resolved "https://registry.yarnpkg.com/ts-pnp/-/ts-pnp-1.2.0.tgz#a500ad084b0798f1c3071af391e65912c86bca92"
integrity sha512-csd+vJOb/gkzvcCHgTGSChYpy5f1/XKNsmvBGO4JXS+z1v2HobugDz4s1IeFXM3wZB44uczs+eazB5Q/ccdhQw==
+tsconfig-paths@^3.9.0:
+ version "3.9.0"
+ resolved "https://registry.yarnpkg.com/tsconfig-paths/-/tsconfig-paths-3.9.0.tgz#098547a6c4448807e8fcb8eae081064ee9a3c90b"
+ integrity sha512-dRcuzokWhajtZWkQsDVKbWyY+jgcLC5sqJhg2PSgf4ZkH2aHPvaOY8YWGhmjb68b5qqTfasSsDO9k7RUiEmZAw==
+ dependencies:
+ "@types/json5" "^0.0.29"
+ json5 "^1.0.1"
+ minimist "^1.2.0"
+ strip-bom "^3.0.0"
+
tslib@^1.10.0, tslib@^1.8.1, tslib@^1.9.0, tslib@^1.9.3:
version "1.11.0"
resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.11.0.tgz#f1f3528301621a53220d58373ae510ff747a66bc"
From 8ab0608b619576baeacb0b0ff115a2673018851a Mon Sep 17 00:00:00 2001
From: CD Cabrera
Date: Wed, 10 Jun 2020 16:08:24 -0400
Subject: [PATCH 03/16] fix(build): npm lint updates (#313)
* build, jsdoc annotation updates
---
package.json | 2 +-
src/common/dateHelpers.js | 6 +--
src/components/c3GraphCard/c3GraphCard.js | 8 ++--
.../c3GraphCard/c3GraphCardHelpers.js | 20 +++++-----
src/components/form/checkbox.js | 10 +++++
src/components/form/formState.js | 4 +-
.../graphCard/graphCardChartLegend.js | 12 +++---
.../graphCard/graphCardChartTooltip.js | 5 +++
src/components/graphCard/graphCardHelpers.js | 14 +++----
.../__tests__/__snapshots__/i18n.test.js.snap | 30 +++++++--------
src/components/messageView/messageView.js | 5 +++
src/components/optinView/optinView.js | 1 +
src/components/pageLayout/pageHeader.js | 2 +
src/components/pageLayout/pageLayout.js | 2 +
src/components/pageLayout/pageSection.js | 2 +
src/components/pageLayout/pageToolbar.js | 2 +
src/components/router/redirect.js | 7 ++++
src/components/router/routerHelpers.js | 20 +++++-----
src/components/tourView/tourView.js | 3 ++
yarn.lock | 38 +++++++++++--------
20 files changed, 120 insertions(+), 73 deletions(-)
diff --git a/package.json b/package.json
index 2a337fbe6..ef8278f35 100644
--- a/package.json
+++ b/package.json
@@ -122,7 +122,7 @@
"eslint-config-prettier": "^6.11.0",
"eslint-plugin-import": "^2.21.2",
"eslint-plugin-jest": "^23.13.2",
- "eslint-plugin-jsdoc": "^24.0.6",
+ "eslint-plugin-jsdoc": "^27.0.5",
"eslint-plugin-json": "^2.1.1",
"eslint-plugin-jsx-a11y": "^6.2.3",
"eslint-plugin-prettier": "^3.1.3",
diff --git a/src/common/dateHelpers.js b/src/common/dateHelpers.js
index 6be660950..dcaee0d8c 100644
--- a/src/common/dateHelpers.js
+++ b/src/common/dateHelpers.js
@@ -14,9 +14,9 @@ const getCurrentDate = () =>
* Set a date range based on a granularity type.
*
* @param {object} params
- * @property {Date} date Start date, typically the current date.
- * @property {number} subtract Number of granularity type to subtract from the current date.
- * @property {string} measurement Granularity type.
+ * @param {Date} params.date Start date, typically the current date.
+ * @param {number} params.subtract Number of granularity type to subtract from the current date.
+ * @param {string} params.measurement Granularity type.
* @returns {{endDate: Date, startDate: Date}}
*/
const setRangedDateTime = ({ date, subtract, measurement }) => ({
diff --git a/src/components/c3GraphCard/c3GraphCard.js b/src/components/c3GraphCard/c3GraphCard.js
index a4ced97f7..943bddc2b 100644
--- a/src/components/c3GraphCard/c3GraphCard.js
+++ b/src/components/c3GraphCard/c3GraphCard.js
@@ -76,10 +76,10 @@ class C3GraphCard extends React.Component {
* Apply a custom legend.
*
* @param {object} options
- * @property {Function} chart
- * @property {Array} filteredData
- * @property {string} granularity
- * @property {Array} hiddenDataFacets
+ * @param {Function} options.chart
+ * @param {Array} options.filteredData
+ * @param {string} options.granularity
+ * @param {Array} options.hiddenDataFacets
* @returns {Array}
*/
renderLegend({ chart, filteredData = [], granularity, hiddenDataFacets = [] }) {
diff --git a/src/components/c3GraphCard/c3GraphCardHelpers.js b/src/components/c3GraphCard/c3GraphCardHelpers.js
index 425bbd59e..1297cb697 100644
--- a/src/components/c3GraphCard/c3GraphCardHelpers.js
+++ b/src/components/c3GraphCard/c3GraphCardHelpers.js
@@ -9,8 +9,8 @@ import { dateHelpers, helpers } from '../../common';
* Return a formatted date string.
*
* @param {object} params
- * @property {Date} date
- * @property {string} granularity See enum of RHSM_API_QUERY_GRANULARITY_TYPES
+ * @param {Date} params.date
+ * @param {string} params.granularity See enum of RHSM_API_QUERY_GRANULARITY_TYPES
* @returns {string}
*/
const getTooltipDate = ({ date, granularity }) => {
@@ -40,10 +40,10 @@ const getTooltipDate = ({ date, granularity }) => {
* Format x axis ticks.
*
* @param {object} params
- * @property {Date} date
- * @property {string} granularity See enum of RHSM_API_QUERY_GRANULARITY_TYPES
- * @property {number|string} tick
- * @property {Date} previousDate
+ * @param {Date} params.date
+ * @param {string} params.granularity See enum of RHSM_API_QUERY_GRANULARITY_TYPES
+ * @param {number|string} params.tick
+ * @param {Date} params.previousDate
* @returns {string|undefined}
*/
const xAxisTickFormat = ({ date, granularity, tick, previousDate }) => {
@@ -89,7 +89,7 @@ const xAxisTickFormat = ({ date, granularity, tick, previousDate }) => {
* Format y axis ticks.
*
* @param {object} params
- * @property {number|string} tick
+ * @param {number|string} params.tick
* @returns {string}
*/
const yAxisTickFormat = ({ tick }) => numbro(tick).format({ average: true, mantissa: 1, optionalMantissa: true });
@@ -98,9 +98,9 @@ const yAxisTickFormat = ({ tick }) => numbro(tick).format({ average: true, manti
* Convert data into a C3 configuration object.
*
* @param {object} options
- * @property {Array} data
- * @property {string} granularity
- * @property {string} productShortLabel
+ * @param {Array} options.data
+ * @param {string} options.granularity
+ * @param {string} options.productShortLabel
* @returns {{configuration: {padding: {top: number, left: number, bottom: number, right: number},
* data: {types: {}, names: {}, columns: [], x: string, groups: [[]], colors: {}},
* legend: {show: boolean}, grid: {y: {show: boolean}}, tooltip: {format: {title: (function(*): string),
diff --git a/src/components/form/checkbox.js b/src/components/form/checkbox.js
index 6ef32878b..b0e2236da 100644
--- a/src/components/form/checkbox.js
+++ b/src/components/form/checkbox.js
@@ -6,6 +6,16 @@ import { helpers } from '../../common';
/**
* Render a checkbox form element.
*
+ * @param {object} props
+ * @param {string} props.ariaLabel
+ * @param {*} props.checked
+ * @param {Node} props.children
+ * @param {boolean} props.isDisabled
+ * @param {Node} props.label
+ * @param {string} props.name
+ * @param {Function} props.onChange
+ * @param {boolean} props.readOnly
+ * @param {*} props.value
* @returns {Node}
*/
const Checkbox = ({ ariaLabel, checked, children, isDisabled, label, name, onChange, readOnly, value, ...props }) => {
diff --git a/src/components/form/formState.js b/src/components/form/formState.js
index 25ed6df03..aa580aa55 100644
--- a/src/components/form/formState.js
+++ b/src/components/form/formState.js
@@ -31,8 +31,8 @@ class FormState extends React.Component {
* Infer a field value is "checked" from a boolean value.
*
* @param {object} params
- * @property {boolean} setValuesAssumeBoolIsChecked
- * @property {object} setValues
+ * @param {boolean} params.setValuesAssumeBoolIsChecked
+ * @param {object} params.setValues
* @returns {{}}
*/
static checkedSetValues({ setValuesAssumeBoolIsChecked, setValues }) {
diff --git a/src/components/graphCard/graphCardChartLegend.js b/src/components/graphCard/graphCardChartLegend.js
index 82553fe0e..ce47d1a62 100644
--- a/src/components/graphCard/graphCardChartLegend.js
+++ b/src/components/graphCard/graphCardChartLegend.js
@@ -45,12 +45,12 @@ class GraphCardChartLegend extends React.Component {
* Return a legend item.
*
* @param {object} options
- * @property {string} chartId
- * @property {string} color
- * @property {boolean} isDisabled
- * @property {boolean} isThreshold
- * @property {string} labelContent
- * @property {string} tooltipContent
+ * @param {string} options.chartId
+ * @param {string} options.color
+ * @param {boolean} options.isDisabled
+ * @param {boolean} options.isThreshold
+ * @param {string} options.labelContent
+ * @param {string} options.tooltipContent
* @returns {Node}
*/
renderLegendItem({ chartId, color, isDisabled, isThreshold, labelContent, tooltipContent }) {
diff --git a/src/components/graphCard/graphCardChartTooltip.js b/src/components/graphCard/graphCardChartTooltip.js
index e2a291528..ff60c24c6 100644
--- a/src/components/graphCard/graphCardChartTooltip.js
+++ b/src/components/graphCard/graphCardChartTooltip.js
@@ -7,6 +7,11 @@ import { helpers } from '../../common';
/**
* A custom chart tooltip.
*
+ * @param {object} props
+ * @param {object} props.datum
+ * @param {string} props.granularity
+ * @param {string} props.product
+ * @param {Function} props.t
* @returns {Node}
*/
const GraphCardChartTooltip = ({ datum, granularity, product, t }) => {
diff --git a/src/components/graphCard/graphCardHelpers.js b/src/components/graphCard/graphCardHelpers.js
index 72e41d728..cf43b5695 100644
--- a/src/components/graphCard/graphCardHelpers.js
+++ b/src/components/graphCard/graphCardHelpers.js
@@ -26,8 +26,8 @@ const getChartXAxisLabelIncrement = granularity => {
* Return a formatted date string.
*
* @param {object} params
- * @property {Date} date
- * @property {string} granularity See enum of RHSM_API_QUERY_GRANULARITY_TYPES
+ * @param {Date} params.date
+ * @param {string} params.granularity See enum of RHSM_API_QUERY_GRANULARITY_TYPES
* @returns {string}
*/
const getTooltipDate = ({ date, granularity }) => {
@@ -57,10 +57,10 @@ const getTooltipDate = ({ date, granularity }) => {
* Format x axis ticks.
*
* @param {object} params
- * @property {Date} date
- * @property {string} granularity See enum of RHSM_API_QUERY_GRANULARITY_TYPES
- * @property {number|string} tick
- * @property {Date} previousDate
+ * @param {Date} params.date
+ * @param {string} params.granularity See enum of RHSM_API_QUERY_GRANULARITY_TYPES
+ * @param {number|string} params.tick
+ * @param {Date} params.previousDate
* @returns {string|undefined}
*/
const xAxisTickFormat = ({ date, granularity, tick, previousDate }) => {
@@ -106,7 +106,7 @@ const xAxisTickFormat = ({ date, granularity, tick, previousDate }) => {
* Format y axis ticks.
*
* @param {object} params
- * @property {number|string} tick
+ * @param {number|string} params.tick
* @returns {string}
*/
const yAxisTickFormat = ({ tick }) => numbro(tick).format({ average: true, mantissa: 1, optionalMantissa: true });
diff --git a/src/components/i18n/__tests__/__snapshots__/i18n.test.js.snap b/src/components/i18n/__tests__/__snapshots__/i18n.test.js.snap
index 8ba01b649..43caa635a 100644
--- a/src/components/i18n/__tests__/__snapshots__/i18n.test.js.snap
+++ b/src/components/i18n/__tests__/__snapshots__/i18n.test.js.snap
@@ -49,18 +49,18 @@ msgid \\"curiosity-graph.dropdownWeekly\\"
msgstr \\"\\"
#: src/components/c3GraphCard/c3GraphCardHelpers.js:176
-#: src/components/graphCard/graphCardChartTooltip.js:31
+#: src/components/graphCard/graphCardChartTooltip.js:36
msgid \\"curiosity-graph.infiniteThresholdLabel\\"
msgstr \\"\\"
-#: src/components/graphCard/graphCardChartTooltip.js:79
+#: src/components/graphCard/graphCardChartTooltip.js:84
msgid \\"curiosity-graph.noDataErrorLabel\\"
msgstr \\"\\"
#: src/components/c3GraphCard/c3GraphCardHelpers.js:177
#: src/components/c3GraphCard/c3GraphCardHelpers.js:180
-#: src/components/graphCard/graphCardChartTooltip.js:32
-#: src/components/graphCard/graphCardChartTooltip.js:38
+#: src/components/graphCard/graphCardChartTooltip.js:37
+#: src/components/graphCard/graphCardChartTooltip.js:43
msgid \\"curiosity-graph.noDataLabel\\"
msgstr \\"\\"
@@ -76,7 +76,7 @@ msgstr \\"\\"
#: src/components/c3GraphCard/c3GraphCard.js:110
#: src/components/c3GraphCard/c3GraphCardHelpers.js:133
#: src/components/graphCard/graphCardChartLegend.js:130
-#: src/components/graphCard/graphCardChartTooltip.js:34
+#: src/components/graphCard/graphCardChartTooltip.js:39
msgid \\"curiosity-graph.thresholdLabel\\"
msgstr \\"\\"
@@ -84,7 +84,7 @@ msgstr \\"\\"
msgid \\"curiosity-graph.thresholdLegendTooltip\\"
msgstr \\"\\"
-#: src/components/graphCard/graphCardChartTooltip.js:49
+#: src/components/graphCard/graphCardChartTooltip.js:54
msgid \\"curiosity-graph.tooltipSummary\\"
msgstr \\"\\"
@@ -194,36 +194,36 @@ msgstr \\"\\"
msgid \\"curiosity-toolbar.slaStandard\\"
msgstr \\"\\"
-#: src/components/tourView/tourView.js:69
+#: src/components/tourView/tourView.js:72
msgid \\"curiosity-tour.emptyStateButton\\"
msgstr \\"\\"
-#: src/components/tourView/tourView.js:47
+#: src/components/tourView/tourView.js:50
msgid \\"curiosity-tour.emptyStateDescription\\"
msgstr \\"\\"
-#: src/components/tourView/tourView.js:54
+#: src/components/tourView/tourView.js:57
msgid \\"curiosity-tour.emptyStateDescriptionExtended\\"
msgstr \\"\\"
-#: src/components/tourView/tourView.js:49
+#: src/components/tourView/tourView.js:52
msgid \\"curiosity-tour.emptyStateDescriptionTour\\"
msgstr \\"\\"
-#: src/components/tourView/tourView.js:37
+#: src/components/tourView/tourView.js:40
msgid \\"curiosity-tour.emptyStateIconAlt\\"
msgstr \\"\\"
-#: src/components/tourView/tourView.js:84
+#: src/components/tourView/tourView.js:87
msgid \\"curiosity-tour.emptyStateLinkContactUs\\"
msgstr \\"\\"
-#: src/components/tourView/tourView.js:65
-#: src/components/tourView/tourView.js:80
+#: src/components/tourView/tourView.js:68
+#: src/components/tourView/tourView.js:83
msgid \\"curiosity-tour.emptyStateLinkLearnMore\\"
msgstr \\"\\"
-#: src/components/tourView/tourView.js:42
+#: src/components/tourView/tourView.js:45
msgid \\"curiosity-tour.emptyStateTitle\\"
msgstr \\"\\"
diff --git a/src/components/messageView/messageView.js b/src/components/messageView/messageView.js
index 8d10c47d0..bd9613f77 100644
--- a/src/components/messageView/messageView.js
+++ b/src/components/messageView/messageView.js
@@ -16,6 +16,11 @@ import { helpers } from '../../common';
/**
* Render a message view.
*
+ * @param {object} props
+ * @param {Node|Function} props.icon
+ * @param {string} props.message
+ * @param {string} props.pageTitle
+ * @param {string} props.title
* @returns {Node}
*/
const MessageView = ({ icon, message, pageTitle, title }) => (
diff --git a/src/components/optinView/optinView.js b/src/components/optinView/optinView.js
index 72ecbb2ee..5ba76ec72 100644
--- a/src/components/optinView/optinView.js
+++ b/src/components/optinView/optinView.js
@@ -251,6 +251,7 @@ const mapDispatchToProps = dispatch => ({
* Apply state to props.
*
* @param {object} state
+ * @param {object} state.user
* @returns {object}
*/
const mapStateToProps = ({ user }) => ({ ...user.optin, session: user.session });
diff --git a/src/components/pageLayout/pageHeader.js b/src/components/pageLayout/pageHeader.js
index 81fefc256..ba1738578 100644
--- a/src/components/pageLayout/pageHeader.js
+++ b/src/components/pageLayout/pageHeader.js
@@ -8,6 +8,8 @@ import {
/**
* Render a platform page header.
*
+ * @param {object} props
+ * @param {Node} props.children
* @returns {Node}
*/
const PageHeader = ({ children }) => (
diff --git a/src/components/pageLayout/pageLayout.js b/src/components/pageLayout/pageLayout.js
index 168f1bfc6..00249b134 100644
--- a/src/components/pageLayout/pageLayout.js
+++ b/src/components/pageLayout/pageLayout.js
@@ -12,6 +12,8 @@ import { PageToolbar } from './pageToolbar';
/**
* Render a platform page layout.
*
+ * @param {object} props
+ * @param {Node} props.children
* @returns {Node}
*/
const PageLayout = ({ children }) => (
diff --git a/src/components/pageLayout/pageSection.js b/src/components/pageLayout/pageSection.js
index 744fa882d..4b1e1d057 100644
--- a/src/components/pageLayout/pageSection.js
+++ b/src/components/pageLayout/pageSection.js
@@ -5,6 +5,8 @@ import { Section } from '@redhat-cloud-services/frontend-components/components/S
/**
* Render a platform page section.
*
+ * @param {object} props
+ * @param {Node} props.children
* @returns {Node}
*/
const PageSection = ({ children, ...props }) => ;
diff --git a/src/components/pageLayout/pageToolbar.js b/src/components/pageLayout/pageToolbar.js
index 864cfffe3..6087b0b69 100644
--- a/src/components/pageLayout/pageToolbar.js
+++ b/src/components/pageLayout/pageToolbar.js
@@ -5,6 +5,8 @@ import { Section } from '@redhat-cloud-services/frontend-components/components/S
/**
* Render a platform toolbar section.
*
+ * @param {object} props
+ * @param {Node} props.children
* @returns {Node}
*/
const PageToolbar = ({ children, ...props }) => ;
diff --git a/src/components/router/redirect.js b/src/components/router/redirect.js
index d4690725c..221b79a50 100644
--- a/src/components/router/redirect.js
+++ b/src/components/router/redirect.js
@@ -8,6 +8,13 @@ import { helpers } from '../../common';
/**
* A routing redirect.
*
+ * @param {object} props
+ * @param {string} props.baseName
+ * @param {object} props.history
+ * @param {boolean} props.isRedirect
+ * @param {boolean} props.isReplace
+ * @param {string} props.url
+ * @param {string} props.route
* @returns {Node}
*/
const Redirect = ({ baseName, history, isRedirect, isReplace, url, route }) => {
diff --git a/src/components/router/routerHelpers.js b/src/components/router/routerHelpers.js
index 111822849..756a90d52 100644
--- a/src/components/router/routerHelpers.js
+++ b/src/components/router/routerHelpers.js
@@ -7,8 +7,8 @@ import { routes, navigation } from './routerTypes';
* /[OPTIONAL]/[environment]/[APP NAME]
*
* @param {object} params
- * @property {string} pathName
- * @property {string} pathPrefix
+ * @param {string} params.pathName
+ * @param {string} params.pathPrefix
* @returns {string}
*/
const dynamicBaseName = ({ pathName, pathPrefix }) => {
@@ -40,9 +40,9 @@ const getErrorRoute = routes.find(route => route.activateOnError === true) || {}
* Return an object matching a specific navigation object.
*
* @param {object} params
- * @property {string} id
- * @property {string} pathname
- * @property {boolean} returnDefault
+ * @param {string} params.id
+ * @param {string} params.pathname
+ * @param {boolean} params.returnDefault
* @returns {object}
*/
const getNavigationDetail = ({ id = null, pathname = null, returnDefault = false }) => {
@@ -75,8 +75,8 @@ const getNavigationDetail = ({ id = null, pathname = null, returnDefault = false
* Return an object matching a specific, or the first generic route.
*
* @param {object} params
- * @property {string} id
- * @property {string} pathname
+ * @param {string} params.id
+ * @param {string} params.pathname
* @returns {object}
*/
const getRouteDetail = ({ id = null, pathname = null }) => {
@@ -100,9 +100,9 @@ const getRouteDetail = ({ id = null, pathname = null }) => {
* navigation.
*
* @param {object} params
- * @property {string} id
- * @property {string} pathname
- * @property {boolean} returnDefault
+ * @param {string} params.id
+ * @param {string} params.pathname
+ * @param {boolean} params.returnDefault
* @returns {object}
*/
const getNavRouteDetail = ({ id = null, pathname = null, returnDefault = false }) => {
diff --git a/src/components/tourView/tourView.js b/src/components/tourView/tourView.js
index 1ec28527c..97b846f4c 100644
--- a/src/components/tourView/tourView.js
+++ b/src/components/tourView/tourView.js
@@ -24,6 +24,9 @@ import subscriptionsSvg from '../../images/subscriptions.svg';
/**
* Render a user guided tour view.
*
+ * @param {object} props
+ * @param {object} props.session
+ * @param {Function} props.t
* @returns {Node} Node containing tour view.
*/
const TourView = ({ session, t }) => (
diff --git a/yarn.lock b/yarn.lock
index ec909bf00..c99e1ae6d 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -3604,10 +3604,10 @@ commander@^4.1.1:
resolved "https://registry.yarnpkg.com/commander/-/commander-4.1.1.tgz#9fd602bd936294e9e9ef46a3f4d6964044b18068"
integrity sha512-NOKm8xhkzAjzFx8B2v5OAHT+u5pRQc2UCa2Vq9jYL/31o2wi9mxBA7LIFs3sV5VSC49z6pEhfbMULvShKj26WA==
-comment-parser@^0.7.4:
- version "0.7.4"
- resolved "https://registry.yarnpkg.com/comment-parser/-/comment-parser-0.7.4.tgz#f5eb83cbae323cae6533c057f41d52692361c83a"
- integrity sha512-Nnl77/mt6sj1BiYSVMeMWzvD0183F2MFOJyFRmZHimUVDYS9J40AvXpiFA7RpU5pQH+HkvYc0dnsHpwW2xmbyQ==
+comment-parser@^0.7.5:
+ version "0.7.5"
+ resolved "https://registry.yarnpkg.com/comment-parser/-/comment-parser-0.7.5.tgz#06db157a3b34addf8502393743e41897e2c73059"
+ integrity sha512-iH9YA35ccw94nx5244GVkpyC9eVTsL71jZz6iz5w6RIf79JLF2AsXHXq9p6Oaohyl3sx5qSMnGsWUDFIAfWL4w==
common-tags@^1.8.0:
version "1.8.0"
@@ -5411,18 +5411,18 @@ eslint-plugin-jest@^23.13.2:
dependencies:
"@typescript-eslint/experimental-utils" "^2.5.0"
-eslint-plugin-jsdoc@^24.0.6:
- version "24.0.6"
- resolved "https://registry.yarnpkg.com/eslint-plugin-jsdoc/-/eslint-plugin-jsdoc-24.0.6.tgz#360f75b7b79a64eb6f072de9f37322588578abf0"
- integrity sha512-WDzUgShMK7Zg9N6s19LxUqy71At/PxCuMEXaKyBzybhABq6iU4DaZtWZ+4fkCMBvMzMwMAPa2oRD/+fQGORMhg==
+eslint-plugin-jsdoc@^27.0.5:
+ version "27.0.5"
+ resolved "https://registry.yarnpkg.com/eslint-plugin-jsdoc/-/eslint-plugin-jsdoc-27.0.5.tgz#065c1ae9fa4c1219d9f960da1bba11c4f358d9e6"
+ integrity sha512-LU2sclCdHe4ykYlb2Jb7Nk7L6xd8PfwANV1KRgwHV78kCo/D8aeTdinNZb8BpZQEmu4HbrY82SPZIvyYumHVTQ==
dependencies:
- comment-parser "^0.7.4"
+ comment-parser "^0.7.5"
debug "^4.1.1"
jsdoctypeparser "^6.1.0"
lodash "^4.17.15"
- regextras "^0.7.0"
+ regextras "^0.7.1"
semver "^6.3.0"
- spdx-expression-parse "^3.0.0"
+ spdx-expression-parse "^3.0.1"
eslint-plugin-json@^2.1.1:
version "2.1.1"
@@ -11263,10 +11263,10 @@ regexpu-core@^4.7.0:
unicode-match-property-ecmascript "^1.0.4"
unicode-match-property-value-ecmascript "^1.2.0"
-regextras@^0.7.0:
- version "0.7.0"
- resolved "https://registry.yarnpkg.com/regextras/-/regextras-0.7.0.tgz#2298bef8cfb92b1b7e3b9b12aa8f69547b7d71e4"
- integrity sha512-ds+fL+Vhl918gbAUb0k2gVKbTZLsg84Re3DI6p85Et0U0tYME3hyW4nMK8Px4dtDaBA2qNjvG5uWyW7eK5gfmw==
+regextras@^0.7.1:
+ version "0.7.1"
+ resolved "https://registry.yarnpkg.com/regextras/-/regextras-0.7.1.tgz#be95719d5f43f9ef0b9fa07ad89b7c606995a3b2"
+ integrity sha512-9YXf6xtW+qzQ+hcMQXx95MOvfqXFgsKDZodX3qZB0x2n5Z94ioetIITsBtvJbiOyxa/6s9AtyweBLCdPmPko/w==
regjsgen@^0.5.0, regjsgen@^0.5.1:
version "0.5.1"
@@ -12038,6 +12038,14 @@ spdx-expression-parse@^3.0.0:
spdx-exceptions "^2.1.0"
spdx-license-ids "^3.0.0"
+spdx-expression-parse@^3.0.1:
+ version "3.0.1"
+ resolved "https://registry.yarnpkg.com/spdx-expression-parse/-/spdx-expression-parse-3.0.1.tgz#cf70f50482eefdc98e3ce0a6833e4a53ceeba679"
+ integrity sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q==
+ dependencies:
+ spdx-exceptions "^2.1.0"
+ spdx-license-ids "^3.0.0"
+
spdx-license-ids@^3.0.0:
version "3.0.5"
resolved "https://registry.yarnpkg.com/spdx-license-ids/-/spdx-license-ids-3.0.5.tgz#3694b5804567a458d3c8045842a6358632f62654"
From 60dd30bc671092e95b050d2467ecc3788b0f1aff Mon Sep 17 00:00:00 2001
From: CD Cabrera
Date: Thu, 11 Jun 2020 11:23:08 -0400
Subject: [PATCH 04/16] fix(build,chartArea): npm update for victory charts
(#314)
* chartArea, label attribute fix, note
---
package.json | 6 +-
.../__snapshots__/chartArea.test.js.snap | 272 ++++++++++++--
.../chartArea/__tests__/chartArea.test.js | 14 +-
src/components/chartArea/chartArea.js | 13 +-
yarn.lock | 349 +++++++++---------
5 files changed, 439 insertions(+), 215 deletions(-)
diff --git a/package.json b/package.json
index ef8278f35..6dae20f32 100644
--- a/package.json
+++ b/package.json
@@ -109,9 +109,9 @@
"redux-promise-middleware": "^6.1.2",
"redux-thunk": "^2.3.0",
"reselect": "^4.0.0",
- "victory": "^34.2.0",
- "victory-core": "^34.2.0",
- "victory-legend": "^34.2.0"
+ "victory": "^34.3.11",
+ "victory-core": "^34.3.8",
+ "victory-legend": "^34.3.8"
},
"devDependencies": {
"apidoc-mock": "^3.0.2",
diff --git a/src/components/chartArea/__tests__/__snapshots__/chartArea.test.js.snap b/src/components/chartArea/__tests__/__snapshots__/chartArea.test.js.snap
index 95f0d582c..3502061fd 100644
--- a/src/components/chartArea/__tests__/__snapshots__/chartArea.test.js.snap
+++ b/src/components/chartArea/__tests__/__snapshots__/chartArea.test.js.snap
@@ -765,6 +765,194 @@ Object {
}
`;
+exports[`ChartArea Component should handle custom chart tooltips: componentTooltip 1`] = `
+
+
+
+`;
+
+exports[`ChartArea Component should handle custom chart tooltips: custom tooltip, post-props chart 1`] = `
+
+
}
+ role="presentation"
+ shapeRendering="auto"
+ />
+ }
+ cursorDimension="x"
+ cursorLabelComponent={
+
}
+ tspanComponent={
}
+ />
+ }
+ cursorLabelOffset={
+ Object {
+ "x": 5,
+ "y": -10,
+ }
+ }
+ labelComponent={
}
+ labels={[Function]}
+ portalComponent={
}
+ portalZIndex={99}
+ responsive={true}
+ voronoiDimension="x"
+ voronoiPadding={60}
+ />
+ }
+ domain={
+ Object {
+ "y": Array [
+ 0,
+ 20,
+ ],
+ }
+ }
+ padding={
+ Object {
+ "bottom": 75,
+ "left": 50,
+ "right": 50,
+ "top": 50,
+ }
+ }
+ themeColor="blue"
+ width={0}
+ >
+
+
+
+
+
+
+
+
+`;
+
exports[`ChartArea Component should handle custom chart tooltips: getTooltipData:after function 1`] = `
Array [
Object {
@@ -814,54 +1002,58 @@ Array [
},
},
},
- "tooltip": Object {
- "dataSets": Array [
- Object {
- "data": Array [
- Object {
+ "tooltip":
+ Object {
+ "dataSets": Array [
+ Object {
+ "data": Array [
+ Object {
+ "x": 1,
+ "xAxisLabel": "1 x axis label",
+ "y": 0,
+ },
+ ],
+ "id": "loremGraph",
+ "interpolation": "natural",
+ "isStacked": true,
+ },
+ Object {
+ "data": Array [
+ Object {
+ "x": 1,
+ "xAxisLabel": "1 x axis label",
+ "y": 10,
+ },
+ ],
+ "id": "ipsumGraph",
+ "isThreshold": true,
+ },
+ ],
+ "index": 0,
+ "itemsByKey": Object {
+ "ipsumGraph": Object {
+ "color": "",
+ "data": Object {
"x": 1,
"xAxisLabel": "1 x axis label",
- "y": 0,
+ "y": 10,
},
- ],
- "id": "loremGraph",
- "interpolation": "natural",
- "isStacked": true,
- },
- Object {
- "data": Array [
- Object {
+ },
+ "loremGraph": Object {
+ "color": "",
+ "data": Object {
"x": 1,
"xAxisLabel": "1 x axis label",
- "y": 10,
+ "y": 0,
},
- ],
- "id": "ipsumGraph",
- "isThreshold": true,
- },
- ],
- "index": 0,
- "itemsByKey": Object {
- "ipsumGraph": Object {
- "color": "",
- "data": Object {
- "x": 1,
- "xAxisLabel": "1 x axis label",
- "y": 10,
- },
- },
- "loremGraph": Object {
- "color": "",
- "data": Object {
- "x": 1,
- "xAxisLabel": "1 x axis label",
- "y": 0,
},
},
- },
- "x": 1,
- "y": 0,
- },
+ "x": 1,
+ "y": 0,
+ }
+
,
"x": 1,
"y": null,
},
diff --git a/src/components/chartArea/__tests__/chartArea.test.js b/src/components/chartArea/__tests__/chartArea.test.js
index 657647285..163abd56c 100644
--- a/src/components/chartArea/__tests__/chartArea.test.js
+++ b/src/components/chartArea/__tests__/chartArea.test.js
@@ -296,15 +296,19 @@ describe('ChartArea Component', () => {
expect(component.instance().getTooltipData()).toMatchSnapshot('getTooltipData:after function');
component.setProps({
- chartTooltip: propsObj => propsObj.datum
+ chartTooltip: propsObj => {propsObj.datum}
});
expect(component.instance().getTooltipData()).toMatchSnapshot('getTooltipData:after node');
// check renderTooltip
- component.setProps({
- chartTooltip: propsObj => propsObj.datum
- });
- expect(component.instance().renderTooltip()).toMatchSnapshot('renderTooltip: should return a custom tooltip');
+ const renderTooltip = component.instance().renderTooltip();
+ expect(renderTooltip).toMatchSnapshot('renderTooltip: should return a custom tooltip');
+
+ const componentTooltip = shallow(renderTooltip);
+ expect(componentTooltip).toMatchSnapshot('componentTooltip');
+
+ // confirm chart output
+ expect(component).toMatchSnapshot('custom tooltip, post-props chart');
});
it('should handle custom chart legends', () => {
diff --git a/src/components/chartArea/chartArea.js b/src/components/chartArea/chartArea.js
index 20a8d46b4..eded29a45 100644
--- a/src/components/chartArea/chartArea.js
+++ b/src/components/chartArea/chartArea.js
@@ -286,7 +286,16 @@ class ChartArea extends React.Component {
}
/**
- * Return a chart/graph tooltip Victory container component to allow custom tooltips.
+ * ToDo: monitor Victory charts release version increment around Voronoi container attributes.
+ * Future updates could lead to additional unexpected behavior. Victory charts released a patch/fix
+ * around attribute behavior for Voronoi containers. The behavior was already "unexpected" in that there appears
+ * to be a need to provide the "label" attribute when using the "labelComponent" attribute, even if "label" is
+ * just a pass-through. Providing `label={() => ''}` was a work-around, that is now `label={obj => obj}`. See
+ * - https://github.com/FormidableLabs/victory/blob/master/CHANGELOG.md#3436-2020-05-18
+ * - https://github.com/FormidableLabs/victory/pull/1581
+ */
+ /**
+ * Return a chart/graph tooltip Victory container component to allow custom HTML tooltips.
*
* @returns {Node}
*/
@@ -351,7 +360,7 @@ class ChartArea extends React.Component {
return (
''}
+ labels={obj => obj}
labelComponent={ }
voronoiDimension="x"
voronoiPadding={60}
diff --git a/yarn.lock b/yarn.lock
index c99e1ae6d..83c46f43c 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -4319,6 +4319,11 @@ d3-array@1, d3-array@^1.1.1, d3-array@^1.2.0:
resolved "https://registry.yarnpkg.com/d3-array/-/d3-array-1.2.4.tgz#635ce4d5eea759f6f605863dbcfc30edc737f71f"
integrity sha512-KHW6M86R+FUPYGb3R5XiYjXPq7VzwxZ22buHhAEVG5ztoEcZZMLov530mmccaqA1GghZArjQV46fuc8kUqhhHw==
+d3-array@^2.4.0:
+ version "2.4.0"
+ resolved "https://registry.yarnpkg.com/d3-array/-/d3-array-2.4.0.tgz#87f8b9ad11088769c82b5ea846bcb1cc9393f242"
+ integrity sha512-KQ41bAF2BMakf/HdKT865ALd4cgND6VcIztVQZUTt0+BH3RWy6ZYnHghVXf6NFjt2ritLr8H1T8LreAAlfiNcw==
+
d3-axis@1:
version "1.0.12"
resolved "https://registry.yarnpkg.com/d3-axis/-/d3-axis-1.0.12.tgz#cdf20ba210cfbb43795af33756886fb3638daac9"
@@ -13132,15 +13137,15 @@ victory-area@^33.1.7:
prop-types "^15.5.8"
victory-core "^33.1.7"
-victory-area@^34.2.0:
- version "34.2.0"
- resolved "https://registry.yarnpkg.com/victory-area/-/victory-area-34.2.0.tgz#f8dd570ccd6bef45c55df62aff8d07615290317c"
- integrity sha512-ArjYXf73S96vRTItI3tF6YuqXTiNnYRDw16m2qVUjhGvujusAfvWYknbrPiQhUcC4SSofvwPZy7SQEJeQCe+Ew==
+victory-area@^34.3.8:
+ version "34.3.8"
+ resolved "https://registry.yarnpkg.com/victory-area/-/victory-area-34.3.8.tgz#4e07da6250af6729ca96c87826430ecb18abe5e4"
+ integrity sha512-iN5jqYxQ2qE5fGCWgJJ2YoObRgcY4h23GiFHee8OG8dKLDCQvsR4/ZKdI4I78iLrIJf4eHeKWW+1xXheoG6A6w==
dependencies:
d3-shape "^1.2.0"
lodash "^4.17.15"
prop-types "^15.5.8"
- victory-core "^34.2.0"
+ victory-core "^34.3.8"
victory-axis@^33.1.7:
version "33.1.7"
@@ -13151,14 +13156,14 @@ victory-axis@^33.1.7:
prop-types "^15.5.8"
victory-core "^33.1.7"
-victory-axis@^34.2.0:
- version "34.2.0"
- resolved "https://registry.yarnpkg.com/victory-axis/-/victory-axis-34.2.0.tgz#33b7cc1e49e9041ec8761ab646b65b6d1ccbf091"
- integrity sha512-bXB1/jo6/FPOL9wU0CnMCS09lJw+zLLm1S9lNPo3PJ1EQxhSvB9rGJGcpIykSWFUatmpsgfWH/tl4A7qvUvD6Q==
+victory-axis@^34.3.8:
+ version "34.3.8"
+ resolved "https://registry.yarnpkg.com/victory-axis/-/victory-axis-34.3.8.tgz#a0754a4e4d4986898fdb0bd5cd204b94d5866c06"
+ integrity sha512-GD0/dJAV7hY22owiC3rKalJkf6C8WZsuu3HgzBYxySr7aiQgcJDhJ+T2DIH2DH7zUQi0FeD7lA1dyDagYdcnGA==
dependencies:
lodash "^4.17.15"
prop-types "^15.5.8"
- victory-core "^34.2.0"
+ victory-core "^34.3.8"
victory-bar@^33.1.7:
version "33.1.7"
@@ -13170,15 +13175,15 @@ victory-bar@^33.1.7:
prop-types "^15.5.8"
victory-core "^33.1.7"
-victory-bar@^34.2.0:
- version "34.2.0"
- resolved "https://registry.yarnpkg.com/victory-bar/-/victory-bar-34.2.0.tgz#031e2e369b8e3a64fbfe19d74cd28b420335984c"
- integrity sha512-cJSi2+D4CekSP8IcbYsW7Otl3El55TEfZIV9NSZiolKT66yWz62KkOP4nQpB2PmSX6RyceBZLgiSsk4ZpDy6rQ==
+victory-bar@^34.3.8:
+ version "34.3.8"
+ resolved "https://registry.yarnpkg.com/victory-bar/-/victory-bar-34.3.8.tgz#9dee4ef85505fc83c74102d35964d2e20d9d43fb"
+ integrity sha512-0LBT/DrScUTwgA1wkmZ1dI34Jt0sRM/1f+LKl92GAFQIQiwznzOFs0KBhywExf7weYw68mhVA6iUvwK+4uf17A==
dependencies:
d3-shape "^1.2.0"
lodash "^4.17.15"
prop-types "^15.5.8"
- victory-core "^34.2.0"
+ victory-core "^34.3.8"
victory-box-plot@^33.1.7:
version "33.1.7"
@@ -13190,15 +13195,15 @@ victory-box-plot@^33.1.7:
prop-types "^15.5.8"
victory-core "^33.1.7"
-victory-box-plot@^34.2.0:
- version "34.2.0"
- resolved "https://registry.yarnpkg.com/victory-box-plot/-/victory-box-plot-34.2.0.tgz#f7b981a4f2958abed93cc43a02a3ed1fe232fa04"
- integrity sha512-7CkN3xJ82hgEPIYKnu8LVBy6PMqitKjiG3OCWYOW/D4LenHAte4QcmRHov7KDX5pz25Cb5g46UAEJ8VazKsTyg==
+victory-box-plot@^34.3.8:
+ version "34.3.8"
+ resolved "https://registry.yarnpkg.com/victory-box-plot/-/victory-box-plot-34.3.8.tgz#0aeeba93e4dcf4ebd787380f6e535acad479b41c"
+ integrity sha512-Y0n6tVeUZrLbUkK69rJiyY0rcLMAnbUrQ2kqq8d0JF+UrYfvZQBvr6M4IVVrI0zoGUpqmx7ach5VTD6g6VEiug==
dependencies:
d3-array "^1.2.0"
lodash "^4.17.15"
prop-types "^15.5.8"
- victory-core "^34.2.0"
+ victory-core "^34.3.8"
victory-brush-container@^33.1.7:
version "33.1.7"
@@ -13209,15 +13214,15 @@ victory-brush-container@^33.1.7:
prop-types "^15.5.8"
victory-core "^33.1.7"
-victory-brush-container@^34.2.0:
- version "34.2.0"
- resolved "https://registry.yarnpkg.com/victory-brush-container/-/victory-brush-container-34.2.0.tgz#c1e410be8f5bfa647912bbd0ed4237ebb57ba3ec"
- integrity sha512-sef7M8BMgG1da/Ep/TXwleKLFXNpf+OsuagCZIzrDF4FdWDEmZv4adevv1FYMQrfvPwdEEIlTECse0P6roW3gQ==
+victory-brush-container@^34.3.8:
+ version "34.3.8"
+ resolved "https://registry.yarnpkg.com/victory-brush-container/-/victory-brush-container-34.3.8.tgz#83d607eb896c21694926295cf248063de6d605b7"
+ integrity sha512-/vQy/yEmoiUkuzVKBdMIevpez0JsqcTqFdRQtXbRmgK+1Rxt6z0HgtQazGEm7K80xHw+2yajSyG5G68ksjFjqg==
dependencies:
lodash "^4.17.15"
prop-types "^15.5.8"
react-fast-compare "^2.0.0"
- victory-core "^34.2.0"
+ victory-core "^34.3.8"
victory-brush-line@^33.1.7:
version "33.1.7"
@@ -13228,15 +13233,15 @@ victory-brush-line@^33.1.7:
prop-types "^15.5.8"
victory-core "^33.1.7"
-victory-brush-line@^34.2.0:
- version "34.2.0"
- resolved "https://registry.yarnpkg.com/victory-brush-line/-/victory-brush-line-34.2.0.tgz#6fc3c611babaf01d5f57c7564aaef2cca43fb2d6"
- integrity sha512-PW3icLL6f7Ql5K/7mQAGGU9bgnOFVsq7g4tIOAlmTSM1nPl4AqhVfz2iQThHajnqcP4PJgDAJEp22H0uodsAag==
+victory-brush-line@^34.3.8:
+ version "34.3.8"
+ resolved "https://registry.yarnpkg.com/victory-brush-line/-/victory-brush-line-34.3.8.tgz#5fd6d33d235dbc25346772efb9b2aecd289703fc"
+ integrity sha512-mY7ozEgTqvJCxxNhyHhOLk6M3CPDDFJKuUFT9B2vmQyPU5/EmFQuErVo6bl1hWkj1nzm5q916qt6GsVPC3mTdg==
dependencies:
lodash "^4.17.15"
prop-types "^15.5.8"
react-fast-compare "^2.0.0"
- victory-core "^34.2.0"
+ victory-core "^34.3.8"
victory-candlestick@^33.1.7:
version "33.1.7"
@@ -13247,14 +13252,14 @@ victory-candlestick@^33.1.7:
prop-types "^15.5.8"
victory-core "^33.1.7"
-victory-candlestick@^34.2.0:
- version "34.2.0"
- resolved "https://registry.yarnpkg.com/victory-candlestick/-/victory-candlestick-34.2.0.tgz#3826761265b6d9b5ee77e094c1bd833b78ed6c28"
- integrity sha512-PZyFjkrhEvbdqOdijPYX1uuZjz8RT+aEIJez7ovoS3dYncQ1XWnkIH3qJxNCAfOOVFG5iqOAj2gkntXQaSgzJg==
+victory-candlestick@^34.3.8:
+ version "34.3.8"
+ resolved "https://registry.yarnpkg.com/victory-candlestick/-/victory-candlestick-34.3.8.tgz#c16d918044f864c065f5c9c93d55c9f4aeb479ef"
+ integrity sha512-qvaEJsNPjKN25yu9TcH8+PZ2yBTOXvgH9Faup37jeIoKXtTVaHI1uYuZcLlp542tSbAnq/5EkQTiPXCx/C31Lg==
dependencies:
lodash "^4.17.15"
prop-types "^15.5.8"
- victory-core "^34.2.0"
+ victory-core "^34.3.8"
victory-chart@^33.1.7:
version "33.1.7"
@@ -13269,18 +13274,18 @@ victory-chart@^33.1.7:
victory-polar-axis "^33.1.7"
victory-shared-events "^33.1.7"
-victory-chart@^34.2.0:
- version "34.2.0"
- resolved "https://registry.yarnpkg.com/victory-chart/-/victory-chart-34.2.0.tgz#515c0f11f1668ba2e2a1a5295906f25daf75c6d2"
- integrity sha512-bklmzjbmH7pu3UScDZ3HDlAHrLS6ha4q7UKFnJAfqFhk4Jke4JyjXg5fY25xsz4IqrYPtwvcxc0tnQemgDM1FQ==
+victory-chart@^34.3.11:
+ version "34.3.11"
+ resolved "https://registry.yarnpkg.com/victory-chart/-/victory-chart-34.3.11.tgz#308d62a836c252b7be0546ec4ef83c9608bed661"
+ integrity sha512-Fj9xWzS9649addJm9pd3pxVRoiDHoNx4p9yNLwiOgSSSPrJjJd7okGk+q5fxfVyVbztMXKsuJZ5C1OJ8qanDWQ==
dependencies:
lodash "^4.17.15"
prop-types "^15.5.8"
react-fast-compare "^2.0.0"
- victory-axis "^34.2.0"
- victory-core "^34.2.0"
- victory-polar-axis "^34.2.0"
- victory-shared-events "^34.2.0"
+ victory-axis "^34.3.8"
+ victory-core "^34.3.8"
+ victory-polar-axis "^34.3.8"
+ victory-shared-events "^34.3.9"
victory-core@^33.0.1, victory-core@^33.1.7:
version "33.1.7"
@@ -13296,10 +13301,10 @@ victory-core@^33.0.1, victory-core@^33.1.7:
prop-types "^15.5.8"
react-fast-compare "^2.0.0"
-victory-core@^34.2.0:
- version "34.2.0"
- resolved "https://registry.yarnpkg.com/victory-core/-/victory-core-34.2.0.tgz#bbcfb465bf7ffe9b3a3c24a338cef9043feda3ff"
- integrity sha512-7Wrysfcz8mxZFopbWb+ydFNvHDPb2Xs7+OnF5aWY64JwKEKwVBffvtcD0Yyma0Dch/zAyOEOYXyd+ddDVJ+jjw==
+victory-core@^34.3.8:
+ version "34.3.8"
+ resolved "https://registry.yarnpkg.com/victory-core/-/victory-core-34.3.8.tgz#86c951599416c4ddd0f6e8bee7214baab0b8d478"
+ integrity sha512-m3xRt05VywEb3rgAzDAZ1pgWcjeyazbRzLLmXyrS+78U/AkmvZFjgq+26o+3+tqD7s7O4jvSeFqg0XmVi51+EQ==
dependencies:
d3-ease "^1.0.0"
d3-interpolate "^1.1.1"
@@ -13323,18 +13328,18 @@ victory-create-container@^33.1.7:
victory-voronoi-container "^33.1.7"
victory-zoom-container "^33.1.7"
-victory-create-container@^34.2.0:
- version "34.2.0"
- resolved "https://registry.yarnpkg.com/victory-create-container/-/victory-create-container-34.2.0.tgz#8210b2cba8a0180cbb5c6799cf58fe963071a02c"
- integrity sha512-LCnWvU3Cs4igGr9xjq/RJdE0A0FvhrVJ7g1jgAjATiQFVn7CJmwx/hg/8AQmno/nYV50uKDS/kgE5Z0aFDlVTw==
+victory-create-container@^34.3.10:
+ version "34.3.10"
+ resolved "https://registry.yarnpkg.com/victory-create-container/-/victory-create-container-34.3.10.tgz#e024db9755224a14ccc7434ab703be7cfc99ef55"
+ integrity sha512-JUlUHfw3Lzw8as8kyYlj2sFkrU7ER+kC/bSGDUIyYZ9ChVdXc4xy/9DzgXA/lswp5JhE92p+TGaDXToUn8UygA==
dependencies:
lodash "^4.17.15"
- victory-brush-container "^34.2.0"
- victory-core "^34.2.0"
- victory-cursor-container "^34.2.0"
- victory-selection-container "^34.2.0"
- victory-voronoi-container "^34.2.0"
- victory-zoom-container "^34.2.0"
+ victory-brush-container "^34.3.8"
+ victory-core "^34.3.8"
+ victory-cursor-container "^34.3.10"
+ victory-selection-container "^34.3.8"
+ victory-voronoi-container "^34.3.8"
+ victory-zoom-container "^34.3.8"
victory-cursor-container@^33.1.7:
version "33.1.7"
@@ -13345,14 +13350,14 @@ victory-cursor-container@^33.1.7:
prop-types "^15.5.8"
victory-core "^33.1.7"
-victory-cursor-container@^34.2.0:
- version "34.2.0"
- resolved "https://registry.yarnpkg.com/victory-cursor-container/-/victory-cursor-container-34.2.0.tgz#3fec4fff07c64a90cec520b0ddba0842d185b25a"
- integrity sha512-JbDN3JxumuOcxW2YHtQBzdQ4ttowER9d6yqi/6NmOY/PhNl+U+keofHWL3K9pCCqL3nJT9i3F3zozZtAtkk7EQ==
+victory-cursor-container@^34.3.10:
+ version "34.3.10"
+ resolved "https://registry.yarnpkg.com/victory-cursor-container/-/victory-cursor-container-34.3.10.tgz#708a7c15bf1e172d797103e8ebf8f273103529e7"
+ integrity sha512-Gve4i6fjhklCTW/k+RYZBf6UBAq4M/1HA32KEa/TtrQVaewLUu7O564ndcQDCqWiQEIBjKdSbEfgiq6fqT9zag==
dependencies:
lodash "^4.17.15"
prop-types "^15.5.8"
- victory-core "^34.2.0"
+ victory-core "^34.3.8"
victory-errorbar@^33.1.7:
version "33.1.7"
@@ -13363,14 +13368,14 @@ victory-errorbar@^33.1.7:
prop-types "^15.5.8"
victory-core "^33.1.7"
-victory-errorbar@^34.2.0:
- version "34.2.0"
- resolved "https://registry.yarnpkg.com/victory-errorbar/-/victory-errorbar-34.2.0.tgz#af5623e06e6421c9ada7a60ba568431ce520cdc5"
- integrity sha512-u0RCadFD4779aOYXfXl46YplwoD4lRuITqIU3eVCeEeLtynS8anU2wAfbrT2VgBaaWrqFCsu9cjfXkVmN0EzUQ==
+victory-errorbar@^34.3.8:
+ version "34.3.8"
+ resolved "https://registry.yarnpkg.com/victory-errorbar/-/victory-errorbar-34.3.8.tgz#23c042c667e85f2d677dee959644e9825ac513d8"
+ integrity sha512-AIHK3LMj3HapFQthls58C6oma0reDmCNFJoqhor+9LFC0KTCsCrIZXFthSyDtzT+arOxuB6vu3j4ayOGXsurkA==
dependencies:
lodash "^4.17.15"
prop-types "^15.5.8"
- victory-core "^34.2.0"
+ victory-core "^34.3.8"
victory-group@^33.1.7:
version "33.1.7"
@@ -13382,16 +13387,29 @@ victory-group@^33.1.7:
react-fast-compare "^2.0.0"
victory-core "^33.1.7"
-victory-group@^34.2.0:
- version "34.2.0"
- resolved "https://registry.yarnpkg.com/victory-group/-/victory-group-34.2.0.tgz#b5d8fd43e1d07a1c75ca845342136df01232f54c"
- integrity sha512-ZE0ERmoVUCx1wXwXTCYyfAh5Gfz4KajOvT3is06dsipxlks1TkvSgB1WgaBezxlPVnYmCCee1TEgEbvtyrU8tA==
+victory-group@^34.3.10:
+ version "34.3.10"
+ resolved "https://registry.yarnpkg.com/victory-group/-/victory-group-34.3.10.tgz#c25ac1e888f95f6284226bcf8b04744d604b7500"
+ integrity sha512-PAUjqs5O+lPc50ZB9/TK7dx/ICCB0/jscl9ZwjxcpogfQhXL/hDnOCoaF+TpH9KuvK4Tth1DQIVzw7TaUxeeWA==
+ dependencies:
+ lodash "^4.17.15"
+ prop-types "^15.5.8"
+ react-fast-compare "^2.0.0"
+ victory-core "^34.3.8"
+ victory-shared-events "^34.3.9"
+
+victory-histogram@^34.3.8:
+ version "34.3.8"
+ resolved "https://registry.yarnpkg.com/victory-histogram/-/victory-histogram-34.3.8.tgz#b278f957300120ca1236413d276d7ee8fd7d55b9"
+ integrity sha512-MVstAEDkWNJ6d5obAgp2TSoex+GYsXToBcgR0QMEJPj2TAKAetrUOM94H/cBzjbSQG6xo+rdNM/Ena1Sqmn2cQ==
dependencies:
+ d3-array "^2.4.0"
+ d3-scale "^1.0.0"
lodash "^4.17.15"
prop-types "^15.5.8"
react-fast-compare "^2.0.0"
- victory-core "^34.2.0"
- victory-shared-events "^34.2.0"
+ victory-bar "^34.3.8"
+ victory-core "^34.3.8"
victory-legend@^33.0.1, victory-legend@^33.1.7:
version "33.1.7"
@@ -13402,14 +13420,14 @@ victory-legend@^33.0.1, victory-legend@^33.1.7:
prop-types "^15.5.8"
victory-core "^33.1.7"
-victory-legend@^34.2.0:
- version "34.2.0"
- resolved "https://registry.yarnpkg.com/victory-legend/-/victory-legend-34.2.0.tgz#f8918a0cb08b3d8c1bfeb024db96aa3f7d33f9e3"
- integrity sha512-JXyEy+DtVmlCgKLHAzxAuXIzOaDWN0zA+Llj599RydCsJ2pTU01BlwkrotmEAh+ucg4LNGlBG4EeyefBK963Qw==
+victory-legend@^34.3.8:
+ version "34.3.8"
+ resolved "https://registry.yarnpkg.com/victory-legend/-/victory-legend-34.3.8.tgz#bed74657cf13cb02fc49fb4825893ab854df1d1a"
+ integrity sha512-FZRCK2rETIUIS9rSbLPBgvwTetKfnT/MwvOnTG+wD29fio7cHloGHHAhxbTbhFFcs9AQRKZVpgsOA+nlb4Byew==
dependencies:
lodash "^4.17.15"
prop-types "^15.5.8"
- victory-core "^34.2.0"
+ victory-core "^34.3.8"
victory-line@^33.1.7:
version "33.1.7"
@@ -13421,15 +13439,15 @@ victory-line@^33.1.7:
prop-types "^15.5.8"
victory-core "^33.1.7"
-victory-line@^34.2.0:
- version "34.2.0"
- resolved "https://registry.yarnpkg.com/victory-line/-/victory-line-34.2.0.tgz#9a62b090117730b7223145da7c685708c29c6c64"
- integrity sha512-qCUODkJE3a4Vud0xzGnKGwTSY8DY2mPScKvw92sVsvoih4nqa7QeYmVXzLvJxn1kFHDgdF/N9sY8ZHBKqk2TRQ==
+victory-line@^34.3.8:
+ version "34.3.8"
+ resolved "https://registry.yarnpkg.com/victory-line/-/victory-line-34.3.8.tgz#4b44b8a7166ce7192b7b5a3d75c9459250b7ee16"
+ integrity sha512-lxA+ncyusT230wHOzrY0SzFWQLHTHjJVA558AkrV9zB7lcUblxMoeUhaV2hgv9yWfhi6Dy/Ap3drH/Vnnz/n0Q==
dependencies:
d3-shape "^1.2.0"
lodash "^4.17.15"
prop-types "^15.5.8"
- victory-core "^34.2.0"
+ victory-core "^34.3.8"
victory-pie@^33.1.7:
version "33.1.7"
@@ -13441,15 +13459,15 @@ victory-pie@^33.1.7:
prop-types "^15.5.8"
victory-core "^33.1.7"
-victory-pie@^34.2.0:
- version "34.2.0"
- resolved "https://registry.yarnpkg.com/victory-pie/-/victory-pie-34.2.0.tgz#2cf11789640b8e84cfc8acddb2a3955b5fc0b360"
- integrity sha512-D+cpeQDOHMIAzgpsHuSs+kiUkreL9rf7pZ1GyujPJ41MSA4+WcoR08PsVxXLw1J40UpPpbrxldKW2E+ymobDFw==
+victory-pie@^34.3.8:
+ version "34.3.8"
+ resolved "https://registry.yarnpkg.com/victory-pie/-/victory-pie-34.3.8.tgz#d7dc9f34030abba8f2c81962cd394f384570264a"
+ integrity sha512-S23Y9cBsYEe/EWcVjz9Nfu/F905yjRWtVhoCEf6e+tJp3Fy7cUBQOyE1UiNKm9LEoUxrOSHhsmS4d23qIWuw6w==
dependencies:
d3-shape "^1.0.0"
lodash "^4.17.15"
prop-types "^15.5.8"
- victory-core "^34.2.0"
+ victory-core "^34.3.8"
victory-polar-axis@^33.1.7:
version "33.1.7"
@@ -13460,14 +13478,14 @@ victory-polar-axis@^33.1.7:
prop-types "^15.5.8"
victory-core "^33.1.7"
-victory-polar-axis@^34.2.0:
- version "34.2.0"
- resolved "https://registry.yarnpkg.com/victory-polar-axis/-/victory-polar-axis-34.2.0.tgz#c3e2a6081865b0c72560c58f58a65522a87097a7"
- integrity sha512-pVg2wBk8Ltg6mS0NXfEypz7JIGVcGABKAPdVl/lJV4krhSInf0pEWECSNqj1uQTo3M/mX/45yrIhGPQK0NtVFw==
+victory-polar-axis@^34.3.8:
+ version "34.3.8"
+ resolved "https://registry.yarnpkg.com/victory-polar-axis/-/victory-polar-axis-34.3.8.tgz#d6b8cf5686abafd89c311bbfebd87880e500826b"
+ integrity sha512-8ziguUnYzVlHL699AwVVUhaRSXdV1+zwi1ycE/ouW/9QyzC32NVsq+De2S8Sxf3PJ2wbOF51B6/kAWrppsNhGw==
dependencies:
lodash "^4.17.15"
prop-types "^15.5.8"
- victory-core "^34.2.0"
+ victory-core "^34.3.8"
victory-scatter@^33.1.7:
version "33.1.7"
@@ -13478,14 +13496,14 @@ victory-scatter@^33.1.7:
prop-types "^15.5.8"
victory-core "^33.1.7"
-victory-scatter@^34.2.0:
- version "34.2.0"
- resolved "https://registry.yarnpkg.com/victory-scatter/-/victory-scatter-34.2.0.tgz#736f7d57bd40c98ab1669ac6404030beff427646"
- integrity sha512-pxOLic67lBdGreVUHIgyM53zg34Jy7/wJYVLiz0x9w49ErMOrioxNv2BJMNiDtHR9mp8UKe4Z18ywfAgInexsw==
+victory-scatter@^34.3.8:
+ version "34.3.8"
+ resolved "https://registry.yarnpkg.com/victory-scatter/-/victory-scatter-34.3.8.tgz#0c7afe1ed8268c2d045717bddc593cd3c4b73092"
+ integrity sha512-xocPcCD1um6DhcB6h+3ENbXlesd1EzhwVdIuLHmvdM2t32UpVxH+kX9gv/rvtDRoIaZNpb8vlbu/jWJJDY8K/g==
dependencies:
lodash "^4.17.15"
prop-types "^15.5.8"
- victory-core "^34.2.0"
+ victory-core "^34.3.8"
victory-selection-container@^33.1.7:
version "33.1.7"
@@ -13496,14 +13514,14 @@ victory-selection-container@^33.1.7:
prop-types "^15.5.8"
victory-core "^33.1.7"
-victory-selection-container@^34.2.0:
- version "34.2.0"
- resolved "https://registry.yarnpkg.com/victory-selection-container/-/victory-selection-container-34.2.0.tgz#95844ad3631b888ff832a8310fd663ced5358f7b"
- integrity sha512-lgevAucMmlJdw6i8oYdDEVE8g46s/WaxcWtAFiH0GNCcJSKc6uwQyIealsMXORnaY3b9/JL+2ErgetvgwhlXJg==
+victory-selection-container@^34.3.8:
+ version "34.3.8"
+ resolved "https://registry.yarnpkg.com/victory-selection-container/-/victory-selection-container-34.3.8.tgz#b035271a1a3d2c0873d65e40b0053fa62539be01"
+ integrity sha512-Nb+EITn2REY8NtE29qlxv2ypM2fWrqVlhx8QYpeIFngii7VXeinudTF7bkDqL5XDurmce+P//WQ86nMtOLgGig==
dependencies:
lodash "^4.17.15"
prop-types "^15.5.8"
- victory-core "^34.2.0"
+ victory-core "^34.3.8"
victory-shared-events@^33.1.7:
version "33.1.7"
@@ -13515,15 +13533,15 @@ victory-shared-events@^33.1.7:
react-fast-compare "^2.0.0"
victory-core "^33.1.7"
-victory-shared-events@^34.2.0:
- version "34.2.0"
- resolved "https://registry.yarnpkg.com/victory-shared-events/-/victory-shared-events-34.2.0.tgz#024e6f43eb72cf1ce7479fbae328979fc9fad112"
- integrity sha512-G3gm8/Uo/FDrjVCPF3XVWkIKKUdNa9mKqrkxbe7/aCPrIarUWnVUGg7pqUJ/w9M5Y6Ch7kLMtT9x4AEEEGl94g==
+victory-shared-events@^34.3.9:
+ version "34.3.9"
+ resolved "https://registry.yarnpkg.com/victory-shared-events/-/victory-shared-events-34.3.9.tgz#3f42f86eacff56156ba30e0567fc928cf28dd08d"
+ integrity sha512-cW4/tI2VDB+R3LzD0ZtjRc1Bo5X5CCPIZ6hJ/8q9nAfyvitHdpPyL42kO5/o2v62ksSl0kR0Zlyn4eEonXKKpg==
dependencies:
lodash "^4.17.15"
prop-types "^15.5.8"
react-fast-compare "^2.0.0"
- victory-core "^34.2.0"
+ victory-core "^34.3.8"
victory-stack@^33.1.7:
version "33.1.7"
@@ -13535,16 +13553,16 @@ victory-stack@^33.1.7:
react-fast-compare "^2.0.0"
victory-core "^33.1.7"
-victory-stack@^34.2.0:
- version "34.2.0"
- resolved "https://registry.yarnpkg.com/victory-stack/-/victory-stack-34.2.0.tgz#a463363fde8773aab17c747ccc817c271e62e609"
- integrity sha512-LsKfqI1cC7ySL3UT1DKOjaroZ13d++IGK4sDIgSiTiMpyO00YPqlppqOX9GXwAlWTysYoUKOiigvUldKT7DqHQ==
+victory-stack@^34.3.9:
+ version "34.3.9"
+ resolved "https://registry.yarnpkg.com/victory-stack/-/victory-stack-34.3.9.tgz#9c0b360baf0da9ca1d57606d68c8c2d6581128c8"
+ integrity sha512-wTbEeYFOyG/i5o2YA5blJFXb/+arCEfuzxBTg44Yu2fOcd9MJs9amBwlOo+e94Dd+pwsQeMvkzhpRKYlzFXsdQ==
dependencies:
lodash "^4.17.15"
prop-types "^15.5.8"
react-fast-compare "^2.0.0"
- victory-core "^34.2.0"
- victory-shared-events "^34.2.0"
+ victory-core "^34.3.8"
+ victory-shared-events "^34.3.9"
victory-tooltip@^33.1.7:
version "33.1.7"
@@ -13555,14 +13573,14 @@ victory-tooltip@^33.1.7:
prop-types "^15.5.8"
victory-core "^33.1.7"
-victory-tooltip@^34.2.0:
- version "34.2.0"
- resolved "https://registry.yarnpkg.com/victory-tooltip/-/victory-tooltip-34.2.0.tgz#878b06e48faf95a0d335a5dbeacddb1c488cabfe"
- integrity sha512-OKEqfZBuyer2ZgZ+F4a4dsY6UszBkiWOfqMx+DpTgWKkj3YKkMtEH6L9h0hOIzPOrw2q6bvEVqHmMh5nrtMhxQ==
+victory-tooltip@^34.3.8:
+ version "34.3.8"
+ resolved "https://registry.yarnpkg.com/victory-tooltip/-/victory-tooltip-34.3.8.tgz#fb5c8d249f9d61cad089e0646ea7ea564385c864"
+ integrity sha512-iJ/VoDS7DphDHnYZqcfvTY/q0XMvOjU3DjwVE/A9MaQAbu+xmdYSgIn7BG5YIjSpuUglzi7h3xmK248m0RnyCw==
dependencies:
lodash "^4.17.15"
prop-types "^15.5.8"
- victory-core "^34.2.0"
+ victory-core "^34.3.8"
victory-voronoi-container@^33.1.7:
version "33.1.7"
@@ -13575,17 +13593,17 @@ victory-voronoi-container@^33.1.7:
victory-core "^33.1.7"
victory-tooltip "^33.1.7"
-victory-voronoi-container@^34.2.0:
- version "34.2.0"
- resolved "https://registry.yarnpkg.com/victory-voronoi-container/-/victory-voronoi-container-34.2.0.tgz#53e86ceeee078d8430023b81d7893dfe4a1b6d74"
- integrity sha512-K3L/KIkWwA87yhrHD3TkhFVQqtRy/B5mKS5y+XMEjutknlOKywCWUhiB8U/uXd5LL1B3IIae8lb5KsJ8xLXMyQ==
+victory-voronoi-container@^34.3.8:
+ version "34.3.8"
+ resolved "https://registry.yarnpkg.com/victory-voronoi-container/-/victory-voronoi-container-34.3.8.tgz#a03124be87f34cf07139a2d9c53cc6a48457b41e"
+ integrity sha512-wx46Mf3BEprtuQ2CRod6KcO1MHm0wxOEn/NO9qzOi3GnnD+CVsVfvIG6gFTDbjoo+fsKE7fW8AWYWo8oqx9fxg==
dependencies:
delaunay-find "0.0.5"
lodash "^4.17.15"
prop-types "^15.5.8"
react-fast-compare "^2.0.0"
- victory-core "^34.2.0"
- victory-tooltip "^34.2.0"
+ victory-core "^34.3.8"
+ victory-tooltip "^34.3.8"
victory-voronoi@^33.1.7:
version "33.1.7"
@@ -13597,15 +13615,15 @@ victory-voronoi@^33.1.7:
prop-types "^15.5.8"
victory-core "^33.1.7"
-victory-voronoi@^34.2.0:
- version "34.2.0"
- resolved "https://registry.yarnpkg.com/victory-voronoi/-/victory-voronoi-34.2.0.tgz#b89ae6d3639db2b64d532f17ef7b9bbc8a48bf59"
- integrity sha512-SOdtLXsPTK7toX07OJxKHV6tu0g/BW/eNTc1Gxxsy2stH6iC1Axck5BBpfXmIfhn/Eu0xWlgzkskcUSJO1bIWw==
+victory-voronoi@^34.3.8:
+ version "34.3.8"
+ resolved "https://registry.yarnpkg.com/victory-voronoi/-/victory-voronoi-34.3.8.tgz#bc35fa299adcb9c630f3c955514ec8e3cb3d1ab6"
+ integrity sha512-xXn3iYk9SPm8eRofU+tyk6dWPt7hwm29068M1l6AHGfjwI1Z/wLBc+VrlIPiqswBtLc3umxvmxurXQsqH3k8NQ==
dependencies:
d3-voronoi "^1.1.2"
lodash "^4.17.15"
prop-types "^15.5.8"
- victory-core "^34.2.0"
+ victory-core "^34.3.8"
victory-zoom-container@^33.1.7:
version "33.1.7"
@@ -13616,14 +13634,14 @@ victory-zoom-container@^33.1.7:
prop-types "^15.5.8"
victory-core "^33.1.7"
-victory-zoom-container@^34.2.0:
- version "34.2.0"
- resolved "https://registry.yarnpkg.com/victory-zoom-container/-/victory-zoom-container-34.2.0.tgz#20f56c6ec7f1104c7a8c012bec5536d1e61edcea"
- integrity sha512-AGJfjCuLd3t9d9gBwupCCoxL6lf+TxqKksbUS6Y1ZEmcZQmiaCCKr2VHVP22sBokeRF+H2Fpd3GpNpqrYSb6UA==
+victory-zoom-container@^34.3.8:
+ version "34.3.8"
+ resolved "https://registry.yarnpkg.com/victory-zoom-container/-/victory-zoom-container-34.3.8.tgz#716613594ed6139bd448f6cefd6b64e2bc317a82"
+ integrity sha512-U39CScIXcOVgQqKqgboBTeGxLTkrBRxKi991HGEFI9fD22aNj4bCs+TR0k/qeAz6oi+oDkLvxI74D+7uSNQD1w==
dependencies:
lodash "^4.17.15"
prop-types "^15.5.8"
- victory-core "^34.2.0"
+ victory-core "^34.3.8"
victory@^33.0.5:
version "33.1.7"
@@ -13656,36 +13674,37 @@ victory@^33.0.5:
victory-voronoi-container "^33.1.7"
victory-zoom-container "^33.1.7"
-victory@^34.2.0:
- version "34.2.0"
- resolved "https://registry.yarnpkg.com/victory/-/victory-34.2.0.tgz#2b1fc5875dcbc36005318f4dd09a6edceaf585e8"
- integrity sha512-dFmRoYkUlC7/ZwpclrWIxVZsM9BZEtjLg2d5OWXittTpJPC/PTIVOcObkWLwxVp9auMOoN+d/3ayHoSORbalRQ==
- dependencies:
- victory-area "^34.2.0"
- victory-axis "^34.2.0"
- victory-bar "^34.2.0"
- victory-box-plot "^34.2.0"
- victory-brush-container "^34.2.0"
- victory-brush-line "^34.2.0"
- victory-candlestick "^34.2.0"
- victory-chart "^34.2.0"
- victory-core "^34.2.0"
- victory-create-container "^34.2.0"
- victory-cursor-container "^34.2.0"
- victory-errorbar "^34.2.0"
- victory-group "^34.2.0"
- victory-legend "^34.2.0"
- victory-line "^34.2.0"
- victory-pie "^34.2.0"
- victory-polar-axis "^34.2.0"
- victory-scatter "^34.2.0"
- victory-selection-container "^34.2.0"
- victory-shared-events "^34.2.0"
- victory-stack "^34.2.0"
- victory-tooltip "^34.2.0"
- victory-voronoi "^34.2.0"
- victory-voronoi-container "^34.2.0"
- victory-zoom-container "^34.2.0"
+victory@^34.3.11:
+ version "34.3.11"
+ resolved "https://registry.yarnpkg.com/victory/-/victory-34.3.11.tgz#16fb757aed1f696f53a5e088d0e8fc0b24ce3acc"
+ integrity sha512-HDzXL4pioL8cMEkNNMBvhyW19jVE+p1pkWEACvYlGhdTXsf6b/8fN2+cCl2NiQG234KeAqPKpSkcHcdkhRQxRw==
+ dependencies:
+ victory-area "^34.3.8"
+ victory-axis "^34.3.8"
+ victory-bar "^34.3.8"
+ victory-box-plot "^34.3.8"
+ victory-brush-container "^34.3.8"
+ victory-brush-line "^34.3.8"
+ victory-candlestick "^34.3.8"
+ victory-chart "^34.3.11"
+ victory-core "^34.3.8"
+ victory-create-container "^34.3.10"
+ victory-cursor-container "^34.3.10"
+ victory-errorbar "^34.3.8"
+ victory-group "^34.3.10"
+ victory-histogram "^34.3.8"
+ victory-legend "^34.3.8"
+ victory-line "^34.3.8"
+ victory-pie "^34.3.8"
+ victory-polar-axis "^34.3.8"
+ victory-scatter "^34.3.8"
+ victory-selection-container "^34.3.8"
+ victory-shared-events "^34.3.9"
+ victory-stack "^34.3.9"
+ victory-tooltip "^34.3.8"
+ victory-voronoi "^34.3.8"
+ victory-voronoi-container "^34.3.8"
+ victory-zoom-container "^34.3.8"
vm-browserify@^1.0.1:
version "1.1.2"
From 19e83875e46ea0ac73cc57989a3353f95c2f701b Mon Sep 17 00:00:00 2001
From: CD Cabrera
Date: Thu, 11 Jun 2020 21:16:17 -0400
Subject: [PATCH 05/16] fix(graphCardHelpers): yAxisTickFormat, use
NumberFormat (#315)
* graphCardHelpers, c3GraphCardHelpers, use Intl.NumberFormat
* tests, expand tick format checks
---
package.json | 1 -
.../c3GraphCard/c3GraphCardHelpers.js | 7 +-
.../c3GraphCardHelpers.test.js.snap | 174 +++++++++++++++---
.../tests/c3GraphCardHelpers.test.js | 10 +-
.../graphCardHelpers.test.js.snap | 174 +++++++++++++++---
.../__tests__/graphCardHelpers.test.js | 10 +-
src/components/graphCard/graphCardHelpers.js | 7 +-
.../__tests__/__snapshots__/i18n.test.js.snap | 6 +-
yarn.lock | 12 --
9 files changed, 317 insertions(+), 84 deletions(-)
diff --git a/package.json b/package.json
index 6dae20f32..7267e04bf 100644
--- a/package.json
+++ b/package.json
@@ -95,7 +95,6 @@
"lodash": "^4.17.15",
"moment": "^2.26.0",
"node-sass": "^4.14.1",
- "numbro": "^2.3.0",
"prop-types": "^15.7.2",
"react": "^16.13.1",
"react-dom": "^16.13.1",
diff --git a/src/components/c3GraphCard/c3GraphCardHelpers.js b/src/components/c3GraphCard/c3GraphCardHelpers.js
index 1297cb697..e38d09167 100644
--- a/src/components/c3GraphCard/c3GraphCardHelpers.js
+++ b/src/components/c3GraphCard/c3GraphCardHelpers.js
@@ -1,5 +1,4 @@
import moment from 'moment';
-import numbro from 'numbro';
import { chart_color_green_300 as chartColorGreenDark } from '@patternfly/react-tokens';
import { translate } from '../i18n/i18n';
import { RHSM_API_QUERY_GRANULARITY_TYPES as GRANULARITY_TYPES } from '../../types/rhsmApiTypes';
@@ -90,9 +89,13 @@ const xAxisTickFormat = ({ date, granularity, tick, previousDate }) => {
*
* @param {object} params
* @param {number|string} params.tick
+ * @param {string} params.locale
* @returns {string}
*/
-const yAxisTickFormat = ({ tick }) => numbro(tick).format({ average: true, mantissa: 1, optionalMantissa: true });
+const yAxisTickFormat = ({ tick, locale }) =>
+ new Intl.NumberFormat(locale, { maximumFractionDigits: 1, notation: 'compact', compactDisplay: 'short' }).format(
+ tick
+ );
/**
* Convert data into a C3 configuration object.
diff --git a/src/components/c3GraphCard/tests/__snapshots__/c3GraphCardHelpers.test.js.snap b/src/components/c3GraphCard/tests/__snapshots__/c3GraphCardHelpers.test.js.snap
index 2227a70b7..d101cff7b 100644
--- a/src/components/c3GraphCard/tests/__snapshots__/c3GraphCardHelpers.test.js.snap
+++ b/src/components/c3GraphCard/tests/__snapshots__/c3GraphCardHelpers.test.js.snap
@@ -232,35 +232,157 @@ Object {
"1": "1",
"10": "10",
"100": "100",
- "1000": "1k",
- "10000": "10k",
- "100000": "100k",
- "1000000": "1m",
- "10000000": "10m",
- "100000000": "100m",
- "1000000000": "1b",
- "10000000000": "10b",
+ "1000": "1K",
+ "10000": "10K",
+ "100000": "100K",
+ "1000000": "1M",
+ "10000000": "10M",
+ "100000000": "100M",
+ "1000000000": "1B",
+ "10000000000": "10B",
+ "100000000000": "100B",
+ "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",
+ "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",
"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",
+ "1300": "1.3K",
+ "13000": "13K",
+ "130000": "130K",
+ "1300000": "1.3M",
+ "13000000": "13M",
+ "130000000": "130M",
+ "1300000000": "1.3B",
+ "13000000000": "13B",
+ "130000000000": "130B",
+ "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",
"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",
+ "1500": "1.5K",
+ "15000": "15K",
+ "150000": "150K",
+ "1500000": "1.5M",
+ "15000000": "15M",
+ "150000000": "150M",
+ "1500000000": "1.5B",
+ "15000000000": "15B",
+ "150000000000": "150B",
+ "2": "2",
+ "20": "20",
+ "200": "200",
+ "2000": "2K",
+ "20000": "20K",
+ "200000": "200K",
+ "2000000": "2M",
+ "20000000": "20M",
+ "200000000": "200M",
+ "2000000000": "2B",
+ "20000000000": "20B",
+ "3": "3",
+ "30": "30",
+ "300": "300",
+ "3000": "3K",
+ "30000": "30K",
+ "300000": "300K",
+ "3000000": "3M",
+ "30000000": "30M",
+ "300000000": "300M",
+ "3000000000": "3B",
+ "30000000000": "30B",
+ "4": "4",
+ "40": "40",
+ "400": "400",
+ "4000": "4K",
+ "40000": "40K",
+ "400000": "400K",
+ "4000000": "4M",
+ "40000000": "40M",
+ "400000000": "400M",
+ "4000000000": "4B",
+ "40000000000": "40B",
+ "5": "5",
+ "50": "50",
+ "500": "500",
+ "5000": "5K",
+ "50000": "50K",
+ "500000": "500K",
+ "5000000": "5M",
+ "50000000": "50M",
+ "500000000": "500M",
+ "5000000000": "5B",
+ "50000000000": "50B",
+ "6": "6",
+ "60": "60",
+ "600": "600",
+ "6000": "6K",
+ "60000": "60K",
+ "600000": "600K",
+ "6000000": "6M",
+ "60000000": "60M",
+ "600000000": "600M",
+ "6000000000": "6B",
+ "60000000000": "60B",
+ "7": "7",
+ "70": "70",
+ "700": "700",
+ "7000": "7K",
+ "70000": "70K",
+ "700000": "700K",
+ "7000000": "7M",
+ "70000000": "70M",
+ "700000000": "700M",
+ "7000000000": "7B",
+ "70000000000": "70B",
+ "8": "8",
+ "80": "80",
+ "800": "800",
+ "8000": "8K",
+ "80000": "80K",
+ "800000": "800K",
+ "8000000": "8M",
+ "80000000": "80M",
+ "800000000": "800M",
+ "8000000000": "8B",
+ "80000000000": "80B",
+ "9": "9",
+ "90": "90",
+ "900": "900",
+ "9000": "9K",
+ "90000": "90K",
+ "900000": "900K",
+ "9000000": "9M",
+ "90000000": "90M",
+ "900000000": "900M",
+ "9000000000": "9B",
+ "90000000000": "90B",
}
`;
diff --git a/src/components/c3GraphCard/tests/c3GraphCardHelpers.test.js b/src/components/c3GraphCard/tests/c3GraphCardHelpers.test.js
index ddde9cb6f..b8dbb81d7 100644
--- a/src/components/c3GraphCard/tests/c3GraphCardHelpers.test.js
+++ b/src/components/c3GraphCard/tests/c3GraphCardHelpers.test.js
@@ -102,12 +102,10 @@ describe('C3GraphCardHelpers', () => {
for (let i = 0; i < 11; i++) {
const multiplier = Math.pow(10, i);
- const thirteenMultiplier = 13 * multiplier;
- const fifteenMultiplier = 15 * multiplier;
-
- ticks[multiplier] = yAxisTickFormat({ tick: multiplier });
- ticks[thirteenMultiplier] = yAxisTickFormat({ tick: thirteenMultiplier });
- ticks[fifteenMultiplier] = yAxisTickFormat({ tick: fifteenMultiplier });
+ for (let k = 1; k < 16; k++) {
+ const incrementMultiplier = k * multiplier;
+ ticks[incrementMultiplier] = yAxisTickFormat({ tick: incrementMultiplier });
+ }
}
expect(ticks).toMatchSnapshot('y axis tick values');
diff --git a/src/components/graphCard/__tests__/__snapshots__/graphCardHelpers.test.js.snap b/src/components/graphCard/__tests__/__snapshots__/graphCardHelpers.test.js.snap
index 6a10906e2..d3e6452fc 100644
--- a/src/components/graphCard/__tests__/__snapshots__/graphCardHelpers.test.js.snap
+++ b/src/components/graphCard/__tests__/__snapshots__/graphCardHelpers.test.js.snap
@@ -126,35 +126,157 @@ Object {
"1": "1",
"10": "10",
"100": "100",
- "1000": "1k",
- "10000": "10k",
- "100000": "100k",
- "1000000": "1m",
- "10000000": "10m",
- "100000000": "100m",
- "1000000000": "1b",
- "10000000000": "10b",
+ "1000": "1K",
+ "10000": "10K",
+ "100000": "100K",
+ "1000000": "1M",
+ "10000000": "10M",
+ "100000000": "100M",
+ "1000000000": "1B",
+ "10000000000": "10B",
+ "100000000000": "100B",
+ "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",
+ "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",
"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",
+ "1300": "1.3K",
+ "13000": "13K",
+ "130000": "130K",
+ "1300000": "1.3M",
+ "13000000": "13M",
+ "130000000": "130M",
+ "1300000000": "1.3B",
+ "13000000000": "13B",
+ "130000000000": "130B",
+ "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",
"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",
+ "1500": "1.5K",
+ "15000": "15K",
+ "150000": "150K",
+ "1500000": "1.5M",
+ "15000000": "15M",
+ "150000000": "150M",
+ "1500000000": "1.5B",
+ "15000000000": "15B",
+ "150000000000": "150B",
+ "2": "2",
+ "20": "20",
+ "200": "200",
+ "2000": "2K",
+ "20000": "20K",
+ "200000": "200K",
+ "2000000": "2M",
+ "20000000": "20M",
+ "200000000": "200M",
+ "2000000000": "2B",
+ "20000000000": "20B",
+ "3": "3",
+ "30": "30",
+ "300": "300",
+ "3000": "3K",
+ "30000": "30K",
+ "300000": "300K",
+ "3000000": "3M",
+ "30000000": "30M",
+ "300000000": "300M",
+ "3000000000": "3B",
+ "30000000000": "30B",
+ "4": "4",
+ "40": "40",
+ "400": "400",
+ "4000": "4K",
+ "40000": "40K",
+ "400000": "400K",
+ "4000000": "4M",
+ "40000000": "40M",
+ "400000000": "400M",
+ "4000000000": "4B",
+ "40000000000": "40B",
+ "5": "5",
+ "50": "50",
+ "500": "500",
+ "5000": "5K",
+ "50000": "50K",
+ "500000": "500K",
+ "5000000": "5M",
+ "50000000": "50M",
+ "500000000": "500M",
+ "5000000000": "5B",
+ "50000000000": "50B",
+ "6": "6",
+ "60": "60",
+ "600": "600",
+ "6000": "6K",
+ "60000": "60K",
+ "600000": "600K",
+ "6000000": "6M",
+ "60000000": "60M",
+ "600000000": "600M",
+ "6000000000": "6B",
+ "60000000000": "60B",
+ "7": "7",
+ "70": "70",
+ "700": "700",
+ "7000": "7K",
+ "70000": "70K",
+ "700000": "700K",
+ "7000000": "7M",
+ "70000000": "70M",
+ "700000000": "700M",
+ "7000000000": "7B",
+ "70000000000": "70B",
+ "8": "8",
+ "80": "80",
+ "800": "800",
+ "8000": "8K",
+ "80000": "80K",
+ "800000": "800K",
+ "8000000": "8M",
+ "80000000": "80M",
+ "800000000": "800M",
+ "8000000000": "8B",
+ "80000000000": "80B",
+ "9": "9",
+ "90": "90",
+ "900": "900",
+ "9000": "9K",
+ "90000": "90K",
+ "900000": "900K",
+ "9000000": "9M",
+ "90000000": "90M",
+ "900000000": "900M",
+ "9000000000": "9B",
+ "90000000000": "90B",
}
`;
diff --git a/src/components/graphCard/__tests__/graphCardHelpers.test.js b/src/components/graphCard/__tests__/graphCardHelpers.test.js
index e008f121f..781e51645 100644
--- a/src/components/graphCard/__tests__/graphCardHelpers.test.js
+++ b/src/components/graphCard/__tests__/graphCardHelpers.test.js
@@ -87,12 +87,10 @@ describe('GraphCardHelpers', () => {
for (let i = 0; i < 11; i++) {
const multiplier = Math.pow(10, i);
- const thirteenMultiplier = 13 * multiplier;
- const fifteenMultiplier = 15 * multiplier;
-
- ticks[multiplier] = yAxisTickFormat({ tick: multiplier });
- ticks[thirteenMultiplier] = yAxisTickFormat({ tick: thirteenMultiplier });
- ticks[fifteenMultiplier] = yAxisTickFormat({ tick: fifteenMultiplier });
+ for (let k = 1; k < 16; k++) {
+ const incrementMultiplier = k * multiplier;
+ ticks[incrementMultiplier] = yAxisTickFormat({ tick: incrementMultiplier });
+ }
}
expect(ticks).toMatchSnapshot('y axis tick values');
diff --git a/src/components/graphCard/graphCardHelpers.js b/src/components/graphCard/graphCardHelpers.js
index cf43b5695..fe5018291 100644
--- a/src/components/graphCard/graphCardHelpers.js
+++ b/src/components/graphCard/graphCardHelpers.js
@@ -1,5 +1,4 @@
import moment from 'moment';
-import numbro from 'numbro';
import { RHSM_API_QUERY_GRANULARITY_TYPES as GRANULARITY_TYPES } from '../../types/rhsmApiTypes';
import { dateHelpers } from '../../common/dateHelpers';
@@ -107,9 +106,13 @@ const xAxisTickFormat = ({ date, granularity, tick, previousDate }) => {
*
* @param {object} params
* @param {number|string} params.tick
+ * @param {string} params.locale
* @returns {string}
*/
-const yAxisTickFormat = ({ tick }) => numbro(tick).format({ average: true, mantissa: 1, optionalMantissa: true });
+const yAxisTickFormat = ({ tick, locale }) =>
+ new Intl.NumberFormat(locale, { maximumFractionDigits: 1, notation: 'compact', compactDisplay: 'short' }).format(
+ tick
+ );
const graphCardHelpers = {
getChartXAxisLabelIncrement,
diff --git a/src/components/i18n/__tests__/__snapshots__/i18n.test.js.snap b/src/components/i18n/__tests__/__snapshots__/i18n.test.js.snap
index 43caa635a..caf72dba4 100644
--- a/src/components/i18n/__tests__/__snapshots__/i18n.test.js.snap
+++ b/src/components/i18n/__tests__/__snapshots__/i18n.test.js.snap
@@ -48,7 +48,7 @@ msgstr \\"\\"
msgid \\"curiosity-graph.dropdownWeekly\\"
msgstr \\"\\"
-#: src/components/c3GraphCard/c3GraphCardHelpers.js:176
+#: src/components/c3GraphCard/c3GraphCardHelpers.js:179
#: src/components/graphCard/graphCardChartTooltip.js:36
msgid \\"curiosity-graph.infiniteThresholdLabel\\"
msgstr \\"\\"
@@ -57,8 +57,8 @@ msgstr \\"\\"
msgid \\"curiosity-graph.noDataErrorLabel\\"
msgstr \\"\\"
-#: src/components/c3GraphCard/c3GraphCardHelpers.js:177
#: src/components/c3GraphCard/c3GraphCardHelpers.js:180
+#: src/components/c3GraphCard/c3GraphCardHelpers.js:183
#: src/components/graphCard/graphCardChartTooltip.js:37
#: src/components/graphCard/graphCardChartTooltip.js:43
msgid \\"curiosity-graph.noDataLabel\\"
@@ -74,7 +74,7 @@ msgid \\"curiosity-graph.socketsHeading\\"
msgstr \\"\\"
#: src/components/c3GraphCard/c3GraphCard.js:110
-#: src/components/c3GraphCard/c3GraphCardHelpers.js:133
+#: src/components/c3GraphCard/c3GraphCardHelpers.js:136
#: src/components/graphCard/graphCardChartLegend.js:130
#: src/components/graphCard/graphCardChartTooltip.js:39
msgid \\"curiosity-graph.thresholdLabel\\"
diff --git a/yarn.lock b/yarn.lock
index 83c46f43c..faa32ff02 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -2867,11 +2867,6 @@ big.js@^5.2.2:
resolved "https://registry.yarnpkg.com/big.js/-/big.js-5.2.2.tgz#65f0af382f578bcdc742bd9c281e9cb2d7768328"
integrity sha512-vyL2OymJxmarO8gxMr0mhChsO9QGwhynfuu4+MHTAW6czfq9humCB7rKpUjDd9YUiDPU4mzpyupFSvOClAwbmQ==
-bignumber.js@^8.1.1:
- version "8.1.1"
- resolved "https://registry.yarnpkg.com/bignumber.js/-/bignumber.js-8.1.1.tgz#4b072ae5aea9c20f6730e4e5d529df1271c4d885"
- integrity sha512-QD46ppGintwPGuL1KqmwhR0O+N2cZUg8JG/VzwI2e28sM9TqHjQB10lI4QAaMHVbLzwVLLAwEglpKPViWX+5NQ==
-
binary-extensions@^1.0.0:
version "1.13.1"
resolved "https://registry.yarnpkg.com/binary-extensions/-/binary-extensions-1.13.1.tgz#598afe54755b2868a5330d2aff9d4ebb53209b65"
@@ -9163,13 +9158,6 @@ number-is-nan@^1.0.0:
resolved "https://registry.yarnpkg.com/number-is-nan/-/number-is-nan-1.0.1.tgz#097b602b53422a522c1afb8790318336941a011d"
integrity sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=
-numbro@^2.3.0:
- version "2.3.0"
- resolved "https://registry.yarnpkg.com/numbro/-/numbro-2.3.0.tgz#a2cdcf164346833fded1128dfc5056a882b3097a"
- integrity sha512-KGa4qVveFGC0HgKaJnmKYqyC9CX7jQONxEfREVwc/8UwTJtcEt60F8j/NCKgZH/IFW/Z9uibhCDqpJiRxuXdsA==
- dependencies:
- bignumber.js "^8.1.1"
-
nwsapi@^2.0.7, nwsapi@^2.1.3:
version "2.2.0"
resolved "https://registry.yarnpkg.com/nwsapi/-/nwsapi-2.2.0.tgz#204879a9e3d068ff2a55139c2c772780681a38b7"
From 17e5fdbf45c9bcf6db72cb6996f3fb28e9636f6a Mon Sep 17 00:00:00 2001
From: CD Cabrera
Date: Tue, 16 Jun 2020 13:43:42 -0400
Subject: [PATCH 06/16] fix(build): issues/321 commit lint, rebase (#322)
* build, commit lint checks adjusted for rebase
---
tests/commit.test.js | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/tests/commit.test.js b/tests/commit.test.js
index 1627cc65b..a6638ca5f 100644
--- a/tests/commit.test.js
+++ b/tests/commit.test.js
@@ -1,5 +1,9 @@
const { execSync } = require('child_process');
+/**
+ * ToDo: evaluate moving this check to Github actions
+ * And evaluate removing the `grep "+"` filter to check for rebase
+ */
/**
* See CONTRIBUTING.md for commit messaging guidelines
*
@@ -24,7 +28,7 @@ describe('Commit Message', () => {
let stdout = '';
try {
- stdout = execSync(`git cherry -v master`);
+ stdout = execSync(`git cherry -v master | grep "+"`);
} catch (e) {
console.log(`Skipping commit check... ${e.message}`);
}
From 577adb9942120ed571ba5f14740e450e759bf9a4 Mon Sep 17 00:00:00 2001
From: CD Cabrera
Date: Tue, 16 Jun 2020 10:56:48 -0400
Subject: [PATCH 07/16] fix(graphCardHelpers): issues/317 yAxisTickFormat
locale (#319)
* helpers, expose default locale, description
* graphCardHelpers, apply helper default locale
* userServices, apply helper default locale
---
.../__tests__/__snapshots__/helpers.test.js.snap | 6 ++++++
src/common/helpers.js | 16 ++++++++++++++++
src/components/graphCard/graphCardHelpers.js | 4 ++--
src/services/userServices.js | 4 ++--
4 files changed, 26 insertions(+), 4 deletions(-)
diff --git a/src/common/__tests__/__snapshots__/helpers.test.js.snap b/src/common/__tests__/__snapshots__/helpers.test.js.snap
index e2823fccd..b3df5cbb6 100644
--- a/src/common/__tests__/__snapshots__/helpers.test.js.snap
+++ b/src/common/__tests__/__snapshots__/helpers.test.js.snap
@@ -14,6 +14,8 @@ Object {
"UI_DISPLAY_CONFIG_NAME": "Subscription Watch",
"UI_DISPLAY_NAME": "Subscription Watch",
"UI_DISPLAY_START_NAME": "Subscription Watch",
+ "UI_LOCALE_DEFAULT": "en-US",
+ "UI_LOCALE_DEFAULT_DESC": "English",
"UI_LOGGER_ID": "curiosity",
"UI_NAME": "subscriptions",
"UI_PATH": "/",
@@ -43,6 +45,8 @@ Object {
"UI_DISPLAY_CONFIG_NAME": "Subscription Watch",
"UI_DISPLAY_NAME": "Subscription Watch",
"UI_DISPLAY_START_NAME": "Subscription Watch",
+ "UI_LOCALE_DEFAULT": "en-US",
+ "UI_LOCALE_DEFAULT_DESC": "English",
"UI_LOGGER_ID": "curiosity",
"UI_NAME": "subscriptions",
"UI_PATH": "/",
@@ -72,6 +76,8 @@ Object {
"UI_DISPLAY_CONFIG_NAME": "Subscription Watch",
"UI_DISPLAY_NAME": "Subscription Watch",
"UI_DISPLAY_START_NAME": "Subscription Watch",
+ "UI_LOCALE_DEFAULT": "en-US",
+ "UI_LOCALE_DEFAULT_DESC": "English",
"UI_LOGGER_ID": "curiosity",
"UI_NAME": "subscriptions",
"UI_PATH": "/",
diff --git a/src/common/helpers.js b/src/common/helpers.js
index d8d87f20c..bbbad1daa 100644
--- a/src/common/helpers.js
+++ b/src/common/helpers.js
@@ -138,6 +138,20 @@ const UI_DISPLAY_CONFIG_NAME = process.env.REACT_APP_UI_DISPLAY_CONFIG_NAME;
*/
const UI_DISPLAY_START_NAME = process.env.REACT_APP_UI_DISPLAY_START_NAME;
+/**
+ * UI locale default.
+ *
+ * @type {string}
+ */
+const UI_LOCALE_DEFAULT = process.env.REACT_APP_CONFIG_SERVICE_LOCALES_DEFAULT_LNG;
+
+/**
+ * UI locale default description.
+ *
+ * @type {string}
+ */
+const UI_LOCALE_DEFAULT_DESC = process.env.REACT_APP_CONFIG_SERVICE_LOCALES_DEFAULT_LNG_DESC;
+
/**
* UI state logging name/id.
* See dotenv config files for updating.
@@ -212,6 +226,8 @@ const helpers = {
UI_DISPLAY_NAME,
UI_DISPLAY_CONFIG_NAME,
UI_DISPLAY_START_NAME,
+ UI_LOCALE_DEFAULT,
+ UI_LOCALE_DEFAULT_DESC,
UI_LOGGER_ID,
UI_NAME,
UI_PATH,
diff --git a/src/components/graphCard/graphCardHelpers.js b/src/components/graphCard/graphCardHelpers.js
index fe5018291..3b504cb3c 100644
--- a/src/components/graphCard/graphCardHelpers.js
+++ b/src/components/graphCard/graphCardHelpers.js
@@ -1,6 +1,6 @@
import moment from 'moment';
import { RHSM_API_QUERY_GRANULARITY_TYPES as GRANULARITY_TYPES } from '../../types/rhsmApiTypes';
-import { dateHelpers } from '../../common/dateHelpers';
+import { dateHelpers, helpers } from '../../common';
/**
* Returns x axis ticks/intervals array for the xAxisTickInterval
@@ -109,7 +109,7 @@ const xAxisTickFormat = ({ date, granularity, tick, previousDate }) => {
* @param {string} params.locale
* @returns {string}
*/
-const yAxisTickFormat = ({ tick, locale }) =>
+const yAxisTickFormat = ({ tick, locale = helpers.UI_LOCALE_DEFAULT }) =>
new Intl.NumberFormat(locale, { maximumFractionDigits: 1, notation: 'compact', compactDisplay: 'short' }).format(
tick
);
diff --git a/src/services/userServices.js b/src/services/userServices.js
index f262a5b93..9db0c48ce 100644
--- a/src/services/userServices.js
+++ b/src/services/userServices.js
@@ -55,8 +55,8 @@ const getLocaleFromCookie = () => {
*/
const getLocale = () => {
const defaultLocale = {
- value: process.env.REACT_APP_CONFIG_SERVICE_LOCALES_DEFAULT_LNG,
- key: process.env.REACT_APP_CONFIG_SERVICE_LOCALES_DEFAULT_LNG_DESC
+ value: helpers.UI_LOCALE_DEFAULT,
+ key: helpers.UI_LOCALE_DEFAULT_DESC
};
return new Promise(resolve =>
From 475ee2058a33e766b0bf27e6ee80f7bf4a393bae Mon Sep 17 00:00:00 2001
From: CD Cabrera
Date: Wed, 17 Jun 2020 14:53:09 -0400
Subject: [PATCH 08/16] fix(graphCardHelpers): issues/317
yAxisTickFormatFallback (#323)
* graphCardHelpers, apply abbreviation fallback
---
.../graphCardHelpers.test.js.snap | 217 ++++++++++++++++++
.../__tests__/graphCardHelpers.test.js | 24 +-
src/components/graphCard/graphCardHelpers.js | 60 ++++-
3 files changed, 285 insertions(+), 16 deletions(-)
diff --git a/src/components/graphCard/__tests__/__snapshots__/graphCardHelpers.test.js.snap b/src/components/graphCard/__tests__/__snapshots__/graphCardHelpers.test.js.snap
index d3e6452fc..a90fc6937 100644
--- a/src/components/graphCard/__tests__/__snapshots__/graphCardHelpers.test.js.snap
+++ b/src/components/graphCard/__tests__/__snapshots__/graphCardHelpers.test.js.snap
@@ -24,6 +24,7 @@ Object {
"getTooltipDate": [Function],
"xAxisTickFormat": [Function],
"yAxisTickFormat": [Function],
+ "yAxisTickFormatFallback": [Function],
}
`;
@@ -135,6 +136,8 @@ Object {
"1000000000": "1B",
"10000000000": "10B",
"100000000000": "100B",
+ "1000000000000": "1T",
+ "10000000000000": "10T",
"11": "11",
"110": "110",
"1100": "1.1K",
@@ -146,6 +149,8 @@ Object {
"1100000000": "1.1B",
"11000000000": "11B",
"110000000000": "110B",
+ "1100000000000": "1.1T",
+ "11000000000000": "11T",
"12": "12",
"120": "120",
"1200": "1.2K",
@@ -157,6 +162,8 @@ Object {
"1200000000": "1.2B",
"12000000000": "12B",
"120000000000": "120B",
+ "1200000000000": "1.2T",
+ "12000000000000": "12T",
"13": "13",
"130": "130",
"1300": "1.3K",
@@ -168,6 +175,8 @@ Object {
"1300000000": "1.3B",
"13000000000": "13B",
"130000000000": "130B",
+ "1300000000000": "1.3T",
+ "13000000000000": "13T",
"14": "14",
"140": "140",
"1400": "1.4K",
@@ -179,6 +188,8 @@ Object {
"1400000000": "1.4B",
"14000000000": "14B",
"140000000000": "140B",
+ "1400000000000": "1.4T",
+ "14000000000000": "14T",
"15": "15",
"150": "150",
"1500": "1.5K",
@@ -190,6 +201,8 @@ Object {
"1500000000": "1.5B",
"15000000000": "15B",
"150000000000": "150B",
+ "1500000000000": "1.5T",
+ "15000000000000": "15T",
"2": "2",
"20": "20",
"200": "200",
@@ -201,6 +214,8 @@ Object {
"200000000": "200M",
"2000000000": "2B",
"20000000000": "20B",
+ "200000000000": "200B",
+ "2000000000000": "2T",
"3": "3",
"30": "30",
"300": "300",
@@ -212,6 +227,8 @@ Object {
"300000000": "300M",
"3000000000": "3B",
"30000000000": "30B",
+ "300000000000": "300B",
+ "3000000000000": "3T",
"4": "4",
"40": "40",
"400": "400",
@@ -223,6 +240,8 @@ Object {
"400000000": "400M",
"4000000000": "4B",
"40000000000": "40B",
+ "400000000000": "400B",
+ "4000000000000": "4T",
"5": "5",
"50": "50",
"500": "500",
@@ -234,6 +253,8 @@ Object {
"500000000": "500M",
"5000000000": "5B",
"50000000000": "50B",
+ "500000000000": "500B",
+ "5000000000000": "5T",
"6": "6",
"60": "60",
"600": "600",
@@ -245,6 +266,8 @@ Object {
"600000000": "600M",
"6000000000": "6B",
"60000000000": "60B",
+ "600000000000": "600B",
+ "6000000000000": "6T",
"7": "7",
"70": "70",
"700": "700",
@@ -256,6 +279,8 @@ Object {
"700000000": "700M",
"7000000000": "7B",
"70000000000": "70B",
+ "700000000000": "700B",
+ "7000000000000": "7T",
"8": "8",
"80": "80",
"800": "800",
@@ -267,6 +292,8 @@ Object {
"800000000": "800M",
"8000000000": "8B",
"80000000000": "80B",
+ "800000000000": "800B",
+ "8000000000000": "8T",
"9": "9",
"90": "90",
"900": "900",
@@ -278,5 +305,195 @@ Object {
"900000000": "900M",
"9000000000": "9B",
"90000000000": "90B",
+ "900000000000": "900B",
+ "9000000000000": "9T",
+}
+`;
+
+exports[`GraphCardHelpers yAxisTickFormat should produce consistent y axis tick values: y axis tick values, yAxisTickFormatFallback 1`] = `
+Object {
+ "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",
}
`;
diff --git a/src/components/graphCard/__tests__/graphCardHelpers.test.js b/src/components/graphCard/__tests__/graphCardHelpers.test.js
index 781e51645..bd1cf8623 100644
--- a/src/components/graphCard/__tests__/graphCardHelpers.test.js
+++ b/src/components/graphCard/__tests__/graphCardHelpers.test.js
@@ -4,7 +4,8 @@ import {
getChartXAxisLabelIncrement,
getTooltipDate,
xAxisTickFormat,
- yAxisTickFormat
+ yAxisTickFormat,
+ yAxisTickFormatFallback
} from '../graphCardHelpers';
import { dateHelpers } from '../../../common';
import { RHSM_API_QUERY_GRANULARITY_TYPES as GRANULARITY_TYPES } from '../../../types/rhsmApiTypes';
@@ -83,16 +84,19 @@ describe('GraphCardHelpers', () => {
});
it('yAxisTickFormat should produce consistent y axis tick values', () => {
- const ticks = {};
-
- for (let i = 0; i < 11; i++) {
- const multiplier = Math.pow(10, i);
- for (let k = 1; k < 16; k++) {
- const incrementMultiplier = k * multiplier;
- ticks[incrementMultiplier] = yAxisTickFormat({ tick: incrementMultiplier });
+ const generateTicks = (method = yAxisTickFormat) => {
+ const ticks = {};
+ for (let i = 0; i < 13; i++) {
+ const multiplier = Math.pow(10, i);
+ for (let k = 1; k < 16; k++) {
+ const incrementMultiplier = k * multiplier;
+ ticks[incrementMultiplier] = method({ tick: incrementMultiplier });
+ }
}
- }
+ return ticks;
+ };
- expect(ticks).toMatchSnapshot('y axis tick values');
+ expect(generateTicks()).toMatchSnapshot('y axis tick values');
+ expect(generateTicks(yAxisTickFormatFallback)).toMatchSnapshot('y axis tick values, yAxisTickFormatFallback');
});
});
diff --git a/src/components/graphCard/graphCardHelpers.js b/src/components/graphCard/graphCardHelpers.js
index 3b504cb3c..207273742 100644
--- a/src/components/graphCard/graphCardHelpers.js
+++ b/src/components/graphCard/graphCardHelpers.js
@@ -101,6 +101,43 @@ const xAxisTickFormat = ({ date, granularity, tick, previousDate }) => {
return formattedDate;
};
+/**
+ * ToDo: Remove yAxisTickFormatFallback.
+ * Appears Linux combined with Firefox has an issue using `Intl.NumberFormat` method.
+ * We've applied shim code from NumeralJS and Numbro as a fallback. Up-to-date
+ * browsers still have the optimal version with locale. If the original package used
+ * corrects its rounding behavior we may consider re-implementing it.
+ */
+/**
+ * Fallback method for Linux and Firefox.
+ *
+ * @param {object} params
+ * @param {number|string} params.tick
+ * @returns {string}
+ */
+const yAxisTickFormatFallback = ({ tick }) => {
+ const abs = Math.abs(tick);
+ let updatedTick = tick;
+ let updatedAbbr = '';
+
+ if (abs >= Math.pow(10, 12)) {
+ updatedAbbr = 'T';
+ updatedTick = tick / Math.pow(10, 12);
+ } else if (abs < Math.pow(10, 12) && abs >= Math.pow(10, 9)) {
+ updatedAbbr = 'B';
+ updatedTick = tick / Math.pow(10, 9);
+ } else if (abs < Math.pow(10, 9) && abs >= Math.pow(10, 6)) {
+ updatedAbbr = 'M';
+ updatedTick = tick / Math.pow(10, 6);
+ } else if (abs < Math.pow(10, 6) && abs >= Math.pow(10, 3)) {
+ updatedAbbr = 'K';
+ updatedTick = tick / Math.pow(10, 3);
+ }
+
+ return `${updatedTick}${updatedAbbr}`;
+};
+
+// ToDo: remove yAxisTickFormatFallback check.
/**
* Format y axis ticks.
*
@@ -109,16 +146,26 @@ const xAxisTickFormat = ({ date, granularity, tick, previousDate }) => {
* @param {string} params.locale
* @returns {string}
*/
-const yAxisTickFormat = ({ tick, locale = helpers.UI_LOCALE_DEFAULT }) =>
- new Intl.NumberFormat(locale, { maximumFractionDigits: 1, notation: 'compact', compactDisplay: 'short' }).format(
- tick
- );
+const yAxisTickFormat = ({ tick, locale = helpers.UI_LOCALE_DEFAULT }) => {
+ let updatedTick = `${new Intl.NumberFormat(locale, {
+ maximumFractionDigits: 1,
+ notation: 'compact',
+ compactDisplay: 'short'
+ }).format(tick)}`;
+
+ if (updatedTick.length > 3 && updatedTick.length >= `${tick}`.length) {
+ updatedTick = yAxisTickFormatFallback({ tick });
+ }
+
+ return updatedTick;
+};
const graphCardHelpers = {
getChartXAxisLabelIncrement,
getTooltipDate,
xAxisTickFormat,
- yAxisTickFormat
+ yAxisTickFormat,
+ yAxisTickFormatFallback
};
export {
@@ -127,5 +174,6 @@ export {
getChartXAxisLabelIncrement,
getTooltipDate,
xAxisTickFormat,
- yAxisTickFormat
+ yAxisTickFormat,
+ yAxisTickFormatFallback
};
From 28ab7308a39956061c99c2bab075312673f2e8b0 Mon Sep 17 00:00:00 2001
From: CD Cabrera
Date: Wed, 17 Jun 2020 20:52:15 -0400
Subject: [PATCH 09/16] fix(chartArea): issues/318 inaccurate voronoi x coords
(#324)
* chartArea, large graph widths throw inaccurate voronoi x coords
---
.../__tests__/__snapshots__/chartArea.test.js.snap | 2 --
src/components/chartArea/chartArea.js | 8 ++++++--
2 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/src/components/chartArea/__tests__/__snapshots__/chartArea.test.js.snap b/src/components/chartArea/__tests__/__snapshots__/chartArea.test.js.snap
index 3502061fd..ad87cb44f 100644
--- a/src/components/chartArea/__tests__/__snapshots__/chartArea.test.js.snap
+++ b/src/components/chartArea/__tests__/__snapshots__/chartArea.test.js.snap
@@ -869,7 +869,6 @@ exports[`ChartArea Component should handle custom chart tooltips: custom tooltip
portalComponent={ }
portalZIndex={99}
responsive={true}
- voronoiDimension="x"
voronoiPadding={60}
/>
}
@@ -1095,7 +1094,6 @@ exports[`ChartArea Component should handle custom chart tooltips: renderTooltip:
portalComponent={ }
portalZIndex={99}
responsive={true}
- voronoiDimension="x"
voronoiPadding={60}
/>
`;
diff --git a/src/components/chartArea/chartArea.js b/src/components/chartArea/chartArea.js
index eded29a45..ec69f225b 100644
--- a/src/components/chartArea/chartArea.js
+++ b/src/components/chartArea/chartArea.js
@@ -294,6 +294,11 @@ class ChartArea extends React.Component {
* - https://github.com/FormidableLabs/victory/blob/master/CHANGELOG.md#3436-2020-05-18
* - https://github.com/FormidableLabs/victory/pull/1581
*/
+ /**
+ * FixMe: Victory charts voronoi containers throw inaccurate coordinates on large graph widths
+ * Issue is "patched" by removing the "x" dimension attribute for voronoi.
+ * - https://github.com/RedHatInsights/curiosity-frontend/issues/318
+ */
/**
* Return a chart/graph tooltip Victory container component to allow custom HTML tooltips.
*
@@ -345,7 +350,7 @@ class ChartArea extends React.Component {
if (htmlContent) {
return (
-
+
{htmlContent}
@@ -362,7 +367,6 @@ class ChartArea extends React.Component {
cursorDimension="x"
labels={obj => obj}
labelComponent={ }
- voronoiDimension="x"
voronoiPadding={60}
/>
);
From 103c262e700874c53d9aeb7f4558bf5a8a18a932 Mon Sep 17 00:00:00 2001
From: CD Cabrera
Date: Thu, 18 Jun 2020 14:01:01 -0400
Subject: [PATCH 10/16] fix(graphCardChartLegend): issues/158 activate tooltips
(#325)
* graphCardChartLegend, legend tooltips, apply product context, i18n
* i18n, locale strings for en-US, test update for locale keys
---
package.json | 2 +-
public/locales/en-US.json | 21 +-
.../graphCardChartLegend.test.js.snap | 401 ++++++++----
.../graphCard/graphCardChartLegend.js | 22 +-
.../__tests__/__snapshots__/i18n.test.js.snap | 612 +++++++++++-------
src/components/i18n/__tests__/i18n.test.js | 74 ++-
yarn.lock | 42 +-
7 files changed, 748 insertions(+), 426 deletions(-)
diff --git a/package.json b/package.json
index 7267e04bf..28130d88c 100644
--- a/package.json
+++ b/package.json
@@ -128,7 +128,7 @@
"eslint-plugin-react": "^7.20.0",
"eslint-plugin-react-hooks": "^4.0.4",
"express": "^4.17.1",
- "gettext-extractor": "^3.5.2",
+ "glob": "^7.1.6",
"moxios": "^0.4.0",
"npm-run-all": "^4.1.5",
"prettier": "^2.0.5",
diff --git a/public/locales/en-US.json b/public/locales/en-US.json
index 492f927b6..21959bf06 100644
--- a/public/locales/en-US.json
+++ b/public/locales/en-US.json
@@ -19,21 +19,26 @@
"noDataErrorLabel": "No data",
"dateLabel": "Date",
"coresLabel": "Cores",
- "coresLegendTooltip": "Lorem ipsum dolor sit, cores.",
+ "coresLegendTooltip": "{{product}} CPU usage, per CPU core.",
"socketsLabel": "Sockets",
- "socketsLegendTooltip": "Lorem ipsum dolor sit, sockets.",
+ "socketsLegendTooltip": "{{product}} CPU usage, per CPU socket pair.",
"cloudSocketsLabel": "Public cloud",
- "cloudSocketsLegendTooltip": "Lorem ipsum dolor sit, cloudSockets.",
+ "cloudSocketsLegendTooltip": "Public cloud {{product}} CPU usage, 1 CPU socket per instance.",
"hypervisorCoresLabel": "Virtualized cores",
- "hypervisorCoresLegendTooltip": "Lorem ipsum dolor sit, hypervisorCores.",
+ "hypervisorCoresLegendTooltip": "{{product}} CPU usage, per CPU core.",
"hypervisorSocketsLabel": "Virtualized {{product}}",
- "hypervisorSocketsLegendTooltip": "Lorem ipsum dolor sit, hypervisorSockets.",
+ "hypervisorSocketsLegendTooltip": "{{product}} CPU socket usage, per socket pair.",
+ "hypervisorSocketsLegendTooltip_RHEL": "Virtualized {{product}} CPU usage, per socket. Hypervisor guest usage with known host-guest mappings (such as multi-guest VDC subscriptions), per socket pair of the hypervisor host, using the same method as physical {{product}}.",
"physicalCoresLabel": "Physical cores",
- "physicalCoresLegendTooltip": "Lorem ipsum dolor sit, physicalCores.",
+ "physicalCoresLegendTooltip": "{{product}} CPU usage, per CPU core.",
"physicalSocketsLabel": "Physical {{product}}",
- "physicalSocketsLegendTooltip": "Lorem ipsum dolor sit, physicalSockets.",
+ "physicalSocketsLegendTooltip": "{{product}} CPU socket usage, per socket pair.",
+ "physicalSocketsLegendTooltip_RHEL": "Physical {{product}} CPU usage, per socket pair. Each system's socket count is rounded upwards to the next even number.",
"thresholdLabel": "Subscription threshold",
- "thresholdLegendTooltip": "Lorem ipsum dolor sit, threshold.",
+ "thresholdLegendTooltip": "Maximum capacity, based on total {{product}} subscriptions in this account.",
+ "thresholdLegendTooltip_RHEL": "Maximum capacity, as CPU sockets, based on total {{product}} subscriptions in this account.",
+ "thresholdCoresLegendTooltip_OpenShift": "Maximum capacity, as CPU cores, based on total {{product}} subscriptions in this account.",
+ "thresholdSocketsLegendTooltip_OpenShift": "Maximum capacity, as CPU sockets, based on total {{product}} subscriptions in this account.",
"tooltipSummary": "Your subscription data facets. With one level of column and row headers."
},
"curiosity-toolbar": {
diff --git a/src/components/graphCard/__tests__/__snapshots__/graphCardChartLegend.test.js.snap b/src/components/graphCard/__tests__/__snapshots__/graphCardChartLegend.test.js.snap
index c0dda8b5c..19a2c3673 100644
--- a/src/components/graphCard/__tests__/__snapshots__/graphCardChartLegend.test.js.snap
+++ b/src/components/graphCard/__tests__/__snapshots__/graphCardChartLegend.test.js.snap
@@ -23,7 +23,7 @@ exports[`GraphCardChartLegend Component should handle a click event: click event
tabIndex={0}
variant="link"
>
- t(curiosity-graph.loremIpsumLabel, [object Object])
+ t(curiosity-graph.loremIpsumLabel,curiosity-graph.noLabel, [object Object])
`;
@@ -50,7 +50,7 @@ exports[`GraphCardChartLegend Component should handle a click event: click event
tabIndex={0}
variant="link"
>
- t(curiosity-graph.loremIpsumLabel, [object Object])
+ t(curiosity-graph.loremIpsumLabel,curiosity-graph.noLabel, [object Object])
`;
@@ -73,7 +73,7 @@ exports[`GraphCardChartLegend Component should handle a click event: click event
tabIndex={0}
variant="link"
>
- t(curiosity-graph.loremIpsumLabel, [object Object])
+ t(curiosity-graph.loremIpsumLabel,curiosity-graph.noLabel, [object Object])
`;
@@ -189,126 +189,311 @@ exports[`GraphCardChartLegend Component should handle variations in data when re
exports[`GraphCardChartLegend Component should render a basic component: basic 1`] = `
-
+
+ t(curiosity-graph.loremIpsumLegendTooltip, [object Object])
+
}
- isDisabled={false}
- key="curiosity-button-loremIpsum"
- onClick={[Function]}
- onKeyPress={[Function]}
- tabIndex={0}
- variant="link"
+ distance={-10}
+ enableFlip={true}
+ entryDelay={100}
+ exitDelay={0}
+ flipBehavior={
+ Array [
+ "top",
+ "right",
+ "bottom",
+ "left",
+ "top",
+ "right",
+ "bottom",
+ ]
+ }
+ id=""
+ isAppLauncher={false}
+ isContentLeftAligned={false}
+ isVisible={false}
+ key="curiosity-tooltip-loremIpsum"
+ maxWidth="18.75rem"
+ position="top"
+ tippyProps={Object {}}
+ trigger="mouseenter focus"
+ zIndex={9999}
>
- t(curiosity-graph.loremIpsumLabel, [object Object])
-
+
+ }
+ isDisabled={false}
+ key="curiosity-button-loremIpsum"
+ onClick={[Function]}
+ onKeyPress={[Function]}
+ tabIndex={0}
+ variant="link"
+ >
+ t(curiosity-graph.loremIpsumLabel,curiosity-graph.noLabel, [object Object])
+
+
`;
exports[`GraphCardChartLegend Component should render basic data: data 1`] = `
-
+
+ t(curiosity-graph.loremIpsumLegendTooltip, [object Object])
+
}
- isDisabled={false}
- key="curiosity-button-loremIpsum"
- onClick={[Function]}
- onKeyPress={[Function]}
- tabIndex={0}
- variant="link"
- >
- t(curiosity-graph.loremIpsumLabel, [object Object])
-
-
+ distance={-10}
+ enableFlip={true}
+ entryDelay={100}
+ exitDelay={0}
+ flipBehavior={
+ Array [
+ "top",
+ "right",
+ "bottom",
+ "left",
+ "top",
+ "right",
+ "bottom",
+ ]
}
- isDisabled={true}
- key="curiosity-button-ametConsectetur"
- onClick={[Function]}
- onKeyPress={[Function]}
- tabIndex={0}
- variant="link"
+ id=""
+ isAppLauncher={false}
+ isContentLeftAligned={false}
+ isVisible={false}
+ key="curiosity-tooltip-loremIpsum"
+ maxWidth="18.75rem"
+ position="top"
+ tippyProps={Object {}}
+ trigger="mouseenter focus"
+ zIndex={9999}
>
- t(curiosity-graph.ametConsecteturLabel, [object Object])
-
-
+ />
+ }
+ isDisabled={false}
+ key="curiosity-button-loremIpsum"
+ onClick={[Function]}
+ onKeyPress={[Function]}
+ tabIndex={0}
+ variant="link"
+ >
+ t(curiosity-graph.loremIpsumLabel,curiosity-graph.noLabel, [object Object])
+
+
+
+ t(curiosity-graph.ametConsecteturLegendTooltip, [object Object])
+
}
- isDisabled={false}
- key="curiosity-button-dolorSit"
- onClick={[Function]}
- onKeyPress={[Function]}
- tabIndex={0}
- variant="link"
+ distance={-10}
+ enableFlip={true}
+ entryDelay={100}
+ exitDelay={0}
+ flipBehavior={
+ Array [
+ "top",
+ "right",
+ "bottom",
+ "left",
+ "top",
+ "right",
+ "bottom",
+ ]
+ }
+ id=""
+ isAppLauncher={false}
+ isContentLeftAligned={false}
+ isVisible={false}
+ key="curiosity-tooltip-ametConsectetur"
+ maxWidth="18.75rem"
+ position="top"
+ tippyProps={Object {}}
+ trigger="mouseenter focus"
+ zIndex={9999}
>
- t(curiosity-graph.thresholdLabel)
-
-
+ }
+ isDisabled={true}
+ key="curiosity-button-ametConsectetur"
+ onClick={[Function]}
+ onKeyPress={[Function]}
+ tabIndex={0}
+ variant="link"
+ >
+ t(curiosity-graph.ametConsecteturLabel,curiosity-graph.noLabel, [object Object])
+
+
+
+ t(curiosity-graph.dolorSitLegendTooltip,curiosity-graph.thresholdLegendTooltip, [object Object])
+
+ }
+ distance={-10}
+ enableFlip={true}
+ entryDelay={100}
+ exitDelay={0}
+ flipBehavior={
+ Array [
+ "top",
+ "right",
+ "bottom",
+ "left",
+ "top",
+ "right",
+ "bottom",
+ ]
+ }
+ id=""
+ isAppLauncher={false}
+ isContentLeftAligned={false}
+ isVisible={false}
+ key="curiosity-tooltip-dolorSit"
+ maxWidth="18.75rem"
+ position="top"
+ tippyProps={Object {}}
+ trigger="mouseenter focus"
+ zIndex={9999}
+ >
+
+ />
+ }
+ isDisabled={false}
+ key="curiosity-button-dolorSit"
+ onClick={[Function]}
+ onKeyPress={[Function]}
+ tabIndex={0}
+ variant="link"
+ >
+ t(curiosity-graph.dolorSitLabel,curiosity-graph.thresholdLabel, [object Object])
+
+
+
+ t(curiosity-graph.nonCursusLegendTooltip,curiosity-graph.thresholdLegendTooltip, [object Object])
+
}
- isDisabled={false}
- key="curiosity-button-nonCursus"
- onClick={[Function]}
- onKeyPress={[Function]}
- tabIndex={0}
- variant="link"
+ distance={-10}
+ enableFlip={true}
+ entryDelay={100}
+ exitDelay={0}
+ flipBehavior={
+ Array [
+ "top",
+ "right",
+ "bottom",
+ "left",
+ "top",
+ "right",
+ "bottom",
+ ]
+ }
+ id=""
+ isAppLauncher={false}
+ isContentLeftAligned={false}
+ isVisible={false}
+ key="curiosity-tooltip-nonCursus"
+ maxWidth="18.75rem"
+ position="top"
+ tippyProps={Object {}}
+ trigger="mouseenter focus"
+ zIndex={9999}
>
- t(curiosity-graph.thresholdLabel)
-
+
+ }
+ isDisabled={false}
+ key="curiosity-button-nonCursus"
+ onClick={[Function]}
+ onKeyPress={[Function]}
+ tabIndex={0}
+ variant="link"
+ >
+ t(curiosity-graph.nonCursusLabel,curiosity-graph.thresholdLabel, [object Object])
+
+
`;
diff --git a/src/components/graphCard/graphCardChartLegend.js b/src/components/graphCard/graphCardChartLegend.js
index ce47d1a62..80ab796d6 100644
--- a/src/components/graphCard/graphCardChartLegend.js
+++ b/src/components/graphCard/graphCardChartLegend.js
@@ -127,21 +127,25 @@ class GraphCardChartLegend extends React.Component {
!data.find(({ y, hasData }) => (y >= 0 && hasData === true) || (y >= 0 && isThreshold === true)) || false;
const labelContent =
- (isThreshold && t(`curiosity-graph.thresholdLabel`)) ||
- t(`curiosity-graph.${id}Label`, { product }) ||
- t(`curiosity-graph.noLabel`, { product });
-
- // ToDo: Disabled tooltip content, reactivate accordingly, issues/158
- // const tooltipContent =
- // (isThreshold && t(`curiosity-graph.thresholdLegendTooltip`)) || t(`curiosity-graph.${id}LegendTooltip`);
+ (isThreshold &&
+ t([`curiosity-graph.${id}Label`, `curiosity-graph.thresholdLabel`], { product, context: product })) ||
+ t([`curiosity-graph.${id}Label`, `curiosity-graph.noLabel`], { product, context: product });
+
+ const tooltipContent =
+ (isThreshold &&
+ t([`curiosity-graph.${id}LegendTooltip`, `curiosity-graph.thresholdLegendTooltip`], {
+ product,
+ context: product
+ })) ||
+ t(`curiosity-graph.${id}LegendTooltip`, { product, context: product });
return this.renderLegendItem({
chartId: id,
color: stroke,
labelContent,
isDisabled,
- isThreshold
- // tooltipContent
+ isThreshold,
+ tooltipContent
});
})}
diff --git a/src/components/i18n/__tests__/__snapshots__/i18n.test.js.snap b/src/components/i18n/__tests__/__snapshots__/i18n.test.js.snap
index caf72dba4..acc9cb285 100644
--- a/src/components/i18n/__tests__/__snapshots__/i18n.test.js.snap
+++ b/src/components/i18n/__tests__/__snapshots__/i18n.test.js.snap
@@ -11,240 +11,384 @@ Object {
exports[`I18n Component should attempt to perform translate with a node: translated node 1`] = `"t(lorem.ipsum, [object Object], [object Object])
"`;
-exports[`I18n Component should generate a predictable pot output snapshot: pot output 1`] = `
-"msgid \\"\\"
-msgstr \\"\\"
-\\"Content-Type: text/plain; charset=UTF-8\\\\n\\"
-
-#: src/components/authentication/authentication.js:74
-msgid \\"curiosity-auth.authorizedTitle\\"
-msgstr \\"\\"
-
-#: src/components/openshiftView/openshiftView.js:105
-#: src/components/openshiftView/openshiftView.js:93
-msgid \\"curiosity-graph.cardHeading\\"
-msgstr \\"\\"
-
-#: src/components/graphCard/graphCardTypes.js:15
-msgid \\"curiosity-graph.dropdownDaily\\"
-msgstr \\"\\"
-
-#: src/components/graphCard/graphCardTypes.js:17
-msgid \\"curiosity-graph.dropdownMonthly\\"
-msgstr \\"\\"
-
-#: src/components/c3GraphCard/c3GraphCard.js:189
-#: src/components/c3GraphCard/c3GraphCard.js:193
-#: src/components/graphCard/graphCard.js:176
-#: src/components/graphCard/graphCard.js:180
-msgid \\"curiosity-graph.dropdownPlaceholder\\"
-msgstr \\"\\"
-
-#: src/components/graphCard/graphCardTypes.js:18
-msgid \\"curiosity-graph.dropdownQuarterly\\"
-msgstr \\"\\"
-
-#: src/components/graphCard/graphCardTypes.js:16
-msgid \\"curiosity-graph.dropdownWeekly\\"
-msgstr \\"\\"
-
-#: src/components/c3GraphCard/c3GraphCardHelpers.js:179
-#: src/components/graphCard/graphCardChartTooltip.js:36
-msgid \\"curiosity-graph.infiniteThresholdLabel\\"
-msgstr \\"\\"
-
-#: src/components/graphCard/graphCardChartTooltip.js:84
-msgid \\"curiosity-graph.noDataErrorLabel\\"
-msgstr \\"\\"
-
-#: src/components/c3GraphCard/c3GraphCardHelpers.js:180
-#: src/components/c3GraphCard/c3GraphCardHelpers.js:183
-#: src/components/graphCard/graphCardChartTooltip.js:37
-#: src/components/graphCard/graphCardChartTooltip.js:43
-msgid \\"curiosity-graph.noDataLabel\\"
-msgstr \\"\\"
-
-#: src/components/graphCard/graphCardChartLegend.js:132
-msgid \\"curiosity-graph.noLabel\\"
-msgstr \\"\\"
-
-#: src/components/rhelView/rhelView.js:50
-#: src/components/rhelView/rhelView.js:60
-msgid \\"curiosity-graph.socketsHeading\\"
-msgstr \\"\\"
-
-#: src/components/c3GraphCard/c3GraphCard.js:110
-#: src/components/c3GraphCard/c3GraphCardHelpers.js:136
-#: src/components/graphCard/graphCardChartLegend.js:130
-#: src/components/graphCard/graphCardChartTooltip.js:39
-msgid \\"curiosity-graph.thresholdLabel\\"
-msgstr \\"\\"
-
-#: src/components/c3GraphCard/c3GraphCard.js:93
-msgid \\"curiosity-graph.thresholdLegendTooltip\\"
-msgstr \\"\\"
-
-#: src/components/graphCard/graphCardChartTooltip.js:54
-msgid \\"curiosity-graph.tooltipSummary\\"
-msgstr \\"\\"
-
-#: src/components/optinView/optinView.js:59
-#: src/components/optinView/optinView.js:99
-msgid \\"curiosity-optin.buttonActivate\\"
-msgstr \\"\\"
-
-#: src/components/optinView/optinView.js:87
-msgid \\"curiosity-optin.buttonIsActive\\"
-msgstr \\"\\"
-
-#: src/components/optinView/optinView.js:135
-msgid \\"curiosity-optin.buttonTour\\"
-msgstr \\"\\"
-
-#: src/components/optinView/optinView.js:165
-msgid \\"curiosity-optin.cardDescription\\"
-msgstr \\"\\"
-
-#: src/components/optinView/optinView.js:187
-msgid \\"curiosity-optin.cardFilterDescription\\"
-msgstr \\"\\"
-
-#: src/components/optinView/optinView.js:184
-msgid \\"curiosity-optin.cardFilterTitle\\"
-msgstr \\"\\"
-
-#: src/components/optinView/optinView.js:90
-msgid \\"curiosity-optin.cardIsActiveDescription\\"
-msgstr \\"\\"
-
-#: src/components/optinView/optinView.js:69
-msgid \\"curiosity-optin.cardIsErrorDescription\\"
-msgstr \\"\\"
-
-#: src/components/optinView/optinView.js:180
-msgid \\"curiosity-optin.cardReportDescription\\"
-msgstr \\"\\"
-
-#: src/components/optinView/optinView.js:177
-msgid \\"curiosity-optin.cardReportTitle\\"
-msgstr \\"\\"
-
-#: src/components/optinView/optinView.js:173
-msgid \\"curiosity-optin.cardSeeDescription\\"
-msgstr \\"\\"
-
-#: src/components/optinView/optinView.js:170
-msgid \\"curiosity-optin.cardSeeTitle\\"
-msgstr \\"\\"
-
-#: src/components/optinView/optinView.js:162
-msgid \\"curiosity-optin.cardTitle\\"
-msgstr \\"\\"
-
-#: src/redux/actions/userActions.js:71
-msgid \\"curiosity-optin.notificationsErrorDescription\\"
-msgstr \\"\\"
-
-#: src/redux/actions/userActions.js:70
-msgid \\"curiosity-optin.notificationsErrorTitle\\"
-msgstr \\"\\"
-
-#: src/redux/actions/userActions.js:77
-msgid \\"curiosity-optin.notificationsSuccessDescription\\"
-msgstr \\"\\"
-
-#: src/redux/actions/userActions.js:76
-msgid \\"curiosity-optin.notificationsSuccessTitle\\"
-msgstr \\"\\"
-
-#: src/components/optinView/optinView.js:132
-msgid \\"curiosity-optin.tourDescription\\"
-msgstr \\"\\"
-
-#: src/components/optinView/optinView.js:129
-msgid \\"curiosity-optin.tourTitle\\"
-msgstr \\"\\"
-
-#: src/components/optinView/optinView.js:121
-msgid \\"curiosity-optin.tourTitleImageAlt\\"
-msgstr \\"\\"
-
-#: src/components/toolbar/toolbar.js:104
-#: src/components/toolbar/toolbar.js:107
-msgid \\"curiosity-toolbar.slaCategory\\"
-msgstr \\"\\"
-
-#: src/components/toolbar/toolbarTypes.js:28
-msgid \\"curiosity-toolbar.slaNone\\"
-msgstr \\"\\"
-
-#: src/components/toolbar/toolbar.js:110
-msgid \\"curiosity-toolbar.slaPlaceholder\\"
-msgstr \\"\\"
-
-#: src/components/toolbar/toolbarTypes.js:16
-msgid \\"curiosity-toolbar.slaPremium\\"
-msgstr \\"\\"
-
-#: src/components/toolbar/toolbarTypes.js:24
-msgid \\"curiosity-toolbar.slaSelfSupport\\"
-msgstr \\"\\"
-
-#: src/components/toolbar/toolbarTypes.js:20
-msgid \\"curiosity-toolbar.slaStandard\\"
-msgstr \\"\\"
-
-#: src/components/tourView/tourView.js:72
-msgid \\"curiosity-tour.emptyStateButton\\"
-msgstr \\"\\"
-
-#: src/components/tourView/tourView.js:50
-msgid \\"curiosity-tour.emptyStateDescription\\"
-msgstr \\"\\"
-
-#: src/components/tourView/tourView.js:57
-msgid \\"curiosity-tour.emptyStateDescriptionExtended\\"
-msgstr \\"\\"
-
-#: src/components/tourView/tourView.js:52
-msgid \\"curiosity-tour.emptyStateDescriptionTour\\"
-msgstr \\"\\"
-
-#: src/components/tourView/tourView.js:40
-msgid \\"curiosity-tour.emptyStateIconAlt\\"
-msgstr \\"\\"
-
-#: src/components/tourView/tourView.js:87
-msgid \\"curiosity-tour.emptyStateLinkContactUs\\"
-msgstr \\"\\"
-
-#: src/components/tourView/tourView.js:68
-#: src/components/tourView/tourView.js:83
-msgid \\"curiosity-tour.emptyStateLinkLearnMore\\"
-msgstr \\"\\"
-
-#: src/components/tourView/tourView.js:45
-msgid \\"curiosity-tour.emptyStateTitle\\"
-msgstr \\"\\"
-
-#: src/components/openshiftView/openshiftView.js:81
-msgid \\"curiosity-view.openshift\\"
-msgstr \\"\\"
-
-#: src/components/rhelView/rhelView.js:38
-msgid \\"curiosity-view.rhel\\"
-msgstr \\"\\"
-
-#: src/components/authentication/authentication.js:75
-msgctxt \\"...\\"
-msgid \\"curiosity-auth.authorizedCopy\\"
-msgstr \\"\\"
-
-#: src/components/authentication/authentication.js:59
-msgctxt \\"...\\"
-msgid \\"curiosity-auth.pending\\"
-msgstr \\"\\"
-"
+exports[`I18n Component should generate a predictable locale key output snapshot: key output 1`] = `
+Array [
+ Object {
+ "file": "./src/common/helpers.js",
+ "keys": Array [
+ Object {
+ "key": "",
+ "match": "t(\${key}\${(value && \`, \${value}\`)",
+ },
+ ],
+ },
+ Object {
+ "file": "./src/components/authentication/authentication.js",
+ "keys": Array [
+ Object {
+ "key": "curiosity-auth.pending",
+ "match": "t('curiosity-auth.pending', '...')",
+ },
+ Object {
+ "key": "curiosity-auth.authorizedTitle",
+ "match": "t('curiosity-auth.authorizedTitle', { appName: helpers.UI_DISPLAY_NAME })",
+ },
+ Object {
+ "key": "curiosity-auth.authorizedCopy",
+ "match": "t('curiosity-auth.authorizedCopy', '...')",
+ },
+ ],
+ },
+ Object {
+ "file": "./src/components/c3GraphCard/c3GraphCard.js",
+ "keys": Array [
+ Object {
+ "key": "curiosity-graph.thresholdLegendTooltip",
+ "match": "t(\`curiosity-graph.thresholdLegendTooltip\`)",
+ },
+ Object {
+ "key": "",
+ "match": "t(\`curiosity-graph.\${id}LegendTooltip\`)",
+ },
+ Object {
+ "key": "curiosity-graph.thresholdLabel",
+ "match": "t(\`curiosity-graph.thresholdLabel\`)",
+ },
+ Object {
+ "key": "",
+ "match": "t(\`curiosity-graph.\${id}Label\`, { product: productShortLabel })",
+ },
+ Object {
+ "key": "curiosity-graph.dropdownPlaceholder",
+ "match": "t('curiosity-graph.dropdownPlaceholder')",
+ },
+ Object {
+ "key": "curiosity-graph.dropdownPlaceholder",
+ "match": "t('curiosity-graph.dropdownPlaceholder')",
+ },
+ ],
+ },
+ Object {
+ "file": "./src/components/c3GraphCard/c3GraphCardHelpers.js",
+ "keys": Array [
+ Object {
+ "key": "curiosity-graph.thresholdLabel",
+ "match": "translate(\`curiosity-graph.thresholdLabel\`)",
+ },
+ Object {
+ "key": "",
+ "match": "translate(\`curiosity-graph.\${value.id}Label\`, { product: productShortLabel })",
+ },
+ Object {
+ "key": "curiosity-graph.infiniteThresholdLabel",
+ "match": "translate('curiosity-graph.infiniteThresholdLabel')",
+ },
+ Object {
+ "key": "curiosity-graph.noDataLabel",
+ "match": "translate('curiosity-graph.noDataLabel')",
+ },
+ Object {
+ "key": "curiosity-graph.noDataLabel",
+ "match": "translate('curiosity-graph.noDataLabel')",
+ },
+ ],
+ },
+ Object {
+ "file": "./src/components/graphCard/graphCard.js",
+ "keys": Array [
+ Object {
+ "key": "curiosity-graph.dropdownPlaceholder",
+ "match": "t('curiosity-graph.dropdownPlaceholder')",
+ },
+ Object {
+ "key": "curiosity-graph.dropdownPlaceholder",
+ "match": "t('curiosity-graph.dropdownPlaceholder')",
+ },
+ ],
+ },
+ Object {
+ "file": "./src/components/graphCard/graphCardChartLegend.js",
+ "keys": Array [
+ Object {
+ "key": "",
+ "match": "t([\`curiosity-graph.\${id}Label\`, \`curiosity-graph.thresholdLabel\`], { product, context: product })",
+ },
+ Object {
+ "key": "",
+ "match": "t([\`curiosity-graph.\${id}Label\`, \`curiosity-graph.noLabel\`], { product, context: product })",
+ },
+ Object {
+ "key": "",
+ "match": "t([\`curiosity-graph.\${id}LegendTooltip\`, \`curiosity-graph.thresholdLegendTooltip\`], { product, context: product })",
+ },
+ Object {
+ "key": "",
+ "match": "t(\`curiosity-graph.\${id}LegendTooltip\`, { product, context: product })",
+ },
+ ],
+ },
+ Object {
+ "file": "./src/components/graphCard/graphCardChartTooltip.js",
+ "keys": Array [
+ Object {
+ "key": "curiosity-graph.infiniteThresholdLabel",
+ "match": "t('curiosity-graph.infiniteThresholdLabel')",
+ },
+ Object {
+ "key": "curiosity-graph.noDataLabel",
+ "match": "t('curiosity-graph.noDataLabel')",
+ },
+ Object {
+ "key": "curiosity-graph.thresholdLabel",
+ "match": "t(\`curiosity-graph.thresholdLabel\`)",
+ },
+ Object {
+ "key": "curiosity-graph.noDataLabel",
+ "match": "t('curiosity-graph.noDataLabel')",
+ },
+ Object {
+ "key": "",
+ "match": "t(\`curiosity-graph.\${key}Label\`, { product })",
+ },
+ Object {
+ "key": "curiosity-graph.tooltipSummary",
+ "match": "t('curiosity-graph.tooltipSummary')",
+ },
+ Object {
+ "key": "curiosity-graph.noDataErrorLabel",
+ "match": "t('curiosity-graph.noDataErrorLabel')",
+ },
+ ],
+ },
+ Object {
+ "file": "./src/components/graphCard/graphCardTypes.js",
+ "keys": Array [
+ Object {
+ "key": "curiosity-graph.dropdownDaily",
+ "match": "translate('curiosity-graph.dropdownDaily')",
+ },
+ Object {
+ "key": "curiosity-graph.dropdownWeekly",
+ "match": "translate('curiosity-graph.dropdownWeekly')",
+ },
+ Object {
+ "key": "curiosity-graph.dropdownMonthly",
+ "match": "translate('curiosity-graph.dropdownMonthly')",
+ },
+ Object {
+ "key": "curiosity-graph.dropdownQuarterly",
+ "match": "translate('curiosity-graph.dropdownQuarterly')",
+ },
+ ],
+ },
+ Object {
+ "file": "./src/components/openshiftView/openshiftView.js",
+ "keys": Array [
+ Object {
+ "key": "curiosity-view.openshift",
+ "match": "t('curiosity-view.openshift', helpers.UI_DISPLAY_CONFIG_NAME)",
+ },
+ Object {
+ "key": "curiosity-graph.cardHeading",
+ "match": "t('curiosity-graph.cardHeading')",
+ },
+ Object {
+ "key": "curiosity-graph.cardHeading",
+ "match": "t('curiosity-graph.cardHeading')",
+ },
+ ],
+ },
+ Object {
+ "file": "./src/components/optinView/optinView.js",
+ "keys": Array [
+ Object {
+ "key": "curiosity-optin.buttonActivate",
+ "match": "t('curiosity-optin.buttonActivate', { appName: helpers.UI_DISPLAY_NAME })",
+ },
+ Object {
+ "key": "curiosity-optin.cardIsErrorDescription",
+ "match": "translate('curiosity-optin.cardIsErrorDescription', { appName: helpers.UI_DISPLAY_NAME }, [ ])",
+ },
+ Object {
+ "key": "curiosity-optin.buttonIsActive",
+ "match": "t('curiosity-optin.buttonIsActive', { appName: helpers.UI_DISPLAY_NAME })",
+ },
+ Object {
+ "key": "curiosity-optin.cardIsActiveDescription",
+ "match": "t('curiosity-optin.cardIsActiveDescription')",
+ },
+ Object {
+ "key": "curiosity-optin.buttonActivate",
+ "match": "t('curiosity-optin.buttonActivate', { appName: helpers.UI_DISPLAY_NAME })",
+ },
+ Object {
+ "key": "curiosity-optin.tourTitleImageAlt",
+ "match": "t('curiosity-optin.tourTitleImageAlt')",
+ },
+ Object {
+ "key": "curiosity-optin.tourTitle",
+ "match": "t('curiosity-optin.tourTitle')",
+ },
+ Object {
+ "key": "curiosity-optin.tourDescription",
+ "match": "t('curiosity-optin.tourDescription')",
+ },
+ Object {
+ "key": "curiosity-optin.buttonTour",
+ "match": "t('curiosity-optin.buttonTour')",
+ },
+ Object {
+ "key": "curiosity-optin.cardTitle",
+ "match": "t('curiosity-optin.cardTitle', { appName: helpers.UI_DISPLAY_NAME })",
+ },
+ Object {
+ "key": "curiosity-optin.cardDescription",
+ "match": "t('curiosity-optin.cardDescription', { appName: helpers.UI_DISPLAY_NAME })",
+ },
+ Object {
+ "key": "curiosity-optin.cardSeeTitle",
+ "match": "t('curiosity-optin.cardSeeTitle')",
+ },
+ Object {
+ "key": "curiosity-optin.cardSeeDescription",
+ "match": "t('curiosity-optin.cardSeeDescription')",
+ },
+ Object {
+ "key": "curiosity-optin.cardReportTitle",
+ "match": "t('curiosity-optin.cardReportTitle')",
+ },
+ Object {
+ "key": "curiosity-optin.cardReportDescription",
+ "match": "t('curiosity-optin.cardReportDescription')",
+ },
+ Object {
+ "key": "curiosity-optin.cardFilterTitle",
+ "match": "t('curiosity-optin.cardFilterTitle')",
+ },
+ Object {
+ "key": "curiosity-optin.cardFilterDescription",
+ "match": "t('curiosity-optin.cardFilterDescription')",
+ },
+ ],
+ },
+ Object {
+ "file": "./src/components/rhelView/rhelView.js",
+ "keys": Array [
+ Object {
+ "key": "curiosity-view.rhel",
+ "match": "t('curiosity-view.rhel', helpers.UI_DISPLAY_CONFIG_NAME)",
+ },
+ Object {
+ "key": "curiosity-graph.socketsHeading",
+ "match": "t('curiosity-graph.socketsHeading')",
+ },
+ Object {
+ "key": "curiosity-graph.socketsHeading",
+ "match": "t('curiosity-graph.socketsHeading')",
+ },
+ ],
+ },
+ Object {
+ "file": "./src/components/toolbar/toolbar.js",
+ "keys": Array [
+ Object {
+ "key": "curiosity-toolbar.slaCategory",
+ "match": "t('curiosity-toolbar.slaCategory')",
+ },
+ Object {
+ "key": "curiosity-toolbar.slaCategory",
+ "match": "t('curiosity-toolbar.slaCategory')",
+ },
+ Object {
+ "key": "curiosity-toolbar.slaPlaceholder",
+ "match": "t('curiosity-toolbar.slaPlaceholder')",
+ },
+ ],
+ },
+ Object {
+ "file": "./src/components/toolbar/toolbarTypes.js",
+ "keys": Array [
+ Object {
+ "key": "curiosity-toolbar.slaPremium",
+ "match": "translate('curiosity-toolbar.slaPremium')",
+ },
+ Object {
+ "key": "curiosity-toolbar.slaStandard",
+ "match": "translate('curiosity-toolbar.slaStandard')",
+ },
+ Object {
+ "key": "curiosity-toolbar.slaSelfSupport",
+ "match": "translate('curiosity-toolbar.slaSelfSupport')",
+ },
+ Object {
+ "key": "curiosity-toolbar.slaNone",
+ "match": "translate('curiosity-toolbar.slaNone')",
+ },
+ ],
+ },
+ Object {
+ "file": "./src/components/tourView/tourView.js",
+ "keys": Array [
+ Object {
+ "key": "curiosity-tour.emptyStateIconAlt",
+ "match": "t('curiosity-tour.emptyStateIconAlt', { appName: helpers.UI_DISPLAY_CONFIG_NAME })",
+ },
+ Object {
+ "key": "curiosity-tour.emptyStateTitle",
+ "match": "t('curiosity-tour.emptyStateTitle', { appName: helpers.UI_DISPLAY_CONFIG_NAME })",
+ },
+ Object {
+ "key": "curiosity-tour.emptyStateDescription",
+ "match": "t('curiosity-tour.emptyStateDescription', { appName: helpers.UI_DISPLAY_CONFIG_NAME })",
+ },
+ Object {
+ "key": "curiosity-tour.emptyStateDescriptionTour",
+ "match": "t('curiosity-tour.emptyStateDescriptionTour', { appName: helpers.UI_DISPLAY_CONFIG_NAME })",
+ },
+ Object {
+ "key": "curiosity-tour.emptyStateDescriptionExtended",
+ "match": "t('curiosity-tour.emptyStateDescriptionExtended', { appName: helpers.UI_DISPLAY_CONFIG_NAME })",
+ },
+ Object {
+ "key": "curiosity-tour.emptyStateLinkLearnMore",
+ "match": "t('curiosity-tour.emptyStateLinkLearnMore')",
+ },
+ Object {
+ "key": "curiosity-tour.emptyStateButton",
+ "match": "t('curiosity-tour.emptyStateButton')",
+ },
+ Object {
+ "key": "curiosity-tour.emptyStateLinkLearnMore",
+ "match": "t('curiosity-tour.emptyStateLinkLearnMore')",
+ },
+ Object {
+ "key": "curiosity-tour.emptyStateLinkContactUs",
+ "match": "t('curiosity-tour.emptyStateLinkContactUs')",
+ },
+ ],
+ },
+ Object {
+ "file": "./src/redux/actions/userActions.js",
+ "keys": Array [
+ Object {
+ "key": "curiosity-optin.notificationsErrorTitle",
+ "match": "translate('curiosity-optin.notificationsErrorTitle', { appName: helpers.UI_DISPLAY_NAME })",
+ },
+ Object {
+ "key": "curiosity-optin.notificationsErrorDescription",
+ "match": "translate('curiosity-optin.notificationsErrorDescription')",
+ },
+ Object {
+ "key": "curiosity-optin.notificationsSuccessTitle",
+ "match": "translate('curiosity-optin.notificationsSuccessTitle', { appName: helpers.UI_DISPLAY_NAME })",
+ },
+ Object {
+ "key": "curiosity-optin.notificationsSuccessDescription",
+ "match": "translate('curiosity-optin.notificationsSuccessDescription')",
+ },
+ ],
+ },
+]
`;
exports[`I18n Component should have locale keys that exist in the default language JSON: missing locale keys 1`] = `Array []`;
diff --git a/src/components/i18n/__tests__/i18n.test.js b/src/components/i18n/__tests__/i18n.test.js
index 797d67551..98250bcbd 100644
--- a/src/components/i18n/__tests__/i18n.test.js
+++ b/src/components/i18n/__tests__/i18n.test.js
@@ -1,8 +1,9 @@
+import { readFileSync } from 'fs';
+import glob from 'glob';
import React from 'react';
import PropTypes from 'prop-types';
import { mount, shallow } from 'enzyme';
import _get from 'lodash/get';
-import { GettextExtractor, JsExtractors } from 'gettext-extractor';
import { I18n, translate, translateComponent } from '../i18n';
import { helpers } from '../../../common';
import enLocales from '../../../../public/locales/en-US';
@@ -13,28 +14,49 @@ import enLocales from '../../../../public/locales/en-US';
jest.mock('i18next');
/**
- * Help generate a POT output.
+ * Get translation keys.
*
- * @returns {Function}
+ * @param {object} params
+ * @param {string} params.files
+ * @param {Array} params.list
+ * @returns {Array}
*/
-const textExtractor = () => {
- const extractor = new GettextExtractor();
- extractor
- .createJsParser([
- JsExtractors.callExpression(['t', '[this].t', 'translate'], {
- arguments: {
- text: 0,
- context: 1
- }
- })
- ])
- .parseFilesGlob('./src/**/!(*.test|*.spec).@(js|jsx)');
+const getTranslationKeys = ({ files = './src/**/!(*.test|*.spec).@(js|jsx)', list = ['t', 'translate'] }) => {
+ const keys = [];
+ const updatedFiles = glob.sync(files);
+
+ updatedFiles.forEach(file => {
+ const fileContent = readFileSync(file, 'utf-8');
+ const generateRegExp = list.map(f => `\\b${f}\\([\\d\\D]+?\\)`).join('|');
+ const matches = fileContent.match(new RegExp(generateRegExp, 'g'));
+
+ if (matches && matches.length) {
+ const filterKeys = matches
+ .map(match => {
+ const key = match.match(/['`"]([\d\D]+?)['`"][,)]/);
+
+ if (key) {
+ return {
+ key: (!/\${/.test(key) && key[1]) || '',
+ match: match.replace(/\n/g, '').replace(/\s+/g, ' ').trim()
+ };
+ }
+
+ return null;
+ })
+ .filter(key => key !== null);
+
+ if (filterKeys.length) {
+ keys.push({ file, keys: filterKeys });
+ }
+ }
+ });
- return extractor;
+ return keys;
};
describe('I18n Component', () => {
- const getText = textExtractor();
+ const getKeys = getTranslationKeys({});
it('should render a basic component', () => {
const props = {
@@ -98,20 +120,20 @@ describe('I18n Component', () => {
}).toMatchSnapshot('translate');
});
- it('should generate a predictable pot output snapshot', () => {
- expect(getText.getPotString()).toMatchSnapshot('pot output');
+ it('should generate a predictable locale key output snapshot', () => {
+ expect(getKeys).toMatchSnapshot('key output');
});
it('should have locale keys that exist in the default language JSON', () => {
- const messages = (getText.getMessages && getText.getMessages()) || [];
+ const keys = getKeys;
const missingKeys = [];
- messages.forEach(value => {
- const keyCheck = (value && value.text) || '';
-
- if (keyCheck && !_get(enLocales, keyCheck, null)) {
- missingKeys.push(keyCheck);
- }
+ keys.forEach(value => {
+ value.keys.forEach(subValue => {
+ if (subValue.key && !_get(enLocales, subValue.key, null)) {
+ missingKeys.push({ file: value.file, key: subValue.key });
+ }
+ });
});
expect(missingKeys).toMatchSnapshot('missing locale keys');
diff --git a/yarn.lock b/yarn.lock
index faa32ff02..2c13749dd 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -1850,7 +1850,7 @@
resolved "https://registry.yarnpkg.com/@types/events/-/events-3.0.0.tgz#2862f3f58a9a7f7c3e78d79f130dd4d71c25c2a7"
integrity sha512-EaObqwIvayI5a8dCzhFrjKzVwKLxjoG9T6Ppd5CEo07LRKfQ8Yokw54r5+Wq7FaBQ+yXRvQAYPrHwya1/UFt9g==
-"@types/glob@5 - 7", "@types/glob@^7.1.1":
+"@types/glob@^7.1.1":
version "7.1.1"
resolved "https://registry.yarnpkg.com/@types/glob/-/glob-7.1.1.tgz#aa59a1c6e3fbc421e07ccd31a944c30eba521575"
integrity sha512-1Bh06cbWJUHMC97acuD6UMG29nMt0Aqz1vF3guLfG+kHHJhy3AyohZFFxYk2f7Q1SQIrNwvncxAE0N/9s70F2w==
@@ -1904,11 +1904,6 @@
resolved "https://registry.yarnpkg.com/@types/parse-json/-/parse-json-4.0.0.tgz#2f8bb441434d163b35fb8ffdccd7138927ffb8c0"
integrity sha512-//oorEZjL6sbPcKUaCdIGlIUeH26mgzimjBB77G6XRgnDl/L5wOnpyBGRe/Mmf5CVW3PwEBE1NjiMZ/ssFh4wA==
-"@types/parse5@^5":
- version "5.0.2"
- resolved "https://registry.yarnpkg.com/@types/parse5/-/parse5-5.0.2.tgz#a877a4658f8238c8266faef300ae41c84d72ec8a"
- integrity sha512-BOl+6KDs4ItndUWUFchy3aEqGdHhw0BC4Uu+qoDonN/f0rbUnJbm71Ulj8Tt9jLFRaAxPLKvdS1bBLfx1qXR9g==
-
"@types/q@^1.5.1":
version "1.5.2"
resolved "https://registry.yarnpkg.com/@types/q/-/q-1.5.2.tgz#690a1475b84f2a884fd07cd797c00f5f31356ea8"
@@ -4150,11 +4145,6 @@ css-select@^2.0.0:
domutils "^1.7.0"
nth-check "^1.0.2"
-css-selector-parser@^1.3:
- version "1.3.0"
- resolved "https://registry.yarnpkg.com/css-selector-parser/-/css-selector-parser-1.3.0.tgz#5f1ad43e2d8eefbfdc304fcd39a521664943e3eb"
- integrity sha1-XxrUPi2O77/cME/NOaUhZklD4+s=
-
css-tree@1.0.0-alpha.37:
version "1.0.0-alpha.37"
resolved "https://registry.yarnpkg.com/css-tree/-/css-tree-1.0.0-alpha.37.tgz#98bebd62c4c1d9f960ec340cf9f7522e30709a22"
@@ -6300,19 +6290,6 @@ getpass@^0.1.1:
dependencies:
assert-plus "^1.0.0"
-gettext-extractor@^3.5.2:
- version "3.5.2"
- resolved "https://registry.yarnpkg.com/gettext-extractor/-/gettext-extractor-3.5.2.tgz#485afb27362e128d33a7947c505e7da7a75a0609"
- integrity sha512-4fJViJvAkWBUV8BHwAaY2T1oirsIEAYgYfYm/+x/gF2xWxOXgn4f7Cjsdq+xuuoA9HZga+fx2PIDP+07zbmP6g==
- dependencies:
- "@types/glob" "5 - 7"
- "@types/parse5" "^5"
- css-selector-parser "^1.3"
- glob "5 - 7"
- parse5 "^5"
- pofile "1.0.x"
- typescript "2 - 3"
-
git-raw-commits@2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/git-raw-commits/-/git-raw-commits-2.0.0.tgz#d92addf74440c14bcc5c83ecce3fb7f8a79118b5"
@@ -6367,7 +6344,7 @@ glob-to-regexp@^0.3.0:
resolved "https://registry.yarnpkg.com/glob-to-regexp/-/glob-to-regexp-0.3.0.tgz#8c5a1494d2066c570cc3bfe4496175acc4d502ab"
integrity sha1-jFoUlNIGbFcMw7/kSWF1rMTVAqs=
-"glob@5 - 7", glob@^7.0.0, glob@^7.0.3, glob@^7.0.5, glob@^7.1.1, glob@^7.1.2, glob@^7.1.3, glob@^7.1.4, glob@^7.1.6, glob@~7.1.1:
+glob@^7.0.0, glob@^7.0.3, glob@^7.0.5, glob@^7.1.1, glob@^7.1.2, glob@^7.1.3, glob@^7.1.4, glob@^7.1.6, glob@~7.1.1:
version "7.1.6"
resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.6.tgz#141f33b81a7c2492e125594307480c46679278a6"
integrity sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==
@@ -9571,11 +9548,6 @@ parse5@^3.0.1:
dependencies:
"@types/node" "*"
-parse5@^5:
- version "5.1.1"
- resolved "https://registry.yarnpkg.com/parse5/-/parse5-5.1.1.tgz#f68e4e5ba1852ac2cadc00f4555fff6c2abb6178"
- integrity sha512-ugq4DFI0Ptb+WWjAdOK16+u/nHfiIrcE+sh8kZMaM0WllQKLI9rOUq6c2b7cwPkXdzfQESqvoqK6ug7U/Yyzug==
-
parseurl@~1.3.2, parseurl@~1.3.3:
version "1.3.3"
resolved "https://registry.yarnpkg.com/parseurl/-/parseurl-1.3.3.tgz#9da19e7bee8d12dff0513ed5b76957793bc2e8d4"
@@ -9800,11 +9772,6 @@ pnp-webpack-plugin@1.6.4:
dependencies:
ts-pnp "^1.1.6"
-pofile@1.0.x:
- version "1.0.11"
- resolved "https://registry.yarnpkg.com/pofile/-/pofile-1.0.11.tgz#35aff58c17491d127a07336d5522ebc9df57c954"
- integrity sha512-Vy9eH1dRD9wHjYt/QqXcTz+RnX/zg53xK+KljFSX30PvdDMb2z+c6uDUeblUGqqJgz3QFsdlA0IJvHziPmWtQg==
-
popper.js@^1.16.0:
version "1.16.1"
resolved "https://registry.yarnpkg.com/popper.js/-/popper.js-1.16.1.tgz#2a223cb3dc7b6213d740e40372be40de43e65b1b"
@@ -12871,11 +12838,6 @@ typedarray@^0.0.6:
resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777"
integrity sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=
-"typescript@2 - 3":
- version "3.8.2"
- resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.8.2.tgz#91d6868aaead7da74f493c553aeff76c0c0b1d5a"
- integrity sha512-EgOVgL/4xfVrCMbhYKUQTdF37SQn4Iw73H5BgCrF1Abdun7Kwy/QZsE/ssAy0y4LxBbvua3PIbFsbRczWWnDdQ==
-
uc.micro@^1.0.1, uc.micro@^1.0.5:
version "1.0.6"
resolved "https://registry.yarnpkg.com/uc.micro/-/uc.micro-1.0.6.tgz#9c411a802a409a91fc6cf74081baba34b24499ac"
From c70ae9f63ea36b56f795b2d6189c48c6cbfa7508 Mon Sep 17 00:00:00 2001
From: CD Cabrera
Date: Wed, 24 Jun 2020 17:41:57 -0400
Subject: [PATCH 11/16] fix(tourView): issues/289 remove unused tourView (#326)
* tourView, component removed
* i18n, remove tourView locale strings
* routerTypes, component removed
* tests, dist/integration file check
---
public/locales/en-US.json | 10 --
.../__tests__/__snapshots__/i18n.test.js.snap | 41 -----
.../__snapshots__/router.test.js.snap | 6 -
.../__snapshots__/routerHelpers.test.js.snap | 7 +-
.../__snapshots__/routerTypes.test.js.snap | 14 --
.../router/__tests__/routerHelpers.test.js | 6 +-
src/components/router/routerTypes.js | 9 -
.../__snapshots__/tourView.test.js.snap | 169 ------------------
.../tourView/__tests__/tourView.test.js | 30 ----
src/components/tourView/tourView.js | 123 -------------
src/images/subscriptions.svg | 36 ----
tests/__snapshots__/dist.test.js.snap | 1 -
12 files changed, 7 insertions(+), 445 deletions(-)
delete mode 100644 src/components/tourView/__tests__/__snapshots__/tourView.test.js.snap
delete mode 100644 src/components/tourView/__tests__/tourView.test.js
delete mode 100644 src/components/tourView/tourView.js
delete mode 100644 src/images/subscriptions.svg
diff --git a/public/locales/en-US.json b/public/locales/en-US.json
index 21959bf06..bd2ea241d 100644
--- a/public/locales/en-US.json
+++ b/public/locales/en-US.json
@@ -71,16 +71,6 @@
"tourTitleImageAlt": "Ready to get started example graph.",
"tourDescription": "We'll walk you through each step, and include insight into how Red Hat collects and uses subscription data."
},
- "curiosity-tour": {
- "emptyStateIconAlt": "{{appName}} logo",
- "emptyStateTitle": "{{appName}} is an early access beta",
- "emptyStateDescription": "{{appName}} helps you understand your total subscription usage and capacity over time.",
- "emptyStateDescriptionTour": "Take a quick tour to learn more.",
- "emptyStateDescriptionExtended": "If you are interested in trying {{appName}}, your Red Hat account team can help.",
- "emptyStateButton": "Take a tour",
- "emptyStateLinkLearnMore": "Learn more",
- "emptyStateLinkContactUs": "Contact us"
- },
"curiosity-view": {
"openshift": "Red Hat OpenShift",
"rhel": "Red Hat Enterprise Linux"
diff --git a/src/components/i18n/__tests__/__snapshots__/i18n.test.js.snap b/src/components/i18n/__tests__/__snapshots__/i18n.test.js.snap
index acc9cb285..c288fd59c 100644
--- a/src/components/i18n/__tests__/__snapshots__/i18n.test.js.snap
+++ b/src/components/i18n/__tests__/__snapshots__/i18n.test.js.snap
@@ -326,47 +326,6 @@ Array [
},
],
},
- Object {
- "file": "./src/components/tourView/tourView.js",
- "keys": Array [
- Object {
- "key": "curiosity-tour.emptyStateIconAlt",
- "match": "t('curiosity-tour.emptyStateIconAlt', { appName: helpers.UI_DISPLAY_CONFIG_NAME })",
- },
- Object {
- "key": "curiosity-tour.emptyStateTitle",
- "match": "t('curiosity-tour.emptyStateTitle', { appName: helpers.UI_DISPLAY_CONFIG_NAME })",
- },
- Object {
- "key": "curiosity-tour.emptyStateDescription",
- "match": "t('curiosity-tour.emptyStateDescription', { appName: helpers.UI_DISPLAY_CONFIG_NAME })",
- },
- Object {
- "key": "curiosity-tour.emptyStateDescriptionTour",
- "match": "t('curiosity-tour.emptyStateDescriptionTour', { appName: helpers.UI_DISPLAY_CONFIG_NAME })",
- },
- Object {
- "key": "curiosity-tour.emptyStateDescriptionExtended",
- "match": "t('curiosity-tour.emptyStateDescriptionExtended', { appName: helpers.UI_DISPLAY_CONFIG_NAME })",
- },
- Object {
- "key": "curiosity-tour.emptyStateLinkLearnMore",
- "match": "t('curiosity-tour.emptyStateLinkLearnMore')",
- },
- Object {
- "key": "curiosity-tour.emptyStateButton",
- "match": "t('curiosity-tour.emptyStateButton')",
- },
- Object {
- "key": "curiosity-tour.emptyStateLinkLearnMore",
- "match": "t('curiosity-tour.emptyStateLinkLearnMore')",
- },
- Object {
- "key": "curiosity-tour.emptyStateLinkContactUs",
- "match": "t('curiosity-tour.emptyStateLinkContactUs')",
- },
- ],
- },
Object {
"file": "./src/redux/actions/userActions.js",
"keys": Array [
diff --git a/src/components/router/__tests__/__snapshots__/router.test.js.snap b/src/components/router/__tests__/__snapshots__/router.test.js.snap
index 4c6b84766..f9e8e1d7d 100644
--- a/src/components/router/__tests__/__snapshots__/router.test.js.snap
+++ b/src/components/router/__tests__/__snapshots__/router.test.js.snap
@@ -70,12 +70,6 @@ exports[`Router Component should render a basic component: basic 1`] = `
path="/openshift-sw"
render={[Function]}
/>
-
{
it('should return navigation and route details that align to location', () => {
expect({
- nav: getNavigationDetail({ id: 'soon' }),
- route: getRouteDetail({ id: 'soon' }),
- navRoute: getNavRouteDetail({ id: 'soon' })
+ nav: getNavigationDetail({ id: 'optin' }),
+ route: getRouteDetail({ id: 'optin' }),
+ navRoute: getNavRouteDetail({ id: 'optin' })
}).toMatchSnapshot('detail: specific route ID');
expect({
diff --git a/src/components/router/routerTypes.js b/src/components/router/routerTypes.js
index e8e4d8da3..0ec0000db 100644
--- a/src/components/router/routerTypes.js
+++ b/src/components/router/routerTypes.js
@@ -3,7 +3,6 @@ import { helpers } from '../../common/helpers';
import OpenshiftView from '../openshiftView/openshiftView';
import OptinView from '../optinView/optinView';
import RhelView from '../rhelView/rhelView';
-import TourView from '../tourView/tourView';
import { RHSM_API_PATH_ID_TYPES } from '../../types/rhsmApiTypes';
/**
@@ -57,14 +56,6 @@ const routes = [
render: true,
disabled: helpers.UI_DISABLED
},
- {
- id: 'soon',
- to: '/soon',
- component: TourView,
- exact: true,
- render: true,
- disabled: helpers.UI_DISABLED
- },
{
id: 'optin',
to: '/optin',
diff --git a/src/components/tourView/__tests__/__snapshots__/tourView.test.js.snap b/src/components/tourView/__tests__/__snapshots__/tourView.test.js.snap
deleted file mode 100644
index c8347f42b..000000000
--- a/src/components/tourView/__tests__/__snapshots__/tourView.test.js.snap
+++ /dev/null
@@ -1,169 +0,0 @@
-// Jest Snapshot v1, https://goo.gl/fbAQLP
-
-exports[`TourView Component should handle an error http status: error http status 1`] = `
-
-
- Subscription Watch
-
-
-
-
-
- t(curiosity-tour.emptyStateTitle, [object Object])
-
-
- t(curiosity-tour.emptyStateDescription, [object Object])
-
-
- t(curiosity-tour.emptyStateDescriptionExtended, [object Object])
-
-
- t(curiosity-tour.emptyStateLinkLearnMore)
-
-
-
- t(curiosity-tour.emptyStateLinkContactUs)
-
-
-
-
-
-`;
-
-exports[`TourView Component should have a fallback title: title 1`] = `
-
-
- Subscription Watch
-
-
-
-
-
- t(curiosity-tour.emptyStateTitle, [object Object])
-
-
- t(curiosity-tour.emptyStateDescription, [object Object])
- t(curiosity-tour.emptyStateDescriptionTour, [object Object])
-
-
- t(curiosity-tour.emptyStateDescriptionExtended, [object Object])
-
-
- t(curiosity-tour.emptyStateButton)
-
-
-
- t(curiosity-tour.emptyStateLinkLearnMore)
-
-
- t(curiosity-tour.emptyStateLinkContactUs)
-
-
-
-
-
-`;
-
-exports[`TourView Component should render a non-connected component: non-connected 1`] = `
-
-
- Subscription Watch
-
-
-
-
-
- t(curiosity-tour.emptyStateTitle, [object Object])
-
-
- t(curiosity-tour.emptyStateDescription, [object Object])
- t(curiosity-tour.emptyStateDescriptionTour, [object Object])
-
-
- t(curiosity-tour.emptyStateDescriptionExtended, [object Object])
-
-
- t(curiosity-tour.emptyStateButton)
-
-
-
- t(curiosity-tour.emptyStateLinkLearnMore)
-
-
- t(curiosity-tour.emptyStateLinkContactUs)
-
-
-
-
-
-`;
diff --git a/src/components/tourView/__tests__/tourView.test.js b/src/components/tourView/__tests__/tourView.test.js
deleted file mode 100644
index 7fc3cfcaf..000000000
--- a/src/components/tourView/__tests__/tourView.test.js
+++ /dev/null
@@ -1,30 +0,0 @@
-import React from 'react';
-import { shallow } from 'enzyme';
-import { TourView } from '../tourView';
-
-describe('TourView Component', () => {
- it('should render a non-connected component', () => {
- const props = {};
-
- const component = shallow( );
- expect(component).toMatchSnapshot('non-connected');
- });
-
- it('should have a fallback title', () => {
- const props = {};
-
- const component = shallow( );
- expect(component).toMatchSnapshot('title');
- });
-
- it('should handle an error http status', () => {
- const props = {
- session: {
- status: 418
- }
- };
-
- const component = shallow( );
- expect(component).toMatchSnapshot('error http status');
- });
-});
diff --git a/src/components/tourView/tourView.js b/src/components/tourView/tourView.js
deleted file mode 100644
index 97b846f4c..000000000
--- a/src/components/tourView/tourView.js
+++ /dev/null
@@ -1,123 +0,0 @@
-import React from 'react';
-import PropTypes from 'prop-types';
-import {
- Button,
- EmptyState,
- EmptyStateVariant,
- EmptyStateBody,
- EmptyStateSecondaryActions,
- Title
-} from '@patternfly/react-core';
-import { PageLayout, PageHeader, PageSection } from '../pageLayout/pageLayout';
-import { helpers } from '../../common';
-import { connectTranslate } from '../../redux';
-import subscriptionsSvg from '../../images/subscriptions.svg';
-
-/**
- * FixMe: Patternfly EmptyStateIcon can't pass a basic image
- * Requires the use of function based component syntax
- */
-/**
- * FixMe: Patternfly EmptyStateBody and Title appear to throw an error on translate string replacement
- * Wrap with a fragment to pass.
- */
-/**
- * Render a user guided tour view.
- *
- * @param {object} props
- * @param {object} props.session
- * @param {Function} props.t
- * @returns {Node} Node containing tour view.
- */
-const TourView = ({ session, t }) => (
-
- {helpers.UI_DISPLAY_CONFIG_NAME}
-
-
-
-
-
- {t('curiosity-tour.emptyStateTitle', { appName: helpers.UI_DISPLAY_CONFIG_NAME })}
-
-
-
-
- {t('curiosity-tour.emptyStateDescription', { appName: helpers.UI_DISPLAY_CONFIG_NAME })}
- {session.status !== 418 &&
- ` ${t('curiosity-tour.emptyStateDescriptionTour', { appName: helpers.UI_DISPLAY_CONFIG_NAME })}`}
-
-
-
-
- {t('curiosity-tour.emptyStateDescriptionExtended', { appName: helpers.UI_DISPLAY_CONFIG_NAME })}
-
-
- {(session.status === 418 && (
-
- {t('curiosity-tour.emptyStateLinkLearnMore')}
-
- )) || (
-
- {t('curiosity-tour.emptyStateButton')}
-
- )}
-
- {session.status !== 418 && (
-
- {t('curiosity-tour.emptyStateLinkLearnMore')}
-
- )}
-
- {t('curiosity-tour.emptyStateLinkContactUs')}
-
-
-
-
-
-);
-
-/**
- * Prop types.
- *
- * @type {{t: Function, session: object}}
- */
-TourView.propTypes = {
- session: PropTypes.shape({
- status: PropTypes.number
- }),
- t: PropTypes.func
-};
-
-/**
- * Default props.
- *
- * @type {{t: Function, session: {status: null}}}
- */
-TourView.defaultProps = {
- session: {
- status: null
- },
- t: helpers.noopTranslate
-};
-
-const mapStateToProps = state => ({ session: state.user.session });
-
-const ConnectedTourView = connectTranslate(mapStateToProps)(TourView);
-
-export { ConnectedTourView as default, ConnectedTourView, TourView };
diff --git a/src/images/subscriptions.svg b/src/images/subscriptions.svg
deleted file mode 100644
index 877c60ac9..000000000
--- a/src/images/subscriptions.svg
+++ /dev/null
@@ -1,36 +0,0 @@
-
-
-
-
-
-
-
diff --git a/tests/__snapshots__/dist.test.js.snap b/tests/__snapshots__/dist.test.js.snap
index b9588b8ec..574ec8ac9 100644
--- a/tests/__snapshots__/dist.test.js.snap
+++ b/tests/__snapshots__/dist.test.js.snap
@@ -26,6 +26,5 @@ Array [
"./build/static/media/pfbg_768*jpg",
"./build/static/media/pfbg_768@2x*jpg",
"./build/static/media/pfbg_992@2x*jpg",
- "./build/static/media/subscriptions*svg",
]
`;
From e654f4e50e9448ff835426081daa36a9786ae6d6 Mon Sep 17 00:00:00 2001
From: CD Cabrera
Date: Tue, 23 Jun 2020 13:46:15 -0400
Subject: [PATCH 12/16] fix(build): issues/296 npm updates for pf4, platform
(#326)
* tests, apply component displayNames to snapshots
* build, local dev run updates, header, branch parameter
* build, npm platform packages patched
* build, npm pf-react icons, tokens, styles, charts
* build, victory charts update sync to pf charts update
---
CONTRIBUTING.md | 13 +
package.json | 26 +-
scripts/dev.chrome.sh | 13 +-
.../__snapshots__/authentication.test.js.snap | 1 -
.../c3GraphCardLegendItem.test.js.snap | 11 +-
.../__snapshots__/chartArea.test.js.snap | 60 +-
.../graphCardChartLegend.test.js.snap | 47 +-
.../__snapshots__/optinView.test.js.snap | 48 +-
src/setupTests.js | 27 +
yarn.lock | 765 ++++++------------
10 files changed, 403 insertions(+), 608 deletions(-)
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index d09a9cda4..d5f8062b9 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -192,6 +192,19 @@ Once you have made the dotenv file and/or changes, like the below "debug" flags,
*Any changes you make to the `.env.local` file should be ignored with `.gitignore`.*
+
+##### Local CSS/Styling display vs Environments
+The default context for starting the local development run with
+ ```
+ $ yarn start
+ ```
+Comes with a caveat, it uses the [Platform Chrome](https://github.com/RedHatInsights/insights-chrome) CI/master branch as its basis. What
+this means is that potential styling changes will affect it, or not depending on recent updates. If styling is looking odd/off, or you
+simply want to use the production styling update the NPM script branch parameter, line 63. Simply change `master` to something like `prod-stable`.
+ ```
+ "dev:chrome": "sh ./scripts/dev.chrome.sh -b master"
+ ```
+
##### Graph display
You can apply a date override during **local development** (using `$ yarn start`) by adding the following line to your `.env.local` file.
```
diff --git a/package.json b/package.json
index 28130d88c..00557b80b 100644
--- a/package.json
+++ b/package.json
@@ -60,7 +60,7 @@
"build:js": "react-scripts build",
"build:post": "bash ./scripts/post.sh",
"build:pre": "bash ./scripts/pre.sh",
- "dev:chrome": "sh ./scripts/dev.chrome.sh",
+ "dev:chrome": "sh ./scripts/dev.chrome.sh -b master",
"release": "standard-version",
"start": "run-s dev:chrome; run-p -l api:dev start:js",
"start:js": "react-scripts start",
@@ -76,15 +76,15 @@
"test:local": "react-scripts test --env=jsdom --roots=./src"
},
"dependencies": {
- "@patternfly/patternfly": "2.71.6",
- "@patternfly/react-charts": "5.3.19",
- "@patternfly/react-core": "3.153.13",
- "@patternfly/react-icons": "3.15.16",
- "@patternfly/react-styles": "3.7.13",
- "@patternfly/react-tokens": "2.8.13",
- "@redhat-cloud-services/frontend-components": "1.0.24",
- "@redhat-cloud-services/frontend-components-notifications": "1.0.3",
- "@redhat-cloud-services/frontend-components-utilities": "1.0.3",
+ "@patternfly/patternfly": "4.16.7",
+ "@patternfly/react-charts": "6.5.4",
+ "@patternfly/react-core": "3.158.3",
+ "@patternfly/react-icons": "4.4.2",
+ "@patternfly/react-styles": "4.4.2",
+ "@patternfly/react-tokens": "4.5.2",
+ "@redhat-cloud-services/frontend-components": "1.0.29",
+ "@redhat-cloud-services/frontend-components-notifications": "1.0.4",
+ "@redhat-cloud-services/frontend-components-utilities": "1.0.4",
"axios": "^0.19.2",
"c3": "^0.7.15",
"classnames": "^2.2.6",
@@ -108,9 +108,9 @@
"redux-promise-middleware": "^6.1.2",
"redux-thunk": "^2.3.0",
"reselect": "^4.0.0",
- "victory": "^34.3.11",
- "victory-core": "^34.3.8",
- "victory-legend": "^34.3.8"
+ "victory": "^34.3.12",
+ "victory-core": "^34.3.12",
+ "victory-legend": "^34.3.12"
},
"devDependencies": {
"apidoc-mock": "^3.0.2",
diff --git a/scripts/dev.chrome.sh b/scripts/dev.chrome.sh
index edb3d7970..d5de81119 100644
--- a/scripts/dev.chrome.sh
+++ b/scripts/dev.chrome.sh
@@ -94,8 +94,14 @@ buildChrome()
printf "${YELLOW}dotenv includes ...${NOCOLOR}"
- HEADER_CONTENT=$(node -pe "require('fs').readFileSync('${SNIPPET_HEAD}').toString().replace(/\n/g, '').concat('')")
- BODY_CONTENT=$(node -pe "require('fs').readFileSync('${SNIPPET_BODY}').toString().replace(/\n/g,'').replace(/Logging in\.\.\./i, 'Development')")
+ HEADER_CONTENT_STR="require('fs').readFileSync('${SNIPPET_HEAD}').toString().replace(/\n/g, '').concat('')"
+
+ HEADER_CONTENT=$(node -pe "${HEADER_CONTENT_STR}")
+ BODY_CONTENT=$(node -pe "require('fs').readFileSync('${SNIPPET_BODY}').toString().replace(/\n/g,'')")
if [[ ! -z "$HEADER_CONTENT" ]] && [[ ! -z "$BODY_CONTENT" ]]; then
echo "\nREACT_APP_INCLUDE_CONTENT_HEADER=${HEADER_CONTENT}\nREACT_APP_INCLUDE_CONTENT_BODY=${BODY_CONTENT}\n" > ./.env.development.local
@@ -125,9 +131,10 @@ buildChrome()
HEAD=./public/apps/chrome/snippets/head.html
BODY=./public/apps/chrome/snippets/body.html
- while getopts u option;
+ while getopts b:u option;
do
case $option in
+ b ) BRANCH="$OPTARG";;
u ) UPDATE=true;;
esac
done
diff --git a/src/components/authentication/__tests__/__snapshots__/authentication.test.js.snap b/src/components/authentication/__tests__/__snapshots__/authentication.test.js.snap
index c38d29f16..ac3876901 100644
--- a/src/components/authentication/__tests__/__snapshots__/authentication.test.js.snap
+++ b/src/components/authentication/__tests__/__snapshots__/authentication.test.js.snap
@@ -127,7 +127,6 @@ exports[`Authentication Component should render a non-connected component error:
color="currentColor"
noVerticalAlign={false}
size="sm"
- title={null}
>
}
isDisabled={true}
@@ -25,7 +24,7 @@ exports[`C3GraphCardLegendItem Component should be able to display both threshol
`;
exports[`C3GraphCardLegendItem Component should be able to display both threshold and disabling icons: threshold 1`] = `
-
lorem ipsum
-
+
`;
exports[`C3GraphCardLegendItem Component should render a tooltip with button: tooltip 1`] = `
@@ -131,7 +130,7 @@ exports[`C3GraphCardLegendItem Component should render a tooltip with button: to
trigger="mouseenter focus"
zIndex={9999}
>
-
}
capHeight={0.71}
direction="inherit"
+ groupComponent={ }
lineHeight={1}
textComponent={ }
tspanComponent={ }
@@ -1076,8 +1078,10 @@ exports[`ChartArea Component should handle custom chart tooltips: renderTooltip:
cursorDimension="x"
cursorLabelComponent={
}
capHeight={0.71}
direction="inherit"
+ groupComponent={ }
lineHeight={1}
textComponent={ }
tspanComponent={ }
diff --git a/src/components/graphCard/__tests__/__snapshots__/graphCardChartLegend.test.js.snap b/src/components/graphCard/__tests__/__snapshots__/graphCardChartLegend.test.js.snap
index 19a2c3673..bf78bbc33 100644
--- a/src/components/graphCard/__tests__/__snapshots__/graphCardChartLegend.test.js.snap
+++ b/src/components/graphCard/__tests__/__snapshots__/graphCardChartLegend.test.js.snap
@@ -1,7 +1,7 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`GraphCardChartLegend Component should handle a click event: click event post 1`] = `
-
t(curiosity-graph.loremIpsumLabel,curiosity-graph.noLabel, [object Object])
-
+
`;
exports[`GraphCardChartLegend Component should handle a click event: click event pre 1`] = `
-
t(curiosity-graph.loremIpsumLabel,curiosity-graph.noLabel, [object Object])
-
+
`;
exports[`GraphCardChartLegend Component should handle a click event: click event update 1`] = `
-
}
isDisabled={false}
@@ -74,11 +73,11 @@ exports[`GraphCardChartLegend Component should handle a click event: click event
variant="link"
>
t(curiosity-graph.loremIpsumLabel,curiosity-graph.noLabel, [object Object])
-
+
`;
exports[`GraphCardChartLegend Component should handle variations in data when returning legend items: legend item, MISSING tooltip content 1`] = `
-
lorem ispum
-
+
`;
exports[`GraphCardChartLegend Component should handle variations in data when returning legend items: legend item, WITH tooltip content 1`] = `
@@ -139,7 +138,7 @@ exports[`GraphCardChartLegend Component should handle variations in data when re
trigger="mouseenter focus"
zIndex={9999}
>
-
lorem ispum
-
+
`;
exports[`GraphCardChartLegend Component should handle variations in data when returning legend items: legend item, disabled 1`] = `
-
}
isDisabled={true}
@@ -184,7 +182,7 @@ exports[`GraphCardChartLegend Component should handle variations in data when re
variant="link"
>
lorem ispum
-
+
`;
exports[`GraphCardChartLegend Component should render a basic component: basic 1`] = `
@@ -225,7 +223,7 @@ exports[`GraphCardChartLegend Component should render a basic component: basic 1
trigger="mouseenter focus"
zIndex={9999}
>
-
t(curiosity-graph.loremIpsumLabel,curiosity-graph.noLabel, [object Object])
-
+
`;
@@ -291,7 +289,7 @@ exports[`GraphCardChartLegend Component should render basic data: data 1`] = `
trigger="mouseenter focus"
zIndex={9999}
>
-
t(curiosity-graph.loremIpsumLabel,curiosity-graph.noLabel, [object Object])
-
+
-
}
isDisabled={true}
@@ -371,7 +368,7 @@ exports[`GraphCardChartLegend Component should render basic data: data 1`] = `
variant="link"
>
t(curiosity-graph.ametConsecteturLabel,curiosity-graph.noLabel, [object Object])
-
+
-
t(curiosity-graph.dolorSitLabel,curiosity-graph.thresholdLabel, [object Object])
-
+
-
t(curiosity-graph.nonCursusLabel,curiosity-graph.thresholdLabel, [object Object])
-
+
`;
diff --git a/src/components/optinView/__tests__/__snapshots__/optinView.test.js.snap b/src/components/optinView/__tests__/__snapshots__/optinView.test.js.snap
index a43eaf088..656423d34 100644
--- a/src/components/optinView/__tests__/__snapshots__/optinView.test.js.snap
+++ b/src/components/optinView/__tests__/__snapshots__/optinView.test.js.snap
@@ -88,12 +88,12 @@ exports[`OptinView Component should render a non-connected component: non-connec
@@ -139,12 +139,12 @@ exports[`OptinView Component should render a non-connected component: non-connec
t(curiosity-optin.tourDescription)
-
t(curiosity-optin.buttonTour)
-
+
@@ -159,12 +159,12 @@ exports[`OptinView Component should render an API state driven view: 4XX view 1`
@@ -174,12 +174,12 @@ exports[`OptinView Component should render an API state driven view: 200 view 1`
@@ -189,12 +189,12 @@ exports[`OptinView Component should render an API state driven view: 401 view 1`
@@ -204,12 +204,12 @@ exports[`OptinView Component should render an API state driven view: 403 view 1`
@@ -219,12 +219,12 @@ exports[`OptinView Component should render an API state driven view: 500 view 1`
@@ -242,12 +242,12 @@ exports[`OptinView Component should render an API state driven view: fulfilled v