mirror of
https://github.com/Unleash/unleash.git
synced 2025-06-27 01:19:00 +02:00
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. |
||
---|---|---|
.. | ||
__mocks__ | ||
assets | ||
component | ||
constants | ||
contexts | ||
hooks | ||
interfaces | ||
openapi | ||
themes | ||
types | ||
utils | ||
index.tsx | ||
setupTests.ts | ||
vite-env.d.ts |