-
Notifications
You must be signed in to change notification settings - Fork 4.7k
PostPreviewButton: rewrite to functional, avoid state transitions in lifecycles #44971
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
Merged
Merged
Changes from 1 commit
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
9b9d188
PostPreviewButton: rewrite to functional, avoid state transitions in …
jsnajdr 56f6c59
PreviewOptions: close dropdown after opening external preview
jsnajdr f524989
Move metaboxes save into a hook in savePost
jsnajdr 92eda2f
Make isSavingPost true during entire save, not only when saving the e…
jsnajdr df7ff3e
Remove forceIsSaving and forcePreviewLink props: isSavingPost returns…
jsnajdr e00da35
Fix unit tests for isEditedPostAutosaveable and isSavingPost
jsnajdr 69e8c5c
Fix PostPreviewButton unit tests
jsnajdr 7376e29
Rename the action to editor.__unstableSavePost
jsnajdr df880bc
Remove the 'disabled when saving metaboxes' e2e test
jsnajdr File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Make isSavingPost true during entire save, not only when saving the e…
…ntity
- Loading branch information
commit 92eda2f16ee3f59f8569e5c8c4e6505a97443e6f
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
My ultimate goal (probably never happens but who knows) is to make the editor package obsolete (because as an abstraction it's not clear). The change here goes in the opposite direction because it uses the store of this package. I think it's fine for now but I just wanted to share some thought on this.
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.
I think it's not just
isSavingPost, but also adding a new functionality (the action hook) to theeditor.savePostaction goes in the opposite direction, too. When thesavePostaction moves somewhere else (toedit-post?), theisSavingPostselector and the state it reads will move as well.