diff --git a/erpnext/public/images/hub_logo.svg b/erpnext/public/images/hub_logo.svg index 1612c6da118..4af482176ea 100644 --- a/erpnext/public/images/hub_logo.svg +++ b/erpnext/public/images/hub_logo.svg @@ -1,37 +1,112 @@ + + + diff --git a/erpnext/public/js/hub/hub_factory.js b/erpnext/public/js/hub/hub_factory.js index 01f55a3c6c9..6451e1d6a96 100644 --- a/erpnext/public/js/hub/hub_factory.js +++ b/erpnext/public/js/hub/hub_factory.js @@ -35,7 +35,7 @@ frappe.views.HubFactory = frappe.views.Factory.extend({ }); } }); - } else { + } else if (!route[3]){ frappe.require(assets['Form'], () => { erpnext.hub.pages[page_name] = new erpnext.hub[page+'Page']({ unique_id: route[2], @@ -44,6 +44,15 @@ frappe.views.HubFactory = frappe.views.Factory.extend({ hub_settings: this.hub_settings }); }); + } else { + frappe.require(assets['List'], () => { + frappe.route_options = {}; + frappe.route_options["company_name"] = route[2] + erpnext.hub.pages[page_name] = new erpnext.hub['ItemListing']({ + parent: this.make_page(true, page_name), + hub_settings: this.hub_settings + }); + }); } window.hub_page = erpnext.hub.pages[page_name]; } else { diff --git a/erpnext/public/js/hub/hub_listing.js b/erpnext/public/js/hub/hub_listing.js index a979d287e6c..237efe614ee 100644 --- a/erpnext/public/js/hub/hub_listing.js +++ b/erpnext/public/js/hub/hub_listing.js @@ -58,12 +58,7 @@ erpnext.hub.HubListing = class HubListing extends frappe.views.BaseList { label: __('Favourites'), action: () => frappe.set_route('Hub', 'Favourites'), standard: true - }, - // { - // label: __('Toggle Sidebar'), - // action: () => this.toggle_side_bar(), - // standard: true - // } + } ]; return items; @@ -85,7 +80,15 @@ erpnext.hub.HubListing = class HubListing extends frappe.views.BaseList { }); } - setup_view() { } + setup_view() { + if(frappe.route_options){ + const filters = []; + for (let field in frappe.route_options) { + var value = frappe.route_options[field]; + this.page.fields_dict[field].set_value(value); + } + } + } get_args() { return { @@ -110,18 +113,7 @@ erpnext.hub.HubListing = class HubListing extends frappe.views.BaseList { this.data_dict = {}; } - freeze(toggle) { - // if(!this.$freeze) return; - // this.$freeze.toggle(toggle); - // if (this.$freeze.find('.image-view-container').length) return; - - // const html = Array.from(new Array(4)).map(d => this.card_html({ - // name: 'Loading...', - // item_name: 'Loading...' - // })).join(''); - - // this.$freeze.html(`