mirror of
https://github.com/Unleash/unleash.git
synced 2025-08-04 13:48:56 +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 { CloseOutlined } from '@mui/icons-material';
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { ConditionallyRender } from '../../../../../common/ConditionallyRender/ConditionallyRender';
|
import { ConditionallyRender } from '../../../../../common/ConditionallyRender/ConditionallyRender';
|
||||||
import { checkForEmptyValues, hasCustomStrategies } from './helpers';
|
import {
|
||||||
|
checkForEmptyValues,
|
||||||
|
hasCustomStrategies,
|
||||||
|
hasOnlyCustomStrategies,
|
||||||
|
} from './helpers';
|
||||||
|
|
||||||
interface PlaygroundFeatureResultDetailsProps {
|
interface PlaygroundFeatureResultDetailsProps {
|
||||||
feature: PlaygroundFeatureSchema;
|
feature: PlaygroundFeatureSchema;
|
||||||
@ -31,7 +35,9 @@ export const PlaygroundResultFeatureDetails = ({
|
|||||||
? 'at least one strategy is True'
|
? 'at least one strategy is True'
|
||||||
: !feature.isEnabledInCurrentEnvironment
|
: !feature.isEnabledInCurrentEnvironment
|
||||||
? 'the environment is disabled'
|
? 'the environment is disabled'
|
||||||
: 'all strategies are False';
|
: hasOnlyCustomStrategies(feature)
|
||||||
|
? 'all strategies are Unevaluated'
|
||||||
|
: 'all strategies are False or Uneavaluated';
|
||||||
|
|
||||||
const color = feature.isEnabled
|
const color = feature.isEnabled
|
||||||
? theme.palette.success.main
|
? theme.palette.success.main
|
||||||
|
@ -25,3 +25,9 @@ export const hasCustomStrategies = (feature: PlaygroundFeatureSchema) => {
|
|||||||
strategy => !DEFAULT_STRATEGIES.includes(strategy.name)
|
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