From e286cbfc8bcc830096c53c853b3eb5f5c78ef735 Mon Sep 17 00:00:00 2001 From: prssanna Date: Thu, 25 Mar 2021 10:07:36 +0530 Subject: [PATCH] fix: render info type comments on form timeline --- frappe/desk/form/load.py | 1 + frappe/public/js/frappe/form/footer/form_timeline.js | 12 ++++++++++++ 2 files changed, 13 insertions(+) diff --git a/frappe/desk/form/load.py b/frappe/desk/form/load.py index 1f5c437330..c1429d361f 100644 --- a/frappe/desk/form/load.py +++ b/frappe/desk/form/load.py @@ -100,6 +100,7 @@ def get_docinfo(doc=None, doctype=None, name=None): "assignment_logs": get_comments(doc.doctype, doc.name, 'assignment'), "permissions": get_doc_permissions(doc), "shared": frappe.share.get_users(doc.doctype, doc.name), + "info_logs": get_comments(doc.doctype, doc.name, 'Info'), "share_logs": get_comments(doc.doctype, doc.name, 'share'), "like_logs": get_comments(doc.doctype, doc.name, 'Like'), "views": get_view_logs(doc.doctype, doc.name), diff --git a/frappe/public/js/frappe/form/footer/form_timeline.js b/frappe/public/js/frappe/form/footer/form_timeline.js index 7b8d36d90b..1da59a2fdf 100644 --- a/frappe/public/js/frappe/form/footer/form_timeline.js +++ b/frappe/public/js/frappe/form/footer/form_timeline.js @@ -139,6 +139,7 @@ class FormTimeline extends BaseTimeline { this.timeline_items.push(...this.get_custom_timeline_contents()); this.timeline_items.push(...this.get_assignment_timeline_contents()); this.timeline_items.push(...this.get_attachment_timeline_contents()); + this.timeline_items.push(...this.get_info_timeline_contents()); this.timeline_items.push(...this.get_milestone_timeline_contents()); } } @@ -269,6 +270,17 @@ class FormTimeline extends BaseTimeline { return assignment_timeline_contents; } + get_info_timeline_contents() { + let info_timeline_contents = []; + (this.doc_info.info_logs || []).forEach(info_log => { + info_timeline_contents.push({ + creation: info_log.creation, + content: `${this.get_user_link(info_log.comment_email)} ${info_log.content}`, + }); + }); + return info_timeline_contents; + } + get_attachment_timeline_contents() { let attachment_timeline_contents = []; (this.doc_info.attachment_logs || []).forEach(attachment_log => {