Skip to content

Commit

Permalink
fix(files_sharing): Ensure "note to recipient" textarea is shown if t…
Browse files Browse the repository at this point in the history
…here is a note

Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
  • Loading branch information
susnux committed Jul 30, 2024
1 parent 047a68d commit a189624
Showing 1 changed file with 19 additions and 13 deletions.
32 changes: 19 additions & 13 deletions apps/files_sharing/src/views/SharingDetailsTab.vue
Original file line number Diff line number Diff line change
Expand Up @@ -164,10 +164,9 @@
{{ t('files_sharing', 'Note to recipient') }}
</NcCheckboxRadioSwitch>
<template v-if="writeNoteToRecipientIsChecked">
<label for="share-note-textarea">
{{ t('files_sharing', 'Enter a note for the share recipient') }}
</label>
<textarea id="share-note-textarea" :value="share.note" @input="share.note = $event.target.value" />
<NcTextArea :label="t('files_sharing', 'Note to recipient')"
:placeholder="t('files_sharing', 'Enter a note for the share recipient')"
:value.sync="share.note" />
</template>
<ExternalShareAction v-for="action in externalLinkActions"
:id="action.id"
Expand Down Expand Up @@ -247,15 +246,17 @@
<script>
import { emit } from '@nextcloud/event-bus'
import { getLanguage } from '@nextcloud/l10n'
import { Type as ShareType } from '@nextcloud/sharing'
import { ShareType } from '@nextcloud/sharing'
import NcButton from '@nextcloud/vue/dist/Components/NcButton.js'
import NcInputField from '@nextcloud/vue/dist/Components/NcInputField.js'
import NcPasswordField from '@nextcloud/vue/dist/Components/NcPasswordField.js'
import NcAvatar from '@nextcloud/vue/dist/Components/NcAvatar.js'
import NcDateTimePickerNative from '@nextcloud/vue/dist/Components/NcDateTimePickerNative.js'
import NcButton from '@nextcloud/vue/dist/Components/NcButton.js'
import NcCheckboxRadioSwitch from '@nextcloud/vue/dist/Components/NcCheckboxRadioSwitch.js'
import NcDateTimePickerNative from '@nextcloud/vue/dist/Components/NcDateTimePickerNative.js'
import NcInputField from '@nextcloud/vue/dist/Components/NcInputField.js'
import NcLoadingIcon from '@nextcloud/vue/dist/Components/NcLoadingIcon.js'
import NcPasswordField from '@nextcloud/vue/dist/Components/NcPasswordField.js'
import NcTextArea from '@nextcloud/vue/dist/Components/NcTextArea.js'
import CircleIcon from 'vue-material-design-icons/CircleOutline.vue'
import CloseIcon from 'vue-material-design-icons/Close.vue'
import EditIcon from 'vue-material-design-icons/Pencil.vue'
Expand Down Expand Up @@ -290,11 +291,12 @@ export default {
components: {
NcAvatar,
NcButton,
NcInputField,
NcPasswordField,
NcDateTimePickerNative,
NcCheckboxRadioSwitch,
NcDateTimePickerNative,
NcInputField,
NcLoadingIcon,
NcPasswordField,
NcTextArea,
CloseIcon,
CircleIcon,
EditIcon,
Expand Down Expand Up @@ -717,7 +719,7 @@ export default {
* @return {Array}
*/
externalLinkActions() {
const filterValidAction = (action) => (action.shareType.includes(ShareType.SHARE_TYPE_LINK) || action.shareType.includes(ShareType.SHARE_TYPE_EMAIL)) && action.advanced
const filterValidAction = (action) => (action.shareType.includes(ShareType.Link) || action.shareType.includes(ShareType.Email)) && action.advanced
// filter only the advanced registered actions for said link
return this.ExternalShareActions.actions
.filter(filterValidAction)
Expand Down Expand Up @@ -808,6 +810,10 @@ export default {
this.advancedSectionAccordionExpanded = true
}
if (this.share.note) {
this.writeNoteToRecipientIsChecked = true
}
},
handleShareType() {
if ('shareType' in this.share) {
Expand Down

0 comments on commit a189624

Please sign in to comment.