diff --git a/src/app/AppLayout/AppLayout.tsx b/src/app/AppLayout/AppLayout.tsx index 8f3cbeaac6..5b831a4f77 100644 --- a/src/app/AppLayout/AppLayout.tsx +++ b/src/app/AppLayout/AppLayout.tsx @@ -75,7 +75,8 @@ import cryostatLogo from '@app/assets/cryostat_logo_hori_rgb_reverse.svg'; import { SessionState } from '@app/Shared/Services/Login.service'; import { NotificationCategory } from '@app/Shared/Services/NotificationChannel.service'; import { useSubscriptions } from '@app/utils/useSubscriptions'; -import { FeatureFlag, FeatureLevel } from '@app/Shared/FeatureFlag/FeatureFlag'; +import { FeatureLevel } from '@app/Shared/Services/Settings.service'; +import { FeatureFlag } from '@app/Shared/FeatureFlag/FeatureFlag'; interface IAppLayout { children: React.ReactNode; diff --git a/src/app/Settings/FeatureLevels.tsx b/src/app/Settings/FeatureLevels.tsx index b167ccf4c8..efb8e2116a 100644 --- a/src/app/Settings/FeatureLevels.tsx +++ b/src/app/Settings/FeatureLevels.tsx @@ -40,7 +40,7 @@ import * as React from 'react'; import { ServiceContext } from '@app/Shared/Services/Services'; import { useSubscriptions } from '@app/utils/useSubscriptions'; import { UserSetting } from './Settings'; -import { FeatureLevel } from '@app/Shared/FeatureFlag/FeatureFlag'; +import { FeatureLevel } from '@app/Shared/Services/Settings.service'; import { Select, SelectOption } from '@patternfly/react-core'; const Component = () => { diff --git a/src/app/Shared/FeatureFlag/FeatureFlag.tsx b/src/app/Shared/FeatureFlag/FeatureFlag.tsx index c5db262b31..679d56d1a8 100644 --- a/src/app/Shared/FeatureFlag/FeatureFlag.tsx +++ b/src/app/Shared/FeatureFlag/FeatureFlag.tsx @@ -37,14 +37,9 @@ */ import * as React from 'react'; import { ServiceContext } from '@app/Shared/Services/Services'; +import { FeatureLevel } from '@app/Shared/Services/Settings.service'; import { useSubscriptions } from '@app/utils/useSubscriptions'; -export enum FeatureLevel { - DEVELOPMENT = 0, - BETA = 1, - PRODUCTION = 2, -} - export interface FeatureFlagProps { level: FeatureLevel; children?: React.ReactNode | undefined; diff --git a/src/app/Shared/Services/Settings.service.tsx b/src/app/Shared/Services/Settings.service.tsx index 0a2aa2d703..b49eb992e8 100644 --- a/src/app/Shared/Services/Settings.service.tsx +++ b/src/app/Shared/Services/Settings.service.tsx @@ -39,7 +39,6 @@ import { DeleteWarningType } from '@app/Modal/DeleteWarningUtils'; import { getFromLocalStorage, saveToLocalStorage } from '@app/utils/LocalStorage'; import { BehaviorSubject, Observable } from 'rxjs'; -import { FeatureLevel } from '@app/Shared/FeatureFlag/FeatureFlag'; import { AutomatedAnalysisRecordingConfig, automatedAnalysisRecordingName, @@ -48,6 +47,12 @@ import { } from './Api.service'; import { NotificationCategory } from './NotificationChannel.service'; +export enum FeatureLevel { + DEVELOPMENT = 0, + BETA = 1, + PRODUCTION = 2, +} + export function enumKeys(obj: O): K[] { return Object.keys(obj).filter((k) => Number.isNaN(+k)) as K[]; } diff --git a/src/test/Settings/Settings.test.tsx b/src/test/Settings/Settings.test.tsx index 1b51f84ba3..76f2c37191 100644 --- a/src/test/Settings/Settings.test.tsx +++ b/src/test/Settings/Settings.test.tsx @@ -90,6 +90,14 @@ jest.mock('@app/Settings/AutoRefresh', () => ({ }, })); +jest.mock('@app/Settings/FeatureLevels', () => ({ + FeatureLevels: { + title: 'Feature Levels Title', + description: 'Feature Levels Description', + content: () => Feature Levels Component, + }, +})); + describe('', () => { afterEach(cleanup); diff --git a/src/test/Settings/__snapshots__/Settings.test.tsx.snap b/src/test/Settings/__snapshots__/Settings.test.tsx.snap index a14ec935fe..dc0df16ec4 100644 --- a/src/test/Settings/__snapshots__/Settings.test.tsx.snap +++ b/src/test/Settings/__snapshots__/Settings.test.tsx.snap @@ -310,6 +310,53 @@ exports[` renders correctly 1`] = ` +
+
+
+

+ Feature Levels Title +

+ + Feature Levels Description + +
+
+

+ Feature Levels Component +

+
+
+
`;