From 15f0e4fa63bb1fd533091d9ab85d3612752c2d27 Mon Sep 17 00:00:00 2001 From: Lvbo163 Date: Wed, 6 Sep 2017 14:32:16 +0800 Subject: support set body parameter by json Rest task's body parameter is definited by json object in swagger definition. Issue-ID: SDC-67 Change-Id: Idb1d96cf9d1135afd7b285105abfdd9a2c50380c Signed-off-by: Lvbo163 --- .../rest-task-parameters/rest-task-parameters.component.html | 4 ++++ .../rest-task-parameters/rest-task-parameters.component.ts | 9 ++++++--- .../app/components/property/rest-task/rest-task.component.html | 4 +++- 3 files changed, 13 insertions(+), 4 deletions(-) (limited to 'sdc-workflow-designer-ui/src/app/components/property/rest-task') diff --git a/sdc-workflow-designer-ui/src/app/components/property/rest-task/rest-task-parameters/rest-task-parameters.component.html b/sdc-workflow-designer-ui/src/app/components/property/rest-task/rest-task-parameters/rest-task-parameters.component.html index 4f98e689..53f02f17 100644 --- a/sdc-workflow-designer-ui/src/app/components/property/rest-task/rest-task-parameters/rest-task-parameters.component.html +++ b/sdc-workflow-designer-ui/src/app/components/property/rest-task/rest-task-parameters/rest-task-parameters.component.html @@ -12,3 +12,7 @@ *******************************************************************************/ --> + + + diff --git a/sdc-workflow-designer-ui/src/app/components/property/rest-task/rest-task-parameters/rest-task-parameters.component.ts b/sdc-workflow-designer-ui/src/app/components/property/rest-task/rest-task-parameters/rest-task-parameters.component.ts index f2d802c2..a50cc1be 100644 --- a/sdc-workflow-designer-ui/src/app/components/property/rest-task/rest-task-parameters/rest-task-parameters.component.ts +++ b/sdc-workflow-designer-ui/src/app/components/property/rest-task/rest-task-parameters/rest-task-parameters.component.ts @@ -18,6 +18,7 @@ import { RestTask } from '../../../../model/workflow/rest-task'; import { BroadcastService } from '../../../../services/broadcast.service'; import { RestParameter } from "../../../../model/workflow/rest-parameter"; import { ValueSource } from "../../../../model/value-source.enum"; +import { SwaggerTreeConverterService } from "../../../../services/swagger-tree-converter.service"; /** * property component presents information of a workflow node. @@ -39,7 +40,7 @@ export class RestTaskParametersComponent implements OnInit { private index = 1; - constructor(private broadcastService: BroadcastService) { + constructor(private broadcastService: BroadcastService, private swaggerTreeConverterService: SwaggerTreeConverterService) { } public ngOnInit() { @@ -55,8 +56,10 @@ export class RestTaskParametersComponent implements OnInit { this.task.parameters.forEach(param => { if (param.position === 'body') { - // TODO add body parameter handler - // this.bodyParameter.push(param); + const requestTreeNode = this.swaggerTreeConverterService + .schema2TreeNode('Request Param', this.task.serviceName, this.task.serviceVersion, param.schema); + param.value = param.schema.value; + this.bodyParameter.push(requestTreeNode); } else { this.requestParameters.push(param); } diff --git a/sdc-workflow-designer-ui/src/app/components/property/rest-task/rest-task.component.html b/sdc-workflow-designer-ui/src/app/components/property/rest-task/rest-task.component.html index a416944c..af428840 100644 --- a/sdc-workflow-designer-ui/src/app/components/property/rest-task/rest-task.component.html +++ b/sdc-workflow-designer-ui/src/app/components/property/rest-task/rest-task.component.html @@ -43,4 +43,6 @@
- +
+ +
-- cgit 1.2.3-korg