From 28128f33ab61a4a7cfba94de742cacd806044673 Mon Sep 17 00:00:00 2001 From: Jannik Stehle Date: Fri, 11 Oct 2024 08:09:06 +0200 Subject: [PATCH 1/2] fix: navigating into ocm shares --- .../bugfix-navigating-into-external-folders | 6 ++++++ .../src/components/FilesList/ResourceTable.vue | 12 ++++++------ .../composables/appDefaults/useAppFolderHandling.ts | 2 +- .../src/composables/spaces/useGetMatchingSpace.ts | 2 +- 4 files changed, 14 insertions(+), 8 deletions(-) create mode 100644 changelog/unreleased/bugfix-navigating-into-external-folders diff --git a/changelog/unreleased/bugfix-navigating-into-external-folders b/changelog/unreleased/bugfix-navigating-into-external-folders new file mode 100644 index 00000000000..09d47538ea6 --- /dev/null +++ b/changelog/unreleased/bugfix-navigating-into-external-folders @@ -0,0 +1,6 @@ +Bugfix: Navigating into folders that have been shared externally + +We've fixed an issue where navigating into folders that have been shared externally would not work. + +https://github.com/owncloud/web/pull/11758 +https://github.com/owncloud/web/issues/11753 diff --git a/packages/web-pkg/src/components/FilesList/ResourceTable.vue b/packages/web-pkg/src/components/FilesList/ResourceTable.vue index 3cf18d8c83a..e94dc0f0cbe 100644 --- a/packages/web-pkg/src/components/FilesList/ResourceTable.vue +++ b/packages/web-pkg/src/components/FilesList/ResourceTable.vue @@ -531,7 +531,10 @@ export default defineComponent({ const capabilityStore = useCapabilityStore() const { getMatchingSpace } = useGetMatchingSpace() const { canBeOpenedWithSecureView } = useCanBeOpenedWithSecureView() - const { getFolderLink } = useFolderLink() + const folderLinkUtils = useFolderLink({ + space: ref(props.space), + targetRouteCallback: computed(() => props.targetRouteCallback) + }) const { isSticky } = useIsTopBarSticky() const { isLocationPicker, @@ -622,7 +625,7 @@ export default defineComponent({ const getResourceLink = (resource: Resource) => { if (resource.isFolder) { - return getFolderLink(resource) + return folderLinkUtils.getFolderLink(resource) } let space = props.space @@ -665,10 +668,7 @@ export default defineComponent({ }, context ), - ...useFolderLink({ - space: ref(props.space), - targetRouteCallback: computed(() => props.targetRouteCallback) - }), + ...folderLinkUtils, postMessage, isFilePicker, isLocationPicker, diff --git a/packages/web-pkg/src/composables/appDefaults/useAppFolderHandling.ts b/packages/web-pkg/src/composables/appDefaults/useAppFolderHandling.ts index a1ee19da9b2..5664c3fa035 100644 --- a/packages/web-pkg/src/composables/appDefaults/useAppFolderHandling.ts +++ b/packages/web-pkg/src/composables/appDefaults/useAppFolderHandling.ts @@ -56,7 +56,7 @@ export function useAppFolderHandling({ }) const isSpaceRoot = spacesStore.spaces.some( - (s) => isMountPointSpaceResource(s) && s.root.remoteItem.id === pathResource.id + (s) => isMountPointSpaceResource(s) && s.root.remoteItem?.id === pathResource.id ) if (isSpaceRoot) { diff --git a/packages/web-pkg/src/composables/spaces/useGetMatchingSpace.ts b/packages/web-pkg/src/composables/spaces/useGetMatchingSpace.ts index 8818f12b408..a829abf0af1 100644 --- a/packages/web-pkg/src/composables/spaces/useGetMatchingSpace.ts +++ b/packages/web-pkg/src/composables/spaces/useGetMatchingSpace.ts @@ -40,7 +40,7 @@ export const useGetMatchingSpace = (options?: GetMatchingSpaceOptions) => { const space = getInternalSpace(storageId) - if (space) { + if (space && !isMountPointSpaceResource(space)) { return space } From 3e084d2b3e53beebe85416a382f3b528c450fcc2 Mon Sep 17 00:00:00 2001 From: Jannik Stehle Date: Fri, 11 Oct 2024 08:09:27 +0200 Subject: [PATCH 2/2] fix: active nav item when being inside an ocm share --- packages/web-app-files/src/index.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/web-app-files/src/index.ts b/packages/web-app-files/src/index.ts index c0f369dd1b5..1a4988a2d07 100644 --- a/packages/web-app-files/src/index.ts +++ b/packages/web-app-files/src/index.ts @@ -92,6 +92,7 @@ export const navItems = (context: ComponentCustomProperties): AppNavigationItem[ }, activeFor: [ { path: `/${appInfo.id}/spaces/share` }, + { path: `/${appInfo.id}/spaces/ocm-share` }, { path: `/${appInfo.id}/spaces/personal` } ], isVisible() {