Skip to content

Commit

Permalink
Update ide-tree.component.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
polterguy committed Dec 14, 2023
1 parent 02f2cd5 commit 7f509c8
Showing 1 changed file with 21 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,13 @@ export class IdeTreeComponent implements OnInit {

// Data binding tree.
this.dataSource.data = this.root.children;

this.getToolboxItemsFromServer().then(() => {

this.generalService.hideLoading();
})
}
});
this.getToolboxItemsFromServer();
}

/**
Expand Down Expand Up @@ -153,20 +157,22 @@ export class IdeTreeComponent implements OnInit {
*/
getToolboxItemsFromServer() {

this.generalService.showLoading();
this.workflowService.listToolboxItems().subscribe({
return new Promise<boolean>(resolve => {

next: (functions: any[]) => {
this.workflowService.listToolboxItems().subscribe({

this.generalService.hideLoading();
this.workflowFunctions = functions.reverse();
},
next: (functions: any[]) => {

error: (error: any) => {
this.workflowFunctions = functions.reverse();
resolve(true);
},

this.generalService.hideLoading();
this.generalService.showFeedback(error?.error?.message ?? error, 'errorMessage');
}
error: (error: any) => {

this.generalService.showFeedback(error?.error?.message ?? error, 'errorMessage');
resolve(false);
}
});
});
}

Expand Down Expand Up @@ -771,9 +777,12 @@ export class IdeTreeComponent implements OnInit {
} else {

this.dataBindTree();
this.generalService.hideLoading();
}
} else {
this.generalService.hideLoading();
}
})
});
}

isExpandable(_: number, node: FlatNode) {
Expand Down

0 comments on commit 7f509c8

Please sign in to comment.