Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 17 additions & 17 deletions apps/files_sharing/js/dist/files_sharing_tab.js

Large diffs are not rendered by default.

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

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions apps/files_sharing/js/dist/personal-settings.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion apps/files_sharing/js/dist/personal-settings.js.map

Large diffs are not rendered by default.

7 changes: 4 additions & 3 deletions apps/files_sharing/src/components/SharingEntryLink.vue
Original file line number Diff line number Diff line change
Expand Up @@ -242,9 +242,10 @@
}"
:class="{ error: errors.note}"
:disabled="saving"
:value.sync="share.note"
:placeholder="t('files_sharing', 'Enter a note for the share recipient')"
:value="share.note"
icon="icon-edit"
@update:value="debounceQueueUpdate('note')" />
@update:value="onNoteChange" />
</template>

<!-- external sharing via url (social...) -->
Expand Down Expand Up @@ -733,7 +734,7 @@ export default {
*/
onPasswordSubmit() {
if (this.hasUnsavedPassword) {
this.share.password = this.share.newPassword
this.share.password = this.share.newPassword.trim()
this.queueUpdate('password')
}
},
Expand Down
20 changes: 15 additions & 5 deletions apps/files_sharing/src/mixins/SharesMixin.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,12 +88,12 @@ export default {
*/
hasNote: {
get: function() {
return !!this.share.note
return this.share.note !== ''
},
set: function(enabled) {
this.share.note = enabled
? t('files_sharing', 'Enter a note for the share recipient')
: ''
? null // enabled but user did not changed the content yet
: '' // empty = no note = disabled
},
},

Expand All @@ -117,10 +117,10 @@ export default {
// fallback to default in case of unavailable data
return {
days: window.dayNamesShort
? window.dayNamesShort // provided by nextcloud
? window.dayNamesShort // provided by nextcloud
: ['Sun.', 'Mon.', 'Tue.', 'Wed.', 'Thu.', 'Fri.', 'Sat.'],
months: window.monthNamesShort
? window.monthNamesShort // provided by nextcloud
? window.monthNamesShort // provided by nextcloud
: ['Jan.', 'Feb.', 'Mar.', 'Apr.', 'May.', 'Jun.', 'Jul.', 'Aug.', 'Sep.', 'Oct.', 'Nov.', 'Dec.'],
placeholder: {
date: 'Select Date', // TODO: Translate
Expand Down Expand Up @@ -182,6 +182,16 @@ export default {
this.queueUpdate('expireDate')
},

/**
* When the note change, we trim, save and dispatch
*
* @param {string} note the note
*/
onNoteChange: debounce(function(note) {
this.share.note = note.trim()
this.queueUpdate('note')
}, 500),

/**
* Delete share button handler
*/
Expand Down
4 changes: 2 additions & 2 deletions apps/files_sharing/src/models/Share.js
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ export default class Share {
* @memberof Share
*/
set note(note) {
this.#share.note = note.trim()
this.#share.note = note
}

/**
Expand Down Expand Up @@ -303,7 +303,7 @@ export default class Share {
* @memberof Share
*/
set password(password) {
this.#share.password = password.trim()
this.#share.password = password
}

// SHARED ITEM DATA ---------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion apps/files_sharing/src/views/SharingLinkList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
-->

<template>
<ul class="sharing-link-list" v-if="canLinkShare">
<ul v-if="canLinkShare" class="sharing-link-list">
<!-- If no link shares, show the add link default entry -->
<SharingEntryLink v-if="!hasLinkShares && canReshare"
:can-reshare="canReshare"
Expand Down