feat(HMS-3906): Add feature flag for import/export
This commit is contained in:
parent
3b843a0d40
commit
bc82ba0ab1
2 changed files with 23 additions and 13 deletions
|
|
@ -8,6 +8,7 @@ import {
|
|||
MenuToggleElement,
|
||||
} from '@patternfly/react-core';
|
||||
import { EllipsisVIcon } from '@patternfly/react-icons';
|
||||
import { useFlag } from '@unleash/proxy-client-react';
|
||||
import { useNavigate } from 'react-router-dom';
|
||||
|
||||
import { selectSelectedBlueprintId } from '../../store/BlueprintSlice';
|
||||
|
|
@ -28,6 +29,7 @@ export const BlueprintActionsMenu: React.FunctionComponent<
|
|||
};
|
||||
const selectedBlueprintId = useAppSelector(selectSelectedBlueprintId);
|
||||
const navigate = useNavigate();
|
||||
const importExportFlag = useFlag('image-builder.import.enabled');
|
||||
|
||||
return (
|
||||
<Dropdown
|
||||
|
|
@ -60,7 +62,9 @@ export const BlueprintActionsMenu: React.FunctionComponent<
|
|||
>
|
||||
Edit details
|
||||
</DropdownItem>
|
||||
<DropdownItem>Download blueprint (.json)</DropdownItem>
|
||||
{importExportFlag && (
|
||||
<DropdownItem>Download blueprint (.json)</DropdownItem>
|
||||
)}
|
||||
<DropdownItem onClick={() => setShowDeleteModal(true)}>
|
||||
Delete blueprint
|
||||
</DropdownItem>
|
||||
|
|
|
|||
|
|
@ -21,6 +21,7 @@ import {
|
|||
PageHeader,
|
||||
PageHeaderTitle,
|
||||
} from '@redhat-cloud-services/frontend-components';
|
||||
import { useFlag } from '@unleash/proxy-client-react';
|
||||
import { Link } from 'react-router-dom';
|
||||
|
||||
import { resolveRelPath } from '../../Utilities/path';
|
||||
|
|
@ -34,13 +35,16 @@ type ImageBuilderHeaderPropTypes = {
|
|||
export const ImageBuilderHeader = ({
|
||||
experimentalFlag,
|
||||
}: ImageBuilderHeaderPropTypes) => {
|
||||
const importExportFlag = useFlag('image-builder.import.enabled');
|
||||
const [showImportModal, setShowImportModal] = useState(false);
|
||||
return (
|
||||
<>
|
||||
<ImportBlueprintModal
|
||||
setShowImportModal={setShowImportModal}
|
||||
isOpen={showImportModal}
|
||||
/>
|
||||
{importExportFlag && (
|
||||
<ImportBlueprintModal
|
||||
setShowImportModal={setShowImportModal}
|
||||
isOpen={showImportModal}
|
||||
/>
|
||||
)}
|
||||
<PageHeader data-testid="image-builder-header">
|
||||
<Flex>
|
||||
<FlexItem>
|
||||
|
|
@ -116,14 +120,16 @@ export const ImageBuilderHeader = ({
|
|||
</Link>
|
||||
</FlexItem>
|
||||
<FlexItem>
|
||||
<Button
|
||||
variant="secondary"
|
||||
icon={<ImportIcon />}
|
||||
iconPosition="end"
|
||||
onClick={() => setShowImportModal(true)}
|
||||
>
|
||||
Import{' '}
|
||||
</Button>
|
||||
{importExportFlag && (
|
||||
<Button
|
||||
variant="secondary"
|
||||
icon={<ImportIcon />}
|
||||
iconPosition="end"
|
||||
onClick={() => setShowImportModal(true)}
|
||||
>
|
||||
Import{' '}
|
||||
</Button>
|
||||
)}
|
||||
</FlexItem>
|
||||
</>
|
||||
)}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue