Fix submit for review button#10941
Conversation
Testing before this is ready! 😄 I'm still working on this. I should have waited before pinging you as a reviewer. |
|
No worries. I'll keep an eye on this! |
|
@jasmussen @WordPress/gutenberg-core this is ready for review. I still need to get ready the e2e tests, but wanted to give folks as much time as possible for review. Need to be away a couple of hours but will come back to this by the end of the day. |
|
This is excellent. I can confirm this works as intended 👍 👍 This should go right in once the e2e tests are fixed. Am I correct in thinking this replaces #10803? If so we should thank @nfmohit-wpmudev for his work so far, and his inspiration for this. |
|
Added some basic e2e tests in c7b89a2. |
noisysocks
left a comment
There was a problem hiding this comment.
This works in my testing and is looking really good! Great work 💯📈🎉
I left a few notes on how I think we could make the code a little easier to understand.
|
@noisysocks done a refactoring to clarify the button or toggle logic, as you suggested. Also added a bunch of unit tests. Everything is much clearer now! Added a table to the PR description with the changes and some code comments to add further context to our futureselves. |
There was a problem hiding this comment.
This was a leftover, wasn't being used.
There was a problem hiding this comment.
I've noticed we're selecting stuff that we don't need all over the place. I wonder if we could somehow write a lint rule to catch them all...
Some languages such as Deustch have longer text that need acomodation. We are also using medium to hide the writing modes, so it makes sense to follow that.
We want to show the "Publish..." button on < medium viewports, no matter what the isPublishSidebarEnabled state is.
53615dd to
b94538d
Compare
noisysocks
left a comment
There was a problem hiding this comment.
Yes! Love it! This is a lot easier to follow. Thanks also for documenting the logic both in the code and in the PR. Gold star for you ⭐️
There were some minor indentation issues in post-publish-button-or-toggle.js. I fixed them up by running Prettier on the file in f4aed3d. Hope you don't mind!
|
Thanks for |

Fixes #10475
This PR takes the viewport size into account when it comes to decide whether we show the button or toggle logic. Here's how this PR modifies the logic (changes in bold):
publishorprivatefutureand the (scheduled) date is after nowpending, cannot be published and the viewport is < mediumpending, cannot be published and the viewport >= mediumTODO