diff --git a/app/javascript/dashboard/components/widgets/conversation/ReplyBox.vue b/app/javascript/dashboard/components/widgets/conversation/ReplyBox.vue index 865c4181aeeb1..e32b45fd39d5c 100644 --- a/app/javascript/dashboard/components/widgets/conversation/ReplyBox.vue +++ b/app/javascript/dashboard/components/widgets/conversation/ReplyBox.vue @@ -322,12 +322,7 @@ export default { return !this.isOnPrivateNote && this.isAnEmailChannel; }, enableMultipleFileUpload() { - return ( - this.isAnEmailChannel || - this.isAWebWidgetInbox || - this.isAPIInbox || - this.isAWhatsAppChannel - ); + return this.isAnEmailChannel || this.isAWebWidgetInbox || this.isAPIInbox; }, isSignatureEnabledForInbox() { return !this.isPrivate && this.sendWithSignature; @@ -900,6 +895,10 @@ export default { }); }, attachFile({ blob, file }) { + if (!this.enableMultipleFileUpload && this.attachedFiles.length > 0) { + useAlert(this.$t('CONVERSATION.REPLYBOX.TIP_ATTACH_SINGLE')); + return; + } const reader = new FileReader(); reader.readAsDataURL(file.file); reader.onloadend = () => { diff --git a/app/javascript/dashboard/i18n/locale/en/conversation.json b/app/javascript/dashboard/i18n/locale/en/conversation.json index 34fa349814112..f2d9b49b5a5eb 100644 --- a/app/javascript/dashboard/i18n/locale/en/conversation.json +++ b/app/javascript/dashboard/i18n/locale/en/conversation.json @@ -156,6 +156,7 @@ "TIP_FORMAT_ICON": "Show rich text editor", "TIP_EMOJI_ICON": "Show emoji selector", "TIP_ATTACH_ICON": "Attach files", + "TIP_ATTACH_SINGLE": "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", diff --git a/app/javascript/dashboard/i18n/locale/pt/conversation.json b/app/javascript/dashboard/i18n/locale/pt/conversation.json index 73da76bb4d31e..86f616d7b70db 100644 --- a/app/javascript/dashboard/i18n/locale/pt/conversation.json +++ b/app/javascript/dashboard/i18n/locale/pt/conversation.json @@ -156,6 +156,7 @@ "TIP_FORMAT_ICON": "Mostrar editor de texto completo", "TIP_EMOJI_ICON": "Mostrar selecionador de emojis", "TIP_ATTACH_ICON": "Anexar ficheiros", + "TIP_ATTACH_SINGLE": "Você não pode adicionar mais de um arquivo para essa mensagem", "TIP_AUDIORECORDER_ICON": "Gravar áudio", "TIP_AUDIORECORDER_PERMISSION": "Permitir acesso ao áudio", "TIP_AUDIORECORDER_ERROR": "Não foi possível abrir o áudio", diff --git a/app/javascript/dashboard/i18n/locale/pt_BR/conversation.json b/app/javascript/dashboard/i18n/locale/pt_BR/conversation.json index ff4350519eb5b..4cb7b824ef978 100644 --- a/app/javascript/dashboard/i18n/locale/pt_BR/conversation.json +++ b/app/javascript/dashboard/i18n/locale/pt_BR/conversation.json @@ -156,6 +156,7 @@ "TIP_FORMAT_ICON": "Mostrar editor de texto completo", "TIP_EMOJI_ICON": "Mostrar seletor de emoji", "TIP_ATTACH_ICON": "Anexar arquivos", + "TIP_ATTACH_SINGLE": "Você não pode adicionar mais de um arquivo para essa mensagem", "TIP_AUDIORECORDER_ICON": "Gravar áudio", "TIP_AUDIORECORDER_PERMISSION": "Permitir acesso ao áudio", "TIP_AUDIORECORDER_ERROR": "Não foi possível abrir o áudio", diff --git a/app/javascript/dashboard/routes/dashboard/conversation/contact/ConversationForm.vue b/app/javascript/dashboard/routes/dashboard/conversation/contact/ConversationForm.vue index 75babaca03e0e..9598ce97d498d 100644 --- a/app/javascript/dashboard/routes/dashboard/conversation/contact/ConversationForm.vue +++ b/app/javascript/dashboard/routes/dashboard/conversation/contact/ConversationForm.vue @@ -167,12 +167,21 @@ export default { this.selectedInbox.inbox.channel_type === INBOX_TYPES.WEB ); }, + isAPIInbox() { + return ( + this.selectedInbox && + this.selectedInbox.inbox.channel_type === INBOX_TYPES.API + ); + }, isEmailOrWebWidgetInbox() { return this.isAnEmailInbox || this.isAnWebWidgetInbox; }, hasWhatsappTemplates() { return !!this.selectedInbox.inbox?.message_templates; }, + enableMultipleFileUpload() { + return this.isAnEmailInbox || this.isAnWebWidgetInbox || this.isAPIInbox; + }, hasAttachments() { return this.attachedFiles.length; }, @@ -223,6 +232,10 @@ export default { }); }, attachFile({ blob, file }) { + if (!this.enableMultipleFileUpload && this.attachedFiles.length > 0) { + useAlert(this.$t('CONVERSATION.REPLYBOX.TIP_ATTACH_SINGLE')); + return; + } const reader = new FileReader(); reader.readAsDataURL(file.file); reader.onloadend = () => { @@ -495,7 +508,7 @@ export default { input-id="newConversationAttachment" :size="4096 * 4096" :accept="allowedFileTypes" - multiple + multiple="enableMultipleFileUpload" :drop="true" :drop-directory="false" :data="{ diff --git a/vendor/db/sentiment-analysis.onnx b/vendor/db/sentiment-analysis.onnx deleted file mode 100644 index 1cb2623543d0c..0000000000000 Binary files a/vendor/db/sentiment-analysis.onnx and /dev/null differ