Skip to content
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

Merged
merged 6 commits into from
Nov 1, 2019
Merged

Conversation

mikeyarce
Copy link
Member

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.

edit-flow-status

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

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.
@mjangda
Copy link
Member

mjangda commented Nov 1, 2019

I'll add some ideas on what to do in another comment.

@mikeyarce do you still remember these ideas? :)

@mjangda mjangda self-requested a review November 1, 2019 14:59
@mjangda
Copy link
Member

mjangda commented Nov 1, 2019

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).
@mjangda
Copy link
Member

mjangda commented Nov 1, 2019

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.

@mjangda mjangda requested a review from dchymko November 1, 2019 17:58
Copy link
Contributor

@dchymko dchymko left a 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.

@mjangda mjangda merged commit 35a4d2e into master Nov 1, 2019
@mjangda mjangda deleted the fix-block-editor-status branch November 1, 2019 21:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

"Pitch" status turns to "Draft" on save
3 participants