aboutsummaryrefslogtreecommitdiffstats
path: root/sdc-workflow-designer-ui/src/app/components/toolbar
diff options
context:
space:
mode:
authorLvbo163 <lv.bo163@zte.com.cn>2017-08-30 09:21:09 +0800
committerLvbo163 <lv.bo163@zte.com.cn>2017-08-30 09:29:32 +0800
commita53dbd4f12ddd206c2ce9dc0a8ff14a08aadc1fe (patch)
treea5565b63067331dc9cde0a1285bcef640868abf6 /sdc-workflow-designer-ui/src/app/components/toolbar
parentce786628733cb20ff806fa5bb8e061400c7213ef (diff)
save and query workflow definition
add in memory web api to mock backend rest api to save and load workflow definition. Issue-ID: SDC-257 Change-Id: Ibedcbe5db5706773de9f6d1093babbcbd7b73297 Signed-off-by: Lvbo163 <lv.bo163@zte.com.cn>
Diffstat (limited to 'sdc-workflow-designer-ui/src/app/components/toolbar')
-rw-r--r--sdc-workflow-designer-ui/src/app/components/toolbar/toolbar.component.html2
-rw-r--r--sdc-workflow-designer-ui/src/app/components/toolbar/toolbar.component.ts13
2 files changed, 14 insertions, 1 deletions
diff --git a/sdc-workflow-designer-ui/src/app/components/toolbar/toolbar.component.html b/sdc-workflow-designer-ui/src/app/components/toolbar/toolbar.component.html
index 5d028b90..91b935e9 100644
--- a/sdc-workflow-designer-ui/src/app/components/toolbar/toolbar.component.html
+++ b/sdc-workflow-designer-ui/src/app/components/toolbar/toolbar.component.html
@@ -19,5 +19,7 @@
<button type="button" class="btn btn-secondary item ui-draggable" [attr.nodeType]="'endEvent'">
<span>endEvent</span>
</button>
+
+ <button type="button" class="btn btn-success" (click)="save()">Save</button>
</div>
</div>
diff --git a/sdc-workflow-designer-ui/src/app/components/toolbar/toolbar.component.ts b/sdc-workflow-designer-ui/src/app/components/toolbar/toolbar.component.ts
index 5fdb6ce5..1e1de191 100644
--- a/sdc-workflow-designer-ui/src/app/components/toolbar/toolbar.component.ts
+++ b/sdc-workflow-designer-ui/src/app/components/toolbar/toolbar.component.ts
@@ -13,6 +13,7 @@
import { AfterViewInit, Component } from '@angular/core';
import { JsPlumbService } from '../../services/jsplumb.service';
+import { WorkflowService } from "../../services/workflow.service";
/**
* toolbar component contains some basic operations(save) and all of the supported workflow nodes.
@@ -25,11 +26,21 @@ import { JsPlumbService } from '../../services/jsplumb.service';
})
export class ToolbarComponent implements AfterViewInit {
- constructor(private jsPlumbService: JsPlumbService) {
+ constructor(private jsPlumbService: JsPlumbService, private workflowService: WorkflowService) {
}
public ngAfterViewInit() {
this.jsPlumbService.buttonDraggable();
}
+ public save() {
+ this.workflowService.save().subscribe(success => {
+ if(success) {
+ console.log(`save workflow success`);
+ } else {
+ console.log(`save workflow failed`);
+ }
+ });
+ }
+
}