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

feat: conditionally show groupId in StrategyExecution under rollout (#9101)

This commit is contained in:
David Leek 2025-01-15 12:56:19 +01:00 committed by GitHub
parent 3a50750a33
commit c98d0e71a3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 15 additions and 1 deletions

View File

@ -21,6 +21,7 @@ import { BuiltInStrategies } from 'utils/strategyNames';
interface IStrategyExecutionProps {
strategy: IFeatureStrategyPayload | CreateFeatureStrategySchema;
displayGroupId?: boolean;
}
const StyledContainer = styled(Box, {
@ -77,6 +78,7 @@ const StyledValueSeparator = styled('span')(({ theme }) => ({
export const StrategyExecution: FC<IStrategyExecutionProps> = ({
strategy,
displayGroupId = false,
}) => {
const { parameters, constraints = [] } = strategy;
const stickiness = parameters?.stickiness;
@ -133,6 +135,18 @@ export const StrategyExecution: FC<IStrategyExecutionProps> = ({
is included.
</span>
</div>
{displayGroupId && parameters.groupId && (
<Box
sx={(theme) => ({
ml: 1,
color: theme.palette.info.contrastText,
})}
>
<Badge color='info'>
GroupId: {parameters.groupId}
</Badge>
</Box>
)}
</StyledValueContainer>
);
}

View File

@ -40,7 +40,7 @@ export const ReleasePlanMilestoneStrategy = ({
<Icon />
{`${formatStrategyName(String(strategy.strategyName))}${strategy.title ? `: ${strategy.title}` : ''}`}
</StyledHeader>
<StrategyExecution strategy={strategy} />
<StrategyExecution strategy={strategy} displayGroupId />
{strategy.variants &&
strategy.variants.length > 0 &&
(strategy.disabled ? (