From b20c4e3184c319ec8870fda1a53f1f1d9c4baf76 Mon Sep 17 00:00:00 2001 From: Prateeksha Singh Date: Thu, 30 Aug 2018 12:01:04 +0530 Subject: [PATCH 1/3] [hub] remove client hub_settings scripts - multiline to single line messages to translate --- .../doctype/hub_settings/hub_settings.js | 34 +------------------ erpnext/public/js/hub/pages/Publish.vue | 8 ++--- 2 files changed, 4 insertions(+), 38 deletions(-) diff --git a/erpnext/hub_node/doctype/hub_settings/hub_settings.js b/erpnext/hub_node/doctype/hub_settings/hub_settings.js index 03314bb436..089f499919 100644 --- a/erpnext/hub_node/doctype/hub_settings/hub_settings.js +++ b/erpnext/hub_node/doctype/hub_settings/hub_settings.js @@ -1,35 +1,3 @@ frappe.ui.form.on("Hub Settings", { - onload_post_render: function(frm) { - if(frm.get_field("unregister_from_hub").$input) - frm.get_field("unregister_from_hub").$input.addClass("btn-danger"); - }, - - hub_user_email: function(frm) { - if(frm.doc.hub_user_email){ - frm.set_value("hub_user_name", frappe.user.full_name(frm.doc.hub_user_email)); - } - }, - - call_register: (frm) => { - this.frm.call({ - doc: this.frm.doc, - method: "register", - args: {}, - freeze: true, - callback: function(r) {}, - onerror: function() { - frappe.msgprint(__("Wrong Password")); - frm.set_value("enabled", 0); - } - }); - }, - - unregister_from_hub: (frm) => { - frappe.verify_password(() => { - var d = frappe.confirm(__('Are you sure you want to unregister?'), () => { - frm.call('unregister'); - }, () => {}, __('Confirm Action')); - d.get_primary_btn().addClass("btn-danger"); - }); - }, + onload_post_render: function() {}, }); diff --git a/erpnext/public/js/hub/pages/Publish.vue b/erpnext/public/js/hub/pages/Publish.vue index 79da6cb5cc..0219fc9dec 100644 --- a/erpnext/public/js/hub/pages/Publish.vue +++ b/erpnext/public/js/hub/pages/Publish.vue @@ -72,13 +72,11 @@ export default { item_id_fieldname: 'item_code', // Constants + // TODO: multiline translations don't work page_title: __('Publish Products'), search_placeholder: __('Search Items ...'), - empty_state_message: __(`No Items selected yet. - Browse and click on products below to publish.`), - valid_products_instruction: __(`Only products with an image, description - and category can be published. Please update them if an item in your - inventory does not appear.`), + empty_state_message: __(`No Items selected yet. Browse and click on products below to publish.`), + valid_products_instruction: __(`Only products with an image and description can be published. Please update them if an item in your inventory does not appear.`), last_sync_message: (hub.settings.last_sync_datetime) ? __(`Last sync was From 47f5f0e608f9e9cb90ff4c9b31a6c761663c55e8 Mon Sep 17 00:00:00 2001 From: Prateeksha Singh Date: Thu, 30 Aug 2018 12:16:08 +0530 Subject: [PATCH 2/3] [hub] remove See All from non expandable sections --- erpnext/public/js/hub/pages/Home.vue | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/erpnext/public/js/hub/pages/Home.vue b/erpnext/public/js/hub/pages/Home.vue index bba2e1d577..4f9796d297 100644 --- a/erpnext/public/js/hub/pages/Home.vue +++ b/erpnext/public/js/hub/pages/Home.vue @@ -13,7 +13,7 @@

{{ section.title }}

-

{{ 'See All' }}

+

{{ 'See All' }}

Date: Thu, 30 Aug 2018 12:58:46 +0530 Subject: [PATCH 3/3] [hub] UI and empty state in 'your products' to guide on publishing --- .../js/hub/components/ItemCardsContainer.vue | 4 ++- .../public/js/hub/pages/PublishedProducts.vue | 30 +++++++++++++++++-- 2 files changed, 31 insertions(+), 3 deletions(-) diff --git a/erpnext/public/js/hub/components/ItemCardsContainer.vue b/erpnext/public/js/hub/components/ItemCardsContainer.vue index 748c2720f9..0a20bcdc63 100644 --- a/erpnext/public/js/hub/components/ItemCardsContainer.vue +++ b/erpnext/public/js/hub/components/ItemCardsContainer.vue @@ -3,8 +3,9 @@ -
{{ page_title }}
+ +
+
{{ page_title }}
+

+ {{ published_items_message }} +

+
+ + + +
@@ -25,8 +42,17 @@ export default { items: [], item_id_fieldname: 'name', + publish_page_action: { + label: __('Publish Your First Items'), + on_click: () => { + frappe.set_route(`marketplace/home`); + } + }, + // Constants - page_title: __('Published Products'), + page_title: __('Published Items'), + publish_button_text: __('Publish More Items'), + published_items_message: __('You can publish upto 200 items.'), // TODO: Add empty state action empty_state_message: __(`You haven't published any products yet. Publish.`) };