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 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
..
AnimateOnMount
Announcer feat: biome lint frontend (#4903) 2023-10-02 13:25:46 +01:00
ApiError feat: biome lint frontend (#4903) 2023-10-02 13:25:46 +01:00
ApiTokenTable fix(removeapitokenbutton.tsx): add environment name in delete token modal (#5469) 2023-12-05 13:17:31 +01:00
AutocompleteBox fix: separate concerns for ConstraintAccordionList (#5701) 2023-12-20 15:36:23 +01:00
Badge feat: biome lint frontend (#4903) 2023-10-02 13:25:46 +01:00
BatchSelectionActionsBar Feat/new paginated table (#5371) 2023-11-24 17:50:58 +01:00
BreadcrumbNav feat: biome lint frontend (#4903) 2023-10-02 13:25:46 +01:00
CheckmarkBadge feat: biome lint frontend (#4903) 2023-10-02 13:25:46 +01:00
Codebox
ConditionallyRender feat: biome lint frontend (#4903) 2023-10-02 13:25:46 +01:00
ConstraintAccordion fix: separate concerns for ConstraintAccordionList (#5701) 2023-12-20 15:36:23 +01:00
CreateButton feat: biome lint frontend (#4903) 2023-10-02 13:25:46 +01:00
DateTimePicker feat: biome lint frontend (#4903) 2023-10-02 13:25:46 +01:00
Dialogue feat: biome lint frontend (#4903) 2023-10-02 13:25:46 +01:00
DividerText feat: biome lint frontend (#4903) 2023-10-02 13:25:46 +01:00
DropdownMenu feat: biome lint frontend (#4903) 2023-10-02 13:25:46 +01:00
EnterpriseBadge
EnvironmentIcon
ExperimentalFeedback refactor: remove feature flag for Dora (#5367) 2023-11-21 08:18:00 +01:00
FavoriteIconButton feat: biome lint frontend (#4903) 2023-10-02 13:25:46 +01:00
FeatureArchiveDialog feat: show Changes scheduled in feature variants even when CR are dis… (#5613) 2023-12-12 15:34:32 +02:00
FeatureStaleDialog
FeatureStatusChip
Feedback feat: biome lint frontend (#4903) 2023-10-02 13:25:46 +01:00
FilterDateItem feat: filter chips icons (#5658) 2023-12-15 13:42:09 +00:00
FormSwitch feat: banner UI/UX adjustments (#5151) 2023-10-25 17:14:18 +01:00
FormTemplate chore(deps): update dependency @biomejs/biome to v1.4.0 (#5288) 2023-11-28 09:32:00 +00:00
GeneralSelect feat: biome lint frontend (#4903) 2023-10-02 13:25:46 +01:00
Gradient
GridCol feat: biome lint frontend (#4903) 2023-10-02 13:25:46 +01:00
GridRow feat: biome lint frontend (#4903) 2023-10-02 13:25:46 +01:00
GuidanceIndicator
HelpIcon feat: biome lint frontend (#4903) 2023-10-02 13:25:46 +01:00
Highlighter feat: Multi highlighter (#5666) 2023-12-18 10:58:07 +01:00
HtmlTooltip feat: biome lint frontend (#4903) 2023-10-02 13:25:46 +01:00
Input feat: biome lint frontend (#4903) 2023-10-02 13:25:46 +01:00
InputCaption feat: biome lint frontend (#4903) 2023-10-02 13:25:46 +01:00
InputListField feat: biome lint frontend (#4903) 2023-10-02 13:25:46 +01:00
InstanceStatus feat: biome lint frontend (#4903) 2023-10-02 13:25:46 +01:00
ItemList feat: biome lint frontend (#4903) 2023-10-02 13:25:46 +01:00
Loader feat: biome lint frontend (#4903) 2023-10-02 13:25:46 +01:00
LoginRedirect
MainHeader
Mermaid feat: biome lint frontend (#4903) 2023-10-02 13:25:46 +01:00
MultipleRoleSelect feat: biome lint frontend (#4903) 2023-10-02 13:25:46 +01:00
NoItems
NotFound feat: biome lint frontend (#4903) 2023-10-02 13:25:46 +01:00
Notifications fix: small adjustments on the new header icons (#5043) 2023-10-16 12:25:27 +01:00
OperatorUpgradeAlert feat: biome lint frontend (#4903) 2023-10-02 13:25:46 +01:00
PageContent fix: conditionally show pagination bar 2023-11-13 14:47:51 +01:00
PageHeader feat: biome lint frontend (#4903) 2023-10-02 13:25:46 +01:00
PasswordField feat: biome lint frontend (#4903) 2023-10-02 13:25:46 +01:00
PercentageCircle fix: grey out text and icons for disabled strategies in playground (#5113) 2023-10-23 15:12:15 +03:00
PermissionButton feat: biome lint frontend (#4903) 2023-10-02 13:25:46 +01:00
PermissionGuard feat: biome lint frontend (#4903) 2023-10-02 13:25:46 +01:00
PermissionHOC
PermissionIconButton feat: biome lint frontend (#4903) 2023-10-02 13:25:46 +01:00
PermissionSwitch feat: biome lint frontend (#4903) 2023-10-02 13:25:46 +01:00
PremiumFeature feat: banners admin page (#5111) 2023-10-20 11:14:48 +01:00
PrettifyLargeNumber feat: biome lint frontend (#4903) 2023-10-02 13:25:46 +01:00
Proclamation feat: biome lint frontend (#4903) 2023-10-02 13:25:46 +01:00
ProtectedRoute
ResponsiveButton feat: biome lint frontend (#4903) 2023-10-02 13:25:46 +01:00
RoleBadge feat: biome lint frontend (#4903) 2023-10-02 13:25:46 +01:00
RoleDescription refactor: favor permission name over id (#5409) 2023-11-27 11:12:09 +00:00
RoleSelect feat: biome lint frontend (#4903) 2023-10-02 13:25:46 +01:00
ScrollTop feat: biome lint frontend (#4903) 2023-10-02 13:25:46 +01:00
Search fix: now history is only shown to search bars that have id to save hi… (#5684) 2023-12-19 14:20:10 +02:00
SegmentItem fix: grey out text and icons for disabled strategies in playground (#5113) 2023-10-23 15:12:15 +03:00
SidebarModal feat: biome lint frontend (#4903) 2023-10-02 13:25:46 +01:00
SkipNavLink
StaleDataNotification feat: biome lint frontend (#4903) 2023-10-02 13:25:46 +01:00
Sticky feat: add new sticky component to handle stacked stickies (#5088) 2023-10-19 15:50:37 +01:00
StrategyItemContainer refactor: custom render should provide container (#4938) 2023-10-06 09:19:49 +02:00
StrategySeparator
StrategyVariantsUpgradeAlert feat: biome lint frontend (#4903) 2023-10-02 13:25:46 +01:00
StringTruncator
Table fix: move paginated table into isolation context (#5694) 2023-12-20 10:47:22 +01:00
TabNav/TabPanel feat: biome lint frontend (#4903) 2023-10-02 13:25:46 +01:00
ThemeMode
ToastRenderer chore(deps): update dependency @biomejs/biome to v1.4.0 (#5288) 2023-11-28 09:32:00 +00:00
TooltipLink feat: disable sorting on selected columns (#5652) 2023-12-15 12:47:00 +01:00
TooltipResolver feat: strategy variants on strategy overview (#4776) 2023-09-21 14:28:45 +02:00
UpdateButton feat: biome lint frontend (#4903) 2023-10-02 13:25:46 +01:00
UserAvatar feat: biome lint frontend (#4903) 2023-10-02 13:25:46 +01:00
VariantInfoAlert feat: biome lint frontend (#4903) 2023-10-02 13:25:46 +01:00
VerticalTabs feat: biome lint frontend (#4903) 2023-10-02 13:25:46 +01:00
common.module.scss
flags.ts feat: open-source segments 🚀 (#4690) 2023-09-19 11:24:26 +00:00
index.jsx feat: biome lint frontend (#4903) 2023-10-02 13:25:46 +01:00
select.tsx Feat/new strategy configuration general tab (#5628) 2023-12-13 12:34:43 +01:00
util.test.ts feat: biome lint frontend (#4903) 2023-10-02 13:25:46 +01:00
util.ts feat: support localization in date filter (#5572) 2023-12-08 13:20:39 +02:00