Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Environment Sync, Beta to Stable #1090

Merged
merged 14 commits into from
Apr 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 14 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -216,12 +216,23 @@ This project makes use of reserved CSS class prefixes used by external resources
CSS classes with the prefix `uxui-` are used by external resources to identify elements for use in 3rd party tooling. Changes to the class name or element should be broadcast towards our UI/UX team members.

### Reserved QE testing attributes
This project makes use of reserved DOM attributes used by the QE team.
> Updating elements with these attributes should be done with the knowledge "you are affecting" QE's ability to test.
This project makes use of reserved DOM attributes and string identifiers used by the QE team.
> Updating elements with these attributes, or settings, should be done with the knowledge "you are affecting" QE's ability to test.
> And it is recommended you coordinate with QE before altering these attributes, settings.

1. Attribute `data-test`

DOM attributes with `data-test=""` are used by QE as a means to identify specific DOM elements.
- DOM attributes with `data-test=""` are used by QE as a means to identify specific DOM elements.
- To use simply place `data-test="[your-id-coordinated-with-QE]`" onto a DOM element.

2. `testId` used with i18next `translate` or `t`

- The i18next `translate` or `t` function supports the use of a `testId` setting. This `testId` wraps a
`<span data-test=[testId|locale string id]>[locale string]</span>` around copy content.
- To use add the `testId` to your locale string function call use
- `t('locale.string.id', { testId: true })`. In this example, this would populate `locale.string.id` as the testId.
- or `t('locale.string.id', { testId: 'custom-id-coordinated-with-QE' })`
- or `t('locale.string.id', { testId: <div data-test="custom-element-wrapper-and-id" /> })`

