From f779ed383cd72ae2cff71ab58dd07fa3cdcf40ff Mon Sep 17 00:00:00 2001 From: Amir Fefer Date: Tue, 1 Aug 2023 16:02:55 +0300 Subject: [PATCH] fix(HMS-1757): remove hard coded preview in sources link --- config/jest.setup.js | 4 +++ .../steps/SourceMissing/index.js | 34 +++++++++++-------- 2 files changed, 23 insertions(+), 15 deletions(-) diff --git a/config/jest.setup.js b/config/jest.setup.js index 0bd6ff5d..6e1598d2 100644 --- a/config/jest.setup.js +++ b/config/jest.setup.js @@ -20,3 +20,7 @@ afterEach(() => { }); afterAll(() => server.close()); + +jest.mock('@redhat-cloud-services/frontend-components/useChrome', () => ({ + useChrome: () => ({ isBeta: jest.fn(() => true) }), +})); diff --git a/src/Components/ProvisioningWizard/steps/SourceMissing/index.js b/src/Components/ProvisioningWizard/steps/SourceMissing/index.js index 532a1429..e23e1748 100644 --- a/src/Components/ProvisioningWizard/steps/SourceMissing/index.js +++ b/src/Components/ProvisioningWizard/steps/SourceMissing/index.js @@ -2,6 +2,7 @@ import PropTypes from 'prop-types'; import React from 'react'; import { Button, EmptyState, EmptyStateBody, EmptyStateIcon, EmptyStateSecondaryActions, Title, Spinner } from '@patternfly/react-core'; import { PlusCircleIcon, ExclamationCircleIcon } from '@patternfly/react-icons'; +import { useChrome } from '@redhat-cloud-services/frontend-components/useChrome'; import DirectProviderLink from './DirectProviderLink'; import { imageProps } from '../../helpers.js'; @@ -27,21 +28,24 @@ const LoadingState = () => ( ); -const SourceMissing = ({ error, image }) => ( - - - - {(error && failedToFetchTitle) || missingSourceTitle} - - {error?.message || missingSourceDescription} - - - - - -); +const SourceMissing = ({ error, image }) => { + const { isBeta } = useChrome(); + return ( + + + + {(error && failedToFetchTitle) || missingSourceTitle} + + {error?.message || missingSourceDescription} + + + + + + ); +}; SourceMissing.propTypes = { error: PropTypes.string,