From ac8650d48611037c23a6cf8867a51683d988a426 Mon Sep 17 00:00:00 2001 From: Neel Bhanushali Date: Mon, 6 May 2024 20:26:07 +0530 Subject: [PATCH 01/14] added automated_messages from communications to activites --- crm/api/activities.py | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/crm/api/activities.py b/crm/api/activities.py index 3cd9e9f3b..c9f88262f 100644 --- a/crm/api/activities.py +++ b/crm/api/activities.py @@ -129,6 +129,25 @@ def get_deal_activities(name): } activities.append(activity) + for communication in docinfo.automated_messages: + activity = { + "activity_type": "communication", + "creation": communication.creation, + "data": { + "subject": communication.subject, + "content": communication.content, + "sender_full_name": communication.sender_full_name, + "sender": communication.sender, + "recipients": communication.recipients, + "cc": communication.cc, + "bcc": communication.bcc, + "attachments": get_attachments('Communication', communication.name), + "read_by_recipient": communication.read_by_recipient, + }, + "is_lead": False, + } + activities.append(activity) + calls = calls + get_linked_calls(name) notes = notes + get_linked_notes(name) tasks = tasks + get_linked_tasks(name) @@ -241,6 +260,25 @@ def get_lead_activities(name): } activities.append(activity) + for communication in docinfo.automated_messages: + activity = { + "activity_type": "communication", + "creation": communication.creation, + "data": { + "subject": communication.subject, + "content": communication.content, + "sender_full_name": communication.sender_full_name, + "sender": communication.sender, + "recipients": communication.recipients, + "cc": communication.cc, + "bcc": communication.bcc, + "attachments": get_attachments('Communication', communication.name), + "read_by_recipient": communication.read_by_recipient, + }, + "is_lead": True, + } + activities.append(activity) + calls = get_linked_calls(name) notes = get_linked_notes(name) tasks = get_linked_tasks(name) From 3be16274dae1f429ef5f5241a12a77e8093e5c76 Mon Sep 17 00:00:00 2001 From: Shariq Ansari Date: Mon, 13 May 2024 12:47:22 +0530 Subject: [PATCH 02/14] fix: copy to clipboard fix --- frontend/src/utils/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/utils/index.js b/frontend/src/utils/index.js index 77065a499..5ba49e78d 100644 --- a/frontend/src/utils/index.js +++ b/frontend/src/utils/index.js @@ -150,7 +150,7 @@ export function errorMessage(title, message) { export function copyToClipboard(text) { if (navigator.clipboard && window.isSecureContext) { - navigator.clipboard.writeText(string).then(show_success_alert) + navigator.clipboard.writeText(text).then(show_success_alert) } else { let input = document.createElement('textarea') document.body.appendChild(input) From 71f876f5e3a56c48a5bff083d202df5b99b08e3c Mon Sep 17 00:00:00 2001 From: Shariq Ansari Date: Mon, 13 May 2024 12:47:49 +0530 Subject: [PATCH 03/14] fix: replace select-text to select-text1 to avoid selection while resizing --- frontend/src/components/Resizer.vue | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/frontend/src/components/Resizer.vue b/frontend/src/components/Resizer.vue index 342ad44c1..e81df9e71 100644 --- a/frontend/src/components/Resizer.vue +++ b/frontend/src/components/Resizer.vue @@ -38,6 +38,10 @@ function startResize() { document.addEventListener('mouseup', () => { document.body.classList.remove('select-none') document.body.classList.remove('cursor-col-resize') + document.querySelectorAll('.select-text1').forEach((el) => { + el.classList.remove('select-text1') + el.classList.add('select-text') + }) localStorage.setItem('sidebarWidth', sidebarWidth.value) sidebarResizing.value = false document.removeEventListener('mousemove', resize) @@ -47,6 +51,10 @@ function resize(e) { sidebarResizing.value = true document.body.classList.add('select-none') document.body.classList.add('cursor-col-resize') + document.querySelectorAll('.select-text').forEach((el) => { + el.classList.remove('select-text') + el.classList.add('select-text1') + }) sidebarWidth.value = props.side == 'left' ? e.clientX : window.innerWidth - e.clientX From ada97f3c03bba8224bd400e80399659a92b551d9 Mon Sep 17 00:00:00 2001 From: Shariq Ansari Date: Mon, 13 May 2024 13:51:09 +0530 Subject: [PATCH 04/14] fix: added default tooltip if name/org is not set --- frontend/src/pages/Deal.vue | 2 +- frontend/src/pages/Lead.vue | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/frontend/src/pages/Deal.vue b/frontend/src/pages/Deal.vue index 505327428..3d849b09a 100644 --- a/frontend/src/pages/Deal.vue +++ b/frontend/src/pages/Deal.vue @@ -64,7 +64,7 @@
- +
{{ organization?.name || __('Untitled') }}
diff --git a/frontend/src/pages/Lead.vue b/frontend/src/pages/Lead.vue index 8849feb37..8e54fdf87 100644 --- a/frontend/src/pages/Lead.vue +++ b/frontend/src/pages/Lead.vue @@ -106,7 +106,7 @@
- +
{{ lead.data.lead_name || __('Untitled') }}
From ed1081d718f8ad7cb458f00462f2ac16dbc0bd25 Mon Sep 17 00:00:00 2001 From: Shariq Ansari Date: Mon, 13 May 2024 15:53:01 +0530 Subject: [PATCH 05/14] fix: remove duplicate code --- crm/api/activities.py | 42 ++---------------------------------------- 1 file changed, 2 insertions(+), 40 deletions(-) diff --git a/crm/api/activities.py b/crm/api/activities.py index c9f88262f..9079d47fa 100644 --- a/crm/api/activities.py +++ b/crm/api/activities.py @@ -110,26 +110,7 @@ def get_deal_activities(name): } activities.append(activity) - for communication in docinfo.communications: - activity = { - "activity_type": "communication", - "creation": communication.creation, - "data": { - "subject": communication.subject, - "content": communication.content, - "sender_full_name": communication.sender_full_name, - "sender": communication.sender, - "recipients": communication.recipients, - "cc": communication.cc, - "bcc": communication.bcc, - "attachments": get_attachments('Communication', communication.name), - "read_by_recipient": communication.read_by_recipient, - }, - "is_lead": False, - } - activities.append(activity) - - for communication in docinfo.automated_messages: + for communication in docinfo.communications + docinfo.automated_messages: activity = { "activity_type": "communication", "creation": communication.creation, @@ -241,26 +222,7 @@ def get_lead_activities(name): } activities.append(activity) - for communication in docinfo.communications: - activity = { - "activity_type": "communication", - "creation": communication.creation, - "data": { - "subject": communication.subject, - "content": communication.content, - "sender_full_name": communication.sender_full_name, - "sender": communication.sender, - "recipients": communication.recipients, - "cc": communication.cc, - "bcc": communication.bcc, - "attachments": get_attachments('Communication', communication.name), - "read_by_recipient": communication.read_by_recipient, - }, - "is_lead": True, - } - activities.append(activity) - - for communication in docinfo.automated_messages: + for communication in docinfo.communications + docinfo.automated_messages: activity = { "activity_type": "communication", "creation": communication.creation, From 03e52c34e1f7db319878b6b3d4afbbd619d42372 Mon Sep 17 00:00:00 2001 From: Shariq Ansari Date: Mon, 13 May 2024 15:56:06 +0530 Subject: [PATCH 06/14] fix: show notification badge if email came from notification --- crm/api/activities.py | 2 ++ frontend/src/components/Activities.vue | 7 +++++++ 2 files changed, 9 insertions(+) diff --git a/crm/api/activities.py b/crm/api/activities.py index 9079d47fa..ead84b1f4 100644 --- a/crm/api/activities.py +++ b/crm/api/activities.py @@ -113,6 +113,7 @@ def get_deal_activities(name): for communication in docinfo.communications + docinfo.automated_messages: activity = { "activity_type": "communication", + "communication_type": communication.communication_type, "creation": communication.creation, "data": { "subject": communication.subject, @@ -225,6 +226,7 @@ def get_lead_activities(name): for communication in docinfo.communications + docinfo.automated_messages: activity = { "activity_type": "communication", + "communication_type": communication.communication_type, "creation": communication.creation, "data": { "subject": communication.subject, diff --git a/frontend/src/components/Activities.vue b/frontend/src/components/Activities.vue index a0e4f6e68..3d9e743fa 100644 --- a/frontend/src/components/Activities.vue +++ b/frontend/src/components/Activities.vue @@ -386,6 +386,12 @@ {{ __(timeAgo(activity.creation)) }}
+
@@ -834,6 +840,7 @@ import { Dropdown, TextEditor, Avatar, + Badge, createResource, call, } from 'frappe-ui' From bc8ba484c3bea41af94bfc876e1a20c3e350ae93 Mon Sep 17 00:00:00 2001 From: Shariq Ansari Date: Mon, 13 May 2024 21:15:32 +0530 Subject: [PATCH 07/14] fix: added fadedScrollableDiv component --- .../src/components/FadedScrollableDiv.vue | 29 +++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 frontend/src/components/FadedScrollableDiv.vue diff --git a/frontend/src/components/FadedScrollableDiv.vue b/frontend/src/components/FadedScrollableDiv.vue new file mode 100644 index 000000000..f54e8f38b --- /dev/null +++ b/frontend/src/components/FadedScrollableDiv.vue @@ -0,0 +1,29 @@ + + From 10894d019d153e8478d82888248495e003363d19 Mon Sep 17 00:00:00 2001 From: Shariq Ansari Date: Mon, 13 May 2024 21:16:54 +0530 Subject: [PATCH 08/14] fix: added fade in activities, call log note, sidebar section --- frontend/src/components/Activities.vue | 21 ++++++++++---- .../src/components/Modals/CallLogModal.vue | 28 +++++++++++++------ frontend/src/components/SectionFields.vue | 7 +++-- 3 files changed, 40 insertions(+), 16 deletions(-) diff --git a/frontend/src/components/Activities.vue b/frontend/src/components/Activities.vue index 4a6e9fab3..a5c441da5 100644 --- a/frontend/src/components/Activities.vue +++ b/frontend/src/components/Activities.vue @@ -1,5 +1,7 @@