fix: update onboarding status when deal status is changed
This commit is contained in:
parent
41c65eb777
commit
5862745253
@ -149,6 +149,20 @@ const steps = reactive([
|
|||||||
title: 'Change deal status',
|
title: 'Change deal status',
|
||||||
icon: markRaw(StepsIcon),
|
icon: markRaw(StepsIcon),
|
||||||
completed: false,
|
completed: false,
|
||||||
|
onClick: async () => {
|
||||||
|
minimize.value = true
|
||||||
|
let deal = await getFirstDeal()
|
||||||
|
|
||||||
|
if (deal) {
|
||||||
|
router.push({
|
||||||
|
name: 'Deal',
|
||||||
|
params: { dealId: deal },
|
||||||
|
hash: '#activity',
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
router.push({ name: 'Leads' })
|
||||||
|
}
|
||||||
|
},
|
||||||
},
|
},
|
||||||
])
|
])
|
||||||
|
|
||||||
|
|||||||
@ -330,6 +330,10 @@ import { getSettings } from '@/stores/settings'
|
|||||||
import { globalStore } from '@/stores/global'
|
import { globalStore } from '@/stores/global'
|
||||||
import { statusesStore } from '@/stores/statuses'
|
import { statusesStore } from '@/stores/statuses'
|
||||||
import { whatsappEnabled, callEnabled } from '@/composables/settings'
|
import { whatsappEnabled, callEnabled } from '@/composables/settings'
|
||||||
|
import {
|
||||||
|
isOnboardingStepsCompleted,
|
||||||
|
useOnboarding,
|
||||||
|
} from '@/composables/onboarding'
|
||||||
import {
|
import {
|
||||||
createResource,
|
createResource,
|
||||||
Dropdown,
|
Dropdown,
|
||||||
@ -347,6 +351,8 @@ import { useActiveTabManager } from '@/composables/useActiveTabManager'
|
|||||||
const { brand } = getSettings()
|
const { brand } = getSettings()
|
||||||
const { $dialog, $socket, makeCall } = globalStore()
|
const { $dialog, $socket, makeCall } = globalStore()
|
||||||
const { statusOptions, getDealStatus } = statusesStore()
|
const { statusOptions, getDealStatus } = statusesStore()
|
||||||
|
const { updateOnboardingStep } = useOnboarding()
|
||||||
|
|
||||||
const route = useRoute()
|
const route = useRoute()
|
||||||
const router = useRouter()
|
const router = useRouter()
|
||||||
|
|
||||||
@ -690,6 +696,10 @@ function triggerCall() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function updateField(name, value, callback) {
|
function updateField(name, value, callback) {
|
||||||
|
if (name == 'status' && !isOnboardingStepsCompleted.value) {
|
||||||
|
updateOnboardingStep('change_deal_status')
|
||||||
|
}
|
||||||
|
|
||||||
updateDeal(name, value, () => {
|
updateDeal(name, value, () => {
|
||||||
deal.data[name] = value
|
deal.data[name] = value
|
||||||
callback?.()
|
callback?.()
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user