fix: Disable "none" option from agent dropdown If agent is not selected (#2687)
This commit is contained in:
parent
a7ca55c080
commit
6b6df7a70d
2 changed files with 19 additions and 9 deletions
|
@ -10,17 +10,24 @@ export default {
|
||||||
...mapGetters({
|
...mapGetters({
|
||||||
currentUser: 'getCurrentUser',
|
currentUser: 'getCurrentUser',
|
||||||
}),
|
}),
|
||||||
|
isAgentSelected() {
|
||||||
|
return this.currentChat?.meta?.assignee;
|
||||||
|
},
|
||||||
agentsList() {
|
agentsList() {
|
||||||
const agents = this.assignableAgents || [];
|
const agents = this.assignableAgents || [];
|
||||||
return [
|
return [
|
||||||
{
|
...(this.isAgentSelected
|
||||||
confirmed: true,
|
? [
|
||||||
name: 'None',
|
{
|
||||||
id: 0,
|
confirmed: true,
|
||||||
role: 'agent',
|
name: 'None',
|
||||||
account_id: 0,
|
id: 0,
|
||||||
email: 'None',
|
role: 'agent',
|
||||||
},
|
account_id: 0,
|
||||||
|
email: 'None',
|
||||||
|
},
|
||||||
|
]
|
||||||
|
: []),
|
||||||
...agents,
|
...agents,
|
||||||
].map(item =>
|
].map(item =>
|
||||||
item.id === this.currentUser.id
|
item.id === this.currentUser.id
|
||||||
|
|
|
@ -24,7 +24,10 @@ describe('agentMixin', () => {
|
||||||
title: 'TestComponent',
|
title: 'TestComponent',
|
||||||
mixins: [agentMixin],
|
mixins: [agentMixin],
|
||||||
data() {
|
data() {
|
||||||
return { inboxId: 1 };
|
return {
|
||||||
|
inboxId: 1,
|
||||||
|
currentChat: { meta: { assignee: { name: 'John' } } },
|
||||||
|
};
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
assignableAgents() {
|
assignableAgents() {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue