Bug 34418: Add is_empty flag

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
This commit is contained in:
Jonathan Druart 2023-07-26 13:32:28 +02:00 committed by Tomas Cohen Arazi
parent 05637b23cf
commit 6660b56124
Signed by: tomascohen
GPG key ID: 0A272EA1B2F3C15F

View file

@ -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() {