1
0
forked from test/crm

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

View File

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

View File

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