From fd3fc4448e271f1f08912cc4be602a140c63f493 Mon Sep 17 00:00:00 2001 From: Shariq Ansari Date: Mon, 20 May 2024 21:15:14 +0530 Subject: [PATCH 01/11] refactor: no need to pass unselectAll method --- frontend/src/components/ListViews/ContactsListView.vue | 8 ++++++-- frontend/src/components/ListViews/DealsListView.vue | 8 ++++++-- .../src/components/ListViews/EmailTemplatesListView.vue | 8 ++++++-- frontend/src/components/ListViews/LeadsListView.vue | 8 ++++++-- .../src/components/ListViews/OrganizationsListView.vue | 8 ++++++-- frontend/src/components/ListViews/TasksListView.vue | 8 ++++++-- 6 files changed, 36 insertions(+), 12 deletions(-) diff --git a/frontend/src/components/ListViews/ContactsListView.vue b/frontend/src/components/ListViews/ContactsListView.vue index e4fdda12..e1169ae5 100644 --- a/frontend/src/components/ListViews/ContactsListView.vue +++ b/frontend/src/components/ListViews/ContactsListView.vue @@ -100,10 +100,9 @@ /> diff --git a/frontend/src/components/ListViews/LeadsListView.vue b/frontend/src/components/ListViews/LeadsListView.vue index 303ecd9e..1855e85e 100644 --- a/frontend/src/components/ListViews/LeadsListView.vue +++ b/frontend/src/components/ListViews/LeadsListView.vue @@ -123,7 +123,7 @@ @@ -139,28 +139,14 @@ }" @loadMore="emit('loadMore')" /> - - + From d518a4709fd92c0c51b2bc3e057b03aed7ce9203 Mon Sep 17 00:00:00 2001 From: Shariq Ansari Date: Mon, 20 May 2024 22:13:58 +0530 Subject: [PATCH 08/11] fix: implemented ListBulkAction component in Deal List View --- .../components/ListViews/DealsListView.vue | 117 ++---------------- 1 file changed, 8 insertions(+), 109 deletions(-) diff --git a/frontend/src/components/ListViews/DealsListView.vue b/frontend/src/components/ListViews/DealsListView.vue index 3769895b..8388c180 100644 --- a/frontend/src/components/ListViews/DealsListView.vue +++ b/frontend/src/components/ListViews/DealsListView.vue @@ -114,7 +114,9 @@ @@ -130,19 +132,14 @@ }" @loadMore="emit('loadMore')" /> - + From 8f1637ffa10d0fea814a11cd5a702f204cba05f5 Mon Sep 17 00:00:00 2001 From: Shariq Ansari Date: Mon, 20 May 2024 22:14:25 +0530 Subject: [PATCH 09/11] fix: allow hiding some bulk actions --- frontend/src/components/ListBulkActions.vue | 37 +++++++++++++++------ 1 file changed, 27 insertions(+), 10 deletions(-) diff --git a/frontend/src/components/ListBulkActions.vue b/frontend/src/components/ListBulkActions.vue index db07b4ba..ad33a0ab 100644 --- a/frontend/src/components/ListBulkActions.vue +++ b/frontend/src/components/ListBulkActions.vue @@ -29,6 +29,14 @@ const props = defineProps({ type: String, default: '', }, + options: { + type: Object, + default: () => ({ + hideEdit: false, + hideDelete: false, + hideAssign: false, + }), + }, }) const list = defineModel() @@ -126,24 +134,33 @@ const customBulkActions = ref([]) const customListActions = ref([]) function bulkActions(selections, unselectAll) { - let actions = [ - { + let actions = [] + debugger + if (!props.options.hideEdit) { + actions.push({ label: __('Edit'), onClick: () => editValues(selections, unselectAll), - }, - { + }) + } + + if (!props.options.hideDelete) { + actions.push({ label: __('Delete'), onClick: () => deleteValues(selections, unselectAll), - }, - { + }) + } + + if (!props.options.hideAssign) { + actions.push({ label: __('Assign To'), onClick: () => assignValues(selections, unselectAll), - }, - { + }) + actions.push({ label: __('Clear Assignment'), onClick: () => clearAssignemnts(selections, unselectAll), - }, - ] + }) + } + customBulkActions.value.forEach((action) => { actions.push({ label: __(action.label), From f34e9bdaeb30e0fda1fe47f19a42bf0fed4bf547 Mon Sep 17 00:00:00 2001 From: Shariq Ansari Date: Mon, 20 May 2024 22:26:25 +0530 Subject: [PATCH 10/11] fix: select options not working --- frontend/src/components/Modals/EditValueModal.vue | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/frontend/src/components/Modals/EditValueModal.vue b/frontend/src/components/Modals/EditValueModal.vue index 0a9e2851..9f60a6fa 100644 --- a/frontend/src/components/Modals/EditValueModal.vue +++ b/frontend/src/components/Modals/EditValueModal.vue @@ -128,6 +128,10 @@ function updateValue(v) { newValue.value = value } +function getSelectOptions(options) { + return options.split('\n') +} + function getValueComponent(f) { const { type, options } = f if (typeSelect.includes(type) || typeCheck.includes(type)) { @@ -138,6 +142,7 @@ function getValueComponent(f) { label: o, value: o, })), + modelValue: newValue.value, }) } else if (typeLink.includes(type)) { if (type == 'Dynamic Link') { From e291f2068c737d9acf08caf1a1746dba43517f83 Mon Sep 17 00:00:00 2001 From: Shariq Ansari Date: Mon, 20 May 2024 22:32:44 +0530 Subject: [PATCH 11/11] fix: implemented ListBulkAction component in all List View --- frontend/src/components/ListBulkActions.vue | 2 +- .../components/ListViews/CallLogsListView.vue | 99 +++-------------- .../components/ListViews/ContactsListView.vue | 104 +++--------------- .../ListViews/EmailTemplatesListView.vue | 102 ++--------------- .../ListViews/OrganizationsListView.vue | 104 +++--------------- .../components/ListViews/TasksListView.vue | 102 ++--------------- 6 files changed, 65 insertions(+), 448 deletions(-) diff --git a/frontend/src/components/ListBulkActions.vue b/frontend/src/components/ListBulkActions.vue index ad33a0ab..6b54b15d 100644 --- a/frontend/src/components/ListBulkActions.vue +++ b/frontend/src/components/ListBulkActions.vue @@ -135,7 +135,7 @@ const customListActions = ref([]) function bulkActions(selections, unselectAll) { let actions = [] - debugger + if (!props.options.hideEdit) { actions.push({ label: __('Edit'), diff --git a/frontend/src/components/ListViews/CallLogsListView.vue b/frontend/src/components/ListViews/CallLogsListView.vue index d4381818..e3aa425a 100644 --- a/frontend/src/components/ListViews/CallLogsListView.vue +++ b/frontend/src/components/ListViews/CallLogsListView.vue @@ -80,7 +80,9 @@ @@ -95,8 +97,18 @@ }" @loadMore="emit('loadMore')" /> + diff --git a/frontend/src/components/ListViews/ContactsListView.vue b/frontend/src/components/ListViews/ContactsListView.vue index e1169ae5..4a192497 100644 --- a/frontend/src/components/ListViews/ContactsListView.vue +++ b/frontend/src/components/ListViews/ContactsListView.vue @@ -82,7 +82,9 @@ @@ -98,18 +100,18 @@ }" @loadMore="emit('loadMore')" /> - diff --git a/frontend/src/components/ListViews/EmailTemplatesListView.vue b/frontend/src/components/ListViews/EmailTemplatesListView.vue index 22625af9..52f3b4b0 100644 --- a/frontend/src/components/ListViews/EmailTemplatesListView.vue +++ b/frontend/src/components/ListViews/EmailTemplatesListView.vue @@ -69,7 +69,7 @@ @@ -84,17 +84,17 @@ }" @loadMore="emit('loadMore')" /> - diff --git a/frontend/src/components/ListViews/OrganizationsListView.vue b/frontend/src/components/ListViews/OrganizationsListView.vue index 29a00d2d..7a3509e0 100644 --- a/frontend/src/components/ListViews/OrganizationsListView.vue +++ b/frontend/src/components/ListViews/OrganizationsListView.vue @@ -69,7 +69,9 @@ @@ -84,17 +86,17 @@ }" @loadMore="emit('loadMore')" /> - diff --git a/frontend/src/components/ListViews/TasksListView.vue b/frontend/src/components/ListViews/TasksListView.vue index 63ceb354..103a1a52 100644 --- a/frontend/src/components/ListViews/TasksListView.vue +++ b/frontend/src/components/ListViews/TasksListView.vue @@ -82,7 +82,7 @@ @@ -97,21 +97,21 @@ }" @loadMore="emit('loadMore')" /> -