Skip to content
This repository was archived by the owner on Nov 23, 2026. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions changelog/unreleased/bugfix-resolving-interal-file-links
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Bugfix: Resolving internal file links

Resolving internal file links when the original file is a shared resource has been fixed.

https://github.com/owncloud/web/pull/8310
https://github.com/owncloud/web/issues/8284
28 changes: 25 additions & 3 deletions packages/web-app-files/src/views/shares/SharedWithMe.vue
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ import FilesViewWrapper from '../../components/FilesViewWrapper.vue'
import { buildShareSpaceResource } from 'web-client/src/helpers'
import { configurationManager } from 'web-pkg/src/configuration'
import { useCapabilityShareJailEnabled, useStore } from 'web-pkg/src/composables'
import MixinFilesListScrolling from '../../mixins/filesListScrolling'

export default defineComponent({
components: {
Expand All @@ -84,7 +85,8 @@ export default defineComponent({
SharedWithMeSection,
SideBar
},

// FIXME: remove mixin on master
mixins: [MixinFilesListScrolling],
setup() {
const {
areResourcesLoading,
Expand Down Expand Up @@ -224,8 +226,28 @@ export default defineComponent({
}
},

created() {
this.loadResourcesTask.perform()
async created() {
await this.loadResourcesTask.perform()
this.scrollToResourceFromRoute()
},
methods: {
// FIXME: remove this on master, use scrollToResourceFromRoute from useResourcesViewDefaults instead
scrollToResourceFromRoute() {
const resourceName = this.$route.query.scrollTo
const paginatedResources = [
...this.acceptedItems,
...this.pendingItems,
...this.declinedItems
]
if (resourceName && paginatedResources.length > 0) {
const resource = paginatedResources.find((r) => r.name === resourceName)

if (resource) {
this.selectedResources = [resource]
this.scrollToResource(resource)
}
}
}
}
})
</script>
14 changes: 11 additions & 3 deletions packages/web-runtime/src/pages/resolvePrivateLink.vue
Original file line number Diff line number Diff line change
Expand Up @@ -94,13 +94,15 @@ export default defineComponent({
const resolvePrivateLinkTask = useTask(function* (signal, id) {
let path
let matchingSpace = getMatchingSpace(id)
let resourceIsNestedInShare = false
if (matchingSpace) {
path = yield clientService.owncloudSdk.files.getPathForFileId(id)
resource.value = yield clientService.webdav.getFileInfo(matchingSpace, { path })
} else {
// no matching space found => the file doesn't lie in own spaces => it's a share.
// do PROPFINDs on parents until root of accepted share is found in `mountpoint` spaces
let mountPoint = findMatchingMountPoint(id)
resourceIsNestedInShare = !mountPoint
resource.value = yield loadFileInfoByIdTask.perform(id)
const sharePathSegments = mountPoint ? [] : [unref(resource).name]
let tmpResource = unref(resource)
Expand All @@ -127,19 +129,25 @@ export default defineComponent({

let fileId
let scrollTo
let targetLocation
if (unref(resource).type === 'folder') {
fileId = unref(resource).fileId
targetLocation = 'files-spaces-generic'
} else {
fileId = unref(resource).parentFolderId
scrollTo = unref(resource).name
path = dirname(path)
// FIXME: we should not hardcode the name here, but we should not depend on
// createLocationSpaces('files-spaces-generic') in web-app-files either
targetLocation =
matchingSpace.driveType === 'share' && !resourceIsNestedInShare
? 'files-shares-with-me'
: 'files-spaces-generic'
}

const { params, query } = createFileRouteOptions(matchingSpace, { fileId, path })
// FIXME: we should not hardcode the name here, but we should not depend on
// createLocationSpaces('files-spaces-generic') in web-app-files either
const location: RawLocation = {
name: 'files-spaces-generic',
name: targetLocation,
params,
query: { ...query, ...(scrollTo && { scrollTo }) }
}
Expand Down