-
Notifications
You must be signed in to change notification settings - Fork 19
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
base: main
Are you sure you want to change the base?
Conversation
- change submit button text to "save" - disable submit button if there are no changes
# Conflicts: # src/test/dataTestIds.ts
There was a problem hiding this 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 🪨🏅
src/page/NewCheck/__tests__/ApiEndPointChecks/CommonFields.payload.test.tsx
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 🔥
# Conflicts: # src/page/NewCheck/NewCheck.tsx
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM ⭐
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)
Native navigation
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
andbeforeunload
doesn't play nice. Get used to hittingEnter
followed byEscape
.