From fcc9f8f77c51c63fab1a738a686b8ce2762d02cc Mon Sep 17 00:00:00 2001 From: Alex Ackermann Date: Fri, 15 Nov 2024 21:10:29 +0100 Subject: [PATCH 1/2] Sort roles in role dropdown according to backend --- .../SideBar/Shares/Collaborators/RoleDropdown.vue | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/packages/web-app-files/src/components/SideBar/Shares/Collaborators/RoleDropdown.vue b/packages/web-app-files/src/components/SideBar/Shares/Collaborators/RoleDropdown.vue index 5dc51434101..a01e6645512 100644 --- a/packages/web-app-files/src/components/SideBar/Shares/Collaborators/RoleDropdown.vue +++ b/packages/web-app-files/src/components/SideBar/Shares/Collaborators/RoleDropdown.vue @@ -144,10 +144,14 @@ export default defineComponent({ const availableInternalRoles = inject>('availableInternalShareRoles') const availableExternalRoles = inject>('availableExternalShareRoles') const availableRoles = computed(() => { + let roles = availableInternalRoles if (props.isExternal) { - return unref(availableExternalRoles) + roles = availableExternalRoles } - return unref(availableInternalRoles) + + return [...unref(roles)].sort( + (role1, role2) => role1['@libre.graph.weight'] - role2['@libre.graph.weight'] + ) }) let initialSelectedRole: ShareRole @@ -295,6 +299,7 @@ export default defineComponent({ &:first-child { margin-top: 0; } + &:last-child { margin-bottom: 0; } @@ -312,6 +317,7 @@ export default defineComponent({ } } } + &-role-select-btn { max-width: 100%; } From f463b615fd78877bd24002e57fe2c5da8f64bf69 Mon Sep 17 00:00:00 2001 From: Alex Ackermann Date: Fri, 15 Nov 2024 21:16:40 +0100 Subject: [PATCH 2/2] Add changelog item --- changelog/unreleased/bugfix-fix-order-in-roles-drop-down | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 changelog/unreleased/bugfix-fix-order-in-roles-drop-down diff --git a/changelog/unreleased/bugfix-fix-order-in-roles-drop-down b/changelog/unreleased/bugfix-fix-order-in-roles-drop-down new file mode 100644 index 00000000000..cfd22976ad3 --- /dev/null +++ b/changelog/unreleased/bugfix-fix-order-in-roles-drop-down @@ -0,0 +1,7 @@ +Bugfix: Fix order in roles drop down + +We've fixed an issue where the order of roles in the roles drop down was not correct. +Now the roles are sorted as delegated by the backend. + +https://github.com/owncloud/web/pull/11916 +https://github.com/owncloud/web/issues/11915 \ No newline at end of file