mirror of
https://github.com/Unleash/unleash.git
synced 2025-07-26 13:48:33 +02:00
custom strategies adjustments
This commit is contained in:
parent
44f77c46c2
commit
3c5c855fc5
@ -8,7 +8,11 @@ import { useStyles } from './PlaygroundResultFeatureDetails.styles';
|
||||
import { CloseOutlined } from '@mui/icons-material';
|
||||
import React from 'react';
|
||||
import { ConditionallyRender } from '../../../../../common/ConditionallyRender/ConditionallyRender';
|
||||
import { checkForEmptyValues, hasCustomStrategies } from './helpers';
|
||||
import {
|
||||
checkForEmptyValues,
|
||||
hasCustomStrategies,
|
||||
hasOnlyCustomStrategies,
|
||||
} from './helpers';
|
||||
|
||||
interface PlaygroundFeatureResultDetailsProps {
|
||||
feature: PlaygroundFeatureSchema;
|
||||
@ -31,7 +35,9 @@ export const PlaygroundResultFeatureDetails = ({
|
||||
? 'at least one strategy is True'
|
||||
: !feature.isEnabledInCurrentEnvironment
|
||||
? 'the environment is disabled'
|
||||
: 'all strategies are False';
|
||||
: hasOnlyCustomStrategies(feature)
|
||||
? 'all strategies are Unevaluated'
|
||||
: 'all strategies are False or Uneavaluated';
|
||||
|
||||
const color = feature.isEnabled
|
||||
? theme.palette.success.main
|
||||
|
@ -25,3 +25,9 @@ export const hasCustomStrategies = (feature: PlaygroundFeatureSchema) => {
|
||||
strategy => !DEFAULT_STRATEGIES.includes(strategy.name)
|
||||
);
|
||||
};
|
||||
|
||||
export const hasOnlyCustomStrategies = (feature: PlaygroundFeatureSchema) => {
|
||||
return !feature.strategies?.data?.find(strategy =>
|
||||
DEFAULT_STRATEGIES.includes(strategy.name)
|
||||
);
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user