diff --git a/app/javascript/dashboard/components/ChatList.vue b/app/javascript/dashboard/components/ChatList.vue index dd9e353b8..990ea9e02 100644 --- a/app/javascript/dashboard/components/ChatList.vue +++ b/app/javascript/dashboard/components/ChatList.vue @@ -125,6 +125,7 @@ @update-conversation-status="toggleConversationStatus" @context-menu-toggle="onContextMenuToggle" @mark-as-unread="markAsUnread" + @assign-priority="assignPriority" />
@@ -670,6 +671,22 @@ export default { this.showAlert(this.$t('BULK_ACTION.ASSIGN_FAILED')); } }, + async assignPriority(priority, conversationId = null) { + this.$store.dispatch('setCurrentChatPriority', { + priority, + conversationId, + }); + this.$store + .dispatch('assignPriority', { conversationId, priority }) + .then(() => { + this.showAlert( + this.$t('CONVERSATION.PRIORITY.CHANGE_PRIORITY.SUCCESSFUL', { + priority, + conversationId, + }) + ); + }); + }, async markAsUnread(conversationId) { try { await this.$store.dispatch('markMessagesUnread', { diff --git a/app/javascript/dashboard/components/widgets/conversation/ConversationCard.vue b/app/javascript/dashboard/components/widgets/conversation/ConversationCard.vue index 397928e75..d2d49580a 100644 --- a/app/javascript/dashboard/components/widgets/conversation/ConversationCard.vue +++ b/app/javascript/dashboard/components/widgets/conversation/ConversationCard.vue @@ -109,12 +109,14 @@
@@ -375,6 +377,10 @@ export default { this.$emit('mark-as-unread', this.chat.id); this.closeContextMenu(); }, + async assignPriority(priority) { + this.$emit('assign-priority', priority, this.chat.id); + this.closeContextMenu(); + }, }, }; diff --git a/app/javascript/dashboard/components/widgets/conversation/contextMenu/Index.vue b/app/javascript/dashboard/components/widgets/conversation/contextMenu/Index.vue index acbfa5575..ca7117cfc 100644 --- a/app/javascript/dashboard/components/widgets/conversation/contextMenu/Index.vue +++ b/app/javascript/dashboard/components/widgets/conversation/contextMenu/Index.vue @@ -23,6 +23,14 @@ @click="snoozeConversation(option.snoozedUntil)" /> + + + item.key !== this.priority), + }, labelMenuConfig: { key: 'label', icon: 'tag', @@ -193,6 +232,9 @@ export default { this.snoozeTimes[snoozedUntil] || null ); }, + assignPriority(priority) { + this.$emit('assign-priority', priority); + }, show(key) { // If the conversation status is same as the action, then don't display the option // i.e.: Don't show an option to resolve if the conversation is already resolved.