diff options
Diffstat (limited to 'cds-ui/designer-client/src/app/modules/feature-modules/packages/designer/functions-attribute')
2 files changed, 11 insertions, 4 deletions
diff --git a/cds-ui/designer-client/src/app/modules/feature-modules/packages/designer/functions-attribute/functions-attribute.component.html b/cds-ui/designer-client/src/app/modules/feature-modules/packages/designer/functions-attribute/functions-attribute.component.html index ab5bb123e..505844c57 100644 --- a/cds-ui/designer-client/src/app/modules/feature-modules/packages/designer/functions-attribute/functions-attribute.component.html +++ b/cds-ui/designer-client/src/app/modules/feature-modules/packages/designer/functions-attribute/functions-attribute.component.html @@ -206,7 +206,7 @@ </div> </div> </div> - <button class="btn btn-info" (click)="saveFunctionData()">Save</button> + <button class="btn btn-info btn-select-template m-auto" (click)="saveFunctionData()">Save</button> </div> <!--function - Select Template - Modal--> diff --git a/cds-ui/designer-client/src/app/modules/feature-modules/packages/designer/functions-attribute/functions-attribute.component.ts b/cds-ui/designer-client/src/app/modules/feature-modules/packages/designer/functions-attribute/functions-attribute.component.ts index 347f304c8..3890a980d 100644 --- a/cds-ui/designer-client/src/app/modules/feature-modules/packages/designer/functions-attribute/functions-attribute.component.ts +++ b/cds-ui/designer-client/src/app/modules/feature-modules/packages/designer/functions-attribute/functions-attribute.component.ts @@ -1,4 +1,4 @@ -import { Component, OnDestroy, OnInit } from '@angular/core'; +import { Component, EventEmitter, OnDestroy, OnInit, Output } from '@angular/core'; import { DesignerStore } from '../designer.store'; import { PackageCreationStore } from '../../package-creation/package-creation.store'; import { Subject } from 'rxjs'; @@ -34,6 +34,7 @@ export class FunctionsAttributeComponent implements OnInit, OnDestroy { actionName = ''; functionName = ''; interfaceChildName = ''; + @Output() saveEvent = new EventEmitter<string>(); constructor( @@ -132,7 +133,11 @@ export class FunctionsAttributeComponent implements OnInit, OnDestroy { if (inputs) { for (const [key, value] of Object.entries(inputs)) { console.log(key + ' - ' + value); - this.currentFuncion.inputs[key] = value; + if (typeof value === 'object') { + this.currentFuncion.inputs[key] = JSON.stringify(value); + } else { + this.currentFuncion.inputs[key] = value; + } } } if (outputs) { @@ -182,7 +187,7 @@ export class FunctionsAttributeComponent implements OnInit, OnDestroy { if (value.isTemplate) { this.nodeTemplates.artifacts[key + '-template'] = { - type: 'artifact-template-resource', + type: 'artifact-template-velocity', file: 'Templates/' + key + '-template.vtl' }; } @@ -210,6 +215,7 @@ export class FunctionsAttributeComponent implements OnInit, OnDestroy { console.log(node_templates); // tslint:disable-next-line: no-unused-expression this.designerStore.addNodeTemplate(instanceName, type, node_templates[instanceName]); + this.saveEvent.emit('save'); } // Template logic private setIsMappingOrTemplate(key: string, templateAndMapping: TemplateAndMapping, isFromTemplate: boolean) { @@ -262,6 +268,7 @@ export class FunctionsAttributeComponent implements OnInit, OnDestroy { getObjectValue(object) { return Object.values(object); } + getNodeType(nodeName: string) { this.functionStore.state$ .subscribe(state => { |