Remove 'Become Seller' option from sidebar

This commit is contained in:
Suraj Shetty 2018-08-28 15:03:01 +05:30
parent 9a50044003
commit f994e3ec6b

View File

@ -19,48 +19,44 @@
export default { export default {
data() { data() {
return { return {
hub_registered: hub.settings.registered,
items: [ items: [
{ {
label: __('Browse'), label: __('Browse'),
route: 'marketplace/home' route: 'marketplace/home'
}, },
{
label: __('Become a Seller'),
action: this.show_register_dialog,
condition: () => !hub.settings.registered
},
{ {
label: __('Saved Products'), label: __('Saved Products'),
route: 'marketplace/saved-products', route: 'marketplace/saved-products',
condition: () => hub.settings.registered condition: () => this.hub_registered
}, },
{ {
label: __('Your Profile'), label: __('Your Profile'),
route: 'marketplace/profile', route: 'marketplace/profile',
condition: () => hub.settings.registered condition: () => this.hub_registered
}, },
{ {
label: __('Your Products'), label: __('Your Products'),
route: 'marketplace/my-products', route: 'marketplace/my-products',
condition: () => hub.settings.registered condition: () => this.hub_registered
}, },
{ {
label: __('Publish Products'), label: __('Publish Products'),
route: 'marketplace/publish', route: 'marketplace/publish',
condition: () => hub.settings.registered condition: () => this.hub_registered
}, },
{ {
label: __('Selling'), label: __('Selling'),
route: 'marketplace/selling', route: 'marketplace/selling',
condition: () => hub.settings.registered condition: () => this.hub_registered
}, },
{ {
label: __('Buying'), label: __('Buying'),
route: 'marketplace/buying', route: 'marketplace/buying',
condition: () => hub.settings.registered condition: () => this.hub_registered
}, },
], ],
categories: [] categories: [],
} }
}, },
created() { created() {
@ -80,6 +76,10 @@ export default {
this.update_sidebar_state(); this.update_sidebar_state();
}); });
}); });
erpnext.hub.on('seller-registered', () => {
this.hub_registered = true;
})
}, },
mounted() { mounted() {
this.update_sidebar_state(); this.update_sidebar_state();
@ -99,7 +99,7 @@ export default {
const $siblings = container.find('[data-route]'); const $siblings = container.find('[data-route]');
$siblings.removeClass('active').addClass('text-muted'); $siblings.removeClass('active').addClass('text-muted');
$sidebar_item.addClass('active').removeClass('text-muted'); $sidebar_item.addClass('active').removeClass('text-muted');
} },
} }
} }
</script> </script>