0
daws created
Here's a suggestion to improve the permission filter in angular : include child nodes of the filtered permission.
Here's my code for that :
filterPermission(nodes, filterText): any {
_forEach(nodes, (node) => {
let matchesFilter = node.data.displayName.toLowerCase().indexOf(filterText.toLowerCase()) >= 0;
if (matchesFilter) {
node.styleClass = this.showParentNodes(node);
} else {
node.styleClass = 'hidden-tree-node';
}
if (node.children) {
if (matchesFilter) {
for (let child of node.children) {
child.styleClass = '';
if (child.children) {
this.filterPermission(child.children, filterText);
}
}
} else {
this.filterPermission(node.children, filterText);
}
}
});
}
1 Answer(s)
-
0
Hi daws
Thank you for your suggestion to improve the permission search filter. We have created an issue for the situation you specified. You can follow the developments here. Good work.