diff --git a/erpnext/public/js/hub/PageContainer.vue b/erpnext/public/js/hub/PageContainer.vue index f213a180b6..cec4c8d746 100644 --- a/erpnext/public/js/hub/PageContainer.vue +++ b/erpnext/public/js/hub/PageContainer.vue @@ -9,8 +9,8 @@ import Home from './pages/Home.vue'; import Search from './pages/Search.vue'; import Category from './pages/Category.vue'; -import SavedProducts from './pages/SavedProducts.vue'; -import PublishedProducts from './pages/PublishedProducts.vue'; +import SavedItems from './pages/SavedItems.vue'; +import PublishedItems from './pages/PublishedItems.vue'; import Item from './pages/Item.vue'; import Seller from './pages/Seller.vue'; import Publish from './pages/Publish.vue'; @@ -30,9 +30,9 @@ const route_map = { // Registered seller routes 'marketplace/profile': Profile, - 'marketplace/saved-products': SavedProducts, + 'marketplace/saved-items': SavedItems, 'marketplace/publish': Publish, - 'marketplace/my-products': PublishedProducts, + 'marketplace/published-items': PublishedItems, 'marketplace/buying': Buying, 'marketplace/buying/:item': Messages, 'marketplace/selling': Selling, @@ -58,7 +58,6 @@ export default { get_current_page() { const curr_route = frappe.get_route_str(); let route = Object.keys(route_map).filter(route => route == curr_route)[0]; - if (!route) { // find route by matching it with dynamic part const curr_route_parts = curr_route.split('/'); @@ -70,7 +69,7 @@ export default { let weight = 0; route_parts.forEach((part, i) => { const curr_route_part = curr_route_parts[i]; - if (part === curr_route_part || curr_route_part.includes(':')) { + if (part === curr_route_part || part.includes(':')) { weight += 1; } }); @@ -80,12 +79,13 @@ export default { }, {}); // get the route with the highest weight - let weight = 0 for (let key in weighted_routes) { const route_weight = weighted_routes[key]; - if (route_weight > weight) { + if (route_weight === curr_route_parts.length) { route = key; - weight = route_weight; + break; + } else { + route = null; } } } diff --git a/erpnext/public/js/hub/Sidebar.vue b/erpnext/public/js/hub/Sidebar.vue index 6728664cad..cff580e5ff 100644 --- a/erpnext/public/js/hub/Sidebar.vue +++ b/erpnext/public/js/hub/Sidebar.vue @@ -19,15 +19,15 @@ export default { data() { return { - hub_registered: hub.settings.registered, + hub_registered: hub.settings.registered && frappe.session.user === hub.settings.company_email, items: [ { label: __('Browse'), route: 'marketplace/home' }, { - label: __('Saved Products'), - route: 'marketplace/saved-products', + label: __('Saved Items'), + route: 'marketplace/saved-items', condition: () => this.hub_registered }, { @@ -36,12 +36,12 @@ export default { condition: () => this.hub_registered }, { - label: __('Your Products'), - route: 'marketplace/my-products', + label: __('Your Items'), + route: 'marketplace/published-items', condition: () => this.hub_registered }, { - label: __('Publish Products'), + label: __('Publish Items'), route: 'marketplace/publish', condition: () => this.hub_registered }, diff --git a/erpnext/public/js/hub/components/TimelineItem.vue b/erpnext/public/js/hub/components/TimelineItem.vue index 97b5a0d942..d13c842beb 100644 --- a/erpnext/public/js/hub/components/TimelineItem.vue +++ b/erpnext/public/js/hub/components/TimelineItem.vue @@ -3,7 +3,7 @@
- 4 weeks ago Published 1 product to Marketplace + 4 weeks ago Published 1 item to Marketplace
diff --git a/erpnext/public/js/hub/components/detail_view.js b/erpnext/public/js/hub/components/detail_view.js index fca6a56bcb..d80720c1da 100644 --- a/erpnext/public/js/hub/components/detail_view.js +++ b/erpnext/public/js/hub/components/detail_view.js @@ -94,7 +94,7 @@ function get_detail_view_html(item, allow_edit) {
- Product Description + Item Description

${description ? description : __('No details')} diff --git a/erpnext/public/js/hub/marketplace.js b/erpnext/public/js/hub/marketplace.js index 67ac50208c..cdf3d2332d 100644 --- a/erpnext/public/js/hub/marketplace.js +++ b/erpnext/public/js/hub/marketplace.js @@ -23,13 +23,14 @@ erpnext.hub.Marketplace = class Marketplace { frappe.db.get_doc('Hub Settings') .then(doc => { hub.settings = doc; - const is_registered = hub.settings.registered + const is_registered = hub.settings.registered; + const is_registered_seller = hub.settings.company_email === frappe.session.user; this.setup_header(); this.make_sidebar(); this.make_body(); this.setup_events(); this.refresh(); - if (!is_registered && frappe.user_roles.includes('System Manager')) { + if (!is_registered && !is_registered_seller && frappe.user_roles.includes('System Manager')) { this.page.set_primary_action('Become a Seller', this.show_register_dialog.bind(this)) } }); diff --git a/erpnext/public/js/hub/pages/Category.vue b/erpnext/public/js/hub/pages/Category.vue index 2ffbcf3d21..3a0e6bfab8 100644 --- a/erpnext/public/js/hub/pages/Category.vue +++ b/erpnext/public/js/hub/pages/Category.vue @@ -18,7 +18,6 @@