From 424d8feab23590e26f2c5fad8f85877fbcdcc6dc Mon Sep 17 00:00:00 2001 From: Shariq Ansari Date: Wed, 27 Sep 2023 19:26:56 +0530 Subject: [PATCH] fix: show user name and avatar instead of email in timeline changes --- crm/fcrm/doctype/crm_lead/api.py | 6 +++++- frontend/src/components/Activities.vue | 22 ++++++++++++++++++++-- 2 files changed, 25 insertions(+), 3 deletions(-) diff --git a/crm/fcrm/doctype/crm_lead/api.py b/crm/fcrm/doctype/crm_lead/api.py index 7895ac1e..5f22efb4 100644 --- a/crm/fcrm/doctype/crm_lead/api.py +++ b/crm/fcrm/doctype/crm_lead/api.py @@ -46,8 +46,11 @@ def get_activities(name): data = json.loads(version.data) if not data.get("changed"): continue + + field_option = None + if change := data.get("changed")[0]: - field_label = next((f.label for f in lead_fields_meta if f.fieldname == change[0]), None) + field_label, field_option = next(((f.label, f.options) for f in lead_fields_meta if f.fieldname == change[0]), None) activity_type = "changed" if field_label == "Lead Owner" and (created_as_deal or not is_lead): field_label = "Deal Owner" @@ -83,6 +86,7 @@ def get_activities(name): "owner": version.owner, "data": data, "is_lead": is_lead, + "options": field_option, } activities.append(activity) diff --git a/frontend/src/components/Activities.vue b/frontend/src/components/Activities.vue index 618fe3a5..803c5d9f 100644 --- a/frontend/src/components/Activities.vue +++ b/frontend/src/components/Activities.vue @@ -331,14 +331,32 @@ v-if="activity.data.old_value" class="max-w-xs truncate font-medium text-gray-800" > - {{ activity.data.old_value }} +
+ + {{ getUser(activity.data.old_value).full_name }} +
+
+ {{ activity.data.old_value }} +
to - {{ activity.data.value }} +
+ + {{ getUser(activity.data.value).full_name }} +
+
+ {{ activity.data.value }} +