From 9a7f957acebaf8aad0f0f03c94e60965c19ce9be Mon Sep 17 00:00:00 2001 From: Prateeksha Singh Date: Thu, 7 Jun 2018 12:40:40 +0530 Subject: [PATCH 1/2] [hub] fix item page recursion --- erpnext/public/js/hub/hub_form.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/public/js/hub/hub_form.js b/erpnext/public/js/hub/hub_form.js index 4a8c4eb3ec..54dd174e53 100644 --- a/erpnext/public/js/hub/hub_form.js +++ b/erpnext/public/js/hub/hub_form.js @@ -325,7 +325,7 @@ erpnext.hub.ItemPage = class ItemPage extends erpnext.hub.HubDetailsPage { } setup_side_bar() { - this.setup_side_bar(); + super.setup_side_bar(); this.attachFooter(); this.attachTimeline(); this.attachReviewArea(); From 00ab78d768c4048c845bd84420e0fd170d54ac49 Mon Sep 17 00:00:00 2001 From: Prateeksha Singh Date: Thu, 7 Jun 2018 14:13:00 +0530 Subject: [PATCH 2/2] [hub] set page title dynamically --- erpnext/public/js/hub/hub_form.js | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/erpnext/public/js/hub/hub_form.js b/erpnext/public/js/hub/hub_form.js index 54dd174e53..9287e6d54f 100644 --- a/erpnext/public/js/hub/hub_form.js +++ b/erpnext/public/js/hub/hub_form.js @@ -5,7 +5,7 @@ erpnext.hub.HubDetailsPage = class HubDetailsPage extends frappe.views.BaseList super.setup_defaults(); this.method = 'erpnext.hub_node.get_details'; const route = frappe.get_route(); - this.page_name = route[2]; + // this.page_name = route[2]; } setup_fields() { @@ -359,6 +359,11 @@ erpnext.hub.ItemPage = class ItemPage extends erpnext.hub.HubDetailsPage { }, 'octicon octicon-plus'); } + prepare_data(r) { + super.prepare_data(r); + this.page.set_title(this.data["item_name"]); + } + make_rfq(item, supplier, btn) { console.log(supplier); return new Promise((resolve, reject) => { @@ -467,7 +472,6 @@ erpnext.hub.ItemPage = class ItemPage extends erpnext.hub.HubDetailsPage { erpnext.hub.CompanyPage = class CompanyPage extends erpnext.hub.HubDetailsPage { constructor(opts) { super(opts); - this.show(); } @@ -477,6 +481,11 @@ erpnext.hub.CompanyPage = class CompanyPage extends erpnext.hub.HubDetailsPage { this.image_field_name = 'company_logo'; } + prepare_data(r) { + super.prepare_data(r); + this.page.set_title(this.data["company_name"]); + } + getFormFields() { let fieldnames = ['company_name', 'description', 'route', 'country', 'seller', 'site_name'];; this.formFields = this.prepareFormFields(this.meta.fields, fieldnames);