Skip to content
Snippets Groups Projects
Commit cf190ee6 authored by srosse's avatar srosse
Browse files

OO-3209: fix the level up part of the visibility algorithm in the document pool

parent 42973ff4
No related branches found
No related tags found
No related merge requests found
......@@ -151,16 +151,14 @@ public class TaxonomyTreeBuilder {
boolean someInvisible;
do {
someInvisible = false;
List<TaxonomyTreeNode> children = new ArrayList<>(parent.getChildCount());
for(int i=0; i<parent.getChildCount(); i++) {
children.add((TaxonomyTreeNode)parent.getChildAt(i));
}
List<TaxonomyTreeNode> children = listChildren(parent);
for(TaxonomyTreeNode child:children) {
if(!child.isVisible()) {
if(!child.isVisible()) {
List<TaxonomyTreeNode> childrenOfChild = listChildren(child);
parent.remove(child);
for(int i=0; i<child.getChildCount(); i++) {
parent.addChild(child.getChildAt(i));
for(TaxonomyTreeNode childOfChild : childrenOfChild) {
parent.addChild(childOfChild);
}
someInvisible = true;
}
......@@ -172,6 +170,14 @@ public class TaxonomyTreeBuilder {
}
}
private List<TaxonomyTreeNode> listChildren(TaxonomyTreeNode parent) {
List<TaxonomyTreeNode> children = new ArrayList<>(parent.getChildCount());
for(int i=0; i<parent.getChildCount(); i++) {
children.add((TaxonomyTreeNode)parent.getChildAt(i));
}
return children;
}
private void computePermissions(TaxonomyTreeNode root) {
List<TaxonomyCompetence> competences = taxonomyService.getTaxonomyCompetences(taxonomy, identity);
Map<TaxonomyLevel, List<TaxonomyCompetenceTypes>> levelToCompetences = new HashMap<>();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment