Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SharingNG] Unified Roles are not sorted by weight #11915

Closed
micbar opened this issue Nov 15, 2024 · 6 comments · Fixed by #11916 or #11922
Closed

[SharingNG] Unified Roles are not sorted by weight #11915

micbar opened this issue Nov 15, 2024 · 6 comments · Fixed by #11916 or #11922
Assignees
Labels
Priority:p2-high Escalation, on top of current planning, release blocker Type:Bug Something isn't working

Comments

@micbar
Copy link
Contributor

micbar commented Nov 15, 2024

Describe the bug

Sharing roles are not sorted by weight in the dropdown.
The libregraph API provides a sorting by weight, which should be respected in the clients.

Steps to reproduce

  1. Create Folder
  2. Open Network tab
  3. Click quick action "Share"
  4. Select Sharee
  5. Open Sharing Role Dropdown

Expected behavior

Items in the dropdown should be sorted by weight.

Actual behavior

Sorting is kind of random

Setup

Ocis 7.0.0-rc.2

Screenshot

Unified Roles Sorting

@micbar micbar added Type:Bug Something isn't working Priority:p2-high Escalation, on top of current planning, release blocker labels Nov 15, 2024
@micbar micbar moved this from Qualification to Prio 2 in Infinite Scale Team Board Nov 15, 2024
@micbar
Copy link
Contributor Author

micbar commented Nov 15, 2024

@AlexAndBear @JammingBen I hope this is just a small fix.

Maybe we failed to communicate the expectation.

@AlexAndBear AlexAndBear self-assigned this Nov 15, 2024
@AlexAndBear
Copy link
Contributor

@micbar does the roleManagement/permissions/roleDefinitions does support any orderBy or sortBy query param? If no, can you make it happen ?

@micbar
Copy link
Contributor Author

micbar commented Nov 15, 2024

@micbar does the roleManagement/permissions/roleDefinitions does support any orderBy or sortBy query param? If no, can you make it happen ?

I do not understand that correctly. The individual permissions call on the resource has the weight property. What is missing there?

@AlexAndBear
Copy link
Contributor

@micbar does the roleManagement/permissions/roleDefinitions does support any orderBy or sortBy query param? If no, can you make it happen ?

I do not understand that correctly. The individual permissions call on the resource has the weight property. What is missing there?

We fetch and persist the roles from the /roleDefinitions endpoint rather from the /permissions endpoint shown in your example, I was wondering if I can sort them via a query param on the endpoint rather than sorting in the client

@micbar
Copy link
Contributor Author

micbar commented Nov 15, 2024

We fetch and persist the roles from the /roleDefinitions endpoint rather from the /permissions endpoint shown in your example, I was wondering if I can sort them via a query param on the endpoint rather than sorting in the client

Hmm, so you are not context sensitive? IMHO we should respect the weight property from the permissions call

"@libre.graph.permissions.roles.allowedValues": [
        {
            "@libre.graph.weight": 1,
            "description": "Ansehen und herunterladen.",
            "displayName": "Kann anzeigen",
            "id": "a8d5fe5e-96e3-418d-825b-534dbdf22b99"
        },
        {
            "@libre.graph.weight": 2,
            "description": "Ansehen, herunterladen, hochladen, editieren, hinzufügen, löschen.",
            "displayName": "Kann bearbeiten ohne Historie",
            "id": "3284f2d5-0070-4ad8-ac40-c247f7c1fb27"
        },
        {
            "@libre.graph.weight": 3,
            "description": "Ansehen, herunterladen, hochladen, bearbeiten, hinzufügen, löschen - inklusive der Historie.",
            "displayName": "Kann bearbeiten",
            "id": "58c63c02-1d89-4572-916a-870abc5a1b7d"
        },
        {
            "@libre.graph.weight": 4,
            "description": "Ansehen, herunterladen, hochladen, bearbeiten, hinzufügen, löschen, teilen und Mitglieder verwalten.",
            "displayName": "Kann verwalten",
            "id": "312c0871-5ef7-4b3a-85b6-0e4074c64049"
        }
    ],

They are always sorted correctly for the current resource and have a weight property. The "/roleDefinitions" is called during bootstrap AFAICT and not called again, so it is not context aware.

@AlexAndBear
Copy link
Contributor

I am fine, sorting will take place in frontend, pr is linked 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Priority:p2-high Escalation, on top of current planning, release blocker Type:Bug Something isn't working
Projects
Status: Done
2 participants