Browse Source

Merge pull request #44484 from nextcloud/44131-persist-initial-share-configs

fix(share): Send correct share attributes upon share creation
pull/44465/head
F. E Noel Nfebe 2 years ago
committed by GitHub
parent
commit
7eb31de349
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 16
      apps/files_sharing/src/views/SharingDetailsTab.vue
  2. 3
      dist/1368-1368.js
  3. 0
      dist/1368-1368.js.LICENSE.txt
  4. 1
      dist/1368-1368.js.map
  5. 3
      dist/7687-7687.js
  6. 1
      dist/7687-7687.js.map
  7. 4
      dist/files_sharing-files_sharing_tab.js
  8. 2
      dist/files_sharing-files_sharing_tab.js.map

16
apps/files_sharing/src/views/SharingDetailsTab.vue

@ -404,10 +404,14 @@ export default {
*/
canDownload: {
get() {
return this.share.hasDownloadPermission
return this.share.attributes.find(attr => attr.key === 'download')?.enabled || false
},
set(checked) {
this.updateAtomicPermissions({ isDownloadChecked: checked })
// Find the 'download' attribute and update its value
const downloadAttr = this.share.attributes.find(attr => attr.key === 'download')
if (downloadAttr) {
downloadAttr.enabled = checked
}
},
},
/**
@ -723,7 +727,6 @@ export default {
isCreateChecked = this.canCreate,
isDeleteChecked = this.canDelete,
isReshareChecked = this.canReshare,
isDownloadChecked = this.canDownload,
} = {}) {
// calc permissions if checked
const permissions = 0
@ -733,9 +736,6 @@ export default {
| (isEditChecked ? ATOMIC_PERMISSIONS.UPDATE : 0)
| (isReshareChecked ? ATOMIC_PERMISSIONS.SHARE : 0)
this.share.permissions = permissions
if (this.share.hasDownloadPermission !== isDownloadChecked) {
this.$set(this.share, 'hasDownloadPermission', isDownloadChecked)
}
},
expandCustomPermissions() {
if (!this.advancedSectionAccordionExpanded) {
@ -909,8 +909,8 @@ export default {
shareType: share.shareType,
shareWith: share.shareWith,
permissions: share.permissions,
attributes: JSON.stringify(fileInfo.shareAttributes),
expireDate: share.expireDate,
attributes: JSON.stringify(share.attributes),
...(share.note ? { note: share.note } : {}),
...(share.password ? { password: share.password } : {}),
})
@ -1054,7 +1054,7 @@ export default {
flex-direction: column;
}
}
/* Target component based style in NcCheckboxRadioSwitch slot content*/
:deep(span.checkbox-content__text.checkbox-radio-switch__text) {
flex-wrap: wrap;

3
dist/1368-1368.js
File diff suppressed because it is too large
View File

0
dist/7687-7687.js.LICENSE.txt → dist/1368-1368.js.LICENSE.txt

1
dist/1368-1368.js.map
File diff suppressed because it is too large
View File

3
dist/7687-7687.js
File diff suppressed because it is too large
View File

1
dist/7687-7687.js.map
File diff suppressed because it is too large
View File

4
dist/files_sharing-files_sharing_tab.js
File diff suppressed because it is too large
View File

2
dist/files_sharing-files_sharing_tab.js.map
File diff suppressed because it is too large
View File

Loading…
Cancel
Save