From c1a1e7d503cf9df43287abe81d3f2d899c6c5ad3 Mon Sep 17 00:00:00 2001 From: Mangesh-Khairnar Date: Thu, 19 Dec 2019 20:11:37 +0530 Subject: [PATCH] style: formatting changes --- erpnext/hub_node/api.py | 4 +- .../js/hub/components/edit_details_dialog.js | 14 +- erpnext/public/js/hub/pages/Item.vue | 181 +++++++++--------- 3 files changed, 101 insertions(+), 98 deletions(-) diff --git a/erpnext/hub_node/api.py b/erpnext/hub_node/api.py index 602d65e81a1..f362539ee7c 100644 --- a/erpnext/hub_node/api.py +++ b/erpnext/hub_node/api.py @@ -116,10 +116,10 @@ def get_valid_items(search_value=''): return valid_items @frappe.whitelist() -def update_item(ref_doctype, ref_doc, data): +def update_item(ref_doc, data): data = json.loads(data) - data.update(dict(doctype=ref_doctype, name=ref_doc)) + data.update(dict(doctype='Hub Item', name=ref_doc)) try: connection = get_hub_connection() connection.update(data) diff --git a/erpnext/public/js/hub/components/edit_details_dialog.js b/erpnext/public/js/hub/components/edit_details_dialog.js index e249ca5d7a4..97c5f83a13a 100644 --- a/erpnext/public/js/hub/components/edit_details_dialog.js +++ b/erpnext/public/js/hub/components/edit_details_dialog.js @@ -1,4 +1,4 @@ -function EditDetailsDialog(primary_action, defaults) { +function edit_details_dialog(params) { let dialog = new frappe.ui.Dialog({ title: __('Update Details'), fields: [ @@ -6,14 +6,14 @@ function EditDetailsDialog(primary_action, defaults) { label: 'Item Name', fieldname: 'item_name', fieldtype: 'Data', - default: defaults.item_name, + default: params.defaults.item_name, reqd: 1 }, { label: 'Hub Category', fieldname: 'hub_category', fieldtype: 'Autocomplete', - default: defaults.hub_category, + default: params.defaults.hub_category, options: [], reqd: 1 }, @@ -21,13 +21,13 @@ function EditDetailsDialog(primary_action, defaults) { label: 'Description', fieldname: 'description', fieldtype: 'Text', - default: defaults.description, + default: params.defaults.description, options: [], reqd: 1 } ], - primary_action_label: primary_action.label || __('Update Details'), - primary_action: primary_action.fn + primary_action_label: params.primary_action.label || __('Update Details'), + primary_action: params.primary_action.fn }); hub.call('get_categories').then(categories => { @@ -38,4 +38,4 @@ function EditDetailsDialog(primary_action, defaults) { return dialog; } -export { EditDetailsDialog }; +export { edit_details_dialog }; diff --git a/erpnext/public/js/hub/pages/Item.vue b/erpnext/public/js/hub/pages/Item.vue index 31cc8d5c8cf..11744781b7a 100644 --- a/erpnext/public/js/hub/pages/Item.vue +++ b/erpnext/public/js/hub/pages/Item.vue @@ -1,10 +1,5 @@