1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-09-15 17:50:48 +02:00
unleash.unleash/frontend/src
Nuno Góis c5fced89fb
feat: visualize variants diff in CR (#2979)
https://linear.app/unleash/issue/2-582/display-the-change-request-created-with-variants-in-the-ui


![image](https://user-images.githubusercontent.com/14320932/214341314-c4f1aefb-fada-4d59-9d40-86f8dce98b76.png)

Includes a basic diff visualisation on variants change requests.

It seems like components like `CodeSnippetPopover` and `PopoverDiff` are
currently very tightly coupled together with strategies, so I preferred
to follow my own approach and leave those alone for now instead of
trying to refactor them. `patchVariant` could also be renamed to a more
fitting name in the future as well, since we're now doing more of an
override than applying a patch.

`Diff` is a generic diff component that uses `EventDiff` internally and
simply takes into account a "before" and "after" state, as `preData` and
`data`.

I made some changes to `EventDiff` that made some sense to me:
- Cover edge cases where `path` is undefined and `.join` crashes, also
fallback to the diff index (or undefined);
 - Leverage the key to correctly sort the change items in the diff;
2023-01-24 16:06:53 +00:00
..
__mocks__
assets Refactor/lazy load (#2842) 2023-01-12 11:34:45 +01:00
component feat: visualize variants diff in CR (#2979) 2023-01-24 16:06:53 +00:00
constants fix: prevent deleting the last variable variant on the ui (#2964) 2023-01-24 09:48:53 +02:00
contexts Custom event tracking (#2151) 2022-10-10 14:06:44 +02:00
hooks feat: add push to all button to UI (#2969) 2023-01-24 10:22:02 +01:00
interfaces feat: add warning hints on potential misconfiguration (#2948) 2023-01-20 18:09:01 +01:00
openapi feat: export ui api integration (#2888) 2023-01-12 16:09:13 +01:00
themes feat: initial status box implementation (#2913) 2023-01-18 10:10:41 +01:00
types chore(deps): update dependency prettier to v2.8.1 (#2509) 2022-12-27 10:45:43 +01:00
utils refactor: styles batch 3 (#2821) 2023-01-11 17:44:21 +01:00
index.tsx feat: message banner (#2726) 2022-12-22 15:16:51 +00:00
setupTests.ts
vite-env.d.ts