fix: capture bulk actions event

This commit is contained in:
Shariq Ansari 2024-08-16 19:29:35 +05:30
parent f1bef0ad75
commit 46e12bdda4
3 changed files with 8 additions and 1 deletions

View File

@ -21,6 +21,7 @@ import EditValueModal from '@/components/Modals/EditValueModal.vue'
import AssignmentModal from '@/components/Modals/AssignmentModal.vue' import AssignmentModal from '@/components/Modals/AssignmentModal.vue'
import { setupListActions, createToast } from '@/utils' import { setupListActions, createToast } from '@/utils'
import { globalStore } from '@/stores/global' import { globalStore } from '@/stores/global'
import { capture } from '@/telemetry'
import { call } from 'frappe-ui' import { call } from 'frappe-ui'
import { ref, onMounted } from 'vue' import { ref, onMounted } from 'vue'
import { useRouter } from 'vue-router' import { useRouter } from 'vue-router'
@ -69,6 +70,7 @@ function convertToDeal(selections, unselectAll) {
label: __('Convert'), label: __('Convert'),
variant: 'solid', variant: 'solid',
onClick: (close) => { onClick: (close) => {
capture('bulk_convert_to_deal')
Array.from(selections).forEach((name) => { Array.from(selections).forEach((name) => {
call('crm.fcrm.doctype.crm_lead.crm_lead.convert_to_deal', { call('crm.fcrm.doctype.crm_lead.crm_lead.convert_to_deal', {
lead: name, lead: name,
@ -103,6 +105,7 @@ function deleteValues(selections, unselectAll) {
variant: 'solid', variant: 'solid',
theme: 'red', theme: 'red',
onClick: (close) => { onClick: (close) => {
capture('bulk_delete')
call('frappe.desk.reportview.delete_items', { call('frappe.desk.reportview.delete_items', {
items: JSON.stringify(Array.from(selections)), items: JSON.stringify(Array.from(selections)),
doctype: props.doctype, doctype: props.doctype,
@ -145,6 +148,7 @@ function clearAssignemnts(selections, unselectAll) {
variant: 'solid', variant: 'solid',
theme: 'red', theme: 'red',
onClick: (close) => { onClick: (close) => {
capture('bulk_clear_assignment')
call('frappe.desk.form.assign_to.remove_multiple', { call('frappe.desk.form.assign_to.remove_multiple', {
doctype: props.doctype, doctype: props.doctype,
names: JSON.stringify(Array.from(selections)), names: JSON.stringify(Array.from(selections)),

View File

@ -161,8 +161,8 @@ function updateAssignees() {
} }
if (addedAssignees.length) { if (addedAssignees.length) {
capture('assign_to', { doctype: props.doctype })
if (props.docs.size) { if (props.docs.size) {
capture('bulk_assign_to', { doctype: props.doctype })
call('frappe.desk.form.assign_to.add_multiple', { call('frappe.desk.form.assign_to.add_multiple', {
doctype: props.doctype, doctype: props.doctype,
name: JSON.stringify(Array.from(props.docs)), name: JSON.stringify(Array.from(props.docs)),
@ -173,6 +173,7 @@ function updateAssignees() {
emit('reload') emit('reload')
}) })
} else { } else {
capture('assign_to', { doctype: props.doctype })
call('frappe.desk.form.assign_to.add', { call('frappe.desk.form.assign_to.add', {
doctype: props.doctype, doctype: props.doctype,
name: props.doc.name, name: props.doc.name,

View File

@ -36,6 +36,7 @@
<script setup> <script setup>
import Link from '@/components/Controls/Link.vue' import Link from '@/components/Controls/Link.vue'
import Autocomplete from '@/components/frappe-ui/Autocomplete.vue' import Autocomplete from '@/components/frappe-ui/Autocomplete.vue'
import { capture } from '@/telemetry'
import { FormControl, call, createResource, TextEditor, DatePicker } from 'frappe-ui' import { FormControl, call, createResource, TextEditor, DatePicker } from 'frappe-ui'
import { ref, computed, onMounted, h } from 'vue' import { ref, computed, onMounted, h } from 'vue'
@ -115,6 +116,7 @@ function updateValues() {
newValue.value = '' newValue.value = ''
loading.value = false loading.value = false
show.value = false show.value = false
capture('bulk_update', { doctype: props.doctype })
emit('reload') emit('reload')
}) })
} }