From ae0b68147e3a8a4a7effda9888c939f680f949f6 Mon Sep 17 00:00:00 2001 From: Muhsin Keloth Date: Fri, 4 Apr 2025 13:03:41 +0530 Subject: [PATCH] chore: Reply window fixes (#11242) - Fixed the can reply window links. - Added the supported file types for Instagram. --- .../widgets/WootWriter/ReplyBottomPanel.vue | 12 ++++++++++++ .../widgets/conversation/MessagesView.vue | 13 ++++++++++--- .../components/widgets/conversation/ReplyBox.vue | 1 + app/javascript/shared/constants/links.js | 2 ++ app/javascript/shared/constants/messages.js | 4 ++++ 5 files changed, 29 insertions(+), 3 deletions(-) diff --git a/app/javascript/dashboard/components/widgets/WootWriter/ReplyBottomPanel.vue b/app/javascript/dashboard/components/widgets/WootWriter/ReplyBottomPanel.vue index 26249e881..cf59532e0 100644 --- a/app/javascript/dashboard/components/widgets/WootWriter/ReplyBottomPanel.vue +++ b/app/javascript/dashboard/components/widgets/WootWriter/ReplyBottomPanel.vue @@ -10,6 +10,7 @@ import { ALLOWED_FILE_TYPES, ALLOWED_FILE_TYPES_FOR_TWILIO_WHATSAPP, ALLOWED_FILE_TYPES_FOR_LINE, + ALLOWED_FILE_TYPES_FOR_INSTAGRAM, } from 'shared/constants/messages'; import VideoCallButton from '../VideoCallButton.vue'; import AIAssistanceButton from '../AIAssistanceButton.vue'; @@ -113,6 +114,10 @@ export default { type: String, required: true, }, + conversationType: { + type: String, + default: '', + }, }, emits: [ 'replaceText', @@ -187,6 +192,9 @@ export default { showAudioPlayStopButton() { return this.showAudioRecorder && this.isRecordingAudio; }, + isInstagramDM() { + return this.conversationType === 'instagram_direct_message'; + }, allowedFileTypes() { if (this.isATwilioWhatsAppChannel) { return ALLOWED_FILE_TYPES_FOR_TWILIO_WHATSAPP; @@ -194,6 +202,10 @@ export default { if (this.isALineChannel) { return ALLOWED_FILE_TYPES_FOR_LINE; } + if (this.isAInstagramChannel || this.isInstagramDM) { + return ALLOWED_FILE_TYPES_FOR_INSTAGRAM; + } + return ALLOWED_FILE_TYPES; }, enableDragAndDrop() { diff --git a/app/javascript/dashboard/components/widgets/conversation/MessagesView.vue b/app/javascript/dashboard/components/widgets/conversation/MessagesView.vue index ae798d8d9..865122386 100644 --- a/app/javascript/dashboard/components/widgets/conversation/MessagesView.vue +++ b/app/javascript/dashboard/components/widgets/conversation/MessagesView.vue @@ -226,16 +226,23 @@ export default { return this.$t('CONVERSATION.CANNOT_REPLY'); }, replyWindowLink() { - if (this.isAWhatsAppChannel) { + if (this.isAFacebookInbox || this.isAInstagramChannel) { return REPLY_POLICY.FACEBOOK; } + if (this.isAWhatsAppCloudChannel) { + return REPLY_POLICY.WHATSAPP_CLOUD; + } if (!this.isAPIInbox) { return REPLY_POLICY.TWILIO_WHATSAPP; } return ''; }, replyWindowLinkText() { - if (this.isAWhatsAppChannel) { + if ( + this.isAWhatsAppChannel || + this.isAFacebookInbox || + this.isAInstagramChannel + ) { return this.$t('CONVERSATION.24_HOURS_WINDOW'); } if (!this.isAPIInbox) { @@ -485,7 +492,7 @@ export default {