-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Add "switch to draft" button in publish flow dropdown. #3718
Conversation
@@ -22,7 +22,7 @@ import { | |||
} from '../../selectors'; | |||
|
|||
function PostPublishWithDropdown( { isSaving, isPublishable, isSaveable, isPublished } ) { | |||
const isButtonEnabled = ! isSaving && isPublishable && isSaveable; | |||
const isButtonEnabled = ! isSaving && isPublishable && isSaveable || isPublished; |
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.
[0] /home/travis/build/WordPress/gutenberg/editor/components/post-publish-with-dropdown/index.js
[0] 25:54 error Unexpected mix of '&&' and '||' no-mixed-operators
[0] 25:68 error Unexpected mix of '&&' and '||' no-mixed-operators
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.
Should I expect this to actually perform the action of reverting the post to draft?
@@ -41,7 +41,7 @@ function PostPublishWithDropdown( { isSaving, isPublishable, isSaveable, isPubli | |||
<Dashicon icon="arrow-down" /> | |||
</Button> | |||
) } | |||
renderContent={ ( { onClose } ) => <PostPublishDropdown onSubmit={ onClose } /> } | |||
renderContent={ ( { onClose } ) => <PostPublishDropdown onSubmit={ onClose } showSwitchToDraft={ isPublished } /> } |
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.
Might be good to split to multiple lines.
No, putting it here as a mockup for discussing with Joen. @mcsf is looking at making it into a component like |
Codecov Report
@@ Coverage Diff @@
## master #3718 +/- ##
==========================================
- Coverage 37.55% 37.38% -0.17%
==========================================
Files 277 278 +1
Lines 6710 6775 +65
Branches 1223 1242 +19
==========================================
+ Hits 2520 2533 +13
- Misses 3531 3566 +35
- Partials 659 676 +17
Continue to review full report at Codecov.
|
Basic working state can be tested now: Questions:
|
This makes sense to me. Unless the dropdown menu disappears immediately.
This one should be more intelligent in general. Changing status should not show "view". |
I would concur with Matías on his thoughts on that. The flow overall is receiving more thought separately, but with those two changes, we'll have something good I think. |
0ca568e
to
8f25618
Compare
@mtias, @jasmussen: thanks for your notes.
Taken care of.
Per Slack, I think this is good to merge as-is, so we can test the usability of the dropdown as it stands and tweak if needed. |
8f25618
to
27f6f97
Compare
@@ -0,0 +1,5 @@ | |||
.editor-post-publish-dropdown__publish-button-container { | |||
.editor-post-publish-dropdown__switch-to-draft { |
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.
Is the nesting necessary?
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.
The nesting per se isn't, but the added specificity is.
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.
Yes, needed the core-ui thing otherwise :(
This adds a button to switch a published post to draft form. See #1452.