feat: disable upload after one message
This commit is contained in:
@@ -13,12 +13,17 @@
|
||||
/>
|
||||
<file-upload
|
||||
ref="upload"
|
||||
v-tooltip.top-end="$t('CONVERSATION.REPLYBOX.TIP_ATTACH_ICON')"
|
||||
v-tooltip.top-end="
|
||||
disableFileUpload
|
||||
? $t('CONVERSATION.REPLYBOX.TIP_ATTACHMENT_LIMIT_FB')
|
||||
: $t('CONVERSATION.REPLYBOX.TIP_ATTACH_ICON')
|
||||
"
|
||||
input-id="conversationAttachment"
|
||||
:disabled="disableFileUpload"
|
||||
:size="4096 * 4096"
|
||||
:accept="allowedFileTypes"
|
||||
:multiple="enableMultipleFileUpload"
|
||||
:drop="enableDragAndDrop"
|
||||
:drop="disableFileUpload ? false : enableDragAndDrop"
|
||||
:drop-directory="false"
|
||||
:data="{
|
||||
direct_upload_url: '/rails/active_storage/direct_uploads',
|
||||
@@ -29,7 +34,12 @@
|
||||
<woot-button
|
||||
v-if="showAttachButton"
|
||||
class-names="button--upload"
|
||||
:title="$t('CONVERSATION.REPLYBOX.TIP_ATTACH_ICON')"
|
||||
:disabled="disableFileUpload"
|
||||
:title="
|
||||
disableFileUpload
|
||||
? $t('CONVERSATION.REPLYBOX.TIP_ATTACHMENT_LIMIT_FB')
|
||||
: $t('CONVERSATION.REPLYBOX.TIP_ATTACH_ICON')
|
||||
"
|
||||
icon="attach"
|
||||
emoji="📎"
|
||||
color-scheme="secondary"
|
||||
@@ -248,6 +258,10 @@ export default {
|
||||
type: String,
|
||||
required: true,
|
||||
},
|
||||
disableFileUpload: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
},
|
||||
computed: {
|
||||
...mapGetters({
|
||||
|
||||
@@ -109,6 +109,7 @@
|
||||
<reply-bottom-panel
|
||||
:conversation-id="conversationId"
|
||||
:enable-multiple-file-upload="enableMultipleFileUpload"
|
||||
:disable-file-upload="disableFileUpload"
|
||||
:has-whatsapp-templates="hasWhatsappTemplates"
|
||||
:inbox="inbox"
|
||||
:is-on-private-note="isOnPrivateNote"
|
||||
@@ -465,6 +466,13 @@ export default {
|
||||
showReplyHead() {
|
||||
return !this.isOnPrivateNote && this.isAnEmailChannel;
|
||||
},
|
||||
disableFileUpload() {
|
||||
if (this.isAFacebookInbox) {
|
||||
return this.hasAttachments > 0;
|
||||
}
|
||||
|
||||
return false;
|
||||
},
|
||||
enableMultipleFileUpload() {
|
||||
return (
|
||||
this.isAnEmailChannel ||
|
||||
|
||||
@@ -148,6 +148,7 @@
|
||||
"TIP_FORMAT_ICON": "Show rich text editor",
|
||||
"TIP_EMOJI_ICON": "Show emoji selector",
|
||||
"TIP_ATTACH_ICON": "Attach files",
|
||||
"TIP_ATTACHMENT_LIMIT_FB": "You cannot attach more files to this message",
|
||||
"TIP_AUDIORECORDER_ICON": "Record audio",
|
||||
"TIP_AUDIORECORDER_PERMISSION": "Allow access to audio",
|
||||
"TIP_AUDIORECORDER_ERROR": "Could not open the audio",
|
||||
@@ -323,4 +324,4 @@
|
||||
"TRANSLATED_CONTENT": "Translated Content",
|
||||
"NO_TRANSLATIONS_AVAILABLE": "No translations are available for this content"
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user