feat: Replace conversation/teamMixin within the components (#9923)

This commit is contained in:
Sivin Varghese
2024-08-11 10:09:08 +05:30
committed by GitHub
parent 3558878ae2
commit d5f34bf9d0
5 changed files with 29 additions and 28 deletions

View File

@@ -7,7 +7,8 @@
"LEARN_MORE": "Learn more about teams", "LEARN_MORE": "Learn more about teams",
"LIST": { "LIST": {
"404": "There are no teams created on this account.", "404": "There are no teams created on this account.",
"EDIT_TEAM": "Edit team" "EDIT_TEAM": "Edit team",
"NONE": "None"
}, },
"CREATE_FLOW": { "CREATE_FLOW": {
"CREATE": { "CREATE": {

View File

@@ -1,22 +0,0 @@
import { mapGetters } from 'vuex';
export default {
computed: {
...mapGetters({ teams: 'teams/getTeams' }),
hasAnAssignedTeam() {
return !!this.currentChat?.meta?.team;
},
teamsList() {
if (this.hasAnAssignedTeam) {
return [
{
id: 0,
name: 'None',
},
...this.teams,
];
}
return this.teams;
},
},
};

View File

@@ -8,7 +8,6 @@ import goToCommandHotKeys from './goToCommandHotKeys';
import appearanceHotKeys from './appearanceHotKeys'; import appearanceHotKeys from './appearanceHotKeys';
import agentMixin from 'dashboard/mixins/agentMixin'; import agentMixin from 'dashboard/mixins/agentMixin';
import conversationLabelMixin from 'dashboard/mixins/conversation/labelMixin'; import conversationLabelMixin from 'dashboard/mixins/conversation/labelMixin';
import conversationTeamMixin from 'dashboard/mixins/conversation/teamMixin';
import { GENERAL_EVENTS } from '../../../helper/AnalyticsHelper/events'; import { GENERAL_EVENTS } from '../../../helper/AnalyticsHelper/events';
export default { export default {
@@ -18,7 +17,6 @@ export default {
bulkActionsHotKeysMixin, bulkActionsHotKeysMixin,
inboxHotKeysMixin, inboxHotKeysMixin,
conversationLabelMixin, conversationLabelMixin,
conversationTeamMixin,
appearanceHotKeys, appearanceHotKeys,
goToCommandHotKeys, goToCommandHotKeys,
], ],

View File

@@ -65,6 +65,7 @@ export default {
currentChat: 'getSelectedChat', currentChat: 'getSelectedChat',
replyMode: 'draftMessages/getReplyEditorMode', replyMode: 'draftMessages/getReplyEditorMode',
contextMenuChatId: 'getContextMenuChatId', contextMenuChatId: 'getContextMenuChatId',
teams: 'teams/getTeams',
}), }),
draftMessage() { draftMessage() {
return this.$store.getters['draftMessages/get'](this.draftKey); return this.$store.getters['draftMessages/get'](this.draftKey);
@@ -78,7 +79,18 @@ export default {
conversationId() { conversationId() {
return this.currentChat?.id; return this.currentChat?.id;
}, },
hasAnAssignedTeam() {
return !!this.currentChat?.meta?.team;
},
teamsList() {
if (this.hasAnAssignedTeam) {
return [
{ id: 0, name: this.$t('TEAMS_SETTINGS.LIST.NONE') },
...this.teams,
];
}
return this.teams;
},
statusActions() { statusActions() {
const isOpen = const isOpen =
this.currentChat?.status === wootConstants.STATUS_TYPE.OPEN; this.currentChat?.status === wootConstants.STATUS_TYPE.OPEN;

View File

@@ -6,7 +6,6 @@ import ContactDetailsItem from './ContactDetailsItem.vue';
import MultiselectDropdown from 'shared/components/ui/MultiselectDropdown.vue'; import MultiselectDropdown from 'shared/components/ui/MultiselectDropdown.vue';
import ConversationLabels from './labels/LabelBox.vue'; import ConversationLabels from './labels/LabelBox.vue';
import agentMixin from 'dashboard/mixins/agentMixin'; import agentMixin from 'dashboard/mixins/agentMixin';
import teamMixin from 'dashboard/mixins/conversation/teamMixin';
import { CONVERSATION_PRIORITY } from '../../../../shared/constants/messages'; import { CONVERSATION_PRIORITY } from '../../../../shared/constants/messages';
import { CONVERSATION_EVENTS } from '../../../helper/AnalyticsHelper/events'; import { CONVERSATION_EVENTS } from '../../../helper/AnalyticsHelper/events';
@@ -16,7 +15,7 @@ export default {
MultiselectDropdown, MultiselectDropdown,
ConversationLabels, ConversationLabels,
}, },
mixins: [agentMixin, teamMixin], mixins: [agentMixin],
props: { props: {
conversationId: { conversationId: {
type: [Number, String], type: [Number, String],
@@ -65,7 +64,20 @@ export default {
...mapGetters({ ...mapGetters({
currentChat: 'getSelectedChat', currentChat: 'getSelectedChat',
currentUser: 'getCurrentUser', currentUser: 'getCurrentUser',
teams: 'teams/getTeams',
}), }),
hasAnAssignedTeam() {
return !!this.currentChat?.meta?.team;
},
teamsList() {
if (this.hasAnAssignedTeam) {
return [
{ id: 0, name: this.$t('TEAMS_SETTINGS.LIST.NONE') },
...this.teams,
];
}
return this.teams;
},
assignedAgent: { assignedAgent: {
get() { get() {
return this.currentChat.meta.assignee; return this.currentChat.meta.assignee;