diff --git a/package-lock.json b/package-lock.json index ef13e67819..7e6d0a62fa 100644 --- a/package-lock.json +++ b/package-lock.json @@ -44,7 +44,7 @@ "@babel/preset-env": "7.15.4", "@babel/preset-flow": "7.14.5", "@babel/preset-react": "7.14.5", - "@cypress/code-coverage": "^3.10.0", + "@cypress/code-coverage": "^3.12.37", "@cypress/react18": "^2.0.1", "@formatjs/cli": "4.2.33", "@redhat-cloud-services/frontend-components-config": "^6.0.13", @@ -1941,15 +1941,15 @@ } }, "node_modules/@cypress/code-coverage": { - "version": "3.12.19", - "resolved": "https://registry.npmjs.org/@cypress/code-coverage/-/code-coverage-3.12.19.tgz", - "integrity": "sha512-RNpgESArIwX2PG7k0KEb941eSYSBEGF1WB5NPeWrVJMX6KeAxj3Ki5aeYlFeV+wxoAJ+7gcF4s5xV18BQLCpjQ==", + "version": "3.13.4", + "resolved": "https://registry.npmjs.org/@cypress/code-coverage/-/code-coverage-3.13.4.tgz", + "integrity": "sha512-4Bne95y/Vkye9tfctyiKjYHirA/0LZq7Z5MiCrrT2mlyWfaOSnPeUHG84BdxuycgVOLzMFxqvc+uNQO5lupvTg==", "dev": true, "dependencies": { "@cypress/webpack-preprocessor": "^6.0.0", "chalk": "4.1.2", - "dayjs": "1.11.10", - "debug": "4.3.4", + "dayjs": "1.11.13", + "debug": "4.3.7", "execa": "4.1.0", "globby": "11.1.0", "istanbul-lib-coverage": "^3.0.0", @@ -10601,9 +10601,9 @@ "dev": true }, "node_modules/dayjs": { - "version": "1.11.10", - "resolved": "https://registry.npmjs.org/dayjs/-/dayjs-1.11.10.tgz", - "integrity": "sha512-vjAczensTgRcqDERK0SR2XMwsF/tSvnvlv6VcF2GIhg6Sx4yOIt/irsr1RDJsKiIyBzJDpCoXiWWq28MqH2cnQ==" + "version": "1.11.13", + "resolved": "https://registry.npmjs.org/dayjs/-/dayjs-1.11.13.tgz", + "integrity": "sha512-oaMBel6gjolK862uaPQOVTA7q3TZhuSvuMQAAglQDOWYO9A91IrAOUJEyKVlqJlHE0vq5p5UXxzdPfMH/x6xNg==" }, "node_modules/debounce-promise": { "version": "3.1.2", @@ -10611,11 +10611,11 @@ "integrity": "sha512-rZHcgBkbYavBeD9ej6sP56XfG53d51CD4dnaw989YX/nZ/ZJfgRx/9ePKmTNiUiyQvh4mtrMoS3OAWW+yoYtpg==" }, "node_modules/debug": { - "version": "4.3.4", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", - "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "version": "4.3.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.7.tgz", + "integrity": "sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ==", "dependencies": { - "ms": "2.1.2" + "ms": "^2.1.3" }, "engines": { "node": ">=6.0" @@ -19753,9 +19753,9 @@ } }, "node_modules/ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==" }, "node_modules/multicast-dns": { "version": "7.2.5", @@ -22983,12 +22983,6 @@ "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", "dev": true }, - "node_modules/send/node_modules/ms": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", - "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", - "dev": true - }, "node_modules/serialize-javascript": { "version": "6.0.2", "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.2.tgz", diff --git a/package.json b/package.json index 93e1778a10..940bffda2a 100644 --- a/package.json +++ b/package.json @@ -88,7 +88,7 @@ "@babel/preset-env": "7.15.4", "@babel/preset-flow": "7.14.5", "@babel/preset-react": "7.14.5", - "@cypress/code-coverage": "^3.10.0", + "@cypress/code-coverage": "^3.12.37", "@cypress/react18": "^2.0.1", "@formatjs/cli": "4.2.33", "@redhat-cloud-services/frontend-components-config": "^6.0.13", diff --git a/pr_check.sh b/pr_check.sh index 63613d5393..92507def5f 100755 --- a/pr_check.sh +++ b/pr_check.sh @@ -4,6 +4,7 @@ export COMPONENT="insights-dashboard-frontend" export IMAGE="quay.io/cloudservices/$COMPONENT" export WORKSPACE=${WORKSPACE:-$APP_ROOT} # if running in jenkins, use the build's workspace export APP_ROOT=$(pwd) +export NODE_BUILD_VERSION=18 cat /etc/redhat-release COMMON_BUILDER=https://raw.githubusercontent.com/RedHatInsights/insights-frontend-builder-common/master diff --git a/src/Messages.js b/src/Messages.js index 4cb2a67f36..9908482840 100644 --- a/src/Messages.js +++ b/src/Messages.js @@ -450,11 +450,7 @@ export default defineMessages({ description: 'Learn more about Insights', defaultMessage: 'Learn more about Insights' }, - insightsDescription: { - id: 'insightsDescription', - description: 'insights Description', - defaultMessage: 'Single, consistent management solution across on-premise, hybrid cloud, and public cloud. Included with Red Hat Enterprise Linux subscription. Single, consistent management solution across on-premise, hybrid cloud, and public cloud.' - }, + insightsDescription: 'Single, consistent management solution across on-premise, hybrid cloud, and public cloud. Included with Red Hat Enterprise Linux subscription. Single, consistent management solution across on-premise, hybrid cloud, and public cloud.', contactsales: { id: 'contactsales', description: 'Contact sales', diff --git a/src/PresentationalComponents/ZeroState/AppZeroState.js b/src/PresentationalComponents/ZeroState/AppZeroState.js index 52595e576c..29cff48123 100644 --- a/src/PresentationalComponents/ZeroState/AppZeroState.js +++ b/src/PresentationalComponents/ZeroState/AppZeroState.js @@ -5,7 +5,7 @@ import ZeroStateFooter from './ZeroStateFooter'; import propTypes from 'prop-types'; import { IntlProvider } from '@redhat-cloud-services/frontend-components-translations'; import { useAxiosWithPlatformInterceptors } from '@redhat-cloud-services/frontend-components-utilities/interceptors'; -import zeroStateAppList from './zeroStateConstants'; +import { createAppNamesList } from './zeroStateHelpers'; const standardApiReq = '/api/inventory/v1/hosts?page=1&per_page=1'; @@ -75,7 +75,7 @@ const AppZeroState = ({ export default AppZeroState; -const appNames = Object.keys(zeroStateAppList).map(key => key.split('_')[0]); +const appNames = createAppNamesList(); AppZeroState.propTypes = { children: propTypes.any, diff --git a/src/PresentationalComponents/ZeroState/AppZeroState.test.js b/src/PresentationalComponents/ZeroState/AppZeroState.test.js index 8b804f27d6..ba8c49c012 100644 --- a/src/PresentationalComponents/ZeroState/AppZeroState.test.js +++ b/src/PresentationalComponents/ZeroState/AppZeroState.test.js @@ -4,7 +4,7 @@ import React from 'react'; import AppZeroState from './AppZeroState'; import { MemoryRouter, Route, Routes } from 'react-router-dom'; import { useAxiosWithPlatformInterceptors } from '@redhat-cloud-services/frontend-components-utilities/interceptors'; -import zeroStateAppList from './zeroStateConstants'; +import { createAppNamesList } from './zeroStateHelpers'; jest.mock('@redhat-cloud-services/frontend-components-utilities/interceptors', () => ({ __esModule: true, @@ -14,7 +14,7 @@ jest.mock('@redhat-cloud-services/frontend-components-utilities/interceptors', ( })) })); -const appNames = Object.keys(zeroStateAppList).map(key => key.split('_')[0]); +const appNames = createAppNamesList(); const randomApp = appNames[Math.floor(Math.random() * appNames.length)]; describe('AppZeroState component', () => { diff --git a/src/PresentationalComponents/ZeroState/ZeroStateBanner.js b/src/PresentationalComponents/ZeroState/ZeroStateBanner.js index 80463d03be..2e3c19a87a 100644 --- a/src/PresentationalComponents/ZeroState/ZeroStateBanner.js +++ b/src/PresentationalComponents/ZeroState/ZeroStateBanner.js @@ -22,15 +22,15 @@ import zeroStateConstants from './zeroStateConstants'; const ZeroStateBanner = ({ appName, - description = zeroStateConstants[`${appName.toUpperCase()}_ZERO_STATE`].header.description, - commands = zeroStateConstants[`${appName.toUpperCase()}_ZERO_STATE`].header.commands, - bulletPoints = zeroStateConstants[`${appName.toUpperCase()}_ZERO_STATE`].header.bulletPoints, customInstructions, customButton, customText, customTitle, appId }) => { + const description = zeroStateConstants[`${appName.toUpperCase()}_ZERO_STATE`].header.description; + const commands = zeroStateConstants[`${appName.toUpperCase()}_ZERO_STATE`].header.commands; + const bulletPoints = zeroStateConstants[`${appName.toUpperCase()}_ZERO_STATE`].header.bulletPoints; const intl = useIntl(); const { hideGlobalFilter } = useChrome(); diff --git a/src/PresentationalComponents/ZeroState/zeroStateConstants.js b/src/PresentationalComponents/ZeroState/zeroStateConstants.js index 044f293a5e..93c8cf4f6b 100644 --- a/src/PresentationalComponents/ZeroState/zeroStateConstants.js +++ b/src/PresentationalComponents/ZeroState/zeroStateConstants.js @@ -157,7 +157,8 @@ const INSIGHTS_ZERO_STATE = { ], bulletPoints: ['What problems do we solve', 'What solution do we provide'] }, - otherApps: {} + otherApps: [], + documentation: [] }; const CONTENT_MANAGEMENT_ZERO_STATE = { diff --git a/src/PresentationalComponents/ZeroState/zeroStateHelpers.js b/src/PresentationalComponents/ZeroState/zeroStateHelpers.js new file mode 100644 index 0000000000..735b61288f --- /dev/null +++ b/src/PresentationalComponents/ZeroState/zeroStateHelpers.js @@ -0,0 +1,5 @@ +import zeroStateAppList from './zeroStateConstants'; + +export const createAppNamesList = () => { + return Object.keys(zeroStateAppList).map(key => key.replace('_ZERO_STATE', '')); +};