show current workflow name 15/13715/1
authorLvbo163 <lv.bo163@zte.com.cn>
Wed, 20 Sep 2017 06:44:57 +0000 (14:44 +0800)
committerLvbo163 <lv.bo163@zte.com.cn>
Wed, 20 Sep 2017 06:44:57 +0000 (14:44 +0800)
show workflow name while a workflow is selected.

Issue-ID: SDC-354

Change-Id: I61d72d36f20552cf57ca8713b44d93a053cbd172
Signed-off-by: Lvbo163 <lv.bo163@zte.com.cn>
sdc-workflow-designer-ui/src/app/components/menu/menu.component.css
sdc-workflow-designer-ui/src/app/components/menu/menu.component.html
sdc-workflow-designer-ui/src/app/components/menu/menu.component.ts

index e54dd4e..8cf9dc5 100644 (file)
  */
 -->
 
+<div class="btn-left">
+    <p-splitButton [label]="currentWorkflow" icon="fa-arrows" (onClick)="showWorkflows()" [model]="getWorkflows()"></p-splitButton>
+</div>
 <div class="btn-right">
-    <p-splitButton label="Workflows" icon="fa-check" (onClick)="showWorkflows()" [model]="getWorkflows()"></p-splitButton>
     <button type="button" class="btn white" (click)="save()">
         <i class="fa fa-save"></i>Save
     </button>
index 4183391..4cd8848 100644 (file)
@@ -25,6 +25,7 @@ import { Workflow } from "../../model/workflow/workflow";
 export class MenuComponent {
     @ViewChild(MicroserviceComponent) public microserviceComponent: MicroserviceComponent;
     @ViewChild(WorkflowsComponent) public workflowsComponent: WorkflowsComponent;
+    public currentWorkflow = 'Workflows';
 
     constructor(private broadcastService: BroadcastService, private workflowService: WorkflowService) {
     }
@@ -58,23 +59,20 @@ export class MenuComponent {
     }
 
     public workflowSelected(workflow: Workflow) {
+        this.currentWorkflow = workflow.name;
         this.broadcastService.broadcast(this.broadcastService.workflow, workflow);
     }
 
     public download() {
         const filename = this.workflowService.workflow.name + '.json';
         const content = JSON.stringify(this.workflowService.workflow);
-        // 创建隐藏的可下载链接
         var eleLink = document.createElement('a');
         eleLink.download = filename;
         eleLink.style.display = 'none';
-        // 字符内容转变成blob地址
         var blob = new Blob([content]);
         eleLink.href = URL.createObjectURL(blob);
-        // 触发点击
         document.body.appendChild(eleLink);
         eleLink.click();
-        // 然后移除
         document.body.removeChild(eleLink);
     }
 }