2018-08-01 14:09:07 +05:30
|
|
|
frappe.provide('erpnext.hub');
|
2017-12-10 22:02:41 +05:30
|
|
|
|
2018-12-19 10:15:59 +05:30
|
|
|
frappe.views.MarketplaceFactory = class MarketplaceFactory extends frappe.views.Factory {
|
2018-07-23 18:44:46 +05:30
|
|
|
show() {
|
2018-08-31 15:35:32 +05:30
|
|
|
is_marketplace_disabled()
|
|
|
|
.then(disabled => {
|
|
|
|
if (disabled) {
|
|
|
|
frappe.show_not_found('Marketplace');
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (frappe.pages.marketplace) {
|
|
|
|
frappe.container.change_to('marketplace');
|
|
|
|
erpnext.hub.marketplace.refresh();
|
|
|
|
} else {
|
|
|
|
this.make('marketplace');
|
|
|
|
}
|
|
|
|
});
|
2018-07-23 18:44:46 +05:30
|
|
|
}
|
2017-12-10 22:02:41 +05:30
|
|
|
|
2018-07-23 18:44:46 +05:30
|
|
|
make(page_name) {
|
2021-05-07 14:53:42 +05:30
|
|
|
frappe.require('marketplace.bundle.js', () => {
|
2018-07-23 18:44:46 +05:30
|
|
|
erpnext.hub.marketplace = new erpnext.hub.Marketplace({
|
|
|
|
parent: this.make_page(true, page_name)
|
|
|
|
});
|
2018-02-15 10:17:07 +05:30
|
|
|
});
|
2018-07-25 16:51:01 +05:30
|
|
|
}
|
2018-08-29 14:27:47 +05:30
|
|
|
};
|
2018-04-03 10:44:13 +05:30
|
|
|
|
2018-08-31 15:35:32 +05:30
|
|
|
function is_marketplace_disabled() {
|
2018-10-23 11:52:06 +05:30
|
|
|
return frappe.call({
|
|
|
|
method: "erpnext.hub_node.doctype.marketplace_settings.marketplace_settings.is_marketplace_enabled"
|
|
|
|
}).then(r => r.message)
|
2018-08-31 15:35:32 +05:30
|
|
|
}
|