### Reserved Files
#### Spandx Config
Expand Down
1 change: 1 addition & 0 deletions config/jest.setupTests.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ global.window.insights = {
})
)
},
getBundleData: Function.prototype,
getUserPermissions: () => [],
hideGlobalFilter: Function.prototype,
identifyApp: Function.prototype,
Expand Down
2 changes: 1 addition & 1 deletion jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ module.exports = {
'!src/app.js',
'!src/bootstrap.js',
'!src/entry.js',
'!src/index.js',
'!src/index*.js',
'!src/components/**/index.js',
'!src/common/index.js',
'!src/redux/index.js',
Expand Down
38 changes: 19 additions & 19 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,33 +73,33 @@
},
"dependencies": {
"@joi/date": "^2.1.0",
"@patternfly/patternfly": "4.221.2",
"@patternfly/react-charts": "6.94.12",
"@patternfly/react-core": "4.264.0",
"@patternfly/react-icons": "4.93.0",
"@patternfly/react-styles": "4.92.0",
"@patternfly/react-table": "4.111.45",
"@patternfly/react-tokens": "4.94.0",
"@patternfly/patternfly": "4.224.2",
"@patternfly/react-charts": "6.94.18",
"@patternfly/react-core": "4.276.6",
"@patternfly/react-icons": "4.93.6",
"@patternfly/react-styles": "4.92.6",
"@patternfly/react-table": "4.112.39",
"@patternfly/react-tokens": "4.94.6",
"@redhat-cloud-services/frontend-components": "3.9.25",
"@redhat-cloud-services/frontend-components-notifications": "3.2.12",
"@redhat-cloud-services/frontend-components-utilities": "3.3.9",
"@redhat-cloud-services/frontend-components-utilities": "3.3.13",
"axios": "^0.27.2",
"classnames": "^2.3.2",
"crypto-js": "^4.1.1",
"fastest-levenshtein": "^1.0.16",
"i18next": "^22.0.6",
"i18next-http-backend": "^2.1.1",
"i18next": "^22.4.11",
"i18next-http-backend": "^2.2.0",
"iso-639-1": "^2.1.15",
"joi": "^17.8.3",
"joi": "^17.8.4",
"js-cookie": "^3.0.1",
"lodash": "^4.17.21",
"lru-cache": "^7.14.1",
"lru-cache": "^7.18.3",
"moment": "^2.29.4",
"numbro": "^2.3.6",
"prop-types": "^15.8.1",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"react-i18next": "^12.0.0",
"react-i18next": "^12.2.0",
"react-redux": "^8.0.5",
"react-router": "6.8.1",
"react-router-dom": "6.8.1",
Expand All @@ -113,9 +113,9 @@
"victory-create-container": "36.6.8"
},
"devDependencies": {
"@babel/core": "7.21.0",
"@babel/core": "7.21.3",
"@babel/eslint-parser": "^7.19.1",
"@redhat-cloud-services/frontend-components-config": "4.6.34",
"@redhat-cloud-services/frontend-components-config": "4.7.0",
"@wojtekmaj/enzyme-adapter-react-17": "^0.8.0",
"apidoc-mock": "^4.1.0",
"babel-jest": "^29.4.3",
Expand All @@ -128,9 +128,9 @@
"dotenv-webpack": "^8.0.1",
"enzyme": "^3.11.0",
"enzyme-to-json": "^3.6.2",
"eslint": "8.34.0",
"eslint": "8.36.0",
"eslint-config-airbnb": "^19.0.4",
"eslint-config-prettier": "^8.6.0",
"eslint-config-prettier": "^8.7.0",
"eslint-config-react-app": "^7.0.1",
"eslint-plugin-flowtype": "^8.0.3",
"eslint-plugin-import": "^2.26.0",
Expand All @@ -144,13 +144,13 @@
"eslint-webpack-plugin": "^4.0.0",
"express": "^4.18.2",
"glob": "^8.1.0",
"jest": "29.4.3",
"jest": "29.5.0",
"jest-environment-jsdom": "29.4.3",
"jest-resolve": "29.4.3",
"jest-watch-typeahead": "2.2.2",
"jsdoc-to-markdown": "^8.0.0",
"moxios": "^0.4.0",
"npm-check-updates": "^16.7.9",
"npm-check-updates": "^16.10.0",
"npm-run-all": "^4.1.5",
"prettier": "^2.8.4",
"react-scripts": "^5.0.1",
Expand Down
46 changes: 3 additions & 43 deletions public/locales/en-US.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,31 +11,25 @@
"curiosity-graph": {
"cardActionTotal": "{{total}} used",
"cardActionTotal_Cores": "{{total}} core hours used",
"cardActionTotal_coreHours": "{{total}} core hours used",
"cardHeading": "CPU usage",
"cardHeading_cores": "CPU core usage",
"cardHeading_cores_OpenShift Container Platform": "CPU core usage",
"cardHeading_cores_OpenShift-metrics": "CPU core usage",
"cardHeading_cores_OpenShift-dedicated-metrics": "CPU core usage",
"cardHeading": "Usage",
"cardHeading_Cores": "vCPU hours",
"cardHeading_sockets": "CPU socket usage",
"cardHeading_Cores_OpenShift-metrics": "On-Demand subscriptions",
"cardHeading_Instance-hours": "Instance hours",
"cardHeading_Storage-gibibytes": "Data storage",
"cardHeading_Storage-gibibyte-months": "Data storage",
"cardHeading_Transfer-gibibytes": "Data transfer",
"cardHeading_OpenShift Container Platform": "Annual subscriptions",
"cardHeading_OpenShift-metrics": "On-Demand subscriptions",
"cardHeading_OpenShift-dedicated-metrics": "On-Demand subscriptions",
"cardHeading_RHEL": "CPU socket usage",
"cardHeading_Satellite": "CPU socket usage",
"cardHeadingDescription": "...",
"cardHeadingDescription_Cores": "vCPU hours usage in hours",
"cardHeadingDescription_Cores_OpenShift-metrics": "A subscription model that offers purchasing options to match your usage patterns.",
"cardHeadingDescription_Instance-hours": "Instance hours usage in hours",
"cardHeadingDescription_Storage-gibibytes": "Data storage usage in binary gigabyte hours",
"cardHeadingDescription_Storage-gibibyte-months": "Data storage usage in binary gigabyte months",
"cardHeadingDescription_Transfer-gibibytes": "Data transfer usage in binary gigabytes",
"cardHeadingDescription_OpenShift Container Platform": "A pre-paid subscription model that offers a designated maximum quota of units within a set time frame.",
"cardHeadingDescription_OpenShift-metrics": "A subscription model that offers purchasing options to match your usage patterns.",
"cardHeadingDescription_OpenShift-dedicated-metrics": "A subscription model that offers purchasing options to match your usage patterns.",
"cardHeadingMetric": "Total",
"cardHeadingMetric_dailyTotal": "Daily total",
Expand Down Expand Up @@ -65,10 +59,6 @@
"label_axisY_Storage-gibibytes": "Binary gigabyte hours",
"label_axisY_Storage-gibibyte-months": "Binary gigabyte months",
"label_axisY_Transfer-gibibytes": "Binary gigabytes",
"label_cores": "Cores",
"label_cores_OpenShift Container Platform": "Cores",
"label_cores_OpenShift-metrics": "Cores",
"label_cores_OpenShift-dedicated-metrics": "Cores",
"label_Cores": "vCPU hours",
"label_Cores_OpenShift Container Platform": "Cores",
"label_Cores_OpenShift-metrics": "Core hours",
Expand All @@ -77,20 +67,12 @@
"label_Cores_hypervisor": "Hypervisor",
"label_Cores_physical": "Physical cores",
"label_Cores_virtual": "Virtual",
"label_coreHours": "Core hours",
"label_instanceHours": "Instance hours",
"label_Instance-hours": "Instance hours",
"label_sockets": "Sockets",
"label_Sockets": "Sockets",
"label_Sockets_cloud": "Public cloud",
"label_Sockets_hypervisor": "Hypervisor",
"label_Sockets_physical": "Physical",
"label_Sockets_virtual": "Virtual",
"label_cloudSockets": "Public cloud",
"label_hypervisorCores": "Virtualized cores",
"label_hypervisorSockets": "Virtualized {{product}}",
"label_physicalCores": "Physical cores",
"label_physicalSockets": "Physical {{product}}",
"label_no": "Data",
"label_noData": "no data",
"label_noData_error": "No data",
Expand All @@ -100,29 +82,14 @@
"label_threshold_infinite": "<0>unlimited</0>",
"label_threshold_Cores": "Subscription threshold",
"label_threshold_Sockets": "Subscription threshold",
"label_thresholdCores": "Subscription threshold",
"label_thresholdSockets": "Subscription threshold",
"label_Transfer-gibibytes": "Data transfer",
"legendTooltip": "{{product}} metric usage",
"legendTooltip_cores": "{{product}} CPU usage, per CPU core.",
"legendTooltip_cores_OpenShift Container Platform": "{{product}} CPU usage, per CPU core.",
"legendTooltip_cores_OpenShift-metrics": "{{product}} CPU usage, per CPU core.",
"legendTooltip_cores_OpenShift-dedicated-metrics": "{{product}} CPU usage, per CPU core.",
"legendTooltip_Cores": "vCPU hours usage",
"legendTooltip_Cores_OpenShift Container Platform": "{{product}} CPU usage, per CPU core.",
"legendTooltip_Cores_OpenShift-metrics": "OpenShift Container Platform <0>On-Demand</0> core hour usage.",
"legendTooltip_Cores_OpenShift-dedicated-metrics": "OpenShift Dedicated <0>On-Demand</0> core hour usage.",
"legendTooltip_coreHours": "{{product}} core hours usage.",
"legendTooltip_coreHours_OpenShift-dedicated-metrics": "OpenShift Dedicated <0>On-Demand</0> core hour usage.",
"legendTooltip_Instance-hours": "Instance hours usage",
"legendTooltip_Instance-hours_OpenShift-dedicated-metrics": "OpenShift Dedicated <0>On-Demand</0> instance hour usage.",
"legendTooltip_instanceHours_OpenShift-dedicated-metrics": "OpenShift Dedicated <0>On-Demand</0> instance hour usage.",
"legendTooltip_coreHours_OpenShift-metrics": "OpenShift Container Platform <0>On-Demand</0> core hour usage.",
"legendTooltip_cloudSockets": "Public cloud {{product}} CPU usage, 1 CPU socket per instance.",
"legendTooltip_hypervisorCores": "{{product}} CPU usage, per CPU core.",
"legendTooltip_hypervisorSockets": "{{product}} CPU socket usage, per socket pair.",
"legendTooltip_physicalCores": "{{product}} CPU usage, per CPU core.",
"legendTooltip_physicalSockets": "{{product}} CPU socket usage, per socket pair.",
"legendTooltip_Sockets": "{{product}} CPU usage, per CPU socket pair.",
"legendTooltip_Sockets_cloud": "Public cloud {{product}} CPU usage, per socket. Each instance is considered a single socket.",
"legendTooltip_Sockets_hypervisor": "{{product}} CPU socket usage, per socket pair.",
Expand All @@ -131,19 +98,12 @@
"legendTooltip_Sockets_physical_RHEL": "Physical {{product}} CPU usage, per socket pair. Each system's socket count is rounded upward to the next even number.",
"legendTooltip_Sockets_virtual": "{{product}} CPU socket usage, per socket pair.",
"legendTooltip_Sockets_virtual_RHEL": "Virtual {{product}} CPU usage, per socket. Each virtual machine without host-guest mapping is considered a single socket.",
"legendTooltip_sockets": "{{product}} CPU usage, per CPU socket pair.",
"legendTooltip_Storage-gibibytes": "Data storage usage",
"legendTooltip_Storage-gibibyte-months": "Data storage usage",
"legendTooltip_threshold_Cores_OpenShift Container Platform": "Maximum capacity, as CPU cores, based on total {{product}} Annual subscriptions in this account.",
"legendTooltip_threshold_Sockets": "Maximum capacity, based on total {{product}} subscriptions in this account.",
"legendTooltip_threshold_Sockets_OpenShift Container Platform": "Maximum capacity, as CPU sockets, based on total {{product}} Annual subscriptions in this account.",
"legendTooltip_threshold_Sockets_RHEL": "Maximum capacity, as CPU sockets, based on total {{product}} subscriptions in this account.",
"legendTooltip_thresholdCores_OpenShift Container Platform": "Maximum capacity, as CPU cores, based on total {{product}} Annual subscriptions in this account.",
"legendTooltip_thresholdSockets": "Maximum capacity, based on total {{product}} subscriptions in this account.",
"legendTooltip_thresholdSockets_OpenShift Container Platform": "Maximum capacity, as CPU sockets, based on total {{product}} Annual subscriptions in this account.",
"legendTooltip_threshold_thresholdSockets": "Maximum capacity, based on total {{product}} subscriptions in this account.",
"legendTooltip_threshold_thresholdCores_OpenShift Container Platform": "Maximum capacity, as CPU cores, based on total {{product}} Annual subscriptions in this account.",
"legendTooltip_threshold_thresholdSockets_OpenShift Container Platform": "Maximum capacity, as CPU sockets, based on total {{product}} Annual subscriptions in this account.",
"legendTooltip_Transfer-gibibytes": "Data transfer usage",
"tooltipSummary": "Your subscription data facets. With one level of column and row headers."
},
Expand Down
43 changes: 19 additions & 24 deletions src/common/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,7 @@ Download the debug log file.
* [General](#Helpers.module_General)
* [~noop](#Helpers.module_General..noop)
* [~noopPromise](#Helpers.module_General..noopPromise) : <code>Promise.&lt;{}&gt;</code>
* [~setImmutableData](#Helpers.module_General..setImmutableData) ⇒ <code>\*</code>
* [~DEV_MODE](#Helpers.module_General..DEV_MODE) : <code>boolean</code>
* [~PROD_MODE](#Helpers.module_General..PROD_MODE) : <code>boolean</code>
* [~REVIEW_MODE](#Helpers.module_General..REVIEW_MODE) : <code>boolean</code>
Expand Down Expand Up @@ -204,7 +205,6 @@ Download the debug log file.
* [~isPromise(obj)](#Helpers.module_General..isPromise) ⇒ <code>boolean</code>
* [~generateHash(anyValue, options)](#Helpers.module_General..generateHash) ⇒ <code>\*</code> \| <code>string</code>
* [~memo(func, options)](#Helpers.module_General..memo) ⇒ <code>function</code>
* [~noopTranslate(key, value, components)](#Helpers.module_General..noopTranslate) ⇒ <code>string</code>
* [~numberDisplay(value)](#Helpers.module_General..numberDisplay) ⇒ <code>numbro.Numbro</code> \| <code>\*</code>
* [~objFreeze(obj)](#Helpers.module_General..objFreeze) ⇒ <code>\*</code>
* [~browserExpose(obj, options)](#Helpers.module_General..browserExpose)
Expand All @@ -223,6 +223,24 @@ An empty promise.
Typically used as a default prop, or during testing.

**Kind**: inner constant of [<code>General</code>](#Helpers.module_General)
<a name="Helpers.module_General..setImmutableData"></a>

### General~setImmutableData ⇒ <code>\*</code>
Quick set data as "immutable-like". Used to pass object and array data through configuration callbacks.

**Kind**: inner constant of [<code>General</code>](#Helpers.module_General)
<table>
<thead>
<tr>
<th>Param</th><th>Type</th>
</tr>
</thead>
<tbody>
<tr>
<td>data</td><td><code>*</code></td>
</tr> </tbody>
</table>

<a name="Helpers.module_General..DEV_MODE"></a>

### General~DEV\_MODE : <code>boolean</code>
Expand Down Expand Up @@ -529,29 +547,6 @@ Simple memoize, cache based arguments with adjustable limit.
</tr> </tbody>
</table>

<a name="Helpers.module_General..noopTranslate"></a>

### General~noopTranslate(key, value, components) ⇒ <code>string</code>
A placeholder for "t", translation method.
Associated with the i18n package, and typically used as a default prop.

**Kind**: inner method of [<code>General</code>](#Helpers.module_General)
<table>
<thead>
<tr>
<th>Param</th><th>Type</th>
</tr>
</thead>
<tbody>
<tr>
<td>key</td><td><code>string</code> | <code>Array</code></td>
</tr><tr>
<td>value</td><td><code>string</code> | <code>object</code> | <code>Array</code></td>
</tr><tr>
<td>components</td><td><code>Array</code></td>
</tr> </tbody>
</table>

<a name="Helpers.module_General..numberDisplay"></a>

### General~numberDisplay(value) ⇒ <code>numbro.Numbro</code> \| <code>\*</code>
Expand Down
6 changes: 3 additions & 3 deletions src/common/__tests__/__snapshots__/helpers.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,9 @@ exports[`Helpers should expose a window object: limited window object 1`] = `
"memo": [Function],
"noop": [Function],
"noopPromise": Promise {},
"noopTranslate": [Function],
"numberDisplay": [Function],
"objFreeze": [Function],
"setImmutableData": [Function],
}
`;

Expand Down Expand Up @@ -90,9 +90,9 @@ exports[`Helpers should expose a window object: window object 1`] = `
"memo": [Function],
"noop": [Function],
"noopPromise": Promise {},
"noopTranslate": [Function],
"numberDisplay": [Function],
"objFreeze": [Function],
"setImmutableData": [Function],
}
`;

Expand Down Expand Up @@ -146,9 +146,9 @@ exports[`Helpers should have specific functions: helpers 1`] = `
"memo": [Function],
"noop": [Function],
"noopPromise": Promise {},
"noopTranslate": [Function],
"numberDisplay": [Function],
"objFreeze": [Function],
"setImmutableData": [Function],
}
`;

Expand Down
Loading