diff --git a/changelog/unreleased/bugfix-spaces-on-share-via-link-page b/changelog/unreleased/bugfix-spaces-on-share-via-link-page index 04789ddf49a..7d1a9987a09 100644 --- a/changelog/unreleased/bugfix-spaces-on-share-via-link-page +++ b/changelog/unreleased/bugfix-spaces-on-share-via-link-page @@ -4,5 +4,7 @@ Spaces on the "Shared via link"-page are now being displayed correctly. Also, th https://github.com/owncloud/web/pull/7651 https://github.com/owncloud/web/pull/7742 +https://github.com/owncloud/web/pull/7870 https://github.com/owncloud/web/issues/7103 https://github.com/owncloud/web/issues/7741 +https://github.com/owncloud/web/issues/7869 diff --git a/packages/web-app-files/src/components/SideBar/SideBar.vue b/packages/web-app-files/src/components/SideBar/SideBar.vue index 3739403109c..7ed2ac2409d 100644 --- a/packages/web-app-files/src/components/SideBar/SideBar.vue +++ b/packages/web-app-files/src/components/SideBar/SideBar.vue @@ -51,6 +51,7 @@ import { computed, defineComponent, PropType } from '@vue/composition-api' import { useCapabilityShareJailEnabled, useClientService, + useGraphClient, usePublicLinkPassword, useStore } from 'web-pkg/src/composables' @@ -58,7 +59,7 @@ import { eventBus } from 'web-pkg/src/services/eventBus' import { SideBarEventTopics } from '../../composables/sideBar' import isEqual from 'lodash-es/isEqual' import { useActiveLocation } from '../../composables' -import { SpaceResource } from 'web-client/src/helpers' +import { isProjectSpaceResource, SpaceResource } from 'web-client/src/helpers' import { WebDAV } from 'web-client/src/webdav' export default defineComponent({ @@ -115,6 +116,7 @@ export default defineComponent({ const { webdav } = useClientService() return { + ...useGraphClient(), isSharedWithMeLocation: useActiveLocation(isLocationSharesActive, 'files-shares-with-me'), isSharedWithOthersLocation: useActiveLocation( isLocationSharesActive, @@ -237,6 +239,10 @@ export default defineComponent({ this.loadShares() } + if (isProjectSpaceResource(this.highlightedFile)) { + this.loadSpaceMembers({ graphClient: this.graphClient, space: this.highlightedFile }) + } + if (this.isShareLocation || !noChanges) { this.fetchFileInfo() } @@ -246,6 +252,7 @@ export default defineComponent({ }, methods: { ...mapActions('Files', ['loadSharesTree']), + ...mapActions('runtime/spaces', ['loadSpaceMembers']), async fetchFileInfo() { this.loading = true diff --git a/packages/web-app-files/src/mixins/actions/showDetails.ts b/packages/web-app-files/src/mixins/actions/showDetails.ts index 0542cfca45b..f124b6adc2e 100644 --- a/packages/web-app-files/src/mixins/actions/showDetails.ts +++ b/packages/web-app-files/src/mixins/actions/showDetails.ts @@ -1,9 +1,8 @@ -import { mapActions, mapMutations } from 'vuex' +import { mapMutations } from 'vuex' import { isLocationTrashActive } from '../../router' import isFilesAppActive from './helpers/isFilesAppActive' import { eventBus } from 'web-pkg/src/services/eventBus' import { SideBarEventTopics } from '../../composables/sideBar' -import { isProjectSpaceResource } from 'web-client/src/helpers' import { useGraphClient } from 'web-pkg/src/composables' export default { @@ -40,13 +39,8 @@ export default { }, methods: { ...mapMutations('Files', ['SET_FILE_SELECTION']), - ...mapActions('runtime/spaces', ['loadSpaceMembers']), $_showDetails_trigger({ resources }) { - if (resources.length === 1 && isProjectSpaceResource(resources[0])) { - this.loadSpaceMembers({ graphClient: this.graphClient, space: resources[0] }) - } - this.SET_FILE_SELECTION(resources) eventBus.publish(SideBarEventTopics.open) } diff --git a/packages/web-app-files/src/mixins/spaces/actions/showMembers.js b/packages/web-app-files/src/mixins/spaces/actions/showMembers.js index 7b7ced9a377..19c9898147c 100644 --- a/packages/web-app-files/src/mixins/spaces/actions/showMembers.js +++ b/packages/web-app-files/src/mixins/spaces/actions/showMembers.js @@ -1,4 +1,4 @@ -import { mapActions, mapMutations } from 'vuex' +import { mapMutations } from 'vuex' import { eventBus } from 'web-pkg/src/services/eventBus' import { SideBarEventTopics } from '../../../composables/sideBar' import { useGraphClient } from 'web-pkg/src/composables' @@ -24,10 +24,8 @@ export default { }, methods: { ...mapMutations('Files', ['SET_FILE_SELECTION']), - ...mapActions('runtime/spaces', ['loadSpaceMembers']), $_showMembers_trigger({ resources }) { - this.loadSpaceMembers({ graphClient: this.graphClient, space: resources[0] }) this.SET_FILE_SELECTION(resources) eventBus.publish(SideBarEventTopics.openWithPanel, 'space-share-item') } diff --git a/packages/web-app-files/src/views/spaces/Projects.vue b/packages/web-app-files/src/views/spaces/Projects.vue index 368663aec18..1eb6a7ad4b2 100644 --- a/packages/web-app-files/src/views/spaces/Projects.vue +++ b/packages/web-app-files/src/views/spaces/Projects.vue @@ -263,7 +263,6 @@ export default defineComponent({ }, methods: { ...mapActions(['showMessage']), - ...mapActions('runtime/spaces', ['loadSpaceMembers']), ...mapMutations('Files', ['SET_CURRENT_FOLDER', 'SET_FILE_SELECTION']), getSpaceProjectRoute(space: SpaceResource) { @@ -283,7 +282,6 @@ export default defineComponent({ }, openSidebarSharePanel(space: SpaceResource) { - this.loadSpaceMembers({ graphClient: this.graphClient, space }) this.SET_FILE_SELECTION([space]) eventBus.publish(SideBarEventTopics.openWithPanel, 'space-share-item') }, diff --git a/packages/web-app-files/tests/unit/components/SideBar/Shares/SharesPanel.spec.js b/packages/web-app-files/tests/unit/components/SideBar/Shares/SharesPanel.spec.js index 1d07863fa1a..2f1e25e262f 100644 --- a/packages/web-app-files/tests/unit/components/SideBar/Shares/SharesPanel.spec.js +++ b/packages/web-app-files/tests/unit/components/SideBar/Shares/SharesPanel.spec.js @@ -70,8 +70,7 @@ describe('SharesPanel', () => { setup: () => { return { sharesLoading: sharesLoading, - graphClient: jest.fn(), - loadSpaceMembersTask: jest.fn() + graphClient: jest.fn() } } }) diff --git a/packages/web-app-files/tests/unit/mixins/actions/showDetails.spec.ts b/packages/web-app-files/tests/unit/mixins/actions/showDetails.spec.ts index 7a9a839ff91..b6256b2f7af 100644 --- a/packages/web-app-files/tests/unit/mixins/actions/showDetails.spec.ts +++ b/packages/web-app-files/tests/unit/mixins/actions/showDetails.spec.ts @@ -6,7 +6,6 @@ import { defaultComponentMocks } from 'web-test-helpers/src/mocks/defaultCompone import { defaultStoreMockOptions } from 'web-test-helpers/src/mocks/store/defaultStoreMockOptions' import { eventBus } from 'web-pkg/src/services/eventBus' import { SideBarEventTopics } from '../../../../src/composables/sideBar' -import { buildSpace } from 'web-client/src/helpers' const localVue = createLocalVue() localVue.use(Vuex) @@ -25,15 +24,6 @@ describe('showDetails', () => { wrapper.vm.$_showDetails_trigger({ resources }) expect(busStub).toHaveBeenCalledWith(SideBarEventTopics.open) }) - it('should load space members if a project space is selected', () => { - const busStub = jest.spyOn(eventBus, 'publish') - const { wrapper } = getWrapper() - const loadSpaceMembersStub = jest.spyOn(wrapper.vm, 'loadSpaceMembers') - const resources = [buildSpace({ id: 1, driveType: 'project' })] - wrapper.vm.$_showDetails_trigger({ resources }) - expect(busStub).toHaveBeenCalledWith(SideBarEventTopics.open) - expect(loadSpaceMembersStub).toHaveBeenCalled() - }) }) })