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;
|
||||
};
|
||||
|
||||
const showVariants =
|
||||
strategy.parameters && 'stickiness' in strategy.parameters;
|
||||
return (
|
||||
<>
|
||||
<StyledHeaderBox>
|
||||
@ -381,16 +383,18 @@ export const NewFeatureStrategyForm = ({
|
||||
</Typography>
|
||||
}
|
||||
/>
|
||||
<Tab
|
||||
label={
|
||||
<Typography>
|
||||
Variants
|
||||
<StyledBadge>
|
||||
{strategy.variants?.length}
|
||||
</StyledBadge>
|
||||
</Typography>
|
||||
}
|
||||
/>
|
||||
{showVariants && (
|
||||
<Tab
|
||||
label={
|
||||
<Typography>
|
||||
Variants
|
||||
<StyledBadge>
|
||||
{strategy.variants?.length || 0}
|
||||
</StyledBadge>
|
||||
</Typography>
|
||||
}
|
||||
/>
|
||||
)}
|
||||
</StyledTabs>
|
||||
<StyledForm onSubmit={onSubmitWithValidation}>
|
||||
<ConditionallyRender
|
||||
|
Loading…
Reference in New Issue
Block a user