-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
If a more recent revision/autosave exists, store its state on editor …
…setup (#7945) * Refactor autosave state into core-data - Migrate state from core/editor to core - Adjust selectors and action creators to take a post id. - Store autosave state by the post id. - Deprecate old action creators and selectors and forward to new implementation - Update tests - Update changelog Add a resolver for fetching autosave data Preload any autosaves for the current post Improve isEditedPostAutosaveable selector deprecation Pass entire parent post object into autosave selector functions to allow the getAutosave resolver to form a REST API path that incorporates both the post id and type Use a selector to get the correct post type base url for the autosave Rename resetAutosave to receiveAutosave for conformity Render the post preview button as disabled until autosave has been fetched. Comments/test description tidy up Prefer `action` over `action creator` in copy Remove unecessary if statement Remove `autosave` prop overriding the prop of the same name in withDispatch Fix deprecated resetAutosave function Fix jsdoc formatting Remove new getAutosaveAttribute in favour of deprecating and removing old version Change autosave selector interface from func( post ) to func( postType, postId ) Store raw autosave from REST API in core, move transformation of autosave back to the core/editor package Remove and deprecate hasAutosave in favour of getAutosave Update docs Rename reducer autosave -> autosaves Fix erroneous changelog entry caused by bad merge conflict resolution Update deprecations Remove unnecessary new line Use createRegistrySelector to select autosave data from correct registry for deprecated functions Handle usage of registry selector in tests for isEditedPostAutosaveable * Update deprecation version numbers * Add resolveSelect control to core-data store * Use resolveSelect to query for postType in getAutosave resolver * Rework state for autosaves to reflect that multiple autosave can be received (one per user) * Add state for the current user * Add a selector/resolver for retrieving an autosave for an individual author * Handle providing the current user id to the getAutosave selector * Undeprecate isEditedPostAutosaveable, update tests to handle registrySelector * Update changelog and deprecation version numbers * Update docs * Add JSDocs for currentUser reducer * Minor renaming of functions/props * Update deprecation version for action * Change PostPreviewButton prop back to isSaveable. * Do not consider a post autosaveable if existing autosaves have not yet been fetched from the REST API * Use undefined as the fallback when no currentUser is fetched * Move changelog entries to unreleased section, and bump minor instead of patch version * Allow single or multiple autosaves to be passed to receiveAutosaves * Update deprecation versions * Use REDUCER_KEY as arg to select Co-Authored-By: talldan <[email protected]> * Update docs
- Loading branch information
Showing
21 changed files
with
919 additions
and
241 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.