From a3585e40f7aec22ee3951378a555e5c8775aaf66 Mon Sep 17 00:00:00 2001 From: prssanna Date: Mon, 1 Feb 2021 19:50:27 +0530 Subject: [PATCH] style: fix formatting --- .../accounts/doctype/account/account_tree.js | 2 +- erpnext/crm/doctype/contract/contract_list.js | 20 +++++++++---------- .../course_scheduling_tool.js | 4 ++-- .../healthcare_service_unit_tree.js | 8 ++++---- erpnext/hr/page/team_updates/team_updates.js | 2 +- erpnext/public/scss/shopping_cart.scss | 2 +- .../page/point_of_sale/point_of_sale.js | 2 +- erpnext/shopping_cart/search.py | 3 +-- erpnext/templates/includes/cart.js | 6 ++++-- 9 files changed, 25 insertions(+), 24 deletions(-) diff --git a/erpnext/accounts/doctype/account/account_tree.js b/erpnext/accounts/doctype/account/account_tree.js index 7dc0533506..7516134baf 100644 --- a/erpnext/accounts/doctype/account/account_tree.js +++ b/erpnext/accounts/doctype/account/account_tree.js @@ -123,7 +123,7 @@ frappe.treeview_settings["Account"] = { }, "add"); }, onrender: function(node) { - if(frappe.boot.user.can_read.indexOf("GL Entry") !== -1){ + if (frappe.boot.user.can_read.indexOf("GL Entry") !== -1) { // show Dr if positive since balance is calculated as debit - credit else show Cr let balance = node.data.balance_in_account_currency || node.data.balance; diff --git a/erpnext/crm/doctype/contract/contract_list.js b/erpnext/crm/doctype/contract/contract_list.js index a09d123ed2..26a2907c7c 100644 --- a/erpnext/crm/doctype/contract/contract_list.js +++ b/erpnext/crm/doctype/contract/contract_list.js @@ -1,12 +1,12 @@ frappe.listview_settings['Contract'] = { - add_fields: ["status"], - get_indicator: function (doc) { - if (doc.status == "Unsigned") { - return [__(doc.status), "red", "status,=," + doc.status]; - } else if (doc.status == "Active") { - return [__(doc.status), "green", "status,=," + doc.status]; - } else if (doc.status == "Inactive") { - return [__(doc.status), "gray", "status,=," + doc.status]; - } - }, + add_fields: ["status"], + get_indicator: function (doc) { + if (doc.status == "Unsigned") { + return [__(doc.status), "red", "status,=," + doc.status]; + } else if (doc.status == "Active") { + return [__(doc.status), "green", "status,=," + doc.status]; + } else if (doc.status == "Inactive") { + return [__(doc.status), "gray", "status,=," + doc.status]; + } + }, }; \ No newline at end of file diff --git a/erpnext/education/doctype/course_scheduling_tool/course_scheduling_tool.js b/erpnext/education/doctype/course_scheduling_tool/course_scheduling_tool.js index 4e2ccaa30c..8699103cb2 100644 --- a/erpnext/education/doctype/course_scheduling_tool/course_scheduling_tool.js +++ b/erpnext/education/doctype/course_scheduling_tool/course_scheduling_tool.js @@ -24,8 +24,8 @@ frappe.ui.form.on('Course Scheduling Tool', { ${__('Following course schedules were created')} ${__("Course")}${__("Date")} - ${course_schedules.map( - c => `${c.name} + ${course_schedules.map(c => + `${c.name} ${c.schedule_date}` ).join('')} diff --git a/erpnext/healthcare/doctype/healthcare_service_unit/healthcare_service_unit_tree.js b/erpnext/healthcare/doctype/healthcare_service_unit/healthcare_service_unit_tree.js index bfb0ba13ce..b75f271827 100644 --- a/erpnext/healthcare/doctype/healthcare_service_unit/healthcare_service_unit_tree.js +++ b/erpnext/healthcare/doctype/healthcare_service_unit/healthcare_service_unit_tree.js @@ -12,19 +12,19 @@ frappe.treeview_settings["Healthcare Service Unit"] = { get_tree_nodes: 'erpnext.healthcare.utils.get_children', ignore_fields:["parent_healthcare_service_unit"], onrender: function(node) { - if (node.data.occupied_out_of_vacant!==undefined){ + if (node.data.occupied_out_of_vacant!==undefined) { $('' + " " + node.data.occupied_out_of_vacant + '').insertBefore(node.$ul); } if (node.data && node.data.inpatient_occupancy!==undefined) { - if (node.data.inpatient_occupancy == 1){ - if (node.data.occupancy_status == "Occupied"){ + if (node.data.inpatient_occupancy == 1) { + if (node.data.occupancy_status == "Occupied") { $('' + " " + node.data.occupancy_status + '').insertBefore(node.$ul); } - if (node.data.occupancy_status == "Vacant"){ + if (node.data.occupancy_status == "Vacant") { $('' + " " + node.data.occupancy_status + '').insertBefore(node.$ul); diff --git a/erpnext/hr/page/team_updates/team_updates.js b/erpnext/hr/page/team_updates/team_updates.js index 29780b8161..13d0074660 100644 --- a/erpnext/hr/page/team_updates/team_updates.js +++ b/erpnext/hr/page/team_updates/team_updates.js @@ -41,7 +41,7 @@ frappe.team_updates = { me.add_row(d); }); } else { - frappe.show_alert({message:__('No more updates'), indicator:'gray'}); + frappe.show_alert({message: __('No more updates'), indicator: 'gray'}); me.more.parent().addClass('hidden'); } } diff --git a/erpnext/public/scss/shopping_cart.scss b/erpnext/public/scss/shopping_cart.scss index ee30f53186..159a8a47cd 100644 --- a/erpnext/public/scss/shopping_cart.scss +++ b/erpnext/public/scss/shopping_cart.scss @@ -58,7 +58,7 @@ body.product-page { .card-grid { display: grid; grid-gap: 15px; - grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));; + grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); } } diff --git a/erpnext/selling/page/point_of_sale/point_of_sale.js b/erpnext/selling/page/point_of_sale/point_of_sale.js index 6d8ad7e1af..501c7df78b 100644 --- a/erpnext/selling/page/point_of_sale/point_of_sale.js +++ b/erpnext/selling/page/point_of_sale/point_of_sale.js @@ -10,7 +10,7 @@ frappe.pages['point-of-sale'].on_page_load = function(wrapper) { frappe.require('assets/js/point-of-sale.min.js', function() { wrapper.pos = new erpnext.PointOfSale.Controller(wrapper); window.cur_pos = wrapper.pos; - }) + }); }; frappe.pages['point-of-sale'].refresh = function(wrapper) { diff --git a/erpnext/shopping_cart/search.py b/erpnext/shopping_cart/search.py index 012d09fafc..63e9fe1b31 100644 --- a/erpnext/shopping_cart/search.py +++ b/erpnext/shopping_cart/search.py @@ -1,7 +1,6 @@ import frappe from frappe.search.full_text_search import FullTextSearch from whoosh.fields import TEXT, ID, KEYWORD, Schema -from frappe.website.render import render_page from frappe.utils import strip_html_tags from whoosh.qparser import MultifieldParser, FieldsPlugin, WildcardPlugin from whoosh.analysis import StemmingAnalyzer @@ -52,7 +51,7 @@ class ProductSearch(FullTextSearch): if item.web_long_description: content = strip_html_tags(item.web_long_description) - elif description: + elif item.description: content = strip_html_tags(item.description) return frappe._dict( diff --git a/erpnext/templates/includes/cart.js b/erpnext/templates/includes/cart.js index 0de02676af..c390cd171d 100644 --- a/erpnext/templates/includes/cart.js +++ b/erpnext/templates/includes/cart.js @@ -35,7 +35,7 @@ $.extend(shopping_cart, { }, get_update_address_dialog() { - return new frappe.ui.Dialog({ + let d = new frappe.ui.Dialog({ title: "Select Address", fields: [{ 'fieldtype': 'HTML', @@ -56,7 +56,7 @@ $.extend(shopping_cart, { }, callback: function(r) { d.hide(); - if(!r.exc) { + if (!r.exc) { $(".cart-tax-items").html(r.message.taxes); shopping_cart.parent.find( `.address-container[data-address-type="${address_type}"]` @@ -66,6 +66,8 @@ $.extend(shopping_cart, { }); } }); + + return d; }, get_address_template(type) {