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') }} - - + + + + + +import { computed } from 'vue'; +import { useMessageContext } from '../../provider.js'; + +import MessageFormatter from 'shared/helpers/MessageFormatter.js'; +import { MESSAGE_VARIANTS } from '../../constants'; + +const props = defineProps({ + content: { + type: String, + required: true, + }, +}); + +const { variant } = useMessageContext(); + +const formattedContent = computed(() => { + if (variant.value === MESSAGE_VARIANTS.ACTIVITY) { + return props.content; + } + + return new MessageFormatter(props.content).formattedMessage; +}); + + + + + diff --git a/app/javascript/dashboard/components-next/message/bubbles/Text.vue b/app/javascript/dashboard/components-next/message/bubbles/Text/Index.vue similarity index 62% rename from app/javascript/dashboard/components-next/message/bubbles/Text.vue rename to app/javascript/dashboard/components-next/message/bubbles/Text/Index.vue index 29fdff768..c22797e99 100644 --- a/app/javascript/dashboard/components-next/message/bubbles/Text.vue +++ b/app/javascript/dashboard/components-next/message/bubbles/Text/Index.vue @@ -1,11 +1,10 @@ - - + + + + + {{ contentAttributes.submittedEmail }} + +