From f4a2fb15f8e5722c650cb98e85bddd9fc3b89fc7 Mon Sep 17 00:00:00 2001 From: Shariq Ansari Date: Mon, 28 Aug 2023 15:29:56 +0530 Subject: [PATCH] fix: created call log in lead/deal calls tab --- frontend/src/components/Activities.vue | 94 +++++++++++++++++++ .../src/components/Icons/DurationIcon.vue | 24 +++++ .../src/components/Icons/MaximizeIcon.vue | 19 ++++ .../src/components/Icons/MinimizeIcon.vue | 27 +++--- frontend/src/components/Icons/PlayIcon.vue | 18 ++++ frontend/src/pages/CallLog.vue | 4 +- frontend/src/pages/Deal.vue | 31 +++++- frontend/src/pages/Lead.vue | 31 +++++- 8 files changed, 221 insertions(+), 27 deletions(-) create mode 100644 frontend/src/components/Icons/DurationIcon.vue create mode 100644 frontend/src/components/Icons/MaximizeIcon.vue create mode 100644 frontend/src/components/Icons/PlayIcon.vue diff --git a/frontend/src/components/Activities.vue b/frontend/src/components/Activities.vue index 4846d4cc..df23913f 100644 --- a/frontend/src/components/Activities.vue +++ b/frontend/src/components/Activities.vue @@ -63,6 +63,77 @@ +
+
+
+
+
+ +
+
+
+
+
+ {{ call.type == 'Incoming' ? 'Inbound' : 'Outbound' }} call +
+
+ + {{ timeAgo(call.modified) }} + +
+
+
+
+ +
Duration
+
{{ call.duration }}s
+
+
+ +
+ {{ + call.show_recording ? 'Hide recording' : 'Listen to call' + }} +
+
+
+
+ +
+
+
+
{{ call.from }}
+ +
{{ call.to }}
+
+
+
+
+
+
{ + if (props.title == 'Calls') { + props.activities.forEach((activity) => { + activity.show_recording = false + }) + return props.activities + } props.activities.forEach((activity) => { activity.owner_name = getUser(activity.owner).full_name activity.icon = timelineIcon(activity.activity_type) @@ -260,3 +339,18 @@ function timelineIcon(activity_type) { return 'edit' } + + diff --git a/frontend/src/components/Icons/DurationIcon.vue b/frontend/src/components/Icons/DurationIcon.vue new file mode 100644 index 00000000..3a88cfc7 --- /dev/null +++ b/frontend/src/components/Icons/DurationIcon.vue @@ -0,0 +1,24 @@ + diff --git a/frontend/src/components/Icons/MaximizeIcon.vue b/frontend/src/components/Icons/MaximizeIcon.vue new file mode 100644 index 00000000..58cd72b8 --- /dev/null +++ b/frontend/src/components/Icons/MaximizeIcon.vue @@ -0,0 +1,19 @@ + diff --git a/frontend/src/components/Icons/MinimizeIcon.vue b/frontend/src/components/Icons/MinimizeIcon.vue index dbdba9f7..94156b9a 100644 --- a/frontend/src/components/Icons/MinimizeIcon.vue +++ b/frontend/src/components/Icons/MinimizeIcon.vue @@ -1,24 +1,19 @@ diff --git a/frontend/src/components/Icons/PlayIcon.vue b/frontend/src/components/Icons/PlayIcon.vue new file mode 100644 index 00000000..a2c1a03a --- /dev/null +++ b/frontend/src/components/Icons/PlayIcon.vue @@ -0,0 +1,18 @@ + diff --git a/frontend/src/pages/CallLog.vue b/frontend/src/pages/CallLog.vue index 0b22b9b0..fd864628 100644 --- a/frontend/src/pages/CallLog.vue +++ b/frontend/src/pages/CallLog.vue @@ -23,7 +23,7 @@
Call note
-
+
[ @@ -120,6 +121,7 @@ const callNote = computed(() => { doctype: 'CRM Note', name: callLog.doc?.note, auto: true, + setValue: {}, }) }) diff --git a/frontend/src/pages/Deal.vue b/frontend/src/pages/Deal.vue index 3a12fc27..6408a733 100644 --- a/frontend/src/pages/Deal.vue +++ b/frontend/src/pages/Deal.vue @@ -84,7 +84,7 @@ v-model="deal" />
-
+
@@ -388,9 +388,7 @@ const tabs = computed(() => { { label: 'Calls', icon: PhoneIcon, - content: deal.data.activities.filter( - (activity) => activity.activity_type === 'call' - ), + content: calls.data, activityTitle: 'Calls', }, // { @@ -516,7 +514,7 @@ const notes = createListResource({ fields: ['name', 'title', 'content', 'owner', 'modified'], filters: { lead: props.dealId }, orderBy: 'modified desc', - pageLength: 20, + pageLength: 999, auto: true, }) @@ -560,6 +558,29 @@ async function updateNote(note) { } } } + +const calls = createListResource({ + type: 'list', + doctype: 'CRM Call Log', + cache: ['Call Logs', props.leadId], + fields: [ + 'name', + 'from', + 'to', + 'duration', + 'start_time', + 'end_time', + 'status', + 'type', + 'recording_url', + 'modified', + 'note', + ], + filters: { lead: props.leadId }, + orderBy: 'modified desc', + pageLength: 999, + auto: true, +})