[hub] cleanups

This commit is contained in:
Prateeksha Singh 2018-02-15 10:47:59 +05:30
parent 2073959bb8
commit 1ad072f2a9
2 changed files with 1 additions and 6 deletions

View File

@ -106,7 +106,7 @@ erpnext.hub.ItemPage = class ItemPage extends erpnext.hub.HubForm{
category_field.read_only = 1; category_field.read_only = 1;
} }
fields.push(category_field); fields.unshift(category_field);
return fields; return fields;
} }

View File

@ -13,14 +13,12 @@ erpnext.hub.HubListing = class HubListing extends frappe.views.BaseList {
setup_fields() { setup_fields() {
return this.get_meta() return this.get_meta()
.then(r => { .then(r => {
// console.log('fields then', this.doctype);
this.meta = r.message || this.meta; this.meta = r.message || this.meta;
frappe.model.sync(this.meta); frappe.model.sync(this.meta);
}); });
} }
get_meta() { get_meta() {
// console.log('get_meta', this.doctype);
return new Promise(resolve => return new Promise(resolve =>
frappe.call('erpnext.hub_node.get_meta', {doctype: this.doctype}, resolve)); frappe.call('erpnext.hub_node.get_meta', {doctype: this.doctype}, resolve));
} }
@ -51,7 +49,6 @@ erpnext.hub.HubListing = class HubListing extends frappe.views.BaseList {
update_data(r) { update_data(r) {
const data = r.message; const data = r.message;
console.log('update data', data);
if (this.start === 0) { if (this.start === 0) {
this.data = data; this.data = data;
@ -79,7 +76,6 @@ erpnext.hub.HubListing = class HubListing extends frappe.views.BaseList {
render_image_view() { render_image_view() {
let data = this.data; let data = this.data;
// console.log('this.data render', this.data);
if (this.start === 0) { if (this.start === 0) {
this.$result.html('<div class="image-view-container small padding-top">'); this.$result.html('<div class="image-view-container small padding-top">');
data = this.data.slice(this.start); data = this.data.slice(this.start);
@ -164,7 +160,6 @@ erpnext.hub.ItemListing = class ItemListing extends erpnext.hub.HubListing {
item._name = encodeURI(item.name); item._name = encodeURI(item.name);
const encoded_name = item._name; const encoded_name = item._name;
const title = strip_html(item['item_name' || 'item_code']); const title = strip_html(item['item_name' || 'item_code']);
// console.log(item);
const company_name = item['company_name']; const company_name = item['company_name'];
const route = `#Hub/Item/${item.hub_item_code}`; const route = `#Hub/Item/${item.hub_item_code}`;