feat: Add Command bar for improved productivity (#3352)
Co-authored-by: Fayaz Ahmed <15716057+fayazara@users.noreply.github.com>
This commit is contained in:
parent
1e3f255ece
commit
e849759e15
21 changed files with 818 additions and 108 deletions
|
@ -7,9 +7,7 @@ export default {
|
|||
this.inboxId
|
||||
);
|
||||
},
|
||||
...mapGetters({
|
||||
currentUser: 'getCurrentUser',
|
||||
}),
|
||||
...mapGetters({ currentUser: 'getCurrentUser' }),
|
||||
isAgentSelected() {
|
||||
return this.currentChat?.meta?.assignee;
|
||||
},
|
||||
|
|
41
app/javascript/dashboard/mixins/conversation/labelMixin.js
Normal file
41
app/javascript/dashboard/mixins/conversation/labelMixin.js
Normal file
|
@ -0,0 +1,41 @@
|
|||
import { mapGetters } from 'vuex';
|
||||
|
||||
export default {
|
||||
computed: {
|
||||
...mapGetters({ accountLabels: 'labels/getLabels' }),
|
||||
savedLabels() {
|
||||
return this.$store.getters['conversationLabels/getConversationLabels'](
|
||||
this.conversationId
|
||||
);
|
||||
},
|
||||
activeLabels() {
|
||||
return this.accountLabels.filter(({ title }) =>
|
||||
this.savedLabels.includes(title)
|
||||
);
|
||||
},
|
||||
inactiveLabels() {
|
||||
return this.accountLabels.filter(
|
||||
({ title }) => !this.savedLabels.includes(title)
|
||||
);
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
addLabelToConversation(value) {
|
||||
const result = this.activeLabels.map(item => item.title);
|
||||
result.push(value.title);
|
||||
this.onUpdateLabels(result);
|
||||
},
|
||||
removeLabelFromConversation(value) {
|
||||
const result = this.activeLabels
|
||||
.map(label => label.title)
|
||||
.filter(label => label !== value);
|
||||
this.onUpdateLabels(result);
|
||||
},
|
||||
async onUpdateLabels(selectedLabels) {
|
||||
this.$store.dispatch('conversationLabels/update', {
|
||||
conversationId: this.conversationId,
|
||||
labels: selectedLabels,
|
||||
});
|
||||
},
|
||||
},
|
||||
};
|
22
app/javascript/dashboard/mixins/conversation/teamMixin.js
Normal file
22
app/javascript/dashboard/mixins/conversation/teamMixin.js
Normal file
|
@ -0,0 +1,22 @@
|
|||
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;
|
||||
},
|
||||
},
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue