From 40f7c4663a06c2435906ea0782ff923426381168 Mon Sep 17 00:00:00 2001 From: Prateeksha Singh Date: Fri, 24 Aug 2018 16:38:34 +0530 Subject: [PATCH] [hub][vue] Publish Page --- erpnext/hub_node/api.py | 16 +- .../public/js/hub/components/EmptyState.vue | 2 +- erpnext/public/js/hub/components/ItemCard.vue | 92 +++++- .../js/hub/components/ItemCardsContainer.vue | 34 ++- .../public/js/hub/components/PublishPage.vue | 105 ++++++- .../js/hub/components/item_publish_dialog.js | 82 +++--- .../js/hub/components/publishing_area.js | 37 --- erpnext/public/js/hub/pages/publish.js | 263 ------------------ erpnext/public/less/hub.less | 10 - 9 files changed, 251 insertions(+), 390 deletions(-) delete mode 100644 erpnext/public/js/hub/components/publishing_area.js diff --git a/erpnext/hub_node/api.py b/erpnext/hub_node/api.py index 85693c72af5..c4a79255822 100644 --- a/erpnext/hub_node/api.py +++ b/erpnext/hub_node/api.py @@ -39,6 +39,7 @@ def map_fields(items): item['doctype'] = 'Hub Item' item['hub_seller'] = hub_seller + item.pop('attachments', None) return items @@ -71,24 +72,19 @@ def publish_selected_items(items_to_publish): if not len(items_to_publish): frappe.throw('No items to publish') - publishing_items = [] - - for item_additional_info in items_to_publish: - item_code = item_additional_info.get('item_code') + for item in items_to_publish: + item_code = item.get('item_code') frappe.db.set_value('Item', item_code, 'publish_in_hub', 1) frappe.get_doc({ 'doctype': 'Hub Tracked Item', 'item_code': item_code, - 'hub_category': item_additional_info.get('hub_category'), - 'image_list': item_additional_info.get('image_list') + 'hub_category': item.get('hub_category'), + 'image_list': item.get('image_list') }).insert() - item_data = frappe.get_doc("Item", item_code).as_dict().update(item_additional_info) - publishing_items.append(item_data) - - items = map_fields(publishing_items) + items = map_fields(items_to_publish) try: item_sync_preprocess() diff --git a/erpnext/public/js/hub/components/EmptyState.vue b/erpnext/public/js/hub/components/EmptyState.vue index 1f36c3c75bb..c0ad971aa72 100644 --- a/erpnext/public/js/hub/components/EmptyState.vue +++ b/erpnext/public/js/hub/components/EmptyState.vue @@ -25,7 +25,7 @@ export default { .empty-state { height: 500px; - margin: 15px 0px; + margin: 15px; } .empty-state.bordered { diff --git a/erpnext/public/js/hub/components/ItemCard.vue b/erpnext/public/js/hub/components/ItemCard.vue index 7a7f8216802..4d72344d257 100644 --- a/erpnext/public/js/hub/components/ItemCard.vue +++ b/erpnext/public/js/hub/components/ItemCard.vue @@ -1,11 +1,18 @@