Skip to content

Commit

Permalink
Merge pull request #44571 from nextcloud/backport/44569/master
Browse files Browse the repository at this point in the history
fix(files_sharing): Create passwords when enforced for mail shares
  • Loading branch information
Fenn-CS authored Mar 31, 2024
2 parents c93d44b + ccd6df6 commit 61f2453
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 17 deletions.
6 changes: 3 additions & 3 deletions apps/files_sharing/src/models/Share.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,11 @@ export default class Share {
ocsData.hide_download = !!ocsData.hide_download
ocsData.mail_send = !!ocsData.mail_send

if (ocsData.attributes) {
if (ocsData.attributes && typeof ocsData.attributes === 'string') {
try {
ocsData.attributes = JSON.parse(ocsData.attributes)
} catch (e) {
console.warn('Could not parse share attributes returned by server: "' + ocsData.attributes + '"')
console.warn('Could not parse share attributes returned by server', ocsData.attributes)
}
}
ocsData.attributes = ocsData.attributes ?? []
Expand Down Expand Up @@ -310,7 +310,7 @@ export default class Share {
* @memberof Share
*/
get label() {
return this._share.label
return this._share.label ?? ''
}

/**
Expand Down
11 changes: 4 additions & 7 deletions apps/files_sharing/src/views/SharingDetailsTab.vue
Original file line number Diff line number Diff line change
Expand Up @@ -508,7 +508,7 @@ export default {
return this.share.type === this.SHARE_TYPES.SHARE_TYPE_GROUP
},
isNewShare() {
return this.share.id === null || this.share.id === undefined
return !this.share.id
},
allowsFileDrop() {
if (this.isFolder && this.config.isPublicUploadEnabled) {
Expand Down Expand Up @@ -787,13 +787,10 @@ export default {
},
handleShareType() {
if (this.share.share_type) {
this.share.type = this.share.share_type
}
// shareType 0 (USER_SHARE) would evaluate to zero
// Hence the use of hasOwnProperty
if ('shareType' in this.share) {
this.share.type = this.share.shareType
} else if (this.share.share_type) {
this.share.type = this.share.share_type
}
},
handleDefaultPermissions() {
Expand All @@ -814,7 +811,7 @@ export default {
this.sharingPermission = 'custom'
this.advancedSectionAccordionExpanded = true
this.setCustomPermissions = true
} else {
} else if (this.share.permissions) {
this.sharingPermission = this.share.permissions.toString()
}
},
Expand Down
1 change: 0 additions & 1 deletion dist/1368-1368.js.map

This file was deleted.

6 changes: 3 additions & 3 deletions dist/1368-1368.js → dist/2641-2641.js

Large diffs are not rendered by default.

File renamed without changes.
1 change: 1 addition & 0 deletions dist/2641-2641.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/files_sharing-files_sharing_tab.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/files_sharing-files_sharing_tab.js.map

Large diffs are not rendered by default.

0 comments on commit 61f2453

Please sign in to comment.