Skip to content

Commit

Permalink
Save label on new share creation
Browse files Browse the repository at this point in the history
  • Loading branch information
aleksei-nmc committed Nov 30, 2023
1 parent 99cadc2 commit 1c5fb16
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/mixins/SharesMixin.js
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ export default {
// force value to string because that is what our
// share api controller accepts
propertyNames.forEach(name => {
if (this.mutableShare && (name === 'note' || name === 'password')) {
if (this.mutableShare && ['note', 'password', 'label'].includes(name)) {
properties[name] = this.mutableShare[name].toString()
} else if ((typeof this.share[name]) === 'object') {
properties[name] = JSON.stringify(this.share[name])
Expand All @@ -304,6 +304,7 @@ export default {
// clear any previous errors
this.$delete(this.errors, propertyNames[0])
this.share.note = updatedShare.note
this.share.label = updatedShare.label
showSuccess(t('nmcsharing', 'Share updated'))
} catch ({ message }) {
if (message && message !== '') {
Expand Down
5 changes: 4 additions & 1 deletion src/views/SharingDetailsTab.vue
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
<div v-if="advancedSectionAccordionExpanded" class="sharingTabDetailsView__advanced">
<section>
<NcInputField v-if="isPublicShare"
:value.sync="share.label"
:value.sync="mutableShare.label"
type="text"
:placeholder="t('files_sharing', 'Share label')" />
<NcCheckboxRadioSwitch v-if="isPublicShare"
Expand Down Expand Up @@ -181,6 +181,7 @@ export default {
mutableShare: {
note: this.share.note,
password: this.share.password,
label: this.share.label,
},
}
},
Expand Down Expand Up @@ -644,6 +645,7 @@ export default {
shareType: this.share.type,
shareWith: this.share.shareWith,
attributes: this.share.attributes,
label: this.mutableShare.label,
note: this.mutableShare.note,
}
Expand Down Expand Up @@ -695,6 +697,7 @@ export default {
...(value.note ? { note: value.note } : {}),
...(value.password ? { password: value.password } : {}),
...(value.expireDate ? { expireDate: value.expireDate } : {}),
...(value.label ? { label: value.label } : {}),
})
return share
} catch (error) {
Expand Down

0 comments on commit 1c5fb16

Please sign in to comment.