fix: store firstLead & firstDeal per user
(cherry picked from commit 44523a0392daae4a1b31f86dd0508be0339cca75)
This commit is contained in:
parent
af5bef08ca
commit
a514a99a75
@ -169,6 +169,7 @@ import {
|
|||||||
notificationsStore,
|
notificationsStore,
|
||||||
} from '@/stores/notifications'
|
} from '@/stores/notifications'
|
||||||
import { usersStore } from '@/stores/users'
|
import { usersStore } from '@/stores/users'
|
||||||
|
import { sessionStore } from '@/stores/session'
|
||||||
import { showSettings, activeSettingsPage } from '@/composables/settings'
|
import { showSettings, activeSettingsPage } from '@/composables/settings'
|
||||||
import { FeatherIcon, call } from 'frappe-ui'
|
import { FeatherIcon, call } from 'frappe-ui'
|
||||||
import {
|
import {
|
||||||
@ -300,17 +301,18 @@ function getIcon(routeName, icon) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// onboarding
|
// onboarding
|
||||||
|
const { user } = sessionStore()
|
||||||
const { users, isManager } = usersStore()
|
const { users, isManager } = usersStore()
|
||||||
const { isOnboardingStepsCompleted, setUp } = useOnboarding('frappecrm')
|
const { isOnboardingStepsCompleted, setUp } = useOnboarding('frappecrm')
|
||||||
|
|
||||||
async function getFirstLead() {
|
async function getFirstLead() {
|
||||||
let firstLead = localStorage.getItem('firstLead')
|
let firstLead = localStorage.getItem('firstLead' + user)
|
||||||
if (firstLead) return firstLead
|
if (firstLead) return firstLead
|
||||||
return await call('crm.api.onboarding.get_first_lead')
|
return await call('crm.api.onboarding.get_first_lead')
|
||||||
}
|
}
|
||||||
|
|
||||||
async function getFirstDeal() {
|
async function getFirstDeal() {
|
||||||
let firstDeal = localStorage.getItem('firstDeal')
|
let firstDeal = localStorage.getItem('firstDeal' + user)
|
||||||
if (firstDeal) return firstDeal
|
if (firstDeal) return firstDeal
|
||||||
return await call('crm.api.onboarding.get_first_deal')
|
return await call('crm.api.onboarding.get_first_deal')
|
||||||
}
|
}
|
||||||
|
|||||||
@ -46,6 +46,7 @@ import EditIcon from '@/components/Icons/EditIcon.vue'
|
|||||||
import FieldLayout from '@/components/FieldLayout/FieldLayout.vue'
|
import FieldLayout from '@/components/FieldLayout/FieldLayout.vue'
|
||||||
import { usersStore } from '@/stores/users'
|
import { usersStore } from '@/stores/users'
|
||||||
import { statusesStore } from '@/stores/statuses'
|
import { statusesStore } from '@/stores/statuses'
|
||||||
|
import { sessionStore } from '@/stores/session'
|
||||||
import { isMobileView } from '@/composables/settings'
|
import { isMobileView } from '@/composables/settings'
|
||||||
import { capture } from '@/telemetry'
|
import { capture } from '@/telemetry'
|
||||||
import { createResource } from 'frappe-ui'
|
import { createResource } from 'frappe-ui'
|
||||||
@ -57,6 +58,7 @@ const props = defineProps({
|
|||||||
defaults: Object,
|
defaults: Object,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
const { user } = sessionStore()
|
||||||
const { getUser, isManager } = usersStore()
|
const { getUser, isManager } = usersStore()
|
||||||
const { getLeadStatus, statusOptions } = statusesStore()
|
const { getLeadStatus, statusOptions } = statusesStore()
|
||||||
const { updateOnboardingStep } = useOnboarding('frappecrm')
|
const { updateOnboardingStep } = useOnboarding('frappecrm')
|
||||||
@ -169,7 +171,7 @@ function createNewLead() {
|
|||||||
show.value = false
|
show.value = false
|
||||||
router.push({ name: 'Lead', params: { leadId: data.name } })
|
router.push({ name: 'Lead', params: { leadId: data.name } })
|
||||||
updateOnboardingStep('create_first_lead', true, false, () => {
|
updateOnboardingStep('create_first_lead', true, false, () => {
|
||||||
localStorage.setItem('firstLead', data.name)
|
localStorage.setItem('firstLead' + user, data.name)
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
onError(err) {
|
onError(err) {
|
||||||
|
|||||||
@ -352,6 +352,7 @@ import {
|
|||||||
} from '@/utils'
|
} from '@/utils'
|
||||||
import { getView } from '@/utils/view'
|
import { getView } from '@/utils/view'
|
||||||
import { getSettings } from '@/stores/settings'
|
import { getSettings } from '@/stores/settings'
|
||||||
|
import { sessionStore } from '@/stores/session'
|
||||||
import { usersStore } from '@/stores/users'
|
import { usersStore } from '@/stores/users'
|
||||||
import { globalStore } from '@/stores/global'
|
import { globalStore } from '@/stores/global'
|
||||||
import { statusesStore } from '@/stores/statuses'
|
import { statusesStore } from '@/stores/statuses'
|
||||||
@ -380,6 +381,7 @@ import { useRouter, useRoute } from 'vue-router'
|
|||||||
import { useActiveTabManager } from '@/composables/useActiveTabManager'
|
import { useActiveTabManager } from '@/composables/useActiveTabManager'
|
||||||
|
|
||||||
const { brand } = getSettings()
|
const { brand } = getSettings()
|
||||||
|
const { user } = sessionStore()
|
||||||
const { isManager } = usersStore()
|
const { isManager } = usersStore()
|
||||||
const { $dialog, $socket, makeCall } = globalStore()
|
const { $dialog, $socket, makeCall } = globalStore()
|
||||||
const { statusOptions, getLeadStatus, getDealStatus } = statusesStore()
|
const { statusOptions, getLeadStatus, getDealStatus } = statusesStore()
|
||||||
@ -675,7 +677,7 @@ async function convertToDeal() {
|
|||||||
existingContact.value = ''
|
existingContact.value = ''
|
||||||
existingOrganization.value = ''
|
existingOrganization.value = ''
|
||||||
updateOnboardingStep('convert_lead_to_deal', true, false, () => {
|
updateOnboardingStep('convert_lead_to_deal', true, false, () => {
|
||||||
localStorage.setItem('firstDeal', _deal)
|
localStorage.setItem('firstDeal' + user, _deal)
|
||||||
})
|
})
|
||||||
capture('convert_lead_to_deal')
|
capture('convert_lead_to_deal')
|
||||||
router.push({ name: 'Deal', params: { dealId: _deal } })
|
router.push({ name: 'Deal', params: { dealId: _deal } })
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user