From 58f056351481e6f2079d2d2539c5241727d0cb56 Mon Sep 17 00:00:00 2001 From: Jannik Stehle Date: Wed, 14 Aug 2024 16:49:29 +0200 Subject: [PATCH] refactor: remove hard-coded space roles, use permissions instead --- .../Spaces/SideBar/MembersPanel.vue | 110 ++-- .../Spaces/SideBar/MembersRoleSection.vue | 13 +- .../src/components/Spaces/SpacesList.vue | 14 +- .../components/Users/SideBar/EditPanel.vue | 16 +- .../src/views/Spaces.vue | 6 +- .../Spaces/SideBar/MembersPanel.spec.ts | 48 +- .../Spaces/SideBar/MembersRoleSection.spec.ts | 8 +- .../__snapshots__/MembersPanel.spec.ts.snap | 41 +- .../unit/components/Spaces/SpacesList.spec.ts | 62 +- .../__snapshots__/SpacesList.spec.ts.snap | 4 +- .../src/components/AppBar/CreateAndUpload.vue | 4 +- .../InviteCollaboratorForm.vue | 3 +- .../SideBar/Shares/Collaborators/ListItem.vue | 7 +- .../components/SideBar/Shares/FileShares.vue | 4 +- .../SideBar/Shares/SpaceMembers.vue | 7 +- .../src/components/Spaces/SpaceHeader.vue | 2 +- .../spaces/useSpaceActionsUploadImage.ts | 16 +- .../composables/extensions/useFileSideBars.ts | 4 +- .../src/views/spaces/GenericTrash.vue | 4 +- .../src/views/spaces/Projects.vue | 9 +- .../SideBar/Shares/FileShares.spec.ts | 14 +- .../SideBar/Shares/SpaceMembers.spec.ts | 2 +- .../Spaces/SpaceContextActions.spec.ts | 6 +- .../components/Spaces/SpaceHeader.spec.ts | 30 +- .../__snapshots__/SpaceHeader.spec.ts.snap | 24 +- .../tests/unit/views/trash/Overview.spec.ts | 2 +- .../web-client/src/graph/drives/drives.ts | 52 +- packages/web-client/src/graph/drives/types.ts | 17 +- .../web-client/src/helpers/resource/types.ts | 1 - .../web-client/src/helpers/share/types.ts | 4 +- .../web-client/src/helpers/space/functions.ts | 267 +++++--- .../web-client/src/helpers/space/types.ts | 29 +- .../unit/helpers/space/functions.spec.ts | 619 +++++++++++------- .../components/FilesList/ResourceTable.vue | 4 +- .../SideBar/Spaces/Details/SpaceDetails.vue | 18 +- .../src/components/Spaces/QuotaModal.vue | 6 +- .../actions/files/useFileActionsDelete.ts | 2 +- .../files/useFileActionsEmptyTrashBin.ts | 2 +- .../actions/files/useFileActionsRename.ts | 8 +- .../actions/files/useFileActionsRestore.ts | 14 +- .../actions/files/useFileActionsSetImage.ts | 15 +- .../helpers/useFileActionsDeleteResources.ts | 9 +- .../spaces/useSpaceActionsDuplicate.ts | 14 +- .../spaces/useSpaceActionsEditDescription.ts | 11 +- .../useSpaceActionsEditReadmeContent.ts | 19 +- .../actions/spaces/useSpaceActionsRename.ts | 11 +- .../actions/spaces/useSpaceActionsRestore.ts | 13 +- .../actions/spaces/useSpaceActionsSetIcon.ts | 21 +- .../src/composables/piniaStores/spaces.ts | 51 +- .../resources/useGetResourceContext.ts | 5 +- .../src/composables/shares/useCanShare.ts | 2 +- .../src/composables/spaces/useCreateSpace.ts | 7 +- .../Spaces/Details/SpaceDetails.spec.ts | 20 +- .../actions/files/useFileActionsCopy.spec.ts | 3 +- .../files/useFileActionsDelete.spec.ts | 3 +- .../useFileActionsDownloadArchive.spec.ts | 3 +- .../files/useFileActionsEmptyTrashBin.spec.ts | 2 +- .../files/useFileActionsRestore.spec.ts | 6 +- .../files/useFileActionsSetImage.spec.ts | 51 +- .../spaces/useSpaceActionsDelete.spec.ts | 47 +- .../spaces/useSpaceActionsDisable.spec.ts | 45 +- .../spaces/useSpaceActionsEditQuota.spec.ts | 27 +- .../useSpaceActionsEditReadmeContent.spec.ts | 37 +- .../spaces/useSpaceActionsRestore.spec.ts | 46 +- .../composables/piniaStores/spaces.spec.ts | 46 +- .../resourcesTransfer.spec.ts | 4 +- .../web-runtime/src/container/sse/shares.ts | 18 +- packages/web-runtime/src/index.ts | 10 +- tests/e2e/cucumber/steps/ui/adminSettings.ts | 6 +- .../app-admin-settings/spaces/actions.ts | 6 +- 70 files changed, 1158 insertions(+), 903 deletions(-) diff --git a/packages/web-app-admin-settings/src/components/Spaces/SideBar/MembersPanel.vue b/packages/web-app-admin-settings/src/components/Spaces/SideBar/MembersPanel.vue index 4c11d536e81..2c067065ecd 100644 --- a/packages/web-app-admin-settings/src/components/Spaces/SideBar/MembersPanel.vue +++ b/packages/web-app-admin-settings/src/components/Spaces/SideBar/MembersPanel.vue @@ -9,103 +9,76 @@

-
-

- +
+
+

+ +

-
-

- -

-
-

- -

-
-

- +
+

+