fix: use activeAgents utils
This commit is contained in:
parent
c65b1ce50f
commit
2772cedadd
@ -67,7 +67,7 @@
|
|||||||
import IndicatorIcon from '@/components/Icons/IndicatorIcon.vue'
|
import IndicatorIcon from '@/components/Icons/IndicatorIcon.vue'
|
||||||
import UserAvatar from '@/components/UserAvatar.vue'
|
import UserAvatar from '@/components/UserAvatar.vue'
|
||||||
import { usersStore } from '@/stores/users'
|
import { usersStore } from '@/stores/users'
|
||||||
import { dealStatuses, statusDropdownOptions } from '@/utils'
|
import { dealStatuses, statusDropdownOptions, activeAgents } from '@/utils'
|
||||||
import {
|
import {
|
||||||
FormControl,
|
FormControl,
|
||||||
Button,
|
Button,
|
||||||
@ -153,18 +153,4 @@ const allFields = [
|
|||||||
],
|
],
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
|
|
||||||
const activeAgents = computed(() => {
|
|
||||||
const nonAgents = ['Administrator', 'Guest']
|
|
||||||
return users.data
|
|
||||||
.filter((user) => !nonAgents.includes(user.name))
|
|
||||||
.sort((a, b) => a.full_name - b.full_name)
|
|
||||||
.map((user) => {
|
|
||||||
return {
|
|
||||||
label: user.full_name,
|
|
||||||
value: user.email,
|
|
||||||
...user,
|
|
||||||
}
|
|
||||||
})
|
|
||||||
})
|
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
<div v-for="section in allFields" :key="section.section">
|
<div v-for="section in allFields" :key="section.section">
|
||||||
<div class="grid grid-cols-3 gap-4">
|
<div class="grid grid-cols-3 gap-4">
|
||||||
<div v-for="field in section.fields" :key="field.name">
|
<div v-for="field in section.fields" :key="field.name">
|
||||||
<div class="text-gray-600 text-sm mb-2">{{ field.label }}</div>
|
<div class="mb-2 text-sm text-gray-600">{{ field.label }}</div>
|
||||||
<FormControl
|
<FormControl
|
||||||
v-if="field.type === 'select'"
|
v-if="field.type === 'select'"
|
||||||
type="select"
|
type="select"
|
||||||
@ -41,10 +41,12 @@
|
|||||||
<template #default="{ open }">
|
<template #default="{ open }">
|
||||||
<Button
|
<Button
|
||||||
:label="newLead[field.name]"
|
:label="newLead[field.name]"
|
||||||
class="justify-between w-full"
|
class="w-full justify-between"
|
||||||
>
|
>
|
||||||
<template #prefix>
|
<template #prefix>
|
||||||
<IndicatorIcon :class="leadStatuses[newLead[field.name]].color" />
|
<IndicatorIcon
|
||||||
|
:class="leadStatuses[newLead[field.name]].color"
|
||||||
|
/>
|
||||||
</template>
|
</template>
|
||||||
<template #default>{{ newLead[field.name] }}</template>
|
<template #default>{{ newLead[field.name] }}</template>
|
||||||
<template #suffix>
|
<template #suffix>
|
||||||
@ -67,7 +69,7 @@
|
|||||||
import IndicatorIcon from '@/components/Icons/IndicatorIcon.vue'
|
import IndicatorIcon from '@/components/Icons/IndicatorIcon.vue'
|
||||||
import UserAvatar from '@/components/UserAvatar.vue'
|
import UserAvatar from '@/components/UserAvatar.vue'
|
||||||
import { usersStore } from '@/stores/users'
|
import { usersStore } from '@/stores/users'
|
||||||
import { leadStatuses, statusDropdownOptions } from '@/utils'
|
import { leadStatuses, statusDropdownOptions, activeAgents } from '@/utils'
|
||||||
import {
|
import {
|
||||||
FormControl,
|
FormControl,
|
||||||
Button,
|
Button,
|
||||||
@ -153,19 +155,4 @@ const allFields = [
|
|||||||
],
|
],
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
|
|
||||||
const activeAgents = computed(() => {
|
|
||||||
const nonAgents = ['Administrator', 'Guest']
|
|
||||||
return users.data
|
|
||||||
.filter((user) => !nonAgents.includes(user.name))
|
|
||||||
.sort((a, b) => a.full_name - b.full_name)
|
|
||||||
.map((user) => {
|
|
||||||
return {
|
|
||||||
label: user.full_name,
|
|
||||||
value: user.email,
|
|
||||||
...user,
|
|
||||||
}
|
|
||||||
})
|
|
||||||
})
|
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@ -322,6 +322,7 @@ import {
|
|||||||
statusDropdownOptions,
|
statusDropdownOptions,
|
||||||
openWebsite,
|
openWebsite,
|
||||||
createToast,
|
createToast,
|
||||||
|
activeAgents,
|
||||||
} from '@/utils'
|
} from '@/utils'
|
||||||
import { usersStore } from '@/stores/users'
|
import { usersStore } from '@/stores/users'
|
||||||
import { contactsStore } from '@/stores/contacts'
|
import { contactsStore } from '@/stores/contacts'
|
||||||
@ -523,20 +524,6 @@ const detailSections = computed(() => {
|
|||||||
]
|
]
|
||||||
})
|
})
|
||||||
|
|
||||||
const activeAgents = computed(() => {
|
|
||||||
const nonAgents = ['Administrator', 'Guest']
|
|
||||||
return users.data
|
|
||||||
.filter((user) => !nonAgents.includes(user.name))
|
|
||||||
.sort((a, b) => a.full_name - b.full_name)
|
|
||||||
.map((user) => {
|
|
||||||
return {
|
|
||||||
label: user.full_name,
|
|
||||||
value: user.email,
|
|
||||||
...user,
|
|
||||||
}
|
|
||||||
})
|
|
||||||
})
|
|
||||||
|
|
||||||
function updateAssignedAgent(email) {
|
function updateAssignedAgent(email) {
|
||||||
deal.data.lead_owner = email
|
deal.data.lead_owner = email
|
||||||
updateDeal('lead_owner', email)
|
updateDeal('lead_owner', email)
|
||||||
|
|||||||
@ -293,6 +293,7 @@ import {
|
|||||||
statusDropdownOptions,
|
statusDropdownOptions,
|
||||||
openWebsite,
|
openWebsite,
|
||||||
createToast,
|
createToast,
|
||||||
|
activeAgents,
|
||||||
} from '@/utils'
|
} from '@/utils'
|
||||||
import { usersStore } from '@/stores/users'
|
import { usersStore } from '@/stores/users'
|
||||||
import { contactsStore } from '@/stores/contacts'
|
import { contactsStore } from '@/stores/contacts'
|
||||||
@ -516,20 +517,6 @@ const detailSections = computed(() => {
|
|||||||
]
|
]
|
||||||
})
|
})
|
||||||
|
|
||||||
const activeAgents = computed(() => {
|
|
||||||
const nonAgents = ['Administrator', 'admin@example.com', 'Guest']
|
|
||||||
return users.data
|
|
||||||
.filter((user) => !nonAgents.includes(user.name))
|
|
||||||
.sort((a, b) => a.full_name - b.full_name)
|
|
||||||
.map((user) => {
|
|
||||||
return {
|
|
||||||
label: user.full_name,
|
|
||||||
value: user.email,
|
|
||||||
...user,
|
|
||||||
}
|
|
||||||
})
|
|
||||||
})
|
|
||||||
|
|
||||||
function convertToDeal() {
|
function convertToDeal() {
|
||||||
lead.data.status = 'Qualified'
|
lead.data.status = 'Qualified'
|
||||||
lead.data.is_deal = 1
|
lead.data.is_deal = 1
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user