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: prompt on unsaved unload #1002

Open
wants to merge 9 commits into
base: main
Choose a base branch
from

Conversation

w1kman
Copy link
Contributor

@w1kman w1kman commented Nov 26, 2024

What this PR does / why we need it:
To avoid users losing modified and tested changes, this PR adds "confirm on leave" for checks.
It also changes the behavior of the SubmitSave-button.

"Submit" is now called "Save" and is only enabled if there are unsaved changes to the check.

Navigation handled by react-router-dom(-v5-compat)
image

Native navigation
image

Which issue(s) this PR fixes:
Resolves #892

Special notes for your reviewer:
Important: Please try to break it. It would be very unsatisfying for users to get blocked from navigating because of a bug.
livereload and beforeunload doesn't play nice. Get used to hitting Enter followed by Escape.

@w1kman w1kman self-assigned this Nov 26, 2024
@w1kman w1kman marked this pull request as ready for review November 26, 2024 09:59
@w1kman w1kman requested a review from a team as a code owner November 26, 2024 09:59
Copy link
Contributor

@ckbedwell ckbedwell left a comment

Choose a reason for hiding this comment

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

Minor change requests but this is pretty much good to go. 🙌

I tried to break it in Chrome, Firefox and Safari but it endured. Solid as a rock 🪨🏅

Copy link
Contributor

@ckbedwell ckbedwell left a comment

Choose a reason for hiding this comment

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

LGTM 🔥

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Warn you are leaving check edit page when unsaved data is present
2 participants