fix: removed setuAssignees code
This commit is contained in:
parent
e214ce8bfb
commit
44df09fac2
@ -13,7 +13,6 @@ def get_deal(name):
|
||||
|
||||
deal["fields_meta"] = get_fields_meta("CRM Deal")
|
||||
deal["_form_script"] = get_form_script("CRM Deal")
|
||||
deal["_assign"] = get_assigned_users("CRM Deal", deal.name)
|
||||
return deal
|
||||
|
||||
|
||||
|
||||
@ -13,5 +13,4 @@ def get_lead(name):
|
||||
|
||||
lead["fields_meta"] = get_fields_meta("CRM Lead")
|
||||
lead["_form_script"] = get_form_script("CRM Lead")
|
||||
lead["_assign"] = get_assigned_users("CRM Lead", lead.name)
|
||||
return lead
|
||||
|
||||
@ -334,12 +334,7 @@ import Section from '@/components/Section.vue'
|
||||
import SidePanelLayout from '@/components/SidePanelLayout.vue'
|
||||
import SLASection from '@/components/SLASection.vue'
|
||||
import CustomActions from '@/components/CustomActions.vue'
|
||||
import {
|
||||
openWebsite,
|
||||
setupAssignees,
|
||||
setupCustomizations,
|
||||
copyToClipboard,
|
||||
} from '@/utils'
|
||||
import { openWebsite, setupCustomizations, copyToClipboard } from '@/utils'
|
||||
import { getView } from '@/utils/view'
|
||||
import { getSettings } from '@/stores/settings'
|
||||
import { globalStore } from '@/stores/global'
|
||||
@ -399,7 +394,6 @@ const deal = createResource({
|
||||
organization.fetch()
|
||||
}
|
||||
|
||||
setupAssignees(deal)
|
||||
setupCustomizations(deal, {
|
||||
doc: data,
|
||||
$dialog,
|
||||
@ -727,8 +721,8 @@ function openEmailBox() {
|
||||
|
||||
const { assignees, document } = useDocument('CRM Deal', props.dealId)
|
||||
|
||||
function reloadAssignees(changes) {
|
||||
if (changes?.hasOwnProperty('lead_owner')) {
|
||||
function reloadAssignees(data) {
|
||||
if (data?.hasOwnProperty('deal_owner')) {
|
||||
assignees.reload()
|
||||
}
|
||||
}
|
||||
|
||||
@ -337,12 +337,7 @@ import SidePanelLayout from '@/components/SidePanelLayout.vue'
|
||||
import FieldLayout from '@/components/FieldLayout/FieldLayout.vue'
|
||||
import SLASection from '@/components/SLASection.vue'
|
||||
import CustomActions from '@/components/CustomActions.vue'
|
||||
import {
|
||||
openWebsite,
|
||||
setupAssignees,
|
||||
setupCustomizations,
|
||||
copyToClipboard,
|
||||
} from '@/utils'
|
||||
import { openWebsite, setupCustomizations, copyToClipboard } from '@/utils'
|
||||
import { showQuickEntryModal, quickEntryProps } from '@/composables/modals'
|
||||
import { getView } from '@/utils/view'
|
||||
import { getSettings } from '@/stores/settings'
|
||||
@ -405,7 +400,6 @@ const lead = createResource({
|
||||
onSuccess: (data) => {
|
||||
errorTitle.value = ''
|
||||
errorMessage.value = ''
|
||||
setupAssignees(lead)
|
||||
setupCustomizations(lead, {
|
||||
doc: data,
|
||||
$dialog,
|
||||
@ -717,8 +711,8 @@ function openQuickEntryModal() {
|
||||
showConvertToDealModal.value = false
|
||||
}
|
||||
|
||||
function reloadAssignees(changes) {
|
||||
if (changes?.hasOwnProperty('lead_owner')) {
|
||||
function reloadAssignees(data) {
|
||||
if (data?.hasOwnProperty('lead_owner')) {
|
||||
assignees.reload()
|
||||
}
|
||||
}
|
||||
|
||||
@ -36,8 +36,8 @@
|
||||
class="flex h-12 items-center justify-between gap-2 border-b px-3 py-2.5"
|
||||
>
|
||||
<AssignTo
|
||||
v-model="deal.data._assignedTo"
|
||||
:data="deal.data"
|
||||
v-model="assignees.data"
|
||||
:data="document.doc"
|
||||
doctype="CRM Deal"
|
||||
/>
|
||||
<div class="flex items-center gap-2">
|
||||
@ -66,6 +66,7 @@
|
||||
doctype="CRM Deal"
|
||||
:docname="deal.data.name"
|
||||
@reload="sections.reload"
|
||||
@afterFieldChange="reloadAssignees"
|
||||
>
|
||||
<template #actions="{ section }">
|
||||
<div v-if="section.name == 'contacts_section'" class="pr-2">
|
||||
@ -258,12 +259,13 @@ import Link from '@/components/Controls/Link.vue'
|
||||
import SidePanelLayout from '@/components/SidePanelLayout.vue'
|
||||
import SLASection from '@/components/SLASection.vue'
|
||||
import CustomActions from '@/components/CustomActions.vue'
|
||||
import { setupAssignees, setupCustomizations } from '@/utils'
|
||||
import { setupCustomizations } from '@/utils'
|
||||
import { getView } from '@/utils/view'
|
||||
import { getSettings } from '@/stores/settings'
|
||||
import { globalStore } from '@/stores/global'
|
||||
import { statusesStore } from '@/stores/statuses'
|
||||
import { getMeta } from '@/stores/meta'
|
||||
import { useDocument } from '@/data/document'
|
||||
import {
|
||||
whatsappEnabled,
|
||||
callEnabled,
|
||||
@ -311,7 +313,6 @@ const deal = createResource({
|
||||
organization.fetch()
|
||||
}
|
||||
|
||||
setupAssignees(deal)
|
||||
setupCustomizations(deal, {
|
||||
doc: data,
|
||||
$dialog,
|
||||
@ -605,4 +606,12 @@ async function deleteDeal(name) {
|
||||
})
|
||||
router.push({ name: 'Deals' })
|
||||
}
|
||||
|
||||
const { assignees, document } = useDocument('CRM Deal', props.dealId)
|
||||
|
||||
function reloadAssignees(data) {
|
||||
if (data?.hasOwnProperty('deal_owner')) {
|
||||
assignees.reload()
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@ -36,8 +36,8 @@
|
||||
class="flex h-12 items-center justify-between gap-2 border-b px-3 py-2.5"
|
||||
>
|
||||
<AssignTo
|
||||
v-model="lead.data._assignedTo"
|
||||
:data="lead.data"
|
||||
v-model="assignees.data"
|
||||
:data="document.doc"
|
||||
doctype="CRM Lead"
|
||||
/>
|
||||
<div class="flex items-center gap-2">
|
||||
@ -71,6 +71,7 @@
|
||||
doctype="CRM Lead"
|
||||
:docname="lead.data.name"
|
||||
@reload="sections.reload"
|
||||
@afterFieldChange="reloadAssignees"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
@ -173,12 +174,13 @@ import Link from '@/components/Controls/Link.vue'
|
||||
import SidePanelLayout from '@/components/SidePanelLayout.vue'
|
||||
import SLASection from '@/components/SLASection.vue'
|
||||
import CustomActions from '@/components/CustomActions.vue'
|
||||
import { setupAssignees, setupCustomizations } from '@/utils'
|
||||
import { setupCustomizations } from '@/utils'
|
||||
import { getView } from '@/utils/view'
|
||||
import { getSettings } from '@/stores/settings'
|
||||
import { globalStore } from '@/stores/global'
|
||||
import { statusesStore } from '@/stores/statuses'
|
||||
import { getMeta } from '@/stores/meta'
|
||||
import { useDocument } from '@/data/document'
|
||||
import {
|
||||
whatsappEnabled,
|
||||
callEnabled,
|
||||
@ -220,7 +222,6 @@ const lead = createResource({
|
||||
params: { name: props.leadId },
|
||||
cache: ['lead', props.leadId],
|
||||
onSuccess: (data) => {
|
||||
setupAssignees(lead)
|
||||
setupCustomizations(lead, {
|
||||
doc: data,
|
||||
$dialog,
|
||||
@ -454,4 +455,12 @@ async function convertToDeal() {
|
||||
router.push({ name: 'Deal', params: { dealId: deal } })
|
||||
}
|
||||
}
|
||||
|
||||
const { assignees, document } = useDocument('CRM Lead', props.leadId)
|
||||
|
||||
function reloadAssignees(data) {
|
||||
if (data?.hasOwnProperty('lead_owner')) {
|
||||
assignees.reload()
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@ -211,16 +211,6 @@ export function validateEmail(email) {
|
||||
return regExp.test(email)
|
||||
}
|
||||
|
||||
export function setupAssignees(doc) {
|
||||
let { getUser } = usersStore()
|
||||
let assignees = doc.data?._assign || []
|
||||
doc.data._assignedTo = assignees.map((user) => ({
|
||||
name: user,
|
||||
image: getUser(user).user_image,
|
||||
label: getUser(user).full_name,
|
||||
}))
|
||||
}
|
||||
|
||||
export function parseAssignees(assignees) {
|
||||
let { getUser } = usersStore()
|
||||
return assignees.map((user) => ({
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user