1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-01-06 00:07:44 +01:00
unleash.unleash/frontend/src/component/events
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
..
EventCard fix: add environment to event log card (#2912) 2023-01-18 10:19:25 +01:00
EventDiff feat: visualize variants diff in CR (#2979) 2023-01-24 16:06:53 +00:00
EventJson fix: wrap long lines in event JSON (#1220) 2022-08-16 12:57:55 +02:00
EventLog feat: add count to event list (#2036) 2022-09-02 08:35:31 +02:00
EventPage feat: add search to event log pages (#1205) 2022-08-09 16:00:51 +02:00