Skip to content

Commit

Permalink
Wizard: feature flag to decide environments to be enabled in
Browse files Browse the repository at this point in the history
Feature flags now support enablement in Preview specifically.
This allows us to use single feature flag for rollout.
  • Loading branch information
ezr-ondrej committed Jul 10, 2024
1 parent 0f7d945 commit 857fa7a
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 15 deletions.
4 changes: 2 additions & 2 deletions src/Components/CreateImageWizardV2/CreateImageWizard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import {
useWizardContext,
} from '@patternfly/react-core';
import { useNavigate, useSearchParams } from 'react-router-dom';
import { useFlag } from '@unleash/proxy-client-react';

Check failure on line 13 in src/Components/CreateImageWizardV2/CreateImageWizard.tsx

View workflow job for this annotation

GitHub Actions / tests (18.x)

`@unleash/proxy-client-react` import should occur before import of `react-router-dom`

Check failure on line 13 in src/Components/CreateImageWizardV2/CreateImageWizard.tsx

View workflow job for this annotation

GitHub Actions / tests (20.x)

`@unleash/proxy-client-react` import should occur before import of `react-router-dom`

import DetailsStep from './steps/Details';
import FileSystemStep, { FileSystemContext } from './steps/FileSystem';
Expand Down Expand Up @@ -63,7 +64,6 @@ import {
selectUseLatest,
} from '../../store/wizardSlice';
import { resolveRelPath } from '../../Utilities/path';
import useBetaFlag from '../../Utilities/useBetaFlag';
import { useGetEnvironment } from '../../Utilities/useGetEnvironment';
import { ImageBuilderHeader } from '../sharedComponents/ImageBuilderHeader';

Expand Down Expand Up @@ -135,7 +135,7 @@ const CreateImageWizard = ({ isEdit }: CreateImageWizardProps) => {

// =========================TO REMOVE=======================

const isFirstBootEnabled = useBetaFlag('image-builder.firstboot.enabled');
const isFirstBootEnabled = useFlag('image-builder.firstboot.enabled');
// IMPORTANT: Ensure the wizard starts with a fresh initial state
useEffect(() => {
dispatch(initializeWizard());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import {
useWizardContext,
} from '@patternfly/react-core';
import { ArrowRightIcon } from '@patternfly/react-icons';
import { useFlag } from '@unleash/proxy-client-react';

import {
ContentList,
Expand Down Expand Up @@ -37,7 +38,6 @@ import {
selectProfile,
selectRegistrationType,
} from '../../../../store/wizardSlice';
import useBetaFlag from '../../../../Utilities/useBetaFlag';

const Review = ({ snapshottingEnabled }: { snapshottingEnabled: boolean }) => {
const { goToStepById } = useWizardContext();
Expand Down Expand Up @@ -99,7 +99,7 @@ const Review = ({ snapshottingEnabled }: { snapshottingEnabled: boolean }) => {
goToStepById(stepId);
};

const isFirstBootEnabled = useBetaFlag('image-builder.firstboot.enabled');
const isFirstBootEnabled = useFlag('image-builder.firstboot.enabled');
return (
<>
<ExpandableSection
Expand Down
11 changes: 0 additions & 11 deletions src/Utilities/useBetaFlag.ts

This file was deleted.

0 comments on commit 857fa7a

Please sign in to comment.