From ae55ea4516fa4b5ec157a48f71d2d93f1e356389 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 --- 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 f7ab99d55ff..5df32a53e16 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.25.1