From a80eff9aa36892d93ebd0c87217522cac5079c2a Mon Sep 17 00:00:00 2001 From: Muhsin Keloth Date: Wed, 20 Dec 2023 12:20:09 +0530 Subject: [PATCH] feat: Enable custom attributes in the suggestion for variables. (#8520) --- .../widgets/conversation/ReplyBox.vue | 6 ++ .../widgets/conversation/VariableList.vue | 30 +++++++++- .../widgets/mentions/MentionBox.vue | 60 ++++++++++++------- package.json | 4 +- yarn.lock | 8 +-- 5 files changed, 78 insertions(+), 30 deletions(-) diff --git a/app/javascript/dashboard/components/widgets/conversation/ReplyBox.vue b/app/javascript/dashboard/components/widgets/conversation/ReplyBox.vue index 4199be673..e22a3a23a 100644 --- a/app/javascript/dashboard/components/widgets/conversation/ReplyBox.vue +++ b/app/javascript/dashboard/components/widgets/conversation/ReplyBox.vue @@ -271,6 +271,11 @@ export default { accountId: 'getCurrentAccountId', isFeatureEnabledonAccount: 'accounts/isFeatureEnabledonAccount', }), + currentContact() { + return this.$store.getters['contacts/getContact']( + this.currentChat.meta.sender.id + ); + }, shouldShowReplyToMessage() { return ( this.inReplyTo?.id && @@ -509,6 +514,7 @@ export default { messageVariables() { const variables = getMessageVariables({ conversation: this.currentChat, + contact: this.currentContact, }); return variables; }, diff --git a/app/javascript/dashboard/components/widgets/conversation/VariableList.vue b/app/javascript/dashboard/components/widgets/conversation/VariableList.vue index 6128abe43..8c714b784 100644 --- a/app/javascript/dashboard/components/widgets/conversation/VariableList.vue +++ b/app/javascript/dashboard/components/widgets/conversation/VariableList.vue @@ -1,5 +1,9 @@