[ACS-5135] Tree component emit pagination only when top level entries change (#8519)

This commit is contained in:
MichalKinas
2023-04-28 16:39:47 +02:00
committed by GitHub
parent 81fea0fe40
commit bcd0b66c96
2 changed files with 13 additions and 12 deletions

View File

@@ -208,7 +208,6 @@ export class TreeComponent<T extends TreeNode> implements OnInit, OnDestroy {
node.isLoading = true;
this.treeService.getSubNodes(node.id, 0, this.userPreferenceService.paginationSize).subscribe((response: TreeResponse<T>) => {
this.treeService.expandNode(node, response.entries);
this.paginationChanged.emit(response.pagination);
node.isLoading = false;
if (this.treeNodesSelection.isSelected(node)) {
//timeout used to update nodeCheckboxes query list after new nodes are added so they can be selected
@@ -233,7 +232,6 @@ export class TreeComponent<T extends TreeNode> implements OnInit, OnDestroy {
const loadedChildren: number = this.treeService.getChildren(parentNode).length;
this.treeService.getSubNodes(parentNode.id, loadedChildren, this.userPreferenceService.paginationSize).subscribe((response: TreeResponse<T>) => {
this.treeService.appendNodes(parentNode, response.entries);
this.paginationChanged.emit(response.pagination);
node.isLoading = false;
if (this.treeNodesSelection.isSelected(parentNode)) {
//timeout used to update nodeCheckboxes query list after new nodes are added so they can be selected