Commit d55a9d4c authored by Alfredo Sumaran's avatar Alfredo Sumaran

Fix tree generation when filtering by name

parent 1604c764
...@@ -33,7 +33,8 @@ export default class GroupsStore { ...@@ -33,7 +33,8 @@ export default class GroupsStore {
Object.keys(mappedGroups).forEach((key) => { Object.keys(mappedGroups).forEach((key) => {
const currentGroup = mappedGroups[key]; const currentGroup = mappedGroups[key];
// If the group is not at the root level, add it to its parent array of subGroups. // If the group is not at the root level, add it to its parent array of subGroups.
if (currentGroup.parentId) { const parentGroup = mappedGroups[currentGroup['parentId']];
if (currentGroup.parentId && parentGroup) {
mappedGroups[currentGroup.parentId].subGroups[currentGroup.id] = currentGroup; mappedGroups[currentGroup.parentId].subGroups[currentGroup.id] = currentGroup;
mappedGroups[currentGroup.parentId].isOpen = true; // Expand group if it has subgroups mappedGroups[currentGroup.parentId].isOpen = true; // Expand group if it has subgroups
} else { } else {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment