From 5046dc572798e6f0508ecdae244ce1d5f050bb3f Mon Sep 17 00:00:00 2001 From: Shivam Mishra Date: Fri, 17 Jan 2025 15:30:52 +0530 Subject: [PATCH] feat: add CSAT & Form bubble (#10711) ![CleanShot 2025-01-17 at 14 02 40@2x](https://github.com/user-attachments/assets/7a19c4d7-7548-4b6a-92bb-0ddba181c428) ![CleanShot 2025-01-17 at 14 39 50@2x](https://github.com/user-attachments/assets/4251c944-2d1f-4cb5-817a-6352a644b743) --------- Co-authored-by: Sivin Varghese <64252451+iamsivin@users.noreply.github.com> --- .../components-next/message/Message.vue | 12 ++++ .../components-next/message/bubbles/CSAT.vue | 45 ++++++++++++++ .../components-next/message/bubbles/Form.vue | 62 +++++++++++++++++++ .../i18n/locale/en/conversation.json | 1 + 4 files changed, 120 insertions(+) create mode 100644 app/javascript/dashboard/components-next/message/bubbles/CSAT.vue create mode 100644 app/javascript/dashboard/components-next/message/bubbles/Form.vue diff --git a/app/javascript/dashboard/components-next/message/Message.vue b/app/javascript/dashboard/components-next/message/Message.vue index 78b637e65..df0602a49 100644 --- a/app/javascript/dashboard/components-next/message/Message.vue +++ b/app/javascript/dashboard/components-next/message/Message.vue @@ -34,6 +34,8 @@ import UnsupportedBubble from './bubbles/Unsupported.vue'; import ContactBubble from './bubbles/Contact.vue'; import DyteBubble from './bubbles/Dyte.vue'; import LocationBubble from './bubbles/Location.vue'; +import CSATBubble from './bubbles/CSAT.vue'; +import FormBubble from './bubbles/Form.vue'; import MessageError from './MessageError.vue'; import ContextMenu from 'dashboard/modules/conversations/components/MessageContextMenu.vue'; @@ -260,6 +262,16 @@ const componentToRender = computed(() => { if (emailInboxTypes.includes(props.messageType)) return EmailBubble; } + if (props.contentType === CONTENT_TYPES.INPUT_CSAT) { + return CSATBubble; + } + + if ( + [CONTENT_TYPES.INPUT_SELECT, CONTENT_TYPES.FORM].includes(props.contentType) + ) { + return FormBubble; + } + if (props.contentType === CONTENT_TYPES.INCOMING_EMAIL) { return EmailBubble; } diff --git a/app/javascript/dashboard/components-next/message/bubbles/CSAT.vue b/app/javascript/dashboard/components-next/message/bubbles/CSAT.vue new file mode 100644 index 000000000..211840944 --- /dev/null +++ b/app/javascript/dashboard/components-next/message/bubbles/CSAT.vue @@ -0,0 +1,45 @@ + + + diff --git a/app/javascript/dashboard/components-next/message/bubbles/Form.vue b/app/javascript/dashboard/components-next/message/bubbles/Form.vue new file mode 100644 index 000000000..0bf92a07b --- /dev/null +++ b/app/javascript/dashboard/components-next/message/bubbles/Form.vue @@ -0,0 +1,62 @@ + + + diff --git a/app/javascript/dashboard/i18n/locale/en/conversation.json b/app/javascript/dashboard/i18n/locale/en/conversation.json index 6e17875b0..994bc8609 100644 --- a/app/javascript/dashboard/i18n/locale/en/conversation.json +++ b/app/javascript/dashboard/i18n/locale/en/conversation.json @@ -54,6 +54,7 @@ "SUCCESS_DELETE_MESSAGE": "Message deleted successfully", "FAIL_DELETE_MESSSAGE": "Couldn't delete message! Try again", "NO_RESPONSE": "No response", + "RESPONSE": "Response", "RATING_TITLE": "Rating", "FEEDBACK_TITLE": "Feedback", "REPLY_MESSAGE_NOT_FOUND": "Message not available",