From 59d07f71e7bbf235e1611fe2deb5ded225f7bfde Mon Sep 17 00:00:00 2001 From: Shivam Mishra Date: Thu, 12 Dec 2024 13:31:51 +0530 Subject: [PATCH] feat: use formatted content --- .../components-next/message/Message.vue | 2 +- .../message/bubbles/Email/Index.vue | 38 ++++++++++++------- .../message/bubbles/Text/FormattedContent.vue | 31 +++++++++++++++ .../bubbles/{Text.vue => Text/Index.vue} | 36 +++++++++++------- 4 files changed, 80 insertions(+), 27 deletions(-) create mode 100644 app/javascript/dashboard/components-next/message/bubbles/Text/FormattedContent.vue rename app/javascript/dashboard/components-next/message/bubbles/{Text.vue => Text/Index.vue} (62%) diff --git a/app/javascript/dashboard/components-next/message/Message.vue b/app/javascript/dashboard/components-next/message/Message.vue index ecef5605c..97cc8306b 100644 --- a/app/javascript/dashboard/components-next/message/Message.vue +++ b/app/javascript/dashboard/components-next/message/Message.vue @@ -12,7 +12,7 @@ import { import Avatar from 'next/avatar/Avatar.vue'; -import TextBubble from './bubbles/Text.vue'; +import TextBubble from './bubbles/Text/Index.vue'; import ActivityBubble from './bubbles/Activity.vue'; import ImageBubble from './bubbles/Image.vue'; import FileBubble from './bubbles/File.vue'; diff --git a/app/javascript/dashboard/components-next/message/bubbles/Email/Index.vue b/app/javascript/dashboard/components-next/message/bubbles/Email/Index.vue index 2dc701a1f..7cd53c1b5 100644 --- a/app/javascript/dashboard/components-next/message/bubbles/Email/Index.vue +++ b/app/javascript/dashboard/components-next/message/bubbles/Email/Index.vue @@ -5,10 +5,11 @@ import { Letter } from 'vue-letter'; import Icon from 'next/icon/Icon.vue'; import { EmailQuoteExtractor } from './removeReply.js'; import BaseBubble from 'next/message/bubbles/Base.vue'; +import FormattedContent from 'next/message/bubbles/Text/FormattedContent.vue'; import AttachmentChips from 'next/message/chips/AttachmentChips.vue'; import EmailMeta from './EmailMeta.vue'; -import { MESSAGE_STATUS } from '../../constants'; +import { MESSAGE_STATUS, MESSAGE_TYPES } from '../../constants'; const props = defineProps({ content: { @@ -32,6 +33,10 @@ const props = defineProps({ type: Object, default: () => ({}), }, + messageType: { + type: String, + required: true, + }, }); const isExpandable = ref(false); @@ -43,6 +48,10 @@ onMounted(() => { isExpandable.value = contentContainer.value.scrollHeight > 400; }); +const isOutgoing = computed(() => { + return props.messageType === MESSAGE_TYPES.OUTGOING; +}); + const fullHTML = computed(() => { return props.contentAttributes?.email?.htmlContent?.full ?? props.content; }); @@ -84,18 +93,21 @@ const textToShow = computed(() => { {{ $t('EMAIL_HEADER.EXPAND') }} - - + +