From 274cf9da1188600e206515f303640efd07d6fad0 Mon Sep 17 00:00:00 2001 From: Edouard Vanbelle Date: Sun, 31 May 2026 23:05:05 +0200 Subject: [PATCH] fix(ShareModal): ensure correct order of roles (Most powerfull first) --- static/js/components/shareModal.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/static/js/components/shareModal.js b/static/js/components/shareModal.js index 67c00bf4..a85099e8 100644 --- a/static/js/components/shareModal.js +++ b/static/js/components/shareModal.js @@ -570,7 +570,11 @@ const shareModal = { */ _renderMemberGroupsInto(container) { container.replaceChildren(); - const groups = /** @type {ShareRoleEnum[]} */ (['viewer', 'editor', 'admin']); + // Highest-privilege role first ("Can manage" → "Can edit" → "Can view"), + // matching the UX contract and the kebab-menu / role-select dropdown + // order. Renaming the labels from "Manager"/"Editor"/"Viewer" to + // "Can manage"/"Can edit"/"Can view" left this iteration order stale. + const groups = /** @type {ShareRoleEnum[]} */ (['admin', 'editor', 'viewer']); let memberIndex = 0; for (const role of groups) {