diff --git a/config/cspell.config.json b/config/cspell.config.json index bd829a2e5..a777c679a 100644 --- a/config/cspell.config.json +++ b/config/cspell.config.json @@ -17,6 +17,7 @@ "flyout", "generatedid", "HHmmss", + "hoverable", "ibmpower", "ibmz", "ipsum", diff --git a/public/locales/en-US.json b/public/locales/en-US.json index 433d5f4b5..8a26f222c 100644 --- a/public/locales/en-US.json +++ b/public/locales/en-US.json @@ -171,12 +171,22 @@ "curiosity-view": { "title": "{{appName}}", "subtitle": "Monitor your usage based on your subscription terms. <0>Learn more about {{appName}} reporting", + "description": "Monitor your usage based on your subscription terms.", "title_OpenShift Container Platform": "OpenShift Container Platform", "subtitle_OpenShift Container Platform": "Monitor your OpenShift Container Platform usage for both Annual and On-Demand subscriptions. <0>Learn more about {{appName}} reporting", + "description_OpenShift Container Platform": "Monitor your OpenShift Container Platform usage for both Annual and On-Demand subscriptions.", "title_OpenShift-dedicated-metrics": "OpenShift Dedicated", "subtitle_OpenShift-dedicated-metrics": "Monitor your OpenShift Dedicated usage for On-Demand subscriptions. <0>Learn more about {{appName}} reporting", + "description_OpenShift-dedicated-metrics": "Monitor your OpenShift Dedicated usage for On-Demand subscriptions.", "title_RHEL": "Red Hat Enterprise Linux", "subtitle_RHEL": "Monitor your Red Hat Enterprise Linux usage by physical, virtual, and public cloud sockets. <0>Learn more about {{appName}} reporting", - "title_Satellite": "Red Hat Satellite" + "description_RHEL": "Monitor your Red Hat Enterprise Linux usage by physical, virtual, and public cloud sockets.", + "title_RHEL for ARM": "Red Hat Enterprise Linux for ARM", + "title_RHEL for IBM Power": "Red Hat Enterprise Linux for IBM Power", + "title_RHEL for IBM z": "Red Hat Enterprise Linux for IBM z", + "title_RHEL for x86": "Red Hat Enterprise Linux for x86", + "title_Satellite": "Red Hat Satellite", + "title_Satellite Capsule": "Red Hat Satellite Capsule", + "title_Satellite Server": "Red Hat Satellite Server" } } diff --git a/src/components/authentication/__tests__/__snapshots__/authentication.test.js.snap b/src/components/authentication/__tests__/__snapshots__/authentication.test.js.snap index cd6babfaa..18f0ea5b3 100644 --- a/src/components/authentication/__tests__/__snapshots__/authentication.test.js.snap +++ b/src/components/authentication/__tests__/__snapshots__/authentication.test.js.snap @@ -66,7 +66,9 @@ exports[`Authentication Component should render a non-connected component error: pageTitle={null} title={null} > - +
+ + + + + + +
+
( +const PageLayout = ({ children, className }) => ( {React.Children.toArray(children).filter(child => React.isValidElement(child) && child.type === PageHeader)} {React.Children.toArray(children).filter(child => React.isValidElement(child) && child.type === PageMessages)} {React.Children.toArray(children).filter(child => React.isValidElement(child) && child.type === PageToolbar)} -
+
{React.Children.toArray(children).filter( child => child.type !== PageHeader && child.type !== PageMessages && child.type !== PageToolbar )} @@ -34,15 +35,20 @@ const PageLayout = ({ children }) => ( /** * Prop types. * - * @type {{children: Node}} + * @type {{children: Node, className: string}} */ PageLayout.propTypes = { - children: PropTypes.node.isRequired + children: PropTypes.node.isRequired, + className: PropTypes.string }; /** * Default props. + * + * @type {{className: string}} */ -PageLayout.defaultProps = {}; +PageLayout.defaultProps = { + className: '' +}; export { PageLayout as default, PageLayout, PageColumns, PageHeader, PageMessages, PageSection, PageToolbar }; diff --git a/src/components/productView/__tests__/__snapshots__/productView.test.js.snap b/src/components/productView/__tests__/__snapshots__/productView.test.js.snap index abb10d479..e7de136e9 100644 --- a/src/components/productView/__tests__/__snapshots__/productView.test.js.snap +++ b/src/components/productView/__tests__/__snapshots__/productView.test.js.snap @@ -1,7 +1,9 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`ProductView Component should allow custom product views: custom graphCard, descriptions 1`] = ` - + + + + + + t(curiosity-view.title, {"appName":"Subscriptions"}) + + + + + + + t(curiosity-view.title, {"appName":"Subscriptions","context":"RHEL"}) + + + + t(curiosity-view.description, {"appName":"Subscriptions","context":"RHEL"}) + + + + + + + + + t(curiosity-view.title, {"appName":"Subscriptions","context":"OpenShift Container Platform"}) + + + + t(curiosity-view.description, {"appName":"Subscriptions","context":"OpenShift Container Platform"}) + + + + + + + + + t(curiosity-view.title, {"appName":"Subscriptions","context":"OpenShift-dedicated-metrics"}) + + + + t(curiosity-view.description, {"appName":"Subscriptions","context":"OpenShift-dedicated-metrics"}) + + + + + + + + +`; + +exports[`ProductViewMissing Component should render a predictable set of product cards: non-connected 1`] = ` + + + t(curiosity-view.title, {"appName":"Subscriptions"}) + + + + + + + t(curiosity-view.title, {"appName":"Subscriptions"}) + + + + t(curiosity-view.description, {"appName":"Subscriptions","context":"loremIpsum"}) + + + + + + + + + t(curiosity-view.title, {"appName":"Subscriptions"}) + + + + t(curiosity-view.description, {"appName":"Subscriptions","context":"dolorSit"}) + + + + + + + + +`; diff --git a/src/components/productView/__tests__/__snapshots__/productViewOpenShiftContainer.test.js.snap b/src/components/productView/__tests__/__snapshots__/productViewOpenShiftContainer.test.js.snap index af7931234..599da12e1 100644 --- a/src/components/productView/__tests__/__snapshots__/productViewOpenShiftContainer.test.js.snap +++ b/src/components/productView/__tests__/__snapshots__/productViewOpenShiftContainer.test.js.snap @@ -1,7 +1,9 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`ProductViewOpenShiftContainer Component should render a non-connected component: non-connected 1`] = ` - + { + it('should render a non-connected component', () => { + const props = {}; + const component = shallow(); + expect(component).toMatchSnapshot('non-connected'); + }); + + it('should render a predictable set of product cards', () => { + const props = { + basePath: '/loremIpsum/dolorSit/', + products: [ + { + id: 'test 001', + isSearchable: true, + path: '/loremIpsum', + productParameter: 'loremIpsum' + }, + { + id: 'test 002', + isSearchable: true, + path: '/dolorSit', + productParameter: 'dolorSit' + }, + { + id: 'test 003', + isSearchable: false, + path: '/test003', + productParameter: 'test003' + } + ] + }; + const component = shallow(); + expect(component).toMatchSnapshot('non-connected'); + }); +}); diff --git a/src/components/productView/productViewMissing.js b/src/components/productView/productViewMissing.js new file mode 100644 index 000000000..b0480381c --- /dev/null +++ b/src/components/productView/productViewMissing.js @@ -0,0 +1,135 @@ +import React from 'react'; +import PropTypes from 'prop-types'; +import { Button, Card, CardBody, CardFooter, CardTitle, Gallery, Title, PageSection } from '@patternfly/react-core'; +import { ArrowRightIcon } from '@patternfly/react-icons'; +import { useHistory } from 'react-router-dom'; +import { PageLayout, PageHeader } from '../pageLayout/pageLayout'; +import { routerConfig, routerHelpers } from '../router/router'; +import { helpers } from '../../common'; +import { translate } from '../i18n/i18n'; + +/** + * Render a missing product view. + * + * @fires onClick + * @param {object} props + * @param {string} props.basePath + * @param {Array} props.products + * @param {Function} props.t + * @returns {Node} + */ +const ProductViewMissing = ({ basePath, products, t }) => { + const history = useHistory(); + + /** + * Return a list of available products. + * + * @returns {Array} + */ + const filterAvailableProducts = () => { + const basePathDirs = basePath.split('/'); + const updatedProducts = {}; + + basePathDirs.forEach(dir => { + if (dir) { + products.forEach(({ id, productParameter, isSearchable, ...navItem }) => { + if (isSearchable && new RegExp(dir, 'i').test(productParameter)) { + updatedProducts[id] = { + id, + productParameter, + isSearchable, + ...navItem + }; + } + }); + } + }); + + const filteredProducts = Object.values(updatedProducts); + return ( + (filteredProducts.length && filteredProducts) || + routerConfig.navigation.filter( + ({ isSearchable, productParameter }) => (isSearchable && productParameter) || false + ) + ); + }; + + /** + * On click, update history. + * + * @event onUpdateHistory + * @param {string} path + * @returns {void} + */ + const onClick = path => history.push(path); + + return ( + + + {t(`curiosity-view.title`, { appName: helpers.UI_DISPLAY_NAME })} + + + + {filterAvailableProducts().map(product => ( + onClick(product.path)}> + + + {t('curiosity-view.title', { appName: helpers.UI_DISPLAY_NAME, context: product.pathParameter })} + + + + {t('curiosity-view.description', { + appName: helpers.UI_DISPLAY_NAME, + context: product.productParameter + })} + + + + + + ))} + + + + ); +}; + +/** + * Prop types. + * + * @type {{t: Function}} + */ +ProductViewMissing.propTypes = { + basePath: PropTypes.string, + products: PropTypes.arrayOf( + PropTypes.shape({ + id: PropTypes.string.isRequired, + isSearchable: PropTypes.bool.isRequired, + path: PropTypes.string.isRequired, + pathParameter: PropTypes.string, + productParameter: PropTypes.string.isRequired + }) + ), + t: PropTypes.func +}; + +/** + * Default props. + * + * @type {{t: translate}} + */ +ProductViewMissing.defaultProps = { + basePath: routerHelpers.basePath, + products: routerConfig.navigation, + t: translate +}; + +export { ProductViewMissing as default, ProductViewMissing }; diff --git a/src/components/router/__tests__/__snapshots__/router.test.js.snap b/src/components/router/__tests__/__snapshots__/router.test.js.snap index 10954e6d5..e877bc225 100644 --- a/src/components/router/__tests__/__snapshots__/router.test.js.snap +++ b/src/components/router/__tests__/__snapshots__/router.test.js.snap @@ -143,6 +143,19 @@ exports[`Router Component should render a basic component: basic 1`] = ` "render": true, "to": "/optin", }, + Object { + "component": Object { + "$$typeof": Symbol(react.lazy), + "_ctor": [Function], + "_result": null, + "_status": -1, + }, + "disabled": false, + "exact": true, + "redirect": "/", + "render": true, + "to": "/", + }, ] } > @@ -177,6 +190,15 @@ exports[`Router Component should render a basic component: basic 1`] = ` path="/optin" render={[Function]} /> + + `; diff --git a/src/components/router/__tests__/__snapshots__/routerConfig.test.js.snap b/src/components/router/__tests__/__snapshots__/routerConfig.test.js.snap index dd3232c8d..a684140a8 100644 --- a/src/components/router/__tests__/__snapshots__/routerConfig.test.js.snap +++ b/src/components/router/__tests__/__snapshots__/routerConfig.test.js.snap @@ -5,8 +5,8 @@ exports[`RouterConfig should return specific properties: appName 1`] = `"subscri exports[`RouterConfig should return specific properties: navigation 1`] = ` Array [ Object { - "default": true, "id": "rhel", + "isSearchable": true, "path": "/rhel", "pathParameter": "RHEL", "productParameter": "RHEL", @@ -14,6 +14,7 @@ Array [ }, Object { "id": "rhel-arm", + "isSearchable": false, "path": "/rhel-arm", "pathParameter": "RHEL for ARM", "productParameter": "RHEL", @@ -21,6 +22,7 @@ Array [ }, Object { "id": "rhel-ibmpower", + "isSearchable": false, "path": "/rhel-ibmpower", "pathParameter": "RHEL for IBM Power", "productParameter": "RHEL", @@ -28,6 +30,7 @@ Array [ }, Object { "id": "rhel-ibmz", + "isSearchable": false, "path": "/rhel-ibmz", "pathParameter": "RHEL for IBM z", "productParameter": "RHEL", @@ -35,6 +38,7 @@ Array [ }, Object { "id": "rhel-x86", + "isSearchable": false, "path": "/rhel-x86", "pathParameter": "RHEL for x86", "productParameter": "RHEL", @@ -42,6 +46,7 @@ Array [ }, Object { "id": "openshift-container", + "isSearchable": true, "path": "/openshift-container", "pathParameter": "OpenShift Container Platform", "productParameter": "OpenShift Container Platform", @@ -49,6 +54,7 @@ Array [ }, Object { "id": "openshift-dedicated", + "isSearchable": true, "path": "/openshift-dedicated", "pathParameter": "OpenShift-dedicated-metrics", "productParameter": "OpenShift-dedicated-metrics", @@ -56,6 +62,7 @@ Array [ }, Object { "id": "satellite", + "isSearchable": false, "path": "/satellite", "pathParameter": "Satellite", "productParameter": "Satellite", @@ -63,6 +70,7 @@ Array [ }, Object { "id": "satellite-capsule", + "isSearchable": false, "path": "/satellite-capsule", "pathParameter": "Satellite Capsule", "productParameter": "Satellite", @@ -70,6 +78,7 @@ Array [ }, Object { "id": "satellite-server", + "isSearchable": false, "path": "/satellite-server", "pathParameter": "Satellite Server", "productParameter": "Satellite", @@ -77,11 +86,21 @@ Array [ }, Object { "id": "optin", + "isSearchable": false, "path": "/optin", "pathParameter": null, "productParameter": null, "viewParameter": null, }, + Object { + "default": true, + "id": "missing", + "isSearchable": false, + "path": "/", + "pathParameter": null, + "productParameter": null, + "viewParameter": null, + }, ] `; @@ -178,5 +197,18 @@ Array [ "render": true, "to": "/optin", }, + Object { + "component": Object { + "$$typeof": Symbol(react.lazy), + "_ctor": [Function], + "_result": null, + "_status": -1, + }, + "disabled": false, + "exact": true, + "redirect": "/", + "render": true, + "to": "/", + }, ] `; diff --git a/src/components/router/__tests__/__snapshots__/routerHelpers.test.js.snap b/src/components/router/__tests__/__snapshots__/routerHelpers.test.js.snap index 0df629412..cc9618a51 100644 --- a/src/components/router/__tests__/__snapshots__/routerHelpers.test.js.snap +++ b/src/components/router/__tests__/__snapshots__/routerHelpers.test.js.snap @@ -59,8 +59,8 @@ Object { exports[`RouterHelpers should return navigation and route details that align to location: detail: match specific path navigation 1`] = ` Object { "nav": Object { - "default": true, "id": "rhel", + "isSearchable": true, "path": "/rhel", "pathParameter": "RHEL", "productParameter": "RHEL", @@ -74,10 +74,10 @@ Object { "_result": null, "_status": -1, }, - "default": true, "disabled": false, "exact": true, "id": "rhel", + "isSearchable": true, "path": "/rhel", "pathParameter": "RHEL", "productParameter": "RHEL", @@ -104,8 +104,8 @@ Object { exports[`RouterHelpers should return navigation and route details that align to location: detail: missing ID, specific path 1`] = ` Object { "nav": Object { - "default": true, "id": "rhel", + "isSearchable": true, "path": "/rhel", "pathParameter": "RHEL", "productParameter": "RHEL", @@ -119,10 +119,10 @@ Object { "_result": null, "_status": -1, }, - "default": true, "disabled": false, "exact": true, "id": "rhel", + "isSearchable": true, "path": "/rhel", "pathParameter": "RHEL", "productParameter": "RHEL", @@ -158,12 +158,13 @@ exports[`RouterHelpers should return navigation and route details that align to Object { "nav": Object { "default": true, - "id": "rhel", - "path": "/rhel", - "pathParameter": "RHEL", - "productParameter": "RHEL", - "routeHref": "/rhel", - "viewParameter": "viewRHEL", + "id": "missing", + "isSearchable": false, + "path": "/", + "pathParameter": null, + "productParameter": null, + "routeHref": "/", + "viewParameter": null, }, "navRoute": Object { "component": Object { @@ -175,14 +176,16 @@ Object { "default": true, "disabled": false, "exact": true, - "id": "rhel", - "path": "/rhel", - "pathParameter": "RHEL", - "productParameter": "RHEL", + "id": "missing", + "isSearchable": false, + "path": "/", + "pathParameter": null, + "productParameter": null, + "redirect": "/", "render": true, - "routeHref": "/rhel", - "to": "/:variant(rhel|rhel-arm|rhel-ibmpower|rhel-ibmz|rhel-x86)", - "viewParameter": "viewRHEL", + "routeHref": "/", + "to": "/", + "viewParameter": null, }, "route": Object {}, } @@ -200,6 +203,7 @@ exports[`RouterHelpers should return navigation and route details that align to Object { "nav": Object { "id": "rhel-arm", + "isSearchable": false, "path": "/rhel-arm", "pathParameter": "RHEL for ARM", "productParameter": "RHEL", @@ -216,6 +220,7 @@ Object { "disabled": false, "exact": true, "id": "rhel-arm", + "isSearchable": false, "path": "/rhel-arm", "pathParameter": "RHEL for ARM", "productParameter": "RHEL", @@ -232,6 +237,7 @@ exports[`RouterHelpers should return navigation and route details that align to Object { "nav": Object { "id": "optin", + "isSearchable": false, "path": "/optin", "pathParameter": null, "productParameter": null, @@ -249,6 +255,7 @@ Object { "disabled": false, "exact": true, "id": "optin", + "isSearchable": false, "path": "/optin", "pathParameter": null, "productParameter": null, diff --git a/src/components/router/__tests__/routerConfig.test.js b/src/components/router/__tests__/routerConfig.test.js index b872e7eaf..00d285aa0 100644 --- a/src/components/router/__tests__/routerConfig.test.js +++ b/src/components/router/__tests__/routerConfig.test.js @@ -30,6 +30,6 @@ describe('RouterConfig', () => { } }); - expect(lazyLoadComponents.length).toBe(5); + expect(lazyLoadComponents.length).toBe(6); }); }); diff --git a/src/components/router/__tests__/routerHelpers.test.js b/src/components/router/__tests__/routerHelpers.test.js index 28a3ec32a..a41df4756 100644 --- a/src/components/router/__tests__/routerHelpers.test.js +++ b/src/components/router/__tests__/routerHelpers.test.js @@ -1,5 +1,6 @@ import { baseName, + basePath, dynamicBaseName, getErrorRoute, getNavigationDetail, @@ -19,6 +20,7 @@ describe('RouterHelpers', () => { it('should return specific properties', () => { expect(baseName).toBeDefined(); + expect(basePath).toBeDefined(); expect(dynamicBaseName).toBeDefined(); expect(getErrorRoute).toBeDefined(); expect(getNavigationDetail).toBeDefined(); diff --git a/src/components/router/routerConfig.js b/src/components/router/routerConfig.js index fc68efe00..8cdaa9a26 100644 --- a/src/components/router/routerConfig.js +++ b/src/components/router/routerConfig.js @@ -92,6 +92,14 @@ const routes = [ render: true, activateOnError: true, disabled: helpers.UI_DISABLED + }, + { + to: '/', + redirect: '/', + component: React.lazy(() => import('../productView/productViewMissing')), + exact: true, + render: true, + disabled: helpers.UI_DISABLED } ]; @@ -107,77 +115,96 @@ const navigation = [ pathParameter: RHSM_API_PATH_ID_TYPES.RHEL, productParameter: RHSM_API_PATH_ID_TYPES.RHEL, viewParameter: `view${RHSM_API_PATH_ID_TYPES.RHEL}`, - default: true + isSearchable: true }, { id: 'rhel-arm', path: '/rhel-arm', pathParameter: RHSM_API_PATH_ID_TYPES.RHEL_ARM, productParameter: RHSM_API_PATH_ID_TYPES.RHEL, - viewParameter: `view${RHSM_API_PATH_ID_TYPES.RHEL}` + viewParameter: `view${RHSM_API_PATH_ID_TYPES.RHEL}`, + isSearchable: false }, { id: 'rhel-ibmpower', path: '/rhel-ibmpower', pathParameter: RHSM_API_PATH_ID_TYPES.RHEL_IBM_POWER, productParameter: RHSM_API_PATH_ID_TYPES.RHEL, - viewParameter: `view${RHSM_API_PATH_ID_TYPES.RHEL}` + viewParameter: `view${RHSM_API_PATH_ID_TYPES.RHEL}`, + isSearchable: false }, { id: 'rhel-ibmz', path: '/rhel-ibmz', pathParameter: RHSM_API_PATH_ID_TYPES.RHEL_IBM_Z, productParameter: RHSM_API_PATH_ID_TYPES.RHEL, - viewParameter: `view${RHSM_API_PATH_ID_TYPES.RHEL}` + viewParameter: `view${RHSM_API_PATH_ID_TYPES.RHEL}`, + isSearchable: false }, { id: 'rhel-x86', path: '/rhel-x86', pathParameter: RHSM_API_PATH_ID_TYPES.RHEL_X86, productParameter: RHSM_API_PATH_ID_TYPES.RHEL, - viewParameter: `view${RHSM_API_PATH_ID_TYPES.RHEL}` + viewParameter: `view${RHSM_API_PATH_ID_TYPES.RHEL}`, + isSearchable: false }, { id: 'openshift-container', path: '/openshift-container', pathParameter: RHSM_API_PATH_ID_TYPES.OPENSHIFT, productParameter: RHSM_API_PATH_ID_TYPES.OPENSHIFT, - viewParameter: `view${RHSM_API_PATH_ID_TYPES.OPENSHIFT}` + viewParameter: `view${RHSM_API_PATH_ID_TYPES.OPENSHIFT}`, + isSearchable: true }, { id: 'openshift-dedicated', path: '/openshift-dedicated', pathParameter: RHSM_API_PATH_ID_TYPES.OPENSHIFT_DEDICATED_METRICS, productParameter: RHSM_API_PATH_ID_TYPES.OPENSHIFT_DEDICATED_METRICS, - viewParameter: `view${RHSM_API_PATH_ID_TYPES.OPENSHIFT_DEDICATED_METRICS}` + viewParameter: `view${RHSM_API_PATH_ID_TYPES.OPENSHIFT_DEDICATED_METRICS}`, + isSearchable: true }, { id: 'satellite', path: '/satellite', pathParameter: RHSM_API_PATH_ID_TYPES.SATELLITE, productParameter: RHSM_API_PATH_ID_TYPES.SATELLITE, - viewParameter: `view${RHSM_API_PATH_ID_TYPES.SATELLITE}` + viewParameter: `view${RHSM_API_PATH_ID_TYPES.SATELLITE}`, + isSearchable: false }, { id: 'satellite-capsule', path: '/satellite-capsule', pathParameter: RHSM_API_PATH_ID_TYPES.SATELLITE_CAPSULE, productParameter: RHSM_API_PATH_ID_TYPES.SATELLITE, - viewParameter: `view${RHSM_API_PATH_ID_TYPES.SATELLITE}` + viewParameter: `view${RHSM_API_PATH_ID_TYPES.SATELLITE}`, + isSearchable: false }, { id: 'satellite-server', path: '/satellite-server', pathParameter: RHSM_API_PATH_ID_TYPES.SATELLITE_SERVER, productParameter: RHSM_API_PATH_ID_TYPES.SATELLITE, - viewParameter: `view${RHSM_API_PATH_ID_TYPES.SATELLITE}` + viewParameter: `view${RHSM_API_PATH_ID_TYPES.SATELLITE}`, + isSearchable: false }, { id: 'optin', path: '/optin', pathParameter: null, productParameter: null, - viewParameter: null + viewParameter: null, + isSearchable: false + }, + { + id: 'missing', + path: '/', + pathParameter: null, + productParameter: null, + viewParameter: null, + isSearchable: false, + default: true } ]; diff --git a/src/components/router/routerHelpers.js b/src/components/router/routerHelpers.js index f6e54ceac..912393e30 100644 --- a/src/components/router/routerHelpers.js +++ b/src/components/router/routerHelpers.js @@ -21,6 +21,14 @@ const dynamicBaseName = ({ pathName = window.location.pathname, appName = helper */ const baseName = (helpers.TEST_MODE && '/') || (helpers.DEV_MODE && '/') || dynamicBaseName(); +/** + * App basePath. + * + * @type {string} + */ +const basePath = + (helpers.TEST_MODE && '/') || (helpers.DEV_MODE && '/') || window.location.pathname.split(helpers.UI_NAME)[0]; + /** * The first error route. * @@ -114,6 +122,7 @@ const getNavRouteDetail = ({ id = null, pathname = null, returnDefault = false } const routerHelpers = { baseName, + basePath, dynamicBaseName, getErrorRoute, getNavigationDetail, @@ -125,6 +134,7 @@ export { routerHelpers as default, routerHelpers, baseName, + basePath, dynamicBaseName, getErrorRoute, getNavigationDetail, diff --git a/src/styles/_inventory-list.scss b/src/styles/_inventory-list.scss index 55cdc88e5..0fe62b954 100644 --- a/src/styles/_inventory-list.scss +++ b/src/styles/_inventory-list.scss @@ -1,13 +1,9 @@ .curiosity { - &.pf-c-page__main-section { - box-shadow: var(--pf-global--BoxShadow--sm); - - .pf-c-card { + .curiosity-inventory-card { + &.pf-c-card { box-shadow: none; } - } - .curiosity-inventory-card { .pf-c-card__header { padding-bottom: 0; } diff --git a/src/styles/_page-layout.scss b/src/styles/_page-layout.scss index a98efd085..244e30e15 100644 --- a/src/styles/_page-layout.scss +++ b/src/styles/_page-layout.scss @@ -1,3 +1,9 @@ +.curiosity { + &.pf-c-page__main-section { + box-shadow: var(--pf-global--BoxShadow--sm); + } +} + .curiosity-page-messages, .curiosity-page-toolbar, .curiosity-page-section, diff --git a/src/styles/_product-view.scss b/src/styles/_product-view.scss new file mode 100644 index 000000000..b45d0d076 --- /dev/null +++ b/src/styles/_product-view.scss @@ -0,0 +1,15 @@ +.curiosity { + &.curiosity-missing-view { + padding: 1em; + + .pf-c-card { + &.pf-m-hoverable { + cursor: pointer; + + .curiosity-missing-view__card-description { + color: var(--pf-global--Color--200); + } + } + } + } +} diff --git a/src/styles/index.scss b/src/styles/index.scss index 76da64a75..0e9462c82 100644 --- a/src/styles/index.scss +++ b/src/styles/index.scss @@ -11,6 +11,7 @@ // App @import 'page-layout'; @import 'fade'; +@import 'product-view'; @import 'optin'; @import 'usage-graph'; @import 'skeleton'; diff --git a/tests/__snapshots__/dist.test.js.snap b/tests/__snapshots__/dist.test.js.snap index b3b8ed02e..c6ce67b8d 100644 --- a/tests/__snapshots__/dist.test.js.snap +++ b/tests/__snapshots__/dist.test.js.snap @@ -17,6 +17,8 @@ Array [ "./build/static/js/1*chunk.js", "./build/static/js/10*chunk*map", "./build/static/js/10*chunk.js", + "./build/static/js/11*chunk*map", + "./build/static/js/11*chunk.js", "./build/static/js/2*chunk*map", "./build/static/js/2*chunk.js", "./build/static/js/5*chunk*LICENSE.txt",