-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Navigation Screen: warn the user about unsaved changes #31197
Conversation
Size Change: +2.96 kB (0%) Total Size: 1.32 MB
ℹ️ View Unchanged
|
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.
Nice work here. The concept is great but for some reason the dirty detection seems off in the Core Store.
As you can see below, I make changes and click Save
and then try to navigate away and it still thinks there are dirty changes.
Screen.Capture.on.2021-05-04.at.12-35-31.mov
Also once this is working, we need to add e2e tests to avoid regressions.
Thanks for the review, @getdave I'm aware of this issue but not sure what's the best way to fix it. My best guess is that it happens because we're using AJAX. The same issue affects my other PR #31119 (comment). |
Could you bring it up in open floor of Core Editor chat to see if folks are aware of the Issue? |
I did a little more research. I think the state stays "dirty" because of the stub navigation post. See Based on the selector comment, this record - "should only exist on runtime and should never be saved." While this works fine, changes to the record aren't removed from the edited state when saving the menu. I'm not familiar with this part of the code and unsure of the best next step. |
That makes sense. I guess one way would be to simulate the way that saving clears the dirty state. I wonder how |
Or I guess it might also be possible to ignore the stub post in the |
I had the same idea to check edited records for the Looking at the |
I was able to resolve the "dirty" state issue via PR #31735. |
eb213bc
to
dcb69c8
Compare
✅ Approved. Let's rebase here and I'll happily re-test for you. |
dcb69c8
to
8558173
Compare
Rebased branch, and it's ready for re-testing. |
@getdave I added some basic e2e tests for warning dialog as we discussed. |
Great work here @Mamaduka. Everything is working really nicely and the addition of e2e tests should avoid any further issues with dirty state and saving. |
Associated issue:
|
Description
Adds warning for users that they will lose unsaved data when navigating away.
See #30322.
Closes #30423.
How has this been tested?
Screenshots
CleanShot.2021-04-26.at.17.39.44.mp4
Types of changes
New feature (non-breaking change which adds functionality)
Checklist:
*.native.js
files for terms that need renaming or removal).