1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-05-03 01:18:43 +02:00

PR comment

This commit is contained in:
andreas-unleash 2022-08-08 16:24:14 +03:00
parent 18afc34f85
commit fa0e75d22a

View File

@ -1,7 +1,7 @@
import { import {
PlaygroundFeatureSchema, PlaygroundFeatureSchema,
PlaygroundRequestSchema, PlaygroundRequestSchema,
} from '../../../../../../hooks/api/actions/usePlayground/playground.model'; } from 'hooks/api/actions/usePlayground/playground.model';
import { Alert, IconButton, Typography, useTheme } from '@mui/material'; import { Alert, IconButton, Typography, useTheme } from '@mui/material';
import { PlaygroundResultChip } from '../../PlaygroundResultChip/PlaygroundResultChip'; import { PlaygroundResultChip } from '../../PlaygroundResultChip/PlaygroundResultChip';
import { useStyles } from './FeatureDetails.styles'; import { useStyles } from './FeatureDetails.styles';
@ -32,17 +32,16 @@ export const FeatureDetails = ({
: `This feature toggle is False in ${input?.environment} because `; : `This feature toggle is False in ${input?.environment} because `;
const reason = (() => { const reason = (() => {
if (feature.isEnabled) if (feature.isEnabled) return 'at least one strategy is True';
return 'at least one strategy is True';
if (!feature.isEnabledInCurrentEnvironment) if (!feature.isEnabledInCurrentEnvironment)
return 'the environment is disabled'; return 'the environment is disabled';
if (hasOnlyCustomStrategies(feature)) if (hasOnlyCustomStrategies(feature))
return 'no strategies could be fully evaluated' return 'no strategies could be fully evaluated';
return 'all strategies are either False or could not be fully evaluated'; return 'all strategies are either False or could not be fully evaluated';
})() })();
const color = feature.isEnabled const color = feature.isEnabled
? theme.palette.success.main ? theme.palette.success.main