From fd73c643b527bffb7f8ff19e2b27be9606ef5cc7 Mon Sep 17 00:00:00 2001 From: 18alantom <2.alan.tom@gmail.com> Date: Thu, 10 Mar 2022 12:06:37 +0530 Subject: [PATCH] feat: add item segregation in sidebar --- src/router.js | 8 ++++++-- src/sidebarConfig.js | 22 ++++++++++++++++------ 2 files changed, 22 insertions(+), 8 deletions(-) diff --git a/src/router.js b/src/router.js index 906bb636..4de8ba4e 100644 --- a/src/router.js +++ b/src/router.js @@ -54,7 +54,7 @@ const routes = [ }, }, { - path: '/list/:doctype', + path: '/list/:doctype/:fieldname?/:value?', name: 'ListView', components: { default: ListView, @@ -62,7 +62,11 @@ const routes = [ }, props: { default: (route) => { - const { doctype, filters } = route.params; + let { doctype, filters, fieldname, value } = route.params; + if (filters === undefined && fieldname && value) { + filters = { [fieldname]: value }; + } + return { doctype, filters, diff --git a/src/sidebarConfig.js b/src/sidebarConfig.js index cbeb148f..5b975b8f 100644 --- a/src/sidebarConfig.js +++ b/src/sidebarConfig.js @@ -33,6 +33,11 @@ const config = { route: '/list/Customer', doctype: 'Customer', }, + { + label: t`Sales Items`, + route: '/list/Item/for/sales', + doctype: 'Item', + }, ], }, { @@ -50,18 +55,18 @@ const config = { route: '/list/Supplier', doctype: 'Supplier', }, + { + label: t`Purchase Items`, + route: '/list/Item/for/purchases', + doctype: 'Item', + }, ], }, { icon: 'common-entries', title: t`Common`, - route: '/list/Item', + route: '/list/Payment', items: [ - { - label: t`Items`, - route: '/list/Item', - doctype: 'Item', - }, { label: t`Payments`, route: '/list/Payment', @@ -72,6 +77,11 @@ const config = { route: '/list/JournalEntry', doctype: 'JournalEntry', }, + { + label: t`Common Items`, + route: '/list/Item/for/both', + doctype: 'Item', + }, ], }, {