diff --git a/packages/web-app-files/src/components/SideBar/Shares/FileShares.vue b/packages/web-app-files/src/components/SideBar/Shares/FileShares.vue index 6ccdabef9bb..b344036b24a 100644 --- a/packages/web-app-files/src/components/SideBar/Shares/FileShares.vue +++ b/packages/web-app-files/src/components/SideBar/Shares/FileShares.vue @@ -198,20 +198,17 @@ export default defineComponent({ }, collaborators() { - return [...this.outgoingCollaborators] - .filter((c) => c.collaborator.displayName) - .sort(this.collaboratorsComparator) - .map((c) => { - const collaborator: typeof c & { key?: string; resharers?: User[] } = { ...c } - collaborator.key = 'collaborator-' + collaborator.id - if ( - collaborator.owner.name !== collaborator.fileOwner.name && - collaborator.owner.name !== this.user.id - ) { - collaborator.resharers = [collaborator.owner] - } - return collaborator - }) + return [...this.outgoingCollaborators].sort(this.collaboratorsComparator).map((c) => { + const collaborator: typeof c & { key?: string; resharers?: User[] } = { ...c } + collaborator.key = 'collaborator-' + collaborator.id + if ( + collaborator.owner.name !== collaborator.fileOwner.name && + collaborator.owner.name !== this.user.id + ) { + collaborator.resharers = [collaborator.owner] + } + return collaborator + }) }, displayCollaborators() { diff --git a/packages/web-app-files/src/composables/shares/useShares.ts b/packages/web-app-files/src/composables/shares/useShares.ts index b453f0d1625..4f2d1f63875 100644 --- a/packages/web-app-files/src/composables/shares/useShares.ts +++ b/packages/web-app-files/src/composables/shares/useShares.ts @@ -5,8 +5,8 @@ import { useStore } from 'web-pkg/src/composables' export function useShares() { const store = useStore() const outgoingLinks: Ref = computed(() => store.getters['Files/outgoingLinks']) - const outgoingCollaborators: Ref = computed( - () => store.getters['Files/outgoingCollaborators'] + const outgoingCollaborators: Ref = computed(() => + store.getters['Files/outgoingCollaborators'].filter((s) => s.collaborator.displayName) ) return { outgoingCollaborators, outgoingLinks } } diff --git a/packages/web-app-files/tests/unit/components/SideBar/Shares/FileShares.spec.ts b/packages/web-app-files/tests/unit/components/SideBar/Shares/FileShares.spec.ts index 6c4a43a07b3..1601d993bd3 100644 --- a/packages/web-app-files/tests/unit/components/SideBar/Shares/FileShares.spec.ts +++ b/packages/web-app-files/tests/unit/components/SideBar/Shares/FileShares.spec.ts @@ -77,19 +77,6 @@ describe('FileShares', () => { expect(wrapper.findAll('#files-collaborators-list li').length).toBe(collaborators.length) expect(wrapper.html()).toMatchSnapshot() }) - it('filters out collaborator without displayName', () => { - const collaboratorsWithDisallowed = [ - ...collaborators, - { - ...getCollaborator(), - collaborator: { name: 'foo', additionalInfo: 'some' } - } - ] - const { wrapper } = getWrapper({ collaborators: collaboratorsWithDisallowed }) - expect(wrapper.findAll('#files-collaborators-list li').length).toBe( - collaboratorsWithDisallowed.length - 1 - ) - }) it('reacts on delete events', async () => { const spyOnCollaboratorDeleteTrigger = jest .spyOn((FileShares as any).methods, '$_ocCollaborators_deleteShare_trigger')