From a4001ec65fbbfeee25c6e6179ac95f724159749e Mon Sep 17 00:00:00 2001 From: Jannik Stehle Date: Mon, 16 Jan 2023 15:28:55 +0100 Subject: [PATCH 1/4] Fix group avatar display in space members list --- changelog/unreleased/enhancement-share-group-recipient | 3 ++- .../components/SideBar/Shares/Collaborators/ListItem.vue | 8 +++++++- .../SideBar/Shares/Collaborators/ListItem.spec.ts | 8 ++++++++ 3 files changed, 17 insertions(+), 2 deletions(-) diff --git a/changelog/unreleased/enhancement-share-group-recipient b/changelog/unreleased/enhancement-share-group-recipient index 991a411a1be..cd4cbc4b174 100644 --- a/changelog/unreleased/enhancement-share-group-recipient +++ b/changelog/unreleased/enhancement-share-group-recipient @@ -4,4 +4,5 @@ We've added the possibility to share a space with a group. https://github.com/owncloud/web/pull/8161 https://github.com/owncloud/web/issues/8160 -https://github.com/owncloud/web/pull/8185 \ No newline at end of file +https://github.com/owncloud/web/pull/8185 +https://github.com/owncloud/web/pull/8248 diff --git a/packages/web-app-files/src/components/SideBar/Shares/Collaborators/ListItem.vue b/packages/web-app-files/src/components/SideBar/Shares/Collaborators/ListItem.vue index 944a731c6a1..38ae3b8bf54 100644 --- a/packages/web-app-files/src/components/SideBar/Shares/Collaborators/ListItem.vue +++ b/packages/web-app-files/src/components/SideBar/Shares/Collaborators/ListItem.vue @@ -9,7 +9,7 @@
{ expect(wrapper.find(selectors.notUserAvatar).exists()).toBeTruthy() expect(wrapper.find(selectors.notUserAvatar).attributes().name).toEqual(shareType.key) }) + it('should display an oc-avatar-item for space group shares', () => { + const { wrapper } = createWrapper({ + shareType: ShareTypes.space.value, + collaborator: { name: undefined, displayName: 'someGroup', additionalInfo: undefined } + }) + expect(wrapper.find(selectors.userAvatarImage).exists()).toBeFalsy() + expect(wrapper.find(selectors.notUserAvatar).exists()).toBeTruthy() + }) }) }) describe('share info', () => { From 4dcd9216f35bdf6254667716b98e21ca936c90f2 Mon Sep 17 00:00:00 2001 From: Jannik Stehle Date: Mon, 16 Jan 2023 15:35:18 +0100 Subject: [PATCH 2/4] Always return boolean type for showAvatar --- .../src/components/SideBar/Shares/Collaborators/ListItem.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/web-app-files/src/components/SideBar/Shares/Collaborators/ListItem.vue b/packages/web-app-files/src/components/SideBar/Shares/Collaborators/ListItem.vue index 38ae3b8bf54..d8dbce82318 100644 --- a/packages/web-app-files/src/components/SideBar/Shares/Collaborators/ListItem.vue +++ b/packages/web-app-files/src/components/SideBar/Shares/Collaborators/ListItem.vue @@ -316,7 +316,7 @@ export default defineComponent({ }, showAvatar() { if (this.isSpace) { - return this.share.collaborator.name + return !!this.share.collaborator.name } return this.isUser } From a7ee157ac9bba69c4113315750883af05d38c7bf Mon Sep 17 00:00:00 2001 From: Benedikt Kulmann Date: Wed, 25 Jan 2023 22:49:36 +0100 Subject: [PATCH 3/4] feat: introduce shareType 8 --- changelog/unreleased/enhancement-update-sdk | 13 ++++--- .../InviteCollaborator/AutocompleteItem.vue | 12 ++++-- .../InviteCollaboratorForm.vue | 37 +++++++------------ .../InviteCollaborator/RecipientContainer.vue | 2 +- .../SideBar/Shares/Collaborators/ListItem.vue | 28 ++++++-------- .../web-app-files/src/helpers/resources.ts | 37 +------------------ .../services/folder/loaderSharedWithOthers.ts | 4 +- .../RecipientContainer.spec.ts.snap | 11 ++++++ .../Shares/Collaborators/ListItem.spec.ts | 10 ++--- .../SideBar/Shares/SpaceMembers.spec.ts | 6 +-- .../tests/unit/store/mutations.spec.ts | 4 +- .../web-client/src/helpers/share/space.ts | 20 +++++++++- packages/web-client/src/helpers/share/type.ts | 26 ++++++++++--- .../Spaces/Details/SpaceDetails.spec.ts | 2 +- packages/web-runtime/package.json | 2 +- packages/web-runtime/src/store/spaces.ts | 16 +++++--- pnpm-lock.yaml | 19 +++++++--- 17 files changed, 135 insertions(+), 114 deletions(-) diff --git a/changelog/unreleased/enhancement-update-sdk b/changelog/unreleased/enhancement-update-sdk index 60f6a55f6b0..f5a9437cd3c 100644 --- a/changelog/unreleased/enhancement-update-sdk +++ b/changelog/unreleased/enhancement-update-sdk @@ -1,9 +1,12 @@ -Enhancement: Update SDK to v3.1.0-alpha.2 +Enhancement: Update SDK to v3.1.0-alpha.3 -We updated the ownCloud SDK to version v3.1.0-alpha.2. Please refer to the full changelog in the SDK release (linked) for more details. Summary: +We updated the ownCloud SDK to version v3.1.0-alpha.3. Please refer to the full changelog in the SDK release (linked) for more details. Summary: + +* Bugfix - Allow removing expiration dates from space shares: [owncloud/owncloud-sdk#1204](https://github.com/owncloud/owncloud-sdk/pull/1204) +* Enhancement - Resource processing: [owncloud/owncloud-sdk#1109](https://github.com/owncloud/owncloud-sdk/pull/1109) +* Enhancement - Share space with group: [owncloud/owncloud-sdk#1207](https://github.com/owncloud/owncloud-sdk/pull/1207) -* Bugfix - Allow removing expiration dates from space shares: [#1204](https://github.com/owncloud/owncloud-sdk/pull/1204) -* Enhancement - Resource processing: [#1109](https://github.com/owncloud/owncloud-sdk/pull/1109) https://github.com/owncloud/web/pull/8320 -https://github.com/owncloud/owncloud-sdk/releases/tag/v3.1.0-alpha.2 +https://github.com/owncloud/web/pull/8248 +https://github.com/owncloud/owncloud-sdk/releases/tag/v3.1.0-alpha.3 diff --git a/packages/web-app-files/src/components/SideBar/Shares/Collaborators/InviteCollaborator/AutocompleteItem.vue b/packages/web-app-files/src/components/SideBar/Shares/Collaborators/InviteCollaborator/AutocompleteItem.vue index 53f734f1213..1b414fd6b86 100644 --- a/packages/web-app-files/src/components/SideBar/Shares/Collaborators/InviteCollaborator/AutocompleteItem.vue +++ b/packages/web-app-files/src/components/SideBar/Shares/Collaborators/InviteCollaborator/AutocompleteItem.vue @@ -5,7 +5,7 @@ :class="collaboratorClass" > user.value.shareWith !== this.user.id) .map((result) => { - // Inject the correct share type here if space - const shareType = this.resourceIsSpace ? ShareTypes.space.value : result.value.shareType - return { - ...result, - value: { - ...result.value, - shareType - } + if (this.resourceIsSpace) { + result.value.shareType = ShareTypes.spaceUser.value } + return result }) - - const groups = recipients.exact.groups.concat(recipients.groups) + const groups = recipients.exact.groups.concat(recipients.groups).map((result) => { + if (this.resourceIsSpace) { + result.value.shareType = ShareTypes.spaceGroup.value + } + return result + }) const remotes = recipients.exact.remotes.concat(recipients.remotes) - this.autocompleteResults = users.concat(groups, remotes).filter((collaborator) => { + this.autocompleteResults = [...users, ...groups, ...remotes].filter((collaborator) => { const selected = this.selectedCollaborators.find((selectedCollaborator) => { return ( collaborator.value.shareWith === selectedCollaborator.value.shareWith && - parseInt(collaborator.value.shareType, 10) === - parseInt(selectedCollaborator.value.shareType, 10) + parseInt(collaborator.value.shareType) === + parseInt(selectedCollaborator.value.shareType) ) }) @@ -230,16 +228,7 @@ export default defineComponent({ const shareCollaboratorIdentifier = share.collaborator.name || share.collaborator.displayName const isSameByIdentifier = collaborator.value.shareWith === shareCollaboratorIdentifier - const isSameByType = parseInt(collaborator.value.shareType, 10) === share.shareType - const isGroupShareCollaborator = - parseInt(collaborator.value.shareType, 10) == ShareTypes.group.value - - // we cannot differentiate by isSameByType for spaces group collaborators, collaborators shareType and group shareType is not the same - // should be part of head-breaking fixMe above.. - if (this.resourceIsSpace && isGroupShareCollaborator && isSameByIdentifier) { - return true - } - + const isSameByType = parseInt(collaborator.value.shareType) === share.shareType return isSameByIdentifier && isSameByType }) diff --git a/packages/web-app-files/src/components/SideBar/Shares/Collaborators/InviteCollaborator/RecipientContainer.vue b/packages/web-app-files/src/components/SideBar/Shares/Collaborators/InviteCollaborator/RecipientContainer.vue index a0664688a52..6105aa58d5d 100644 --- a/packages/web-app-files/src/components/SideBar/Shares/Collaborators/InviteCollaborator/RecipientContainer.vue +++ b/packages/web-app-files/src/components/SideBar/Shares/Collaborators/InviteCollaborator/RecipientContainer.vue @@ -49,7 +49,7 @@ export default { formattedRecipient: { name: this.recipient.label, icon: this.getRecipientIcon(), - hasAvatar: [ShareTypes.user.value, ShareTypes.space.value].includes( + hasAvatar: [ShareTypes.user.value, ShareTypes.spaceUser.value].includes( this.recipient.value.shareType ), isLoadingAvatar: true diff --git a/packages/web-app-files/src/components/SideBar/Shares/Collaborators/ListItem.vue b/packages/web-app-files/src/components/SideBar/Shares/Collaborators/ListItem.vue index d8dbce82318..39acd76dfd0 100644 --- a/packages/web-app-files/src/components/SideBar/Shares/Collaborators/ListItem.vue +++ b/packages/web-app-files/src/components/SideBar/Shares/Collaborators/ListItem.vue @@ -1,6 +1,6 @@