From fd3fc4448e271f1f08912cc4be602a140c63f493 Mon Sep 17 00:00:00 2001 From: Shariq Ansari Date: Mon, 20 May 2024 21:15:14 +0530 Subject: [PATCH 01/16] 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/16] 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/16] 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/16] 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/16] 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')" /> - From b0bf281007ac5e57ac64744ed23189241c632ab6 Mon Sep 17 00:00:00 2001 From: Shariq Ansari Date: Tue, 21 May 2024 11:18:48 +0530 Subject: [PATCH 12/16] revert: set first response to none --- crm/fcrm/doctype/crm_deal/crm_deal.py | 4 ++-- crm/fcrm/doctype/crm_lead/crm_lead.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/crm/fcrm/doctype/crm_deal/crm_deal.py b/crm/fcrm/doctype/crm_deal/crm_deal.py index d303c572..d4e3fcaa 100644 --- a/crm/fcrm/doctype/crm_deal/crm_deal.py +++ b/crm/fcrm/doctype/crm_deal/crm_deal.py @@ -108,8 +108,8 @@ class CRMDeal(Document): """ sla = get_sla(self) if not sla: - self.first_responded_on = None - self.first_response_time = None + # self.first_responded_on = None + # self.first_response_time = None return self.sla = sla.name diff --git a/crm/fcrm/doctype/crm_lead/crm_lead.py b/crm/fcrm/doctype/crm_lead/crm_lead.py index b8160525..0ec3ad81 100644 --- a/crm/fcrm/doctype/crm_lead/crm_lead.py +++ b/crm/fcrm/doctype/crm_lead/crm_lead.py @@ -234,8 +234,8 @@ class CRMLead(Document): """ sla = get_sla(self) if not sla: - self.first_responded_on = None - self.first_response_time = None + # self.first_responded_on = None + # self.first_response_time = None return self.sla = sla.name From 979481c379193b2ff8b745bab9bbafb90c41603e Mon Sep 17 00:00:00 2001 From: Shariq Ansari Date: Tue, 21 May 2024 16:42:07 +0530 Subject: [PATCH 13/16] fix: remove default icon --- frontend/src/components/IconPicker.vue | 6 +----- frontend/src/components/WhatsAppBox.vue | 2 +- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/frontend/src/components/IconPicker.vue b/frontend/src/components/IconPicker.vue index 29fee1b7..c1249d25 100644 --- a/frontend/src/components/IconPicker.vue +++ b/frontend/src/components/IconPicker.vue @@ -66,7 +66,7 @@ diff --git a/frontend/src/components/WhatsAppBox.vue b/frontend/src/components/WhatsAppBox.vue index c3a1aa4c..76e88eac 100644 --- a/frontend/src/components/WhatsAppBox.vue +++ b/frontend/src/components/WhatsAppBox.vue @@ -67,7 +67,7 @@ import IconPicker from '@/components/IconPicker.vue' import SmileIcon from '@/components/Icons/SmileIcon.vue' import { createResource, Textarea, FileUploader, Dropdown } from 'frappe-ui' import FeatherIcon from 'frappe-ui/src/components/FeatherIcon.vue' -import { ref, computed, nextTick, watch } from 'vue' +import { ref, nextTick, watch } from 'vue' const props = defineProps({ doctype: String, From ef2a007319bf45f00f05f7fd9ad0bc4a9e5c1b19 Mon Sep 17 00:00:00 2001 From: Shariq Ansari Date: Tue, 21 May 2024 16:53:12 +0530 Subject: [PATCH 14/16] feat: Added comment tab --- frontend/src/components/Activities.vue | 87 ++++++++++++++++++- frontend/src/components/CommunicationArea.vue | 2 +- 2 files changed, 87 insertions(+), 2 deletions(-) diff --git a/frontend/src/components/Activities.vue b/frontend/src/components/Activities.vue index a5c441da..c0157e95 100644 --- a/frontend/src/components/Activities.vue +++ b/frontend/src/components/Activities.vue @@ -15,6 +15,16 @@ {{ __('New Email') }} +