-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Allow saving and publishing posts #594
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
22 commits
Select commit
Hold shift + click to select a range
b576908
Add post object to editor state
nylen 516a213
Add basic publish button component
nylen d2d6050
Do not use `wp_localize_script` for post content
nylen e4e8044
Implement saving/publishing posts
nylen 7a994ea
Update page URL after creating a new post
nylen fe02d3f
Make eslint happy again
nylen 77c37c9
Make the test suite happy again
nylen b9ac89d
Make message determination more readable
nylen ad29d20
Save drafts instead of publishing posts
nylen 9954198
Move `savePost` to a new `actions.js` file
nylen 8cce4eb
Rename `state.api` to `state.saving`
nylen 12252a0
Change POST_UPDATE_REQUEST to REQUEST_POST_UPDATE
nylen 53fb259
Parse the query string rather than using a regex replace
nylen a2fcfea
Store post edits in undoable state and full post object in another key
nylen 5b2c081
Fix a typo in the `saving` reducer
nylen dbcb85b
Simplify assignment of `buttonEnabled` flag
nylen 72e7aa8
Use ellipsis character instead of three dots
nylen 7872b75
Clarify window.location splitting logic using array destructuring
nylen 5106309
Add tests for `editor.edits` reducer
nylen 0702d66
Add tests for `currentPost` reducer
nylen e938d3e
Add tests for `saving` reducer
nylen d83ea67
Update dirty state key
nylen 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
Parse the query string rather than using a regex replace
- Loading branch information
commit 53fb259257aeb790157af82f39172301ee6c5a99
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.
Minor: The object spread syntax creates another clone step; this is the equivalent of:
Since we've created and have no plans to reuse the object outside the scope of the function, I think it'd be fine enough to mutate
qsby assigning directly into it: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 tried this, and I think the code clarity / elegance due to using the spread operator is worth the extra clone step. I don't think the performance is a concern here as this is not called very often and the browser's
replaceStateis going to be orders of magnitude more expensive than theassign.