aboutsummaryrefslogtreecommitdiffstats
path: root/sdc-workflow-designer-ui/src/app/components/menu/menus.component.ts
diff options
context:
space:
mode:
authorLvbo163 <lv.bo163@zte.com.cn>2018-01-10 17:29:26 +0800
committerLvbo163 <lv.bo163@zte.com.cn>2018-01-10 17:29:26 +0800
commit32222a4010ebdc739ee1586b09da6758136d9813 (patch)
tree769985a62592636ee578595d5514b536bcf48a24 /sdc-workflow-designer-ui/src/app/components/menu/menus.component.ts
parent38dfd59a8b5d05266e5567f79dcf30fd10ef7c54 (diff)
support edit rest task properties
modify rest taks config info, and enable edit rest task properties.component.css Issue-ID: SDC-897 Change-Id: Icad8c1ee60d7572f311d5cba97cda6b2144a7469 Signed-off-by: Lvbo163 <lv.bo163@zte.com.cn>
Diffstat (limited to 'sdc-workflow-designer-ui/src/app/components/menu/menus.component.ts')
-rw-r--r--sdc-workflow-designer-ui/src/app/components/menu/menus.component.ts30
1 files changed, 10 insertions, 20 deletions
diff --git a/sdc-workflow-designer-ui/src/app/components/menu/menus.component.ts b/sdc-workflow-designer-ui/src/app/components/menu/menus.component.ts
index 6932e764..e5f68ad1 100644
--- a/sdc-workflow-designer-ui/src/app/components/menu/menus.component.ts
+++ b/sdc-workflow-designer-ui/src/app/components/menu/menus.component.ts
@@ -25,7 +25,7 @@ import { PlanModel } from "../../model/workflow/plan-model";
export class MenusComponent {
@ViewChild(MicroserviceComponent) public microserviceComponent: MicroserviceComponent;
@ViewChild(WorkflowsComponent) public workflowsComponent: WorkflowsComponent;
- public currentWorkflow = 'Workflows';
+ public currentWorkflowId : number;
public workflows = [];
constructor(private broadcastService: BroadcastService, private workflowService: WorkflowService) {
@@ -34,7 +34,7 @@ export class MenusComponent {
if(wfs) {
wfs.forEach((value, key, map) => {
this.workflows.push({label: value.planName, command: () => {
- this.workflowSelected(value.planName, value.plan);
+ this.workflowSelected(key, value.plan);
}});
});
}
@@ -56,29 +56,19 @@ export class MenusComponent {
this.workflowsComponent.show();
}
- public getWorkflows() {
- const workflows = this.workflowService.getWorkflows();
- if(workflows) {
- const options = [];
- workflows.forEach((value, key, map) => {
- options.push({label: value.planName, command: () => {
- console.log(`${value.planName} selected`);
- this.workflowSelected(value.planName, value.plan);
- }});
- });
- return options;
- } else {
- return [];
- }
+ public workflowSelected(planId: number, planModel: PlanModel) {
+
+ this.broadcastService.broadcast(this.broadcastService.planModel, planModel);
+ this.broadcastService.broadcast(this.broadcastService.planId, planId);
}
- public workflowSelected(planName: string, workflow: PlanModel) {
- this.currentWorkflow = planName;
- this.broadcastService.broadcast(this.broadcastService.planModel, workflow);
+ public getCurrentPlanName() {
+ let planName = this.workflowService.getPlanName(this.currentWorkflowId);
+ return planName ? planName : 'Workflows'
}
public download() {
- const filename = this.currentWorkflow + '.json';
+ const filename = this.getCurrentPlanName() + '.json';
const content = JSON.stringify(this.workflowService.planModel);
var eleLink = document.createElement('a');
eleLink.download = filename;