aboutsummaryrefslogtreecommitdiffstats
path: root/sdc-workflow-designer-ui/src/app/components/menu
diff options
context:
space:
mode:
Diffstat (limited to 'sdc-workflow-designer-ui/src/app/components/menu')
-rw-r--r--sdc-workflow-designer-ui/src/app/components/menu/menu.component.ts13
-rw-r--r--sdc-workflow-designer-ui/src/app/components/menu/workflows/workflows.component.html2
2 files changed, 13 insertions, 2 deletions
diff --git a/sdc-workflow-designer-ui/src/app/components/menu/menu.component.ts b/sdc-workflow-designer-ui/src/app/components/menu/menu.component.ts
index b3954911..adad16c1 100644
--- a/sdc-workflow-designer-ui/src/app/components/menu/menu.component.ts
+++ b/sdc-workflow-designer-ui/src/app/components/menu/menu.component.ts
@@ -26,8 +26,19 @@ export class MenuComponent {
@ViewChild(MicroserviceComponent) public microserviceComponent: MicroserviceComponent;
@ViewChild(WorkflowsComponent) public workflowsComponent: WorkflowsComponent;
public currentWorkflow = 'Workflows';
+ public workflows = [];
constructor(private broadcastService: BroadcastService, private workflowService: WorkflowService) {
+ this.broadcastService.workflows.subscribe(wfs => {
+ this.workflows.splice(0, this.workflows.length);
+ if(wfs) {
+ wfs.forEach((value, key, map) => {
+ this.workflows.push({label: value.planName, command: () => {
+ this.workflowSelected(value.planName, value.plan);
+ }});
+ });
+ }
+ });
}
public save(): void {
@@ -45,7 +56,7 @@ export class MenuComponent {
this.workflowsComponent.show();
}
- public getWorkflows(planId: number) {
+ public getWorkflows() {
const workflows = this.workflowService.getWorkflows();
if(workflows) {
const options = [];
diff --git a/sdc-workflow-designer-ui/src/app/components/menu/workflows/workflows.component.html b/sdc-workflow-designer-ui/src/app/components/menu/workflows/workflows.component.html
index 5568ba60..0f6c7ff2 100644
--- a/sdc-workflow-designer-ui/src/app/components/menu/workflows/workflows.component.html
+++ b/sdc-workflow-designer-ui/src/app/components/menu/workflows/workflows.component.html
@@ -24,7 +24,7 @@ tabindex="-1" role="dialog" aria-labelledby="mySmallModalLabel" aria-hidden="tru
<div class="modal-body">
<ul class="list-group">
<li class="list-group-item d-flex justify-content-between align-items-center"
- *ngFor="let key of workflows.keys()">
+ *ngFor="let key of workflows?.keys()">
<div style="width:380px"><input class="form-control" [(ngModel)]="workflows.get(key).planName"></div>
<div class="badge badge-danger badge-pill" (click)="deleteWorkflow(key)">
<i class="fa fa-minus"></i>