Skip to content

Commit 3a5475b

Browse files
committed
fix(share): Send correct share attributes upon share creation
- Send correct share attributes (`share.attributes`) to server upon creation. - Delete parts of code that create or reference, `share.hasDownloadPermission` (Not required by Share API) Resolves : #44131 Signed-off-by: fenn-cs <fenn25.fn@gmail.com>
1 parent c376dbf commit 3a5475b

1 file changed

Lines changed: 8 additions & 8 deletions

File tree

apps/files_sharing/src/views/SharingDetailsTab.vue

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -404,10 +404,14 @@ export default {
404404
*/
405405
canDownload: {
406406
get() {
407-
return this.share.hasDownloadPermission
407+
return this.share.attributes.find(attr => attr.key === 'download')?.enabled || false
408408
},
409409
set(checked) {
410-
this.updateAtomicPermissions({ isDownloadChecked: checked })
410+
// Find the 'download' attribute and update its value
411+
const downloadAttr = this.share.attributes.find(attr => attr.key === 'download')
412+
if (downloadAttr) {
413+
downloadAttr.enabled = checked
414+
}
411415
},
412416
},
413417
/**
@@ -723,7 +727,6 @@ export default {
723727
isCreateChecked = this.canCreate,
724728
isDeleteChecked = this.canDelete,
725729
isReshareChecked = this.canReshare,
726-
isDownloadChecked = this.canDownload,
727730
} = {}) {
728731
// calc permissions if checked
729732
const permissions = 0
@@ -733,9 +736,6 @@ export default {
733736
| (isEditChecked ? ATOMIC_PERMISSIONS.UPDATE : 0)
734737
| (isReshareChecked ? ATOMIC_PERMISSIONS.SHARE : 0)
735738
this.share.permissions = permissions
736-
if (this.share.hasDownloadPermission !== isDownloadChecked) {
737-
this.$set(this.share, 'hasDownloadPermission', isDownloadChecked)
738-
}
739739
},
740740
expandCustomPermissions() {
741741
if (!this.advancedSectionAccordionExpanded) {
@@ -909,8 +909,8 @@ export default {
909909
shareType: share.shareType,
910910
shareWith: share.shareWith,
911911
permissions: share.permissions,
912-
attributes: JSON.stringify(fileInfo.shareAttributes),
913912
expireDate: share.expireDate,
913+
attributes: JSON.stringify(share.attributes),
914914
...(share.note ? { note: share.note } : {}),
915915
...(share.password ? { password: share.password } : {}),
916916
})
@@ -1054,7 +1054,7 @@ export default {
10541054
flex-direction: column;
10551055
}
10561056
}
1057-
1057+
10581058
/* Target component based style in NcCheckboxRadioSwitch slot content*/
10591059
:deep(span.checkbox-content__text.checkbox-radio-switch__text) {
10601060
flex-wrap: wrap;

0 commit comments

Comments
 (0)