owncloud / web

:dragon_face: Next generation frontend for ownCloud Infinite Scale
https://owncloud.dev/clients/web/
GNU Affero General Public License v3.0
429 stars 160 forks source link

[admin-settings] context menu shows invalid action items when multiple users are selected #8549

Closed hurradieweltgehtunter closed 1 year ago

hurradieweltgehtunter commented 1 year ago

Steps to reproduce

  1. Go to admin settings -> user
  2. Select multiple users
  3. Open context menu (right click on any user)
  4. Click on menu items (Edit, Delete, Details)

Expected behaviour

Not sure what I was expecting. Edit multiple users at once seems unnecessary, also opening details for multiple users at once. Only "Delete" makes sense, and this is the only action item which works.

IMO actions items should be shown disabled or hidden, if they are not suitable in the current context.

Actual behaviour

Click on "Edit" -> nothing happens Click on "Details" -> Nothing happens Click on "Delete" -> Deletion prompt opens -> ok!

Environment general

https://ocis.ocis-wopi.latest.owncloud.works/

ownCloud Infinite Scale Community Version: 2.0.0+2bf458385 WebClient Version: 7.0.0-rc.16

kulmann commented 1 year ago

In the files app the context menu differs depending on the file selection being a single file or multiple files. I'd apply the same pattern here.

Regarding implementation this means that the action composables in the admin-settings app need to take the number of items into account in their respective isEnabled method.

For examples the useUserActionsEdit composable has return resources.length > 0 as body of the isEnabled method. It should clearly be return resources.length === 1. ;-)