Skip to content

Commit 7eb31de

Browse files
authored
Merge pull request #44484 from nextcloud/44131-persist-initial-share-configs
fix(share): Send correct share attributes upon share creation
2 parents ca4f337 + d5b6578 commit 7eb31de

8 files changed

Lines changed: 15 additions & 15 deletions

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;

dist/1368-1368.js

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/1368-1368.js.map

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/7687-7687.js

Lines changed: 0 additions & 3 deletions
This file was deleted.

dist/7687-7687.js.map

Lines changed: 0 additions & 1 deletion
This file was deleted.

dist/files_sharing-files_sharing_tab.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/files_sharing-files_sharing_tab.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)