brotherton-erpnext/erpnext/public/js/hub/pages/seller.js

33 lines
864 B
JavaScript
Raw Normal View History

2018-08-01 20:12:23 +00:00
import SubPage from './subpage';
import { get_profile_html } from '../components/detail_view';
import { get_item_card_container_html } from '../components/items_container';
import { get_detail_skeleton_html } from '../components/skeleton_state';
2018-08-01 20:12:23 +00:00
erpnext.hub.Seller = class Seller extends SubPage {
make_wrapper() {
super.make_wrapper();
}
refresh() {
this.show_skeleton();
this.company = frappe.get_route()[2];
this.get_hub_seller_profile()
.then(this.render.bind(this));
}
get_hub_seller_profile() {
2018-08-07 06:32:14 +00:00
return hub.call('get_hub_seller_page_info', { company: this.company });
2018-08-01 20:12:23 +00:00
}
show_skeleton() {
this.$wrapper.html(get_detail_skeleton_html());
2018-08-01 20:12:23 +00:00
}
2018-08-07 06:32:14 +00:00
render(data) {
this.$wrapper.html(get_profile_html(data.profile));
2018-08-07 06:32:14 +00:00
let html = get_item_card_container_html(data.items, __('Products by ' + p.company));
this.$wrapper.append(html);
2018-08-01 20:12:23 +00:00
}
}