refs #1283 Fix mat-tree close on object refresh
testing/ogGui-multibranch/pipeline/head This commit looks good
Details
testing/ogGui-multibranch/pipeline/head This commit looks good
Details
parent
f15920a016
commit
4c45e51493
|
@ -352,6 +352,12 @@ export class GroupsComponent implements OnInit, OnDestroy {
|
|||
}
|
||||
|
||||
private refreshOrganizationalUnits(): void {
|
||||
const expandedNodeIds = this.treeControl.dataNodes
|
||||
? this.treeControl.dataNodes
|
||||
.filter(node => this.treeControl.isExpanded(node))
|
||||
.map(node => this.extractUuid(node['@id']))
|
||||
: [];
|
||||
|
||||
this.subscriptions.add(
|
||||
this.dataService.getOrganizationalUnits().subscribe(
|
||||
(data) => {
|
||||
|
@ -362,6 +368,15 @@ export class GroupsComponent implements OnInit, OnDestroy {
|
|||
const treeData = this.convertToTreeData(updatedData);
|
||||
this.originalTreeData = treeData[0]?.children || [];
|
||||
this.treeDataSource.data = [...this.originalTreeData];
|
||||
|
||||
setTimeout(() => {
|
||||
this.treeControl.dataNodes.forEach(node => {
|
||||
const nodeId = this.extractUuid(node['@id']);
|
||||
if (nodeId && expandedNodeIds.includes(nodeId)) {
|
||||
this.treeControl.expand(node);
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
},
|
||||
|
@ -369,6 +384,7 @@ export class GroupsComponent implements OnInit, OnDestroy {
|
|||
)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
onEditNode(event: MouseEvent, node: TreeNode | null): void {
|
||||
event.stopPropagation();
|
||||
|
|
Loading…
Reference in New Issue