From f84344592a29a3eb2a60b961e595d0ea04322dfd Mon Sep 17 00:00:00 2001 From: Shariq Ansari <30859809+shariquerik@users.noreply.github.com> Date: Mon, 30 Aug 2021 13:31:07 +0530 Subject: [PATCH] Apply suggestions from code review Co-authored-by: Suraj Shetty <13928957+surajshetty3416@users.noreply.github.com> --- frappe/public/js/frappe/list/list_view.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/frappe/public/js/frappe/list/list_view.js b/frappe/public/js/frappe/list/list_view.js index f304d313b4..c35b5e2d51 100644 --- a/frappe/public/js/frappe/list/list_view.js +++ b/frappe/public/js/frappe/list/list_view.js @@ -952,11 +952,16 @@ frappe.views.ListView = class ListView extends frappe.views.BaseList { get_indicator_html(doc) { const indicator = frappe.get_indicator(doc, this.doctype); - const title = doc.docstatus == 1 ? 'Document has been submitted' : doc.docstatus == 2 ? - 'Document has been cancelled' : 'Document is in draft state'; + // sequence is important + const docstatus_description = [ + __('Document is in draft state'), + __('Document has been submitted'), + __('Document has been cancelled') + ] + const title = docstatus_description[doc.docstatus || 0] if (indicator) { return ` + data-filter='${indicator[2]}' title='${title}'> ${__(indicator[0])} `; }