mirror of
https://github.com/hcengineering/platform.git
synced 2026-09-30 13:35:04 +02:00
[Part-1]: New analytics events (#6319)
Signed-off-by: Kristina Fefelova <kristin.fefelova@gmail.com>
This commit is contained in:
@@ -3,8 +3,9 @@
|
||||
import { IntlString } from '@hcengineering/platform'
|
||||
import { DocPopup, getClient } from '@hcengineering/presentation'
|
||||
import { Task, TaskType } from '@hcengineering/task'
|
||||
import { ObjectPresenter, statusStore } from '@hcengineering/view-resources'
|
||||
import { getObjectId, ObjectPresenter, statusStore } from '@hcengineering/view-resources'
|
||||
import { createEventDispatcher } from 'svelte'
|
||||
import { Analytics } from '@hcengineering/analytics'
|
||||
import { taskTypeStore } from '..'
|
||||
|
||||
export let value: Task | Task[]
|
||||
@@ -30,9 +31,22 @@
|
||||
await ops.update(it, { status: newStatus })
|
||||
}
|
||||
await ops.commit()
|
||||
|
||||
progress = false
|
||||
|
||||
dispatch('close', newStatus)
|
||||
const ids = await getAnalyticsIds(docs)
|
||||
Analytics.handleEvent('task.SetStatus', { status: newStatus, objects: ids })
|
||||
}
|
||||
|
||||
async function getAnalyticsIds (docs: Task[]): Promise<string[]> {
|
||||
const result: string[] = []
|
||||
|
||||
for (const doc of docs) {
|
||||
const id = await getObjectId(doc, client.getHierarchy())
|
||||
result.push(id)
|
||||
}
|
||||
return result
|
||||
}
|
||||
|
||||
$: current = Array.isArray(value)
|
||||
|
||||
Reference in New Issue
Block a user