-
Notifications
You must be signed in to change notification settings - Fork 132
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
Fix setting initial status in Gutenberg #521
Conversation
When you open a new post, click “Save Draft” - it will save the post as a Draft even if a custom status is selected. This fixes that by setting the status right away instead of waiting for a status to be slectred from the dropdown.
9ca6d16
to
8c0d316
Compare
@mikeyarce do you still remember these ideas? :) |
Tested and I'm finding that for existing posts, this reverts the custom status (to the first in the list) when you refresh the page (i.e. if you set the post to "In Progress", then save, then refresh, the dropdown and status will be set to "Pitch" which is top of the status list). |
For existing posts, we end up re-writing their status. Instead, limit the updates to new posts.
Creates for awkward experience where the grammar doesn't quite work (e.g. "Save Assigned" or "Save Waiting for Feedback"). Save gets the point across. Also minimizes another bug where the button gets reset to "Save Draft".
Expand out the compose blocks to make the code easier to read and follow (especially for folks newer to the codebase).
Okay, should be fixed now. We're no longer dispatching on load. For existing posts, this ends up re-writing their status. Instead, we now limit the updates to new posts. Also removes the status from "save" button, which creates for awkward experience where the grammar doesn't quite work (e.g. "Save Assigned" or "Save Waiting for Feedback"). This also minimizes the "Save Draft" bug mentioned in the PR. |
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.
LGTM tested on new and existing posts.
When you open a new post, click “Save Draft” - it will save the post as a Draft even if a custom status is selected.
This fixes that by setting the status right away instead of waiting for a status to be selected from the dropdown.
There is one minor outstanding issue: when the post is done saving, the text goes back to "Save Draft", but it does actually save the right status. I'll add some ideas on what to do in another comment.
Fixes #514