From 04814bfc6302a2747121e5b6f22e117cc5fb2336 Mon Sep 17 00:00:00 2001 From: Fredrik Strand Oseberg Date: Fri, 5 Jan 2024 11:05:58 +0100 Subject: [PATCH] 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. --- .../NewFeatureStrategyForm.tsx | 24 +++++++++++-------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/frontend/src/component/feature/FeatureStrategy/FeatureStrategyForm/NewFeatureStrategyForm.tsx b/frontend/src/component/feature/FeatureStrategy/FeatureStrategyForm/NewFeatureStrategyForm.tsx index b997ab139c..edc924de2f 100644 --- a/frontend/src/component/feature/FeatureStrategy/FeatureStrategyForm/NewFeatureStrategyForm.tsx +++ b/frontend/src/component/feature/FeatureStrategy/FeatureStrategyForm/NewFeatureStrategyForm.tsx @@ -339,6 +339,8 @@ export const NewFeatureStrategyForm = ({ return constraintCount + segmentCount; }; + const showVariants = + strategy.parameters && 'stickiness' in strategy.parameters; return ( <> @@ -381,16 +383,18 @@ export const NewFeatureStrategyForm = ({ } /> - - Variants - - {strategy.variants?.length} - - - } - /> + {showVariants && ( + + Variants + + {strategy.variants?.length || 0} + + + } + /> + )}