1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-07-21 13:47:39 +02:00
unleash.unleash/frontend/src/hooks
Fredrik Strand Oseberg 59a6ef46e8
fix: separate concerns for ConstraintAccordionList (#5701)
## Problem

The ConstraintAccordionList component was used in multiple places: 
* Playground
* Segment form
* StrategyExecution
* Change requests
* Create strategy
* Edit strategy

This is problematic because some of the views are just pure visual
representations, and other views allow you to interact with and edit the
constraints. This causes a situation where the visual representation
needs to be aware of the implementation details of editing and mutating
constraints. In addition the ConstraintAccordionList is not just a pure
rendering of the list, it also keeps internal state on when to show the
create button and optional headers. This is makes it hard to make
changes when stylings need to be subtly different across components.

## Solution

Taking on the full refactor for this is out of scope, but it's
unfortunate that the ConstraintAccordionList needs all this internal
state. For now I split out the list into it's own component called
ConstraintList. I gathered the functions needed for editing and mutating
the constraints in a reusable hook and isolated the version of the list
used in the new feature strategy edit / create components into it's own
component so that the changes in layout will not affect anything else.

Ideally we should try to move towards a future where the components
don't keep internal state like this but clear boundaries and purposes
for the use.
2023-12-20 15:36:23 +01:00
..
api feat: add reset password to user manager (#5580) 2023-12-18 13:54:04 +01:00
useChangeRequestAddStrategy.ts feat: biome lint frontend (#4903) 2023-10-02 13:25:46 +01:00
useChangeRequestInReviewWarning.tsx feat: biome lint frontend (#4903) 2023-10-02 13:25:46 +01:00
useChangeRequestsEnabled.test.tsx feat: biome lint frontend (#4903) 2023-10-02 13:25:46 +01:00
useChangeRequestsEnabled.ts feat: biome lint frontend (#4903) 2023-10-02 13:25:46 +01:00
useChangeRequestToggle.ts feat: biome lint frontend (#4903) 2023-10-02 13:25:46 +01:00
useCollaborateData.tsx feat: biome lint frontend (#4903) 2023-10-02 13:25:46 +01:00
useConditionallyHiddenColumns.ts feat: biome lint frontend (#4903) 2023-10-02 13:25:46 +01:00
useDefaultProjectSettings.ts feat: biome lint frontend (#4903) 2023-10-02 13:25:46 +01:00
useDragItem.ts feat: biome lint frontend (#4903) 2023-10-02 13:25:46 +01:00
useEventSettings.ts feat: biome lint frontend (#4903) 2023-10-02 13:25:46 +01:00
useFormErrors.ts feat: biome lint frontend (#4903) 2023-10-02 13:25:46 +01:00
useGlobalLocalStorage.ts feat: biome lint frontend (#4903) 2023-10-02 13:25:46 +01:00
useGlobalState.ts feat: biome lint frontend (#4903) 2023-10-02 13:25:46 +01:00
useHasAccess.ts feat: delete dependnecy button through change request (#4983) 2023-10-10 14:38:10 +02:00
useHiddenEnvironments.ts feat: biome lint frontend (#4903) 2023-10-02 13:25:46 +01:00
useHighestPermissionChangeRequestEnvironment.test.ts feat(#4209): add segment to drafts (#4408) 2023-08-04 12:57:26 +00:00
useHighestPermissionChangeRequestEnvironment.ts feat: biome lint frontend (#4903) 2023-10-02 13:25:46 +01:00
useId.test.ts
useId.ts
useIsAppleDevice.ts feat: biome lint frontend (#4903) 2023-10-02 13:25:46 +01:00
useKeyboardShortcut.ts feat: biome lint frontend (#4903) 2023-10-02 13:25:46 +01:00
useLastViewedProject.ts Fix/redirect woes (#2899) 2023-01-17 13:33:52 +01:00
useLoading.ts fix: now project overview has skeleton instead of placeholders (#5696) 2023-12-20 14:59:41 +02:00
useLocationSettings.ts feat: biome lint frontend (#4903) 2023-10-02 13:25:46 +01:00
useOnBlur.test.tsx feat: biome lint frontend (#4903) 2023-10-02 13:25:46 +01:00
useOnBlur.ts feat: biome lint frontend (#4903) 2023-10-02 13:25:46 +01:00
useOnClickOutside.test.tsx feat: biome lint frontend (#4903) 2023-10-02 13:25:46 +01:00
useOnClickOutside.ts feat: biome lint frontend (#4903) 2023-10-02 13:25:46 +01:00
useOnVisible.ts feat: add search to event log pages (#1205) 2022-08-09 16:00:51 +02:00
useOptionalPathParam.ts
usePageTitle.ts Refactor project health table (#1098) 2022-06-21 09:08:37 +02:00
usePagination.ts feat: biome lint frontend (#4903) 2023-10-02 13:25:46 +01:00
usePersistentGlobalState.ts feat: biome lint frontend (#4903) 2023-10-02 13:25:46 +01:00
usePersistentTableState.test.tsx feat: keep filter order (#5688) 2023-12-19 15:35:39 +01:00
usePersistentTableState.ts feat: keep filter order (#5688) 2023-12-19 15:35:39 +01:00
usePinnedFavorites.test.ts feat: biome lint frontend (#4903) 2023-10-02 13:25:46 +01:00
usePinnedFavorites.ts feat: biome lint frontend (#4903) 2023-10-02 13:25:46 +01:00
usePlausibleTracker.ts feat: add plausible tracking to scheduling (#5668) 2023-12-18 15:06:58 +02:00
useQueryParams.ts
useQueryStringNumberState.ts feat: biome lint frontend (#4903) 2023-10-02 13:25:46 +01:00
useQueryStringState.ts feat: biome lint frontend (#4903) 2023-10-02 13:25:46 +01:00
useRequiredPathParam.ts
useRequiredQueryParam.ts
useSearch.test.tsx feat: biome lint frontend (#4903) 2023-10-02 13:25:46 +01:00
useSearch.ts chore(deps): update dependency @biomejs/biome to v1.4.0 (#5288) 2023-11-28 09:32:00 +00:00
useTabs.ts
useThemeMode.ts fix: dark theme UI fixes (#3423) 2023-03-30 16:57:35 +01:00
useToast.tsx feat: biome lint frontend (#4903) 2023-10-02 13:25:46 +01:00
useUiFlag.ts feat: useUiFlag shorthand hook (#4566) 2023-09-11 10:01:20 +02:00
useUsersPlan.ts feat: biome lint frontend (#4903) 2023-10-02 13:25:46 +01:00
useVariant.ts feat: message banner (variants) (#3788) 2023-05-18 09:38:59 +01:00
useVirtualizedRange.ts feat: biome lint frontend (#4903) 2023-10-02 13:25:46 +01:00
useWeakMap.ts fix: separate concerns for ConstraintAccordionList (#5701) 2023-12-20 15:36:23 +01:00