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 {
|
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.subscriptions.add(
|
||||||
this.dataService.getOrganizationalUnits().subscribe(
|
this.dataService.getOrganizationalUnits().subscribe(
|
||||||
(data) => {
|
(data) => {
|
||||||
|
@ -362,6 +368,15 @@ export class GroupsComponent implements OnInit, OnDestroy {
|
||||||
const treeData = this.convertToTreeData(updatedData);
|
const treeData = this.convertToTreeData(updatedData);
|
||||||
this.originalTreeData = treeData[0]?.children || [];
|
this.originalTreeData = treeData[0]?.children || [];
|
||||||
this.treeDataSource.data = [...this.originalTreeData];
|
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);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -370,6 +385,7 @@ export class GroupsComponent implements OnInit, OnDestroy {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
onEditNode(event: MouseEvent, node: TreeNode | null): void {
|
onEditNode(event: MouseEvent, node: TreeNode | null): void {
|
||||||
event.stopPropagation();
|
event.stopPropagation();
|
||||||
const uuid = node ? this.extractUuid(node['@id']) : null;
|
const uuid = node ? this.extractUuid(node['@id']) : null;
|
||||||
|
|
Loading…
Reference in New Issue