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: disable router-links for pending and declined shares #10097

Merged
merged 1 commit into from
Nov 30, 2023
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
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