-
Notifications
You must be signed in to change notification settings - Fork 1
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 notices for when post is locked from publishing #11
Conversation
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.
Just a comment around the wording of the message in the notice, otherwise it looks good to me.
@@ -52,12 +52,16 @@ subscribe( function () { | |||
if ( ! postLocked ) { | |||
postLocked = true; | |||
dispatch( 'core/editor' ).lockPostSaving( 'vip-workflow' ); | |||
dispatch( 'core/notices' ).createNotice( | |||
'warning', | |||
__( 'This post is locked from publishing due to its status.', 'vip-workflow' ), |
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 think the wording of this message could be improved. Something like
This post is locked from publishing, until it reaches
pending review
status.
might be better?
@alecgeatches or @smithjw1 - wordsmithing help
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.
A few thoughts:
Can we hide the publish button? If you can't publish, I don't think we want it there. Maybe "Save" instead. I don't think we need any warning in this case.
If we can do 1, then I would have the warning say: "This post can not be published."
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.
There is some experimentation that Hanif did with css/jQuery, but the best solution we found was taking advantage of lockPostSaving
so that the second publish button was disabled via a built-in block editor way
I do like that we have a persistent way to notify the user that the post is locked, but I don't like this visual style. It takes up valuable vertical editing space and I think would be irritating for me if I was using the plugin. I have a different proposal - what if we use a and also Jetpack: My thought is that the icon could dynamically show a lock and text when the post is not publishable "Publish Locked", and if you click it, shows the "This post is locked from publishing due to its status." status in the sidebar. If the post is publishable, we should show a different icon or just hide the button entirely. This could be the way to:
|
To expand on the comment above, it might even be a better UX to rely on the backend publishing guard over |
I like that UX change, if we can't hide (or change the appearance of the publish button). |
For context, I had originally suggested this idea for a notice because there wasn't currently a way to add a tooltip to the disabled publish button or tweak the appearance in any way. This would allow some information to be provided at least, that we could always remove when Gutenberg adds something else that useable in it's place or make it configurable. This bug that I pointed out in #9 will be a blocker in using that backend functionality over this change. From the quick search I did, it seems like this method is recommended for such situations and people do add notices as a way to let users know why it's there. Perhaps making it dismissible might be better? I'm hesitant on adding another plugin sidebar, given we were talking about how we could unify all those sidebars down the line. That said, I do like that UX change. It'll keep the notice small, and tucked out of the way. It also gives us the added benefit of having a sidebar to use for when we want to add editorial metadata back or any other features for the block editor. |
Closing as the changes in #15 would make this unnecessary |
Description
This PR adds a notice to the top of the editor when publish guard is enabled and the post is not in the last status.
Steps to Test
VIP Workflow -> Notifications
Pending review