From a2af5e25e10ea20f5524af95f74cc2add3660bae Mon Sep 17 00:00:00 2001 From: Shivam Mishra Date: Mon, 9 Oct 2023 15:11:08 +0530 Subject: [PATCH] feat: allow showing in-reply-to message --- .../widgets/conversation/Message.vue | 30 +++++++++++++++++++ .../widgets/conversation/MessagesView.vue | 3 ++ .../widgets/conversation/bubble/ReplyTo.vue | 22 ++++++++++++++ 3 files changed, 55 insertions(+) create mode 100644 app/javascript/dashboard/components/widgets/conversation/bubble/ReplyTo.vue diff --git a/app/javascript/dashboard/components/widgets/conversation/Message.vue b/app/javascript/dashboard/components/widgets/conversation/Message.vue index 35feab802..3c8cad407 100644 --- a/app/javascript/dashboard/components/widgets/conversation/Message.vue +++ b/app/javascript/dashboard/components/widgets/conversation/Message.vue @@ -34,6 +34,11 @@ :url="storyUrl" /> + { + if (message.id === replyToMessageId) { + return true; + } + return false; + }); + }, contextMenuEnabledOptions() { return { copy: this.hasText, @@ -522,6 +545,13 @@ export default { this.showBackgroundHighlight = false; }, HIGHLIGHT_TIMER); }, + navigateToMessage() { + this.$nextTick(() => { + bus.$emit(BUS_EVENTS.SCROLL_TO_MESSAGE, { + messageId: this.inReplyTo?.id, + }); + }); + }, }, }; diff --git a/app/javascript/dashboard/components/widgets/conversation/MessagesView.vue b/app/javascript/dashboard/components/widgets/conversation/MessagesView.vue index 5da5408e4..4eb4ae554 100644 --- a/app/javascript/dashboard/components/widgets/conversation/MessagesView.vue +++ b/app/javascript/dashboard/components/widgets/conversation/MessagesView.vue @@ -34,6 +34,7 @@ :has-instagram-story="hasInstagramStory" :is-web-widget-inbox="isAWebWidgetInbox" :inbox-supports-reply-to="inboxSupportsReplyTo" + :current-chat="currentChat" />
  • @@ -55,6 +56,8 @@ :is-a-whatsapp-channel="isAWhatsAppChannel" :has-instagram-story="hasInstagramStory" :is-web-widget-inbox="isAWebWidgetInbox" + :inbox-supports-reply-to="inboxSupportsReplyTo" + :current-chat="currentChat" /> +import { computed } from 'vue'; +import { extractTextFromMarkdown } from 'dashboard/helper/editorHelper'; + +const { content } = defineProps({ + content: { + type: String, + required: true, + }, +}); + +const cleanedContent = computed(() => extractTextFromMarkdown(content)); + + +