Project

General

Profile

Actions

Bug #22235

closed

Offering edit options on collections/containers requests when project is frozen

Added by Peter Amstutz 4 months ago. Updated 3 months ago.

Status:
Resolved
Priority:
Normal
Assigned To:
Category:
Workbench2
Story points:
-
Release:
Release relationship:
Auto

Description

So it looks like there are multiple issues, I'm going to start making screenshots.

Regular user, read-only project in "Shared with me". I think the operations are correct, but the ordering is wrong.

Regular user, read-only project in "Favorite". This is probably the same bug as previous.

Regular user, frozen project in "Shared with me". This has two major problems; the user does not have "manage" access, so they should not be offered the "Share" icon; similarly, the user does not have access to un-freeze the project (depending on the config value UnfreezeProjectRequiresAdmin this requires either "manage" or "admin" access).

Project within a read-only project. This might be the same bug as the first two.

Workflow run within a read-only project. The "edit" and "remove" icons shouldn't be there.

Workflow run within a read-only project, viewed in "All processes". The "edit" and "remove" icons shouldn't be there.

Project in a project with write access. The "share" and "freeze" icons shouldn't be there. Also, the "freeze" icon seems to be disabled, clicking on it doesn't do anything.

Collection in a project with write access. The "share" icon shouldn't be there.


Files


Subtasks 1 (0 open1 closed)

Task #22245: Review 22235-toolbar-access-fixesResolvedPeter Amstutz11/05/2024Actions
Actions #1

Updated by Peter Amstutz 4 months ago

  • Description updated (diff)
Actions #2

Updated by Peter Amstutz 4 months ago

  • Description updated (diff)
Actions #6

Updated by Lisa Knox 4 months ago

  • Assigned To set to Lisa Knox
  • Status changed from New to In Progress
Actions #7

Updated by Peter Amstutz 4 months ago

  • Release set to 70
Actions #8

Updated by Peter Amstutz 4 months ago

  • Target version changed from Development 2024-10-23 sprint to Development 2024-11-06 sprint
Actions #9

Updated by Lisa Knox 3 months ago

22235-toolbar-access-fixes @ de29bf7e3872c4e21f7c94a20872b705c101b0ec

developer-run-tests-services-workbench2: #1329

  • ✅ All agreed upon points are implemented / addressed.
  • ✅ Anything not implemented (discovered or discussed during work) has a follow-up story.
    n/a
  • ✅ Code is tested and passing, both automated and manual, what manual testing was done is described
    Tested by trying and failing to reproduce bugs.
  • ✅ New or changed UX/UX and has gotten feedback from stakeholders.
    The only changes are the requested changes to the menu items.
  • ✅ Documentation has been updated.
    n/a
  • ✅ Behaves appropriately at the intended scale (describe intended scale).
    intended scale is a single user selecting a single resource.
  • ✅ Considered backwards and forwards compatibility issues between client and server.
    no changes
  • ✅ Follows our coding standards and GUI style guidelines.
Notes:
  • A new toolbar/context menu kind was created for the writeable, non-admin cases: the writeableProject and writeableCollection kinds.
  • A bug cropped up where if a new toolbar populated with the same exact options as the previous toolbar, a few of the buttons would overlap during the transition and be forced into the overflow menu. To fix this, I memoized the toolbar actions and implemented a 100 ms debounce for the transition.

Updated by Peter Amstutz 3 months ago

✅ Regular user, read-only project in "Shared with me".
✅ Regular user, read-only project in "Favorite". This is probably the same bug as previous.
✅ Regular user, frozen project in "Shared with me" without manage access (but see below when the user does have manage access)
✅ Project within a read-only project.
✅ Workflow run within a read-only project.
✅ Workflow run within a read-only project, viewed in "All processes".
✅ Project in a project with write access.
✅ Collection in a project with write access.

However I found a couple of corner cases that are still not right.

Regular user, frozen project. User does have manage access. User should have the "share" and "un-freeze" icons. The context menu has the same problem.

For sharing: if the user has manage access (or is an admin), the "Share" icon should always be available on projects.

For unfreeze: the logic is (if the user is an admin) OR (user has manage permission AND API.UnfreezeProjectRequiresAdmin === false)

Regular user, all processes view. The container request is writable (user can write to the parent project), so "Edit" and "Remove" icons should be present. They are present in the context menu, but not the toolbar.

Actions #11

Updated by Peter Amstutz 3 months ago

Another thing: as a regular user, the "Groups" table is using the project toolbar instead of the role group toolbar (not shown here, but for read-only groups it uses the read-only project toolbar). The context menu is correct has the correct operations.

Actions #12

Updated by Lisa Knox 3 months ago

22235-toolbar-access-fixes @ 03763baac17807d033414ab999437b8c1e53f20c

developer-run-tests-services-workbench2: #1337

✅ Regular user, frozen project. User should have the "share" and "un-freeze" icons. The context menu has the same problem.

✅ For sharing: if the user has manage access (or is an admin), the "Share" icon should always be available on projects.

✅ For unfreeze: the logic is (if the user is an admin) OR (user has manage permission AND API.UnfreezeProjectRequiresAdmin === false)

✅ Regular user, all processes view. The container request is writable (user can write to the parent project), so "Edit" and "Remove" icons should be present. They are present in the context menu, but not the toolbar.

Notes:
  • It is worth considering that a refactor of the menu item selection process is already planned, in which many of the fixes on this branch will be obsolete or overwritten.
Actions #13

Updated by Peter Amstutz 3 months ago

process-middleware-service.ts:56

            select: [...containerRequestFieldsNoMounts, "canWrite", "canManage"],

This should be can_write and can_manage

But there's a second problem:

            const params = this.getParams(api, dataExplorer);

            // Get items
            if (params !== null) {
                const containerRequests = await this.services.groupsService.contents('',
                    {
                        ...this.getParams(api, dataExplorer),
                        select: containerRequestFieldsNoMounts.concat(containerFieldsNoMounts)
                });

It's replacing the select field so the can_write and can_manage still don't get sent in the actual query.

Actions #14

Updated by Peter Amstutz 3 months ago

Also, as noted on matrix, looks like you missed note-11 about the Groups toolbar.

Actions #15

Updated by Lisa Knox 3 months ago

22235-toolbar-access-fixes @ 2cbfdab7bb07950b953d99713c77a998b2c024df

developer-run-tests-services-workbench2: #1339

But there's a second problem...

I had fixed this elsewhere but then made these change to pass e2e tests. I then neglected to make sure the result was the same, but it's fixed now.

Groups table now shows proper toolbar menu.

Ticket #22276 was created as a follow-up

Actions #16

Updated by Peter Amstutz 3 months ago

LGTM! Thank you!

Actions #17

Updated by Lisa Knox 3 months ago

  • Status changed from In Progress to Resolved
Actions

Also available in: Atom PDF