From 20c88f51000082557b59a7fe040c8c0ff0bb819f Mon Sep 17 00:00:00 2001 From: Lukas Hirt Date: Thu, 17 Oct 2019 15:27:23 +0200 Subject: [PATCH 1/2] Added helper file for collaborators Added permissionsToRole function and restructured roles object Fixed wrong type in jsdocs Changed functions to interact with bitmask Moved collaborators mixins into mixins folder and used roles helper file Moved roles back into mixin Move permissions bitmask to own file and introduce permissions sets for files and folders Use custom permissions object Split collaborators into smaller components Move permissions bitmask back to collaborators helper file Added object filter package and emit events from child components Refactored default role Added current role Use smaller components in collaborator component Added translations Added docs and provide default function to return original strings Added custom role Implemented bitmaskToRole function Bring bitmaskToRole into store Fixed displaying of custom role Fixed display of existing role Fixed roleToBitmask function and add new collaborators method Fixed passing of file into buildShare function Fixed default role Implement values of additional permissions Add read permission to advanced role Implemented change of collaborator Fixed parentheses around group suffix) Implemented requested changes Renamed collaboratorRoles --- .../Collaborators/AdditionalPermissions.vue | 66 ++++ .../Collaborators/AutocompleteItem.vue | 4 +- .../components/Collaborators/Collaborator.vue | 125 +++----- .../CollaboratorsEditOptions.vue | 88 ++++++ .../Collaborators/NewCollaborator.vue | 292 ++++++------------ .../components/Collaborators/RolesSelect.vue | 59 ++++ .../src/components/FileSharingSidebar.vue | 2 +- .../helpers/collaboratorRolesDefinition.js | 69 +++++ apps/files/src/helpers/collaborators.js | 79 +++++ .../mixins.js => mixins/collaborators.js} | 74 +++-- apps/files/src/store/actions.js | 66 +--- package.json | 1 + yarn.lock | 5 + 13 files changed, 567 insertions(+), 363 deletions(-) create mode 100644 apps/files/src/components/Collaborators/AdditionalPermissions.vue create mode 100644 apps/files/src/components/Collaborators/CollaboratorsEditOptions.vue create mode 100644 apps/files/src/components/Collaborators/RolesSelect.vue create mode 100644 apps/files/src/helpers/collaboratorRolesDefinition.js create mode 100644 apps/files/src/helpers/collaborators.js rename apps/files/src/{components/Collaborators/mixins.js => mixins/collaborators.js} (51%) diff --git a/apps/files/src/components/Collaborators/AdditionalPermissions.vue b/apps/files/src/components/Collaborators/AdditionalPermissions.vue new file mode 100644 index 00000000000..9a656f9c113 --- /dev/null +++ b/apps/files/src/components/Collaborators/AdditionalPermissions.vue @@ -0,0 +1,66 @@ + + + diff --git a/apps/files/src/components/Collaborators/AutocompleteItem.vue b/apps/files/src/components/Collaborators/AutocompleteItem.vue index 441b791b2cc..8bbc55553b6 100644 --- a/apps/files/src/components/Collaborators/AutocompleteItem.vue +++ b/apps/files/src/components/Collaborators/AutocompleteItem.vue @@ -1,6 +1,6 @@