diff --git a/ui/src/app/views/workflow/graph/workflow.graph.component.ts b/ui/src/app/views/workflow/graph/workflow.graph.component.ts index d9eaec339b..e3da712e8a 100644 --- a/ui/src/app/views/workflow/graph/workflow.graph.component.ts +++ b/ui/src/app/views/workflow/graph/workflow.graph.component.ts @@ -81,8 +81,7 @@ export class WorkflowGraphComponent implements AfterViewInit { if (!this.ready && this.workflow) { return; } - // FIXME add a delay for dom container to take good height, otherwise the workflow will not be centered - setTimeout(() => { this.initWorkflow(); }, 1); + this.initWorkflow(); } initWorkflow() { @@ -163,6 +162,7 @@ export class WorkflowGraphComponent implements AfterViewInit { componentRef.instance.hook = h; componentRef.instance.workflow = this.workflow; componentRef.instance.node = node; + componentRef.changeDetectorRef.detectChanges(); this.hooksComponent.set(hookId, componentRef); this.svgContainer.insert(componentRef.hostView, 0); @@ -249,6 +249,7 @@ export class WorkflowGraphComponent implements AfterViewInit { componentRef.instance.node = node; componentRef.instance.workflow = this.workflow; componentRef.instance.project = this.project; + componentRef.changeDetectorRef.detectChanges(); return componentRef; } } diff --git a/ui/src/app/views/workflow/sidebar/code/sidebar.code.component.ts b/ui/src/app/views/workflow/sidebar/code/sidebar.code.component.ts index 3a9744791d..95ee483aa1 100644 --- a/ui/src/app/views/workflow/sidebar/code/sidebar.code.component.ts +++ b/ui/src/app/views/workflow/sidebar/code/sidebar.code.component.ts @@ -106,7 +106,6 @@ export class WorkflowSidebarCodeComponent implements OnInit, AfterViewInit { this.initCodeMirror(); } } - }); }