From 88baf53cc12d7ffd3aa322610cf93378a963bcec Mon Sep 17 00:00:00 2001 From: karthikeyan5 Date: Wed, 30 Jan 2019 17:40:40 +0530 Subject: [PATCH 1/4] feat(marketplace): navigation link to seller profile from item page --- .../public/js/hub/components/DetailHeaderItem.vue | 14 ++++++++++---- erpnext/public/js/hub/pages/Item.vue | 6 ++++-- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/erpnext/public/js/hub/components/DetailHeaderItem.vue b/erpnext/public/js/hub/components/DetailHeaderItem.vue index 8ca4379701..a6c5f066f2 100644 --- a/erpnext/public/js/hub/components/DetailHeaderItem.vue +++ b/erpnext/public/js/hub/components/DetailHeaderItem.vue @@ -1,5 +1,12 @@ + + diff --git a/erpnext/public/js/hub/pages/Item.vue b/erpnext/public/js/hub/pages/Item.vue index c379fc7343..841d0046db 100644 --- a/erpnext/public/js/hub/pages/Item.vue +++ b/erpnext/public/js/hub/pages/Item.vue @@ -72,6 +72,11 @@ export default { condition: hub.is_user_registered() && !this.is_own_item, action: this.add_to_saved_items }, + { + label: __('Add to Featured Item'), + condition: hub.is_user_registered() && this.is_own_item, + action: this.add_to_featured_items + }, { label: __('Report this Item'), condition: !this.is_own_item, @@ -212,6 +217,21 @@ export default { }); }, + add_to_featured_items() { + hub.call('add_item_to_seller_featured_items', { + hub_item_name: this.hub_item_name, + hub_user: frappe.session.user + },) + .then(() => { + const featured_items_link = `${__('Added to Featured Items')}` + frappe.show_alert(featured_items_link); + erpnext.hub.trigger('action:item_feature'); + }) + .catch(e => { + console.error(e); + }); + }, + make_contact_seller_dialog() { this.contact_seller_dialog = new frappe.ui.Dialog({ title: __('Send a message'), From 4df6003bd9d230a874b655dfea3cf16754712f70 Mon Sep 17 00:00:00 2001 From: karthikeyan5 Date: Fri, 8 Feb 2019 17:51:01 +0530 Subject: [PATCH 3/4] feat(marketplace): seller profile page --- erpnext/public/js/hub/PageContainer.vue | 5 +- erpnext/public/js/hub/pages/Profile.vue | 81 ------------- erpnext/public/js/hub/pages/Seller.vue | 122 ++++++++++++++++++-- erpnext/public/js/hub/pages/SellerItems.vue | 57 +++++++++ 4 files changed, 170 insertions(+), 95 deletions(-) delete mode 100644 erpnext/public/js/hub/pages/Profile.vue create mode 100644 erpnext/public/js/hub/pages/SellerItems.vue diff --git a/erpnext/public/js/hub/PageContainer.vue b/erpnext/public/js/hub/PageContainer.vue index 79358376ff..f151add8d5 100644 --- a/erpnext/public/js/hub/PageContainer.vue +++ b/erpnext/public/js/hub/PageContainer.vue @@ -14,11 +14,11 @@ import FeaturedItems from './pages/FeaturedItems.vue'; import PublishedItems from './pages/PublishedItems.vue'; import Item from './pages/Item.vue'; import Seller from './pages/Seller.vue'; +import SellerItems from './pages/SellerItems.vue'; import Publish from './pages/Publish.vue'; import Buying from './pages/Buying.vue'; import Selling from './pages/Selling.vue'; import Messages from './pages/Messages.vue'; -import Profile from './pages/Profile.vue'; import NotFound from './pages/NotFound.vue'; function get_route_map() { @@ -28,10 +28,11 @@ function get_route_map() { 'marketplace/category/:category': Category, 'marketplace/item/:item': Item, 'marketplace/seller/:seller': Seller, + 'marketplace/seller/:seller/items': SellerItems, 'marketplace/not-found': NotFound, } const registered_routes = { - 'marketplace/profile': Profile, + 'marketplace/profile': Seller, 'marketplace/saved-items': SavedItems, 'marketplace/featured-items': FeaturedItems, 'marketplace/publish': Publish, diff --git a/erpnext/public/js/hub/pages/Profile.vue b/erpnext/public/js/hub/pages/Profile.vue deleted file mode 100644 index 91ed946761..0000000000 --- a/erpnext/public/js/hub/pages/Profile.vue +++ /dev/null @@ -1,81 +0,0 @@ - - - - - diff --git a/erpnext/public/js/hub/pages/Seller.vue b/erpnext/public/js/hub/pages/Seller.vue index c80865bfbd..7d9b76e884 100644 --- a/erpnext/public/js/hub/pages/Seller.vue +++ b/erpnext/public/js/hub/pages/Seller.vue @@ -22,30 +22,77 @@ -
{{ item_container_heading }}
- - +
+
+ {{ item_container_heading }} + + Customize your Featured Items + +
+ + + Show all items +
+ +
+
Customer Reviews
+
+
+ + + + + {{ review.subject }} + +
+ by {{ review.username }} + + + + +
+
+
+ +
+
Stats
+
+
+ + + + + From 4324dc6ea890fb471e2927c9df70d04bf6df1aa2 Mon Sep 17 00:00:00 2001 From: karthikeyan5 Date: Tue, 12 Feb 2019 15:09:41 +0530 Subject: [PATCH 4/4] fix(marketplace): fixing hubmarket server specific error --- erpnext/public/js/hub/pages/Seller.vue | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/erpnext/public/js/hub/pages/Seller.vue b/erpnext/public/js/hub/pages/Seller.vue index 7d9b76e884..e339eaa3e5 100644 --- a/erpnext/public/js/hub/pages/Seller.vue +++ b/erpnext/public/js/hub/pages/Seller.vue @@ -125,15 +125,14 @@ export default { return hub.is_user_registered() }, get_seller_profile_and_items() { + let post_data = {company: this.seller_company} if (this.page_name == 'profile'){ this.seller_company = null; this.hub_seller = hub.settings.hub_seller_name + post_data = {hub_seller: this.hub_seller} } - hub.call( - 'get_hub_seller_page_info', - { company: this.seller_company, - hub_seller: this.hub_seller } - ).then(data => { + hub.call('get_hub_seller_page_info', post_data) + .then(data => { this.init = false; this.profile = data.profile; this.items = data.items;