diff options
author | skjnldsv <skjnldsv@protonmail.com> | 2024-07-12 10:41:41 +0200 |
---|---|---|
committer | John Molakvoæ <skjnldsv@users.noreply.github.com> | 2024-07-12 20:14:30 +0200 |
commit | 9b84831c8d0c1d715cd42fa3e4e01ac8a59fa369 (patch) | |
tree | e39514c2cd1e51150075dff10c36c664d2d53ab2 /apps/files | |
parent | 62defbd6b4dded5cdb4d76efe947231cc310263b (diff) | |
download | nextcloud-server-9b84831c8d0c1d715cd42fa3e4e01ac8a59fa369.tar.gz nextcloud-server-9b84831c8d0c1d715cd42fa3e4e01ac8a59fa369.zip |
fix(files_sharing): adjust IAttributes API and files_versions
Signed-off-by: skjnldsv <skjnldsv@protonmail.com>
Diffstat (limited to 'apps/files')
-rw-r--r-- | apps/files/js/fileinfomodel.js | 2 | ||||
-rw-r--r-- | apps/files/src/actions/downloadAction.ts | 2 | ||||
-rw-r--r-- | apps/files/src/actions/moveOrCopyActionUtils.ts | 4 | ||||
-rw-r--r-- | apps/files/src/views/FilesList.vue | 8 |
4 files changed, 8 insertions, 8 deletions
diff --git a/apps/files/js/fileinfomodel.js b/apps/files/js/fileinfomodel.js index 9cd3660f710..0c0061d4d13 100644 --- a/apps/files/js/fileinfomodel.js +++ b/apps/files/js/fileinfomodel.js @@ -128,7 +128,7 @@ for (const i in this.attributes.shareAttributes) { const attr = this.attributes.shareAttributes[i] if (attr.scope === 'permissions' && attr.key === 'download') { - return attr.enabled + return attr.value === true } } diff --git a/apps/files/src/actions/downloadAction.ts b/apps/files/src/actions/downloadAction.ts index 28a52551d22..a63beaca3f2 100644 --- a/apps/files/src/actions/downloadAction.ts +++ b/apps/files/src/actions/downloadAction.ts @@ -33,7 +33,7 @@ const isDownloadable = function(node: Node) { if (node.attributes['mount-type'] === 'shared') { const shareAttributes = JSON.parse(node.attributes['share-attributes'] ?? 'null') const downloadAttribute = shareAttributes?.find?.((attribute: { scope: string; key: string }) => attribute.scope === 'permissions' && attribute.key === 'download') - if (downloadAttribute !== undefined && downloadAttribute.enabled === false) { + if (downloadAttribute !== undefined && downloadAttribute.value === false) { return false } } diff --git a/apps/files/src/actions/moveOrCopyActionUtils.ts b/apps/files/src/actions/moveOrCopyActionUtils.ts index d55247c8662..2092087cd9b 100644 --- a/apps/files/src/actions/moveOrCopyActionUtils.ts +++ b/apps/files/src/actions/moveOrCopyActionUtils.ts @@ -24,7 +24,7 @@ export const getQueue = () => { } type ShareAttribute = { - enabled: boolean + value: any key: string scope: string } @@ -48,7 +48,7 @@ export const canMove = (nodes: Node[]) => { export const canDownload = (nodes: Node[]) => { return nodes.every(node => { const shareAttributes = JSON.parse(node.attributes?.['share-attributes'] ?? '[]') as Array<ShareAttribute> - return !shareAttributes.some(attribute => attribute.scope === 'permissions' && attribute.enabled === false && attribute.key === 'download') + return !shareAttributes.some(attribute => attribute.scope === 'permissions' && attribute.value === false && attribute.key === 'download') }) } diff --git a/apps/files/src/views/FilesList.vue b/apps/files/src/views/FilesList.vue index 98a817ac067..2f09bc73080 100644 --- a/apps/files/src/views/FilesList.vue +++ b/apps/files/src/views/FilesList.vue @@ -396,14 +396,14 @@ export default defineComponent({ return { ...this.$route, query: { dir } } }, - shareAttributes(): number[] | undefined { + shareTypesAttributes(): number[] | undefined { if (!this.currentFolder?.attributes?.['share-types']) { return undefined } return Object.values(this.currentFolder?.attributes?.['share-types'] || {}).flat() as number[] }, shareButtonLabel() { - if (!this.shareAttributes) { + if (!this.shareTypesAttributes) { return t('files', 'Share') } @@ -413,12 +413,12 @@ export default defineComponent({ return t('files', 'Shared') }, shareButtonType(): Type | null { - if (!this.shareAttributes) { + if (!this.shareTypesAttributes) { return null } // If all types are links, show the link icon - if (this.shareAttributes.some(type => type === Type.SHARE_TYPE_LINK)) { + if (this.shareTypesAttributes.some(type => type === Type.SHARE_TYPE_LINK)) { return Type.SHARE_TYPE_LINK } |