From 9f5bea6b2267593ad7c03d8165bc0dac33e69fbf Mon Sep 17 00:00:00 2001 From: Shariq Ansari Date: Wed, 10 Apr 2024 19:36:22 +0530 Subject: [PATCH] fix: implemented customListActions in leads listview --- .../src/components/ListViews/LeadsListView.vue | 16 ++++++++++++++-- frontend/src/pages/Leads.vue | 8 ++++++++ frontend/src/utils/index.js | 11 ++++++----- 3 files changed, 28 insertions(+), 7 deletions(-) diff --git a/frontend/src/components/ListViews/LeadsListView.vue b/frontend/src/components/ListViews/LeadsListView.vue index 1483b574..a78a62ec 100644 --- a/frontend/src/components/ListViews/LeadsListView.vue +++ b/frontend/src/components/ListViews/LeadsListView.vue @@ -155,7 +155,7 @@ import { call, Tooltip, } from 'frappe-ui' -import { setupBulkActions, createToast } from '@/utils' +import { setupListActions, createToast } from '@/utils' import { globalStore } from '@/stores/global' import { onMounted, ref, watch } from 'vue' import { useRouter } from 'vue-router' @@ -243,6 +243,7 @@ function deleteValues(selections, unselectAll) { } const customBulkActions = ref([]) +const customListActions = ref([]) function bulkActions(selections, unselectAll) { let actions = [ @@ -275,7 +276,18 @@ function bulkActions(selections, unselectAll) { onMounted(() => { if (!list.value?.data) return - setupBulkActions(list.value.data) + setupListActions(list.value.data, { + list: list.value, + call, + createToast, + $dialog, + router, + }) customBulkActions.value = list.value?.data?.bulkActions || [] + customListActions.value = list.value?.data?.listActions || [] +}) + +defineExpose({ + customListActions, }) diff --git a/frontend/src/pages/Leads.vue b/frontend/src/pages/Leads.vue index 38118d69..5e018865 100644 --- a/frontend/src/pages/Leads.vue +++ b/frontend/src/pages/Leads.vue @@ -4,6 +4,10 @@