Skip to content

Commit

Permalink
Fix downloads on shared with me page
Browse files Browse the repository at this point in the history
  • Loading branch information
kulmann committed May 10, 2022
1 parent b9d1476 commit f8ecb74
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 3 deletions.
6 changes: 6 additions & 0 deletions changelog/unreleased/bugfix-share-downloads
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Bugfix: Share downloads

Both single file and folder shares didn't have the download action available on the `Shared with me` page. We've fixed this by allowing the shared with me route for download actions and by fixing a download permission check on shares.

https://github.com/owncloud/ocis/issues/3760
https://github.com/owncloud/web/pull/6936
2 changes: 1 addition & 1 deletion packages/web-app-files/src/helpers/resources.ts
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,7 @@ export function buildSharedResource(
resource.path = share.file_target
resource.webDavPath = buildWebDavFilesPath(share.share_with, share.file_target)
}
resource.canDownload = () => share.state === ShareStatus.accepted
resource.canDownload = () => parseInt(share.state) === ShareStatus.accepted
resource.canShare = () => SharePermissions.share.enabled(share.permissions)
resource.canRename = () => SharePermissions.update.enabled(share.permissions)
resource.canBeDeleted = () => SharePermissions.delete.enabled(share.permissions)
Expand Down
4 changes: 3 additions & 1 deletion packages/web-app-files/src/mixins/actions/downloadArchive.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import {
isLocationCommonActive,
isLocationPublicActive,
isLocationSharesActive,
isLocationSpacesActive
} from '../../router'
import isFilesAppActive from './helpers/isFilesAppActive'
Expand All @@ -27,7 +28,8 @@ export default {
!isLocationSpacesActive(this.$router, 'files-spaces-project') &&
!isLocationSpacesActive(this.$router, 'files-spaces-share') &&
!isLocationPublicActive(this.$router, 'files-public-files') &&
!isLocationCommonActive(this.$router, 'files-common-favorites')
!isLocationCommonActive(this.$router, 'files-common-favorites') &&
!isLocationSharesActive(this.$router, 'files-shares-with-me')
) {
return false
}
Expand Down
4 changes: 3 additions & 1 deletion packages/web-app-files/src/mixins/actions/downloadFile.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import {
isLocationCommonActive,
isLocationPublicActive,
isLocationSharesActive,
isLocationSpacesActive
} from '../../router'
import isFilesAppActive from './helpers/isFilesAppActive'
Expand All @@ -24,7 +25,8 @@ export default {
!isLocationSpacesActive(this.$router, 'files-spaces-project') &&
!isLocationSpacesActive(this.$router, 'files-spaces-share') &&
!isLocationPublicActive(this.$router, 'files-public-files') &&
!isLocationCommonActive(this.$router, 'files-common-favorites')
!isLocationCommonActive(this.$router, 'files-common-favorites') &&
!isLocationSharesActive(this.$router, 'files-shares-with-me')
) {
return false
}
Expand Down

0 comments on commit f8ecb74

Please sign in to comment.