From 846a62ecec4e8b2a3911933009cad3d70cf9656e Mon Sep 17 00:00:00 2001 From: andreas-unleash Date: Thu, 13 Jul 2023 10:20:16 +0300 Subject: [PATCH] fix: existing stickiness value should be available in the dropdown (#4228) existing stickiness value should be available in the dropdown even if the context field is no longer sticky Before: if the context field is no longer sticky ![Screenshot 2023-07-13 at 09 50 55](https://github.com/Unleash/unleash/assets/104830839/6a8afa86-7bd3-45e6-bddf-69306f02bf56) After ![Screenshot 2023-07-13 at 09 48 53](https://github.com/Unleash/unleash/assets/104830839/e301e1ff-7624-437c-af02-9e293cae4911) Closes # [1-1115](https://linear.app/unleash/issue/1-1115/current-gradual-rollout-stickiness-configurations-should-take-priority) Signed-off-by: andreas-unleash --- .../FlexibleStrategy/StickinessSelect/StickinessSelect.tsx | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/frontend/src/component/feature/StrategyTypes/FlexibleStrategy/StickinessSelect/StickinessSelect.tsx b/frontend/src/component/feature/StrategyTypes/FlexibleStrategy/StickinessSelect/StickinessSelect.tsx index 7eea39686e..a5e760dfa0 100644 --- a/frontend/src/component/feature/StrategyTypes/FlexibleStrategy/StickinessSelect/StickinessSelect.tsx +++ b/frontend/src/component/feature/StrategyTypes/FlexibleStrategy/StickinessSelect/StickinessSelect.tsx @@ -43,6 +43,11 @@ export const StickinessSelect = ({ options.push({ key: 'random', label: 'random' }); } + // Add existing value to the options + if (value && !options.find(option => option.key === value)) { + options.push({ key: value, label: value }); + } + return options; };