Hide the "Publish Content" button if there are no changes to publish.
When we don't have anything to publish, the Workspaces module still shows the publish content button. See this screen recording for reference.
Problem/Motivation
Steps to reproduce
Enable the Workspaces module.
...
Proposed resolution
Only show the "Publish content" button when there is something new to be published.
Remaining tasks
Issue Summary update
Add before and after screenshot to the issue summary
Agree on the message
Review
Tests
Commit
User interface changes
Before

API changes
Data model changes
Release notes snippet
Comments
Comment #2
gauravvvv commentedComment #3
alancunha commentedComment #4
takuma shimabukuro commentedComment #5
takuma shimabukuro commentedRemoved publish operation button when there is nothing to publish
Comment #6
vikashsoni commentedApplied patch #5 after patch " Publish Content" button hide if there are no changes to publish
Thanks for the patch
for reference sharing screenshot
Comment #7
takuma shimabukuro commentedThanks vikashsoni for reviewing my patch
so i'm moving ticket status for RTBC
Comment #9
beatrizrodriguesSince the patch failed, I will check it and try to resolve.
Comment #10
beatrizrodriguesComment #11
gauravvvv commentedComment #12
beatrizrodriguesI tested here and it not return me any errors. I don't know why the failed tests here.
Comment #13
anagomes commentedAs there are no changes in the new patch uploaded and it passes on the tests and fixes the issue, I'm moving it again to RTBC.
Comment #14
amateescu commentedAre we sure that hiding the Publish the button rather than disabling it is a usability improvement?
Comment #15
beatrizrodriguesFor me, hiding the publish button does not affect usability at all, as we have a message bellow describing that there are anything to publish. I think there will never be a scenario that that button could be enable in case of nothing to publish, so, why leave it there? Maybe to maintain a pattern. But, again, I don't think this affect usability. But I would like to know another opinion.
Comment #16
benjifisherComment #17
benjifisherComment #18
beatrizrodriguesSo, this issue was brought to UX meeting that happened today. The consent was that the second page should not be displayed as it does not have any usability. The modification should be done at the first page but it was not decided how yet. Please, someone correct me if I am wrong about the conclusions. So, I'll change back to needs works.
Comment #19
beatrizrodriguesComment #20
benjifisherAs @beatrizrodrigues said, we discussed this issue at #3245345: Drupal Usability Meeting 2021-10-29. That issue has a link to a recording of the meeting.
We had pretty strong consensus that a better solution to this problem is not to have the "Publish content" button on the first screen. Instead, have a message explaining that there is nothing available to be published. We did not have time to come up with suggestions, but probably someone familiar with the Workspaces module will have a better idea what to say. Perhaps something like, "All content in the Stage workspace is already published."
During the meeting, I attached a screenshot of the screen recording attached to this issue. Comment #16 was a goof (wrong screenshot) and #17 was the right one. I am rewriting the issue summary using the usual template and adding the screenshot as a "before" image in the "User interface changes" section.
Comment #21
amateescu commentedDoes that mean we can close this issue? We have #3213208: Do not show the "Publish content" button if user does not have access for changing the 'Publish content' button from the toolbar.
Comment #22
beatrizrodrigues@amateescu I think we can close this issue, it is exactly the same of
#3213208: Do not show the "Publish content" button if user does not have access
Comment #23
amateescu commentedOk, closing :)
Comment #24
gauravvvv commentedthis is not a duplicate issue. Please see.
https://www.drupal.org/project/drupal/issues/3213208#comment-14132600
Comment #25
amateescu commented@Gauravmahlawat, the usability team concluded that making it harder to get to this page by removing the Publish button from the toolbar workspace switcher is ok. Please see #18 and #20.
Comment #28
wagnerarao commentedHi! Let me work on this.
Comment #29
wagnerarao commentedComment #30
wagnerarao commentedPlease kindly review this patch. Now the 'Publish Content' is hidden in case there are no content to be published. Instead, it will show a simple text message saying there are no content to be published.
Comment #31
wagnerarao commentedComment #32
wagnerarao commentedComment #33
alanmoreira commentedI'll review this =)
Comment #34
alanmoreira commentedI applied the patch and all seems to be working fine! Changing status to RTBC =)
Comment #35
amateescu commentedClosing per #18, #20 and #25.
Comment #36
wagnerarao commentedI was reading the other issue. and i don't think this is a duplicate one. This comment confirms this. It's a different case: https://www.drupal.org/project/drupal/issues/3213208#comment-14132600
Comment #37
quietone commentedThere seems to be some disagreement on whether this issue is a duplicate of #3213208: Do not show the "Publish content" button if user does not have access. If I understand the other issue it is only about displaying 'Publish content' when the user has access. This issue is about only displaying 'Publish content' when there are changes to the content. To me, that is different. Also, in #20 a solution is given from the UX review which again supports that this is different.
There is still work to do here. For one what about tests, there are not tests in the patch. The Issue Summary needs to be updated, it needs before and after screen shots, the proposed resolution does not agree with the patch nor the Usability review, and the steps to reproduce are incomplete. I also do no see a code review in the comments.
All the remaining tasks are suitable for a novice, adding tag.
Comment #38
amateescu commentedThis is indeed about a different button (and page) than the one being addressed in #3213208: Do not show the "Publish content" button if user does not have access, but the UX team's meeting concluded that if we address that one (and users won't be able to get to this page), we don't really have to do anything about this one.
Comment #39
wagnerarao commented@amateescu so this issue can be closed? the task itself is done, i believe.
Comment #41
Yogesh Sahu commentedAdding the patch for drupal 10.1.x.
no interdiff because #30 patch fail to apply.
Comment #42
skt-001 commentedafter applying the patch #41 issue still persist so i change the status need work & sharing the SS.
Comment #43
Vinayak.Ambig commentedI have applied patch #41 and it's working as expected. Attached video.
Also found one more issue. After clicking publish content in Publish Stage workspace screen if we click cancel button it's redirecting to page not found url. page not found afyter clicking cancel button.mov
Comment #44
gauravvvv commentedAttribution updated