From 448bedd8b05303ff4b7beaa990f608fb7e04e3de Mon Sep 17 00:00:00 2001 From: Shariq Ansari Date: Wed, 30 Aug 2023 16:11:21 +0530 Subject: [PATCH] fix: using name of contact/agent on call logs list --- .../doctype/crm_call_log/crm_call_log.json | 38 ++++++----- crm/twilio/twilio_handler.py | 11 +++- frontend/src/components/ListRowItem.vue | 5 ++ frontend/src/components/ListView.vue | 1 + frontend/src/pages/CallLogs.vue | 65 ++++++++++++++++--- 5 files changed, 93 insertions(+), 27 deletions(-) diff --git a/crm/crm/doctype/crm_call_log/crm_call_log.json b/crm/crm/doctype/crm_call_log/crm_call_log.json index 8eb1ce4d..db30a776 100644 --- a/crm/crm/doctype/crm_call_log/crm_call_log.json +++ b/crm/crm/doctype/crm_call_log/crm_call_log.json @@ -11,17 +11,18 @@ "id", "from", "status", - "call_received_by", + "duration", "medium", "start_time", - "note", - "column_break_ufnp", - "type", - "to", "lead", - "duration", + "column_break_ufnp", + "to", + "type", + "receiver", + "caller", "recording_url", - "end_time" + "end_time", + "note" ], "fields": [ { @@ -43,13 +44,6 @@ "options": "Ringing\nIn Progress\nCompleted\nFailed\nBusy\nNo Answer\nQueued\nCanceled", "read_only": 1 }, - { - "depends_on": "to", - "fieldname": "call_received_by", - "fieldtype": "Link", - "label": "Call Received By", - "options": "User" - }, { "fieldname": "start_time", "fieldtype": "Datetime", @@ -106,11 +100,25 @@ "fieldtype": "Link", "label": "Note", "options": "CRM Note" + }, + { + "depends_on": "eval:doc.type == 'Incoming'", + "fieldname": "receiver", + "fieldtype": "Link", + "label": "Call Received By", + "options": "User" + }, + { + "depends_on": "eval:doc.type == 'Outgoing'", + "fieldname": "caller", + "fieldtype": "Link", + "label": "Caller", + "options": "User" } ], "index_web_pages_for_search": 1, "links": [], - "modified": "2023-08-28 11:42:33.487807", + "modified": "2023-08-30 15:39:46.613734", "modified_by": "Administrator", "module": "CRM", "name": "CRM Call Log", diff --git a/crm/twilio/twilio_handler.py b/crm/twilio/twilio_handler.py index 7ab8dfa3..47ea8630 100644 --- a/crm/twilio/twilio_handler.py +++ b/crm/twilio/twilio_handler.py @@ -220,10 +220,17 @@ class TwilioCallDetails: return ' '.join(twilio_status.split('-')).title() def to_dict(self): + """Convert call details into dict. + """ + direction = self.get_direction() + caller = frappe.session.user if direction == 'Outgoing' else '' + receiver = frappe.session.user if direction == 'Incoming' else '' return { - 'type': self.get_direction(), + 'type': direction, 'status': self.call_status, 'id': self.call_sid, 'from': self.get_from_number(), - 'to': self.get_to_number() + 'to': self.get_to_number(), + 'reciever': receiver, + 'caller': caller, } \ No newline at end of file diff --git a/frontend/src/components/ListRowItem.vue b/frontend/src/components/ListRowItem.vue index a2b23dbf..6010f8bc 100644 --- a/frontend/src/components/ListRowItem.vue +++ b/frontend/src/components/ListRowItem.vue @@ -2,6 +2,7 @@ @@ -21,6 +22,10 @@ const props = defineProps({ type: String, default: 'text', }, + align: { + type: String, + default: 'left', + }, value: { type: [String, Number, Object], default: '', diff --git a/frontend/src/components/ListView.vue b/frontend/src/components/ListView.vue index 7a58f1e6..9896510a 100644 --- a/frontend/src/components/ListView.vue +++ b/frontend/src/components/ListView.vue @@ -44,6 +44,7 @@