1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-09-15 17:50:48 +02:00
unleash.unleash/frontend/src/component
Fredrik Strand Oseberg f220f216d6
Fix/legal values deletion (#4564)
This PR fixes a bug reported from a customer where deleting a legal
value that was used in a strategy constraint would make it impossible to
edit the constraint.

[The bug was introduced
here](https://github.com/Unleash/unleash/pull/4473)

The core of the problem introduced was that the values used to calculate
illegal values was based on changing state. On the first render it would
display correct state as it would match the legal values coming from the
context definition with the legal values currently used in the
constraint as values. However, when you triggered the onClick method for
the checkboxes the state would be changed because we would remove the
illegal values from the valueset and only insert current legal values in
the state. This would trigger a re-render of the component, and now the
data used to identify the illegal values would no longer be correct,
because the bad values had been cleaned from the state. This would cause
the UI for constraints to display incorrectly.

Changed the flow to now give you a warning if you have illegal values,
and that if you make changes and save the strategy these values will be
removed from the constraint:

<img width="726" alt="Skjermbilde 2023-08-25 kl 08 56 02"
src="https://github.com/Unleash/unleash/assets/16081982/78e9875d-d864-4e21-bfb7-a530247a07eb">

Also amended this to apply to the single legal value constraints.

<img width="721" alt="Skjermbilde 2023-08-25 kl 08 57 40"
src="https://github.com/Unleash/unleash/assets/16081982/237a11d0-5c05-445c-9e99-b79cab0bff94">
2023-08-25 10:44:00 +02:00
..
admin feat: multiple project roles (#4512) 2023-08-25 09:31:37 +01:00
application feat: application usage frontend (#4561) 2023-08-24 13:13:02 +03:00
archive feat: Last seen per environment archive (#4540) 2023-08-21 15:37:44 +03:00
changeRequest fix: diff component for ordering (#4552) 2023-08-23 12:17:59 +02:00
common Fix/legal values deletion (#4564) 2023-08-25 10:44:00 +02:00
context chore: remove split button strategy flag (#4245) 2023-07-14 14:23:23 +03:00
demo fix: strategy variants in demo link to new variants (#4477) 2023-08-11 09:43:41 +02:00
environments fix: show environment reorder handle (#3990) 2023-06-15 13:39:22 +02:00
events fix: diff no changes (#4480) 2023-08-11 12:31:23 +02:00
feature fix: multiline textarea resizing for json input (#4463) 2023-08-23 15:53:12 +02:00
featureTypes 1-1192: track the feature type and the new lifetime (#4395) 2023-08-03 11:34:03 +02:00
feedback fix: ensure rel=noreferrer on target=_blank (#3755) 2023-05-12 09:51:33 +01:00
integrations Integrations - frontend adjustments (#4527) 2023-08-22 14:40:38 +02:00
layout Fix: change request info (#3971) 2023-07-04 09:09:05 +02:00
loginHistory Menu update - improvements and mobile version (#4423) 2023-08-07 18:13:56 +02:00
maintenance feat: dark theme v1 (#3298) 2023-03-22 16:37:40 +02:00
menu chore: remove configurableFeatureTypeLifetimes flag (#4569) 2023-08-25 09:19:08 +02:00
playground/Playground fix: dot in context fields (#4434) 2023-08-07 13:53:22 +02:00
project feat: multiple project roles (#4512) 2023-08-25 09:31:37 +01:00
providers fix: correct escaping of ui flags for plausible (#3907) 2023-07-07 17:40:37 +02:00
segments Fix/legal values deletion (#4564) 2023-08-25 10:44:00 +02:00
splash feat: dark theme v1 (#3298) 2023-03-22 16:37:40 +02:00
strategies feat: split strategies table into two with new design (#3969) 2023-06-14 09:10:04 +03:00
tags feat: responsive strategy icons (#4121) 2023-06-29 18:01:27 +01:00
user refactor: roles - make better plan assumptions (#4113) 2023-06-28 16:00:14 +01:00
App.tsx feat: demo ui-ux improvements (#3634) 2023-04-27 08:15:17 +01:00
InitialRedirect.tsx