1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-06-27 01:19:00 +02:00
unleash.unleash/frontend/src
Thomas Heartman ef3ffc4d94
fix: Order properties correctly when mapping from Editable Constraint to IConstraint (#10163)
Prevents the property order from changing when constraints are set from
the editable constraint component. When we render out the API command,
we don't specify the order of properties in the objects, which means
that it can change dramatically, which can be a little jarring.

As it is right now, it first renders in one order when you open the
strategy form:

<img width="299" alt="image"
src="https://github.com/user-attachments/assets/52cf2445-d9eb-402c-b5bc-0fece5fbe822"
/>

And when you navigate to the targeting section of the strategy form, it
changes to:
<img width="299" alt="image"
src="https://github.com/user-attachments/assets/e4cb7006-dcf4-4e88-befb-ccba5b647ddd"
/>

This also applies to constraints in segments.

With this change, the order will remain the same before and after.

Additionally, there's some extra tests around constraint ids being kept
the same and being set if it doesn't exist.

## Further work

This came about as part of the issue we had with constraint editing in
segments being broken as of now. As part of that, I would like to make
some further improvements (such as making the ID required when you use a
list of editable constraints), but that will be in a follow-up. There
are some complications that might not make it a viable option, sadly.

We could also try to stabilize the property order in the API rendering
methods (which I think might be a good idea), but because there's
multiple different ones, this seems to be a faster solution.
2025-06-18 11:47:37 +00:00
..
__mocks__
assets fix: appropriately size case icon for non-editing constraints (#9869) 2025-04-30 08:37:16 +00:00
component fix: Order properties correctly when mapping from Editable Constraint to IConstraint (#10163) 2025-06-18 11:47:37 +00:00
constants delete legacy constraint accordion (#10110) 2025-06-11 12:22:55 +02:00
contexts feat: Unleash v7 ESM migration (#9877) 2025-05-14 09:47:12 +02:00
hooks chore(1-3811): use real data for lifecycle trends (#10117) 2025-06-12 13:52:10 +02:00
interfaces chore(1-3835): improve json diff view (#10146) 2025-06-17 12:01:17 +02:00
openapi chore(1-3811): use real data for lifecycle trends (#10117) 2025-06-12 13:52:10 +02:00
themes chore(1-3832): clean up flag overview redesign (#10140) 2025-06-13 10:41:08 +00:00
types
utils Chore(1-3831)/add edit strategy cleanup pt iv (#10135) 2025-06-13 10:02:12 +00:00
index.tsx feat: Unleash v7 ESM migration (#9877) 2025-05-14 09:47:12 +02:00
setupTests.ts
vite-env.d.ts