GetDKAN / dkan

DKAN Open Data Portal
https://dkan.readthedocs.io/en/latest/index.html
GNU General Public License v2.0
367 stars 170 forks source link

"View Published" button should not be shown if it cannot be used #2915

Closed erogray closed 5 years ago

erogray commented 5 years ago

Problem: On workflow sites where a user does not have permissions to view Revisions, or where an asset does not have Revisions, the "View Published" button still appears, but leads nowhere.

Example: Screenshot 2019-06-28 18 34 04

User story: As a user viewing a dataset with no revisions (or where I do not have permissions to view Revisions), I should NOT be able to see the "View Published" button that leads to nowhere.

Acceptance criteria

See also https://github.com/GetDKAN/dkan/issues/2147 and https://github.com/GetDKAN/dkan/pull/2174

Example URL: https://data.louisvilleky.gov/dataset/dockless-vehicles

dharizza commented 5 years ago

The "View published" button is the expected behavior provided by workbench_moderation, the buttons are not really buttons, they are tabs which let you browser between different pages related to the current node, so the "View published" is in blue because that's the current page (it is a highlighted tab) so the other tabs that may appear (for example the "Add feedback" one) will redirect the user to other pages. Removing the button completely just based on permissions doesn't seem like the right thing as it will prevent user going back to the node page if they are in one of the other tab pages. Closing as it is working as intended.

janette commented 5 years ago

@dharizza we want to avoid displaying the tab if no other tabs are present, as it serves no purpose if there are no revisions to that node.