Skip to content

Commit

Permalink
only show Production level in devserver setup
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewazores committed Dec 16, 2022
1 parent 3373a3a commit cf5e30a
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 6 deletions.
13 changes: 10 additions & 3 deletions src/app/Settings/FeatureLevels.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,16 @@ const Component = () => {
<Select isOpen={open} onToggle={handleToggle} selections={FeatureLevel[state]} onSelect={handleSelect}>
{Object.values(FeatureLevel)
.filter((v) => typeof v === 'string')
.map((key, idx) => (
<SelectOption key={idx} value={idx}>
{key}
.map((v): { key: string; value: number } => ({ key: String(v), value: FeatureLevel[v] }))
.filter((v) => {
if (!process.env.CRYOSTAT_AUTHORITY) {
return v.value !== FeatureLevel.DEVELOPMENT;
}
return true;
})
.map((level, idx) => (
<SelectOption key={idx} value={level.value}>
{level.key}
</SelectOption>
))}
</Select>
Expand Down
2 changes: 1 addition & 1 deletion src/app/Settings/Settings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,13 @@ export interface SettingsProps {}

export const Settings: React.FunctionComponent<SettingsProps> = (props) => {
const settings = [
FeatureLevels,
NotificationControl,
AutomatedAnalysisConfig,
CredentialsStorage,
DeletionDialogControl,
WebSocketDebounce,
AutoRefresh,
FeatureLevels,
].map((c) => ({
title: c.title,
description: c.description,
Expand Down
2 changes: 1 addition & 1 deletion src/app/Shared/FeatureFlag/FeatureFlag.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
* SOFTWARE.
*/
import * as React from 'react';
import { ServiceContext } from '../Services/Services';
import { ServiceContext } from '@app/Shared/Services/Services';
import { useSubscriptions } from '@app/utils/useSubscriptions';

export enum FeatureLevel {
Expand Down
2 changes: 1 addition & 1 deletion src/app/Shared/Services/Settings.service.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
import { DeleteWarningType } from '@app/Modal/DeleteWarningUtils';
import { getFromLocalStorage, saveToLocalStorage } from '@app/utils/LocalStorage';
import { BehaviorSubject, Observable } from 'rxjs';
import { FeatureLevel } from '../FeatureFlag/FeatureFlag';
import { FeatureLevel } from '@app/Shared/FeatureFlag/FeatureFlag';
import {
AutomatedAnalysisRecordingConfig,
automatedAnalysisRecordingName,
Expand Down

0 comments on commit cf5e30a

Please sign in to comment.