plone / volto

React-based frontend for the Plone Content Management System
https://demo.plone.org/
MIT License
427 stars 575 forks source link

Listings should not download files directly #5977

Open wesleybl opened 1 week ago

wesleybl commented 1 week ago

Is your feature request related to a problem? Please describe. It's weird when you're in a listing and you click a file link and a download starts. Especially when the listing has files and pages mixed together. It has no indication that a list item is a file.

Describe the solution you'd like The link to the file should not download the file but go to the file view. In Plone Classic it's like this.

Describe alternatives you've considered The downloadableObjects setting should be empty by default.

wesleybl commented 1 week ago

@giuliaghisini @sneridagh @nzambello opinions?

davisagli commented 1 week ago

This is intentional (it's annoying to make users click through an extra screen to download the file) but note that similar to the Link content type, the intended behavior is different based on whether or not the user has permission to edit the item. Users who can edit the file should be taken to its view; other users should get the download immediately.

It's a fair point that we might want to make it more clear that the link will start a download.

djay commented 6 days ago

@davisagli other systems deal with this better by having the link have on hover option to edit instead or an edit icon next to the link but only if you have permission to edit. Normal users just see the link. This means that the link does the same thing no matter who you are. This is less confusing.

ichim-david commented 4 days ago

This is intentional (it's annoying to make users click through an extra screen to download the file) but note that similar to the Link content type, the intended behavior is different based on whether or not the user has permission to edit the item. Users who can edit the file should be taken to its view; other users should get the download immediately.

It's a fair point that we might want to make it more clear that the link will start a download.

@davisagli if only it was that smart, https://github.com/plone/volto/blob/481b9957b9e7cf5eeaed9a32e96a815f6a21a4c0/packages/volto/src/components/manage/UniversalLink/UniversalLink.jsx#L56 We don't really use any permission checking, we just have the check for token thus assuming this is how any logged in users should see something. This is something that I think Volto needs to develop better, an easier pattern of checking for permissions alongside a beefier validation system.

@wesleybl there is nothing special right now regarding listings and display of links, everything goes through UniversalLink and there you have the downloadableObjects option.

I would be in favor of bringing behavior parity between Volto and Plone Classic but if this is a no go we should see about having maybe an icon added within UniversalLink to indicate that it's a download like there are icons to indicate it's an external link. Don't know how the Volto team feels about this, worst-case scenario you add it to your own project but if you mockup something I'm sure it can get at least the conversation going.