From a53dbd4f12ddd206c2ce9dc0a8ff14a08aadc1fe Mon Sep 17 00:00:00 2001 From: Lvbo163 Date: Wed, 30 Aug 2017 09:21:09 +0800 Subject: 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 --- .../src/app/components/toolbar/toolbar.component.html | 2 ++ .../src/app/components/toolbar/toolbar.component.ts | 13 ++++++++++++- 2 files changed, 14 insertions(+), 1 deletion(-) (limited to 'sdc-workflow-designer-ui/src/app/components') 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 @@ + + 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`); + } + }); + } + } -- cgit 1.2.3-korg