Skip to content

Commit

Permalink
Implement clickable folder links in upload overlay
Browse files Browse the repository at this point in the history
  • Loading branch information
JammingBen committed Jun 10, 2022
1 parent c88799d commit 922d810
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 1 deletion.
6 changes: 6 additions & 0 deletions changelog/unreleased/enhancement-upload-overlay-folder-links
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Enhancement: Clickable folder links in upload overlay

Uploaded folders can now be clicked in the upload overlay, which navigates the user to the clicked folder.

https://github.com/owncloud/web/pull/7109
https://github.com/owncloud/web/issues/7102
5 changes: 4 additions & 1 deletion packages/web-runtime/src/components/UploadInfo.vue
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@
:resource="item"
:is-path-displayed="true"
:is-thumbnail-displayed="displayThumbnails"
:is-resource-clickable="false"
:is-resource-clickable="isResourceClickable(item)"
:parent-folder-name-default="defaultParentFolderName(item)"
:folder-link="folderLink(item)"
:parent-folder-link="parentFolderLink(item)"
Expand Down Expand Up @@ -417,6 +417,9 @@ export default {
displayFileAsResource(file) {
return !!file.targetRoute
},
isResourceClickable(file) {
return file.isFolder === true
},
folderLink(file) {
return this.createFolderLink(file.path, file.storageId, file.targetRoute)
},
Expand Down
12 changes: 12 additions & 0 deletions packages/web-runtime/tests/unit/components/UploadInfo.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,18 @@ describe('UploadInfo component', () => {
const uploadedItems = wrapper.findAll('.upload-info-items li')
expect(uploadedItems.length).toBe(2)
})
it('folder is clickable', () => {
const wrapper = getShallowWrapper({
showInfo: true,
infoExpanded: true,
uploads: [{ name: 'file', type: 'folder', isFolder: true, targetRoute: {}, path: '' }]
})

const info = wrapper.find('.upload-info-items')
expect(info.exists()).toBeTruthy()
const resourceStub = wrapper.find('.upload-info-items li oc-resource-stub')
expect(resourceStub.props().isResourceClickable).toBeTruthy()
})
})
describe('getRemainingTime method', () => {
it.each([
Expand Down

0 comments on commit 922d810

Please sign in to comment.