Skip to content

Commit

Permalink
Merge pull request #44591 from nextcloud/backport/44571/stable29
Browse files Browse the repository at this point in the history
[stable29] fix(files_sharing): Create passwords when enforced for mail shares
  • Loading branch information
blizzz authored Apr 4, 2024
2 parents 7a4e0c0 + 8a008d3 commit 11ac9b3
Show file tree
Hide file tree
Showing 9 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 @@ -509,7 +509,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 @@ -788,13 +788,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 @@ -815,7 +812,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
3 changes: 3 additions & 0 deletions dist/4997-4997.js

Large diffs are not rendered by default.

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

Large diffs are not rendered by default.

3 changes: 0 additions & 3 deletions dist/938-938.js

This file was deleted.

1 change: 0 additions & 1 deletion dist/938-938.js.map

This file was deleted.

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 11ac9b3

Please sign in to comment.