1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-09-15 17:50:48 +02:00
unleash.unleash/frontend/src/component/common
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
..
AnimateOnMount refactor: styles batch 3 (#2821) 2023-01-11 17:44:21 +01:00
Announcer MakeStyles refactor 1-3 (#2835) 2023-01-09 10:41:58 +02:00
ApiError chore: update MUI to v5 (#923) 2022-05-02 15:52:41 +02:00
ApiTokenTable Feat/more granular permissions check in create apitoken (#4072) 2023-06-23 10:57:08 +02:00
AutocompleteBox refactor: light theme colors (#3252) 2023-03-06 12:58:36 +02:00
Badge Disable and enable strategies - frontend (#3582) 2023-04-26 11:41:24 +02:00
BatchSelectionActionsBar fix: make area behind bulk actions clickable (#3838) 2023-05-23 10:41:01 +02:00
BreadcrumbNav Update admin navigation (1-1104-improved-menu-oss) (#4458) 2023-08-10 09:28:10 +02:00
CheckmarkBadge feat: dark theme v1 (#3298) 2023-03-22 16:37:40 +02:00
Codebox refactor: light theme colors (#3252) 2023-03-06 12:58:36 +02:00
ConditionallyRender Refactor: convert jsx files to typescript (#881) 2022-05-02 12:52:33 +02:00
ConstraintAccordion Fix/legal values deletion (#4564) 2023-08-25 10:44:00 +02:00
CreateButton feat: revive features (#3344) 2023-03-17 18:21:13 +00:00
DateTimePicker Variants per environment (frontend) (#2453) 2022-11-18 11:43:24 +00:00
Dialogue feat: dark theme v1 (#3298) 2023-03-22 16:37:40 +02:00
DividerText fix: remove all warnings (#3055) 2023-02-07 11:20:44 +01:00
DropdownMenu refactor: improve header button ARIA attrs (#957) 2022-05-06 11:38:11 +02:00
EnterpriseBadge Update admin navigation (1-1104-improved-menu-oss) (#4458) 2023-08-10 09:28:10 +02:00
EnvironmentIcon feat: dark theme v1 (#3298) 2023-03-22 16:37:40 +02:00
EnvironmentStrategiesDialog feat: revive features (#3344) 2023-03-17 18:21:13 +00:00
FavoriteIconButton feat: dark theme v1 (#3298) 2023-03-22 16:37:40 +02:00
FeatureArchiveDialog feat: bulk archive usage warning (#4448) 2023-08-08 15:46:11 +02:00
FeatureStaleDialog Fix: UI improvements (#1114) 2022-06-28 12:58:10 +02:00
FeatureStatusChip feat: dark theme v1 (#3298) 2023-03-22 16:37:40 +02:00
Feedback feat: implement plausible tracking (#3212) 2023-02-28 14:29:14 +01:00
FormTemplate feat: project UI rework, move edit and delete buttons deeper (#4195) 2023-07-11 09:47:38 +03:00
GeneralSelect Change requests - add multiple reviewers (#2448) 2022-11-17 11:08:29 +02:00
Gradient refactor: misc login page accessibility improvements (#914) 2022-04-27 09:29:43 +02:00
GridCol feat: add billing page to admin (#993) 2022-05-25 23:26:05 +02:00
GridRow feat: upgrade users table (#1040) 2022-05-31 07:59:09 +01:00
GuidanceIndicator feat: dark theme v1 (#3298) 2023-03-22 16:37:40 +02:00
HelpIcon fix: dark theme UI fixes (#3423) 2023-03-30 16:57:35 +01:00
Highlighter fix: highlighter casing (#4543) 2023-08-22 16:00:21 +02:00
HtmlTooltip feat: custom root roles (#3975) 2023-06-14 14:40:40 +01:00
Input add selectable timezone (#2911) 2023-01-30 15:36:42 +01:00
InputCaption fix: validate feature strategy parameters (#1192) 2022-08-04 13:34:30 +02:00
InputListField chore: update MUI to v5 (#923) 2022-05-02 15:52:41 +02:00
InstanceStatus refactor: misc cleanups (#4022) 2023-06-21 15:08:52 +01:00
ItemList feat: add SSO mappings to groups (#2175) 2022-10-13 11:34:47 +01:00
Loader Refactor makestyles 2 2 (#2827) 2023-01-05 16:23:40 +02:00
LoginRedirect chore: update react-router to v6 (#946) 2022-05-05 13:42:18 +02:00
MainHeader fix: misc UI/UX fixes, mostly related with favorites (#2683) 2022-12-13 13:19:21 +00:00
Mermaid fix: dark theme UI fixes (#3423) 2023-03-30 16:57:35 +01:00
MessageBanner feat: message banner (variants) (#3788) 2023-05-18 09:38:59 +01:00
MultipleRoleSelect feat: multiple project roles (#4512) 2023-08-25 09:31:37 +01:00
NoItems Refactor makestyles 2 2 (#2827) 2023-01-05 16:23:40 +02:00
NotFound fix: 404 in dark theme (#4337) 2023-07-24 14:23:29 +00:00
Notifications feat: do not update every second (#4492) 2023-08-15 13:35:38 +02:00
OperatorUpgradeAlert feat: dark theme v1 (#3298) 2023-03-22 16:37:40 +02:00
PageContent Update admin navigation (1-1104-improved-menu-oss) (#4458) 2023-08-10 09:28:10 +02:00
PageHeader feat: implement project-scoped segments in project settings (#3335) 2023-03-17 08:23:27 +00:00
PasswordField chore: update MUI to v5 (#923) 2022-05-02 15:52:41 +02:00
PercentageCircle refactor: light theme colors (#3252) 2023-03-06 12:58:36 +02:00
PermissionButton feat: responsive strategy icons (#4121) 2023-06-29 18:01:27 +01:00
PermissionGuard feat: upgrade AdminAlert to PermissionGuard (#4074) 2023-06-23 13:25:35 +01:00
PermissionHOC Project overview feature toggles list (#971) 2022-05-13 14:51:22 +02:00
PermissionIconButton Feat project segments permissions (#3346) 2023-03-17 17:43:48 +00:00
PermissionSwitch added contraints checking in change request permissions (#2690) 2022-12-14 13:00:51 +01:00
PremiumFeature feat: track read about (#4478) 2023-08-11 09:59:23 +02:00
PrettifyLargeNumber linter fixes (#2561) 2022-11-30 10:52:13 +01:00
Proclamation Refactor makestyles 2 2 (#2827) 2023-01-05 16:23:40 +02:00
ProjectSelect chore: update MUI to v5 (#923) 2022-05-02 15:52:41 +02:00
ProtectedRoute chore: update react-router to v6 (#946) 2022-05-05 13:42:18 +02:00
ResponsiveButton Feat/more granular permissions check in create apitoken (#4072) 2023-06-23 10:57:08 +02:00
RoleBadge refactor: roles - make better plan assumptions (#4113) 2023-06-28 16:00:14 +01:00
RoleDescription feat: multiple project roles (#4512) 2023-08-25 09:31:37 +01:00
RoleSelect refactor: roles - make better plan assumptions (#4113) 2023-06-28 16:00:14 +01:00
ScrollTop refactor: port some things to TS (#833) 2022-04-01 10:28:15 +02:00
Search feat: Change request advanced search and filter (#4544) 2023-08-23 09:38:10 +02:00
SegmentItem refactor: light theme colors (#3252) 2023-03-06 12:58:36 +02:00
SidebarModal feat: edit change requests (#3573) 2023-04-24 15:32:19 +02:00
SkipNavLink fix: header-responsiveness (#3381) 2023-03-24 15:51:28 +02:00
StaleDataNotification refactor: styles batch 3 (#2821) 2023-01-11 17:44:21 +01:00
StrategyItemContainer chore: remove strategyImprovements flag (#4043) 2023-06-28 11:38:21 +03:00
StrategySeparator refactor: light theme colors (#3252) 2023-03-06 12:58:36 +02:00
StrategyVariantsUpgradeAlert feat: Demo for strategy variants (#4457) 2023-08-10 11:55:33 +02:00
StringTruncator fix: truncator (#1148) 2022-07-26 08:58:57 +02:00
Table feat: multiple project roles (#4512) 2023-08-25 09:31:37 +01:00
TabNav/TabPanel Update admin navigation (1-1104-improved-menu-oss) (#4458) 2023-08-10 09:28:10 +02:00
ThemeMode Feat/dark mode exp (#1137) 2022-08-23 14:20:02 +02:00
ToastRenderer fix: dark theme UI fixes (#3423) 2023-03-30 16:57:35 +01:00
TooltipLink feat: improve variants modal UI/UX (#3307) 2023-03-15 12:22:06 +00:00
TooltipResolver Fix plan upgrade tooltip (#2549) 2022-11-29 10:06:29 +02:00
UpdateButton #4209: add 'add to draft' button for segments. (#4400) 2023-08-03 14:34:38 +02:00
UserAvatar fix: remove group owner concept (#1210) 2022-08-11 15:34:17 +01:00
VariantInfoAlert feat: pointer to strategy variants (#4440) 2023-08-08 15:48:43 +02:00
VerticalTabs Menu update - improvements and mobile version (#4423) 2023-08-07 18:13:56 +02:00
common.module.scss fix: application name link styling (#3724) 2023-05-09 13:02:32 +00:00
flags.ts feat: add user groups (#1130) 2022-07-22 07:31:08 +00:00
index.jsx fix: url encode application name in links (#2121) 2022-09-30 15:53:02 +02:00
select.tsx chore: update MUI to v5 (#923) 2022-05-02 15:52:41 +02:00
util.test.ts fix: frontend variant weights distribution (#4347) 2023-07-26 16:08:11 +02:00
util.ts Update admin navigation (1-1104-improved-menu-oss) (#4458) 2023-08-10 09:28:10 +02:00