Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix parent folder name in the upload overlay on public pages #7104

Merged
merged 2 commits into from
Jun 9, 2022
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Bugfix: Parent folder name on public links

We've fixed a bug where the parent folder link in the upload overlay on public pages would show the link's token instead of "Public link".

https://github.com/owncloud/web/pull/7104
https://github.com/owncloud/web/issues/7101
17 changes: 16 additions & 1 deletion packages/web-runtime/src/components/UploadInfo.vue
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,14 @@ export default {
}

this.uploads[file.meta.uploadId] = file
this.uploads[file.meta.uploadId].path = `${file.meta.currentFolder}${file.name}`

if (file.meta.route?.name === 'files-public-files') {
// Strip token to not display it in the overlay
const strippedTokenPath = file.meta.currentFolder.split('/').slice(1).join('/')
this.uploads[file.meta.uploadId].path = `${strippedTokenPath}${file.name}`
} else {
this.uploads[file.meta.uploadId].path = `${file.meta.currentFolder}${file.name}`
}
this.uploads[file.meta.uploadId].targetRoute = file.meta.route

if (!file.isFolder) {
Expand Down Expand Up @@ -426,6 +433,10 @@ export default {
if (this.hasShareJail && targetRoute?.name === 'files-spaces-share') {
return targetRoute.params.shareName
}

if (targetRoute?.name === 'files-public-files') {
return this.$gettext('Public link')
}
return this.hasShareJail ? this.$gettext('Personal') : this.$gettext('All files and folders')
},
createFolderLink(path, storageId, targetRoute) {
Expand All @@ -449,6 +460,10 @@ export default {
route.params.item = strippedPath
}

if (route.name === 'files-public-files') {
route.params.item = targetRoute.params.item
}

return route
},
toggleInfo() {
Expand Down