mirror of
https://github.com/Unleash/unleash.git
synced 2025-01-25 00:07:47 +01:00
fix: add condition to show variants tab (#5775)
Adds a conditional check so we don't display this tab for strategies that don't support it.
This commit is contained in:
parent
de7f6e035e
commit
04814bfc63
@ -339,6 +339,8 @@ export const NewFeatureStrategyForm = ({
|
|||||||
return constraintCount + segmentCount;
|
return constraintCount + segmentCount;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const showVariants =
|
||||||
|
strategy.parameters && 'stickiness' in strategy.parameters;
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<StyledHeaderBox>
|
<StyledHeaderBox>
|
||||||
@ -381,16 +383,18 @@ export const NewFeatureStrategyForm = ({
|
|||||||
</Typography>
|
</Typography>
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
<Tab
|
{showVariants && (
|
||||||
label={
|
<Tab
|
||||||
<Typography>
|
label={
|
||||||
Variants
|
<Typography>
|
||||||
<StyledBadge>
|
Variants
|
||||||
{strategy.variants?.length}
|
<StyledBadge>
|
||||||
</StyledBadge>
|
{strategy.variants?.length || 0}
|
||||||
</Typography>
|
</StyledBadge>
|
||||||
}
|
</Typography>
|
||||||
/>
|
}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
</StyledTabs>
|
</StyledTabs>
|
||||||
<StyledForm onSubmit={onSubmitWithValidation}>
|
<StyledForm onSubmit={onSubmitWithValidation}>
|
||||||
<ConditionallyRender
|
<ConditionallyRender
|
||||||
|
Loading…
Reference in New Issue
Block a user