Skip to content

Commit

Permalink
Merge pull request #10097 from owncloud/disable-router-links-for-pend…
Browse files Browse the repository at this point in the history
…ing-declined-shares

fix: disable router-links for pending and declined shares
  • Loading branch information
JammingBen authored Nov 30, 2023
2 parents 19fe3b6 + 2f0d2c1 commit 340ea48
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
1 change: 1 addition & 0 deletions changelog/unreleased/enhancement-show-hide-shares
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ Furthermore, accepting and rejecting shares has been renamed to "enable sync"/"d

https://github.com/owncloud/web/issues/9531
https://github.com/owncloud/web/pull/9718
https://github.com/owncloud/web/pull/10097
13 changes: 9 additions & 4 deletions packages/web-pkg/src/components/FilesList/ResourceTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
:is-thumbnail-displayed="shouldDisplayThumbnails(item)"
:is-icon-displayed="!$slots['image']"
:is-extension-displayed="areFileExtensionsShown"
:is-resource-clickable="isResourceClickable(item.id)"
:is-resource-clickable="isResourceClickable(item)"
:folder-link="getFolderLink(item)"
:parent-folder-link="getParentFolderLink(item)"
:parent-folder-link-icon-additional-attributes="
Expand Down Expand Up @@ -215,7 +215,7 @@ import { mapGetters, mapActions, mapState } from 'vuex'
import { useWindowSize } from '@vueuse/core'
import { Resource } from '@ownclouders/web-client'
import { extractDomSelector, SpaceResource } from '@ownclouders/web-client/src/helpers'
import { ShareTypes } from '@ownclouders/web-client/src/helpers/share'
import { ShareStatus, ShareTypes } from '@ownclouders/web-client/src/helpers/share'
import {
useCapabilityFilesTags,
Expand Down Expand Up @@ -893,12 +893,17 @@ export default defineComponent({
*/
this.$emit('fileClick', { space, resources: [resource] })
},
isResourceClickable(resourceId) {
isResourceClickable({ id, status }: Resource) {
if (!this.areResourcesClickable) {
return false
}
return !this.disabledResources.includes(resourceId)
// TODO: remove as soon as pending & declined shares are accessible
if (status === ShareStatus.pending || status === ShareStatus.declined) {
return false
}
return !this.disabledResources.includes(id)
},
getResourceCheckboxLabel(resource) {
if (resource.type === 'folder') {
Expand Down

0 comments on commit 340ea48

Please sign in to comment.