From 74aa68f7a954e299c01ac71bef71f1f91aece9ca Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Wed, 26 Jul 2023 13:32:28 +0200 Subject: [PATCH] Bug 34418: Add is_empty flag Signed-off-by: Jonathan Druart Signed-off-by: Pedro Amorim --- koha-tmpl/intranet-tmpl/prog/js/vue/stores/navigation.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/js/vue/stores/navigation.js b/koha-tmpl/intranet-tmpl/prog/js/vue/stores/navigation.js index f7ab99d55f..5df32a53e1 100644 --- a/koha-tmpl/intranet-tmpl/prog/js/vue/stores/navigation.js +++ b/koha-tmpl/intranet-tmpl/prog/js/vue/stores/navigation.js @@ -115,16 +115,20 @@ export const useNavigationStore = defineStore("navigation", { return child.is_base || (child.path && child.path !== ""); } + function _isEmptyNode(child) { + return !child.is_empty; + } + function _mapMatches(currentMatches) { return currentMatches .filter(match => _isBaseOrNotStub(match.meta.self)) + .filter(match => _isEmptyNode(match.meta.self)) .map(match => ({ ...match.meta.self, icon: null, path: match.path, children: null, - })) - .filter(match => match.title); + })); } }, leftNavigation() { -- 2.30.2