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(dashboard): Rework route modals #6459

Merged
merged 11 commits into from
Feb 22, 2024
Merged

feat(dashboard): Rework route modals #6459

merged 11 commits into from
Feb 22, 2024

Conversation

kasperkristensen
Copy link
Contributor

@kasperkristensen kasperkristensen commented Feb 21, 2024

What

  • Reworks how RouteModals are setup.

Why

  • With the current implementation it was possible to create a race-condition in the logic that handled displaying a prompt if the user tried to close a modal, while a child form was dirty. The race condition would cause a new prompt to spawn each time the user clicked the screen, making it impossible to dismiss the prompt. This only occurred in a few specific cases.

How

  • Creates two new components: RouteFocusModal and RouteDrawer. The component shares logic for handling their own open/closed state, and now accept a form prop, that allows the modals to keep track of whether their child form is dirty. This change ensures that race conditions cannot occur, and that the prompt always only renders once when needed.

@kasperkristensen kasperkristensen requested review from a team as code owners February 21, 2024 06:24
Copy link

changeset-bot bot commented Feb 21, 2024

⚠️ No Changeset found

Latest commit: ed54490

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link

vercel bot commented Feb 21, 2024

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

Name Status Preview Comments Updated (UTC)
medusa-dashboard ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 22, 2024 8:53am
3 Ignored Deployments
Name Status Preview Comments Updated (UTC)
api-reference ⬜️ Ignored (Inspect) Feb 22, 2024 8:53am
docs-ui ⬜️ Ignored (Inspect) Visit Preview Feb 22, 2024 8:53am
medusa-docs ⬜️ Ignored (Inspect) Visit Preview Feb 22, 2024 8:53am

@kodiakhq kodiakhq bot merged commit 72a17d6 into develop Feb 22, 2024
17 checks passed
@kodiakhq kodiakhq bot deleted the feat/route-modals branch February 22, 2024 09:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants