diff options
author | 2020-11-16 17:13:02 +0200 | |
---|---|---|
committer | 2020-11-16 17:13:02 +0200 | |
commit | 67ae82d8f6f66e1e01a3e28dfa8e17d1168c27aa (patch) | |
tree | dfabbc9f3d7550c6fd1ed8be17dafb997c6f2dac /cds-ui/designer-client/src/app/modules/feature-modules/packages/designer/functions-attribute | |
parent | 644dc55c1e5ffe2e9a23507af905ac40184dcad2 (diff) |
Save package from function attribute button
detect url change in breadcrumb
Issue-ID: CCSDK-2900
Signed-off-by: Ahmedeldeeb50 <ahmed.eldeeb.ext@orange.com>
Change-Id: I30526644715baedfa95080500a23a1eaca10adb5
Diffstat (limited to 'cds-ui/designer-client/src/app/modules/feature-modules/packages/designer/functions-attribute')
2 files changed, 10 insertions, 3 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..871236768 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) { @@ -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 => { |