diff --git a/app/javascript/dashboard/components/ChatList.vue b/app/javascript/dashboard/components/ChatList.vue
index 61df0bf74..16865d0dc 100644
--- a/app/javascript/dashboard/components/ChatList.vue
+++ b/app/javascript/dashboard/components/ChatList.vue
@@ -121,6 +121,7 @@
@select-conversation="selectConversation"
@de-select-conversation="deSelectConversation"
@assign-agent="onAssignAgent"
+ @assign-team="onAssignTeam"
@assign-label="onAssignLabels"
@update-conversation-status="toggleConversationStatus"
@context-menu-toggle="onContextMenuToggle"
@@ -618,11 +619,44 @@ export default {
},
});
this.selectedConversations = [];
- this.showAlert(this.$t('BULK_ACTION.ASSIGN_SUCCESFUL'));
+ if (conversationId) {
+ this.showAlert(
+ this.$t(
+ 'CONVERSATION.CARD_CONTEXT_MENU.API.AGENT_ASSIGNMENT.SUCCESFUL',
+ {
+ agentName: agent.name,
+ conversationId,
+ }
+ )
+ );
+ } else {
+ this.showAlert(this.$t('BULK_ACTION.ASSIGN_SUCCESFUL'));
+ }
} catch (err) {
this.showAlert(this.$t('BULK_ACTION.ASSIGN_FAILED'));
}
},
+ async onAssignTeam(team, conversationId = null) {
+ try {
+ await this.$store.dispatch('assignTeam', {
+ conversationId,
+ teamId: team.id,
+ });
+ this.showAlert(
+ this.$t(
+ 'CONVERSATION.CARD_CONTEXT_MENU.API.TEAM_ASSIGNMENT.SUCCESFUL',
+ {
+ team: team.name,
+ conversationId,
+ }
+ )
+ );
+ } catch (error) {
+ this.showAlert(
+ this.$t('CONVERSATION.CARD_CONTEXT_MENU.API.TEAM_ASSIGNMENT.FAILED')
+ );
+ }
+ },
// Same method used in context menu, conversationId being passed from there.
async onAssignLabels(labels, conversationId = null) {
try {
@@ -634,7 +668,19 @@ export default {
},
});
this.selectedConversations = [];
- this.showAlert(this.$t('BULK_ACTION.LABELS.ASSIGN_SUCCESFUL'));
+ if (conversationId) {
+ this.showAlert(
+ this.$t(
+ 'CONVERSATION.CARD_CONTEXT_MENU.API.LABEL_ASSIGNMENT.SUCCESFUL',
+ {
+ labelName: labels[0],
+ conversationId,
+ }
+ )
+ );
+ } else {
+ this.showAlert(this.$t('BULK_ACTION.LABELS.ASSIGN_SUCCESFUL'));
+ }
} catch (err) {
this.showAlert(this.$t('BULK_ACTION.LABELS.ASSIGN_FAILED'));
}
diff --git a/app/javascript/dashboard/components/widgets/conversation/ConversationCard.vue b/app/javascript/dashboard/components/widgets/conversation/ConversationCard.vue
index b3c36928c..78e8c1988 100644
--- a/app/javascript/dashboard/components/widgets/conversation/ConversationCard.vue
+++ b/app/javascript/dashboard/components/widgets/conversation/ConversationCard.vue
@@ -105,6 +105,7 @@
@update-conversation="onUpdateConversation"
@assign-agent="onAssignAgent"
@assign-label="onAssignLabel"
+ @assign-team="onAssignTeam"
/>
@@ -352,6 +353,10 @@ export default {
this.$emit('assign-label', [label.title], [this.chat.id]);
this.closeContextMenu();
},
+ async onAssignTeam(team) {
+ this.$emit('assign-team', team, 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 32a62544d..dc5a8887f 100644
--- a/app/javascript/dashboard/components/widgets/conversation/contextMenu/Index.vue
+++ b/app/javascript/dashboard/components/widgets/conversation/contextMenu/Index.vue
@@ -6,7 +6,7 @@
:key="option.key"
:option="option"
variant="icon"
- @click.native="toggleStatus(option.key, null)"
+ @click="toggleStatus(option.key, null)"
/>
@@ -14,7 +14,7 @@
v-for="(option, i) in snoozeMenuConfig.options"
:key="i"
:option="option"
- @click.native="snoozeConversation(option.snoozedUntil)"
+ @click="snoozeConversation(option.snoozedUntil)"
/>
@@ -24,7 +24,7 @@
:key="label.id"
:option="generateMenuLabelConfig(label, 'label')"
variant="label"
- @click.native="$emit('assign-label', label)"
+ @click="$emit('assign-label', label)"
/>
@@ -36,10 +36,18 @@
:key="agent.id"
:option="generateMenuLabelConfig(agent, 'agent')"
variant="agent"
- @click.native="$emit('assign-agent', agent)"
+ @click="$emit('assign-agent', agent)"
/>
+
+
+
@@ -119,11 +127,17 @@ export default {
icon: 'person-add',
label: this.$t('CONVERSATION.CARD_CONTEXT_MENU.ASSIGN_AGENT'),
},
+ teamMenuConfig: {
+ key: 'team',
+ icon: 'people-team-add',
+ label: this.$t('CONVERSATION.CARD_CONTEXT_MENU.ASSIGN_TEAM'),
+ },
};
},
computed: {
...mapGetters({
labels: 'labels/getLabels',
+ teams: 'teams/getTeams',
assignableAgentsUiFlags: 'inboxAssignableAgents/getUIFlags',
}),
assignableAgents() {
@@ -160,6 +174,7 @@ export default {
...(type === 'text' && { label: option.label }),
...(type === 'label' && { label: option.title }),
...(type === 'agent' && { label: option.name }),
+ ...(type === 'team' && { label: option.name }),
};
},
},
diff --git a/app/javascript/dashboard/components/widgets/conversation/contextMenu/menuItem.vue b/app/javascript/dashboard/components/widgets/conversation/contextMenu/menuItem.vue
index eb4a71c6f..7534430d5 100644
--- a/app/javascript/dashboard/components/widgets/conversation/contextMenu/menuItem.vue
+++ b/app/javascript/dashboard/components/widgets/conversation/contextMenu/menuItem.vue
@@ -1,5 +1,5 @@
-