fix: update onboarding status when first task is created
This commit is contained in:
parent
4d74943ebc
commit
c07aa03c47
@ -29,3 +29,14 @@ def get_first_non_converted_lead():
|
|||||||
limit=1,
|
limit=1,
|
||||||
)
|
)
|
||||||
return lead[0].name if lead else None
|
return lead[0].name if lead else None
|
||||||
|
|
||||||
|
|
||||||
|
@frappe.whitelist()
|
||||||
|
def get_first_deal():
|
||||||
|
deal = frappe.get_all(
|
||||||
|
"CRM Deal",
|
||||||
|
fields=["name"],
|
||||||
|
order_by="creation",
|
||||||
|
limit=1,
|
||||||
|
)
|
||||||
|
return deal[0].name if deal else None
|
||||||
|
|||||||
@ -117,6 +117,7 @@ import UserAvatar from '@/components/UserAvatar.vue'
|
|||||||
import Link from '@/components/Controls/Link.vue'
|
import Link from '@/components/Controls/Link.vue'
|
||||||
import { taskStatusOptions, taskPriorityOptions, getFormat } from '@/utils'
|
import { taskStatusOptions, taskPriorityOptions, getFormat } from '@/utils'
|
||||||
import { usersStore } from '@/stores/users'
|
import { usersStore } from '@/stores/users'
|
||||||
|
import { useOnboarding } from '@/composables/onboarding'
|
||||||
import { capture } from '@/telemetry'
|
import { capture } from '@/telemetry'
|
||||||
import { TextEditor, Dropdown, Tooltip, call, DateTimePicker } from 'frappe-ui'
|
import { TextEditor, Dropdown, Tooltip, call, DateTimePicker } from 'frappe-ui'
|
||||||
import { ref, watch, nextTick, onMounted } from 'vue'
|
import { ref, watch, nextTick, onMounted } from 'vue'
|
||||||
@ -144,6 +145,7 @@ const emit = defineEmits(['updateTask', 'after'])
|
|||||||
|
|
||||||
const router = useRouter()
|
const router = useRouter()
|
||||||
const { getUser } = usersStore()
|
const { getUser } = usersStore()
|
||||||
|
const { updateOnboardingStep } = useOnboarding()
|
||||||
|
|
||||||
const title = ref(null)
|
const title = ref(null)
|
||||||
const editMode = ref(false)
|
const editMode = ref(false)
|
||||||
@ -200,6 +202,7 @@ async function updateTask() {
|
|||||||
},
|
},
|
||||||
})
|
})
|
||||||
if (d.name) {
|
if (d.name) {
|
||||||
|
updateOnboardingStep('create_first_task')
|
||||||
capture('task_created')
|
capture('task_created')
|
||||||
tasks.value?.reload()
|
tasks.value?.reload()
|
||||||
emit('after', d, true)
|
emit('after', d, true)
|
||||||
|
|||||||
@ -62,17 +62,30 @@ const steps = reactive([
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
|
||||||
name: 'create_first_note',
|
|
||||||
title: 'Create your first note',
|
|
||||||
icon: markRaw(NoteIcon),
|
|
||||||
completed: false,
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
name: 'create_first_task',
|
name: 'create_first_task',
|
||||||
title: 'Create your first task',
|
title: 'Create your first task',
|
||||||
icon: markRaw(TaskIcon),
|
icon: markRaw(TaskIcon),
|
||||||
completed: false,
|
completed: false,
|
||||||
|
onClick: async () => {
|
||||||
|
minimize.value = true
|
||||||
|
let dealName = await call('crm.api.onboarding.get_first_deal')
|
||||||
|
if (dealName) {
|
||||||
|
router.push({
|
||||||
|
name: 'Deal',
|
||||||
|
params: { dealId: dealName },
|
||||||
|
hash: '#tasks',
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
router.push({ name: 'Tasks' })
|
||||||
|
}
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'create_first_note',
|
||||||
|
title: 'Create your first note',
|
||||||
|
icon: markRaw(NoteIcon),
|
||||||
|
completed: false,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'add_first_comment',
|
name: 'add_first_comment',
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user