-
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 Editor: Clear 'stub' navigation post edits on save #31735
Conversation
Size Change: +14 B (0%) Total Size: 1.31 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.
Screen.Capture.on.2021-05-12.at.15-36-33.mov
Nice work sleuthing this and finding a solution!
Tested and now works as expected. No more "you have unsaved changes" warning when trying to go to another page following saving and also Save button remains disabled when I have saved and not made further changes 👍
I wonder whether it would be useful to add a quick e2e test to cover this scenario? I'll leave that up to you to consider.
Description
The Navigation Editor uses the 'stub' post entity on runtime to provide a convenient way of editing navigation items using a regular post editor.
While this works as expected. We can't save this runtime entity using the regular
saveEntityRecord
action when saving the menu, and the state stays "dirty." Latter causes an issue when we want to warn users about unsaved changes (#31197).This PR tries to solve the issue by clearing navigation post edits when a menu is successfully saved.
How has this been tested?
Make sure store unit tests are passing:
Screenshots
CleanShot.2021-05-12.at.10.11.46.mp4
Types of changes
Bugfix
Checklist:
*.native.js
files for terms that need renaming or removal).