Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: visualize variants diff in CR #2979

Merged
merged 1 commit into from
Jan 24, 2023

Conversation

nunogois
Copy link
Member

@nunogois nunogois commented Jan 24, 2023

https://linear.app/unleash/issue/2-582/display-the-change-request-created-with-variants-in-the-ui

image

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;

@vercel
Copy link

vercel bot commented Jan 24, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
unleash-docs ✅ Ready (Inspect) Visit Preview Jan 24, 2023 at 3:57PM (UTC)
unleash-monorepo-frontend ✅ Ready (Inspect) Visit Preview Jan 24, 2023 at 3:57PM (UTC)

Copy link
Contributor

@gastonfournier gastonfournier left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@nunogois nunogois merged commit c5fced8 into main Jan 24, 2023
@nunogois nunogois deleted the feat-variants-per-env-cr-view-diff branch January 24, 2023 16:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

None yet

2 participants