diff options
author | 2021-01-17 17:23:59 +0200 | |
---|---|---|
committer | 2021-01-17 17:23:59 +0200 | |
commit | 529d7205b6b3cc36abe4dd2fb507e3c10bb38a79 (patch) | |
tree | 8fbcfe9ee087d6699cacb17741e18c04d07855e8 /cds-ui/designer-client/src/app/modules/feature-modules/packages/designer/functions-attribute/functions-attribute.component.ts | |
parent | 424fcd63ca57bd8cfa8b46001021c29e020a8a6d (diff) |
Remove save button from function Attributes tab
Issue-ID: CCSDK-3088
Signed-off-by: Ahmedeldeeb50 <ahmed.eldeeb.ext@orange.com>
Change-Id: I009b2b12826286e017a5f3dcad00b30350bf1a6f
Diffstat (limited to 'cds-ui/designer-client/src/app/modules/feature-modules/packages/designer/functions-attribute/functions-attribute.component.ts')
-rw-r--r-- | cds-ui/designer-client/src/app/modules/feature-modules/packages/designer/functions-attribute/functions-attribute.component.ts | 33 |
1 files changed, 27 insertions, 6 deletions
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 70ccb7305..86552b7db 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 @@ -97,6 +97,8 @@ export class FunctionsAttributeComponent implements OnInit, OnDestroy { } + + onInitMapping() { // selectedTemplates , templateAndMappingMap // this.selectedTemplates = new Map<string, TemplateAndMapping>(); @@ -121,6 +123,7 @@ export class FunctionsAttributeComponent implements OnInit, OnDestroy { this.selectedTemplates = new Map(this.finalTemplates); } + toNodeProcess(nodeTemplate, functionName) { console.log(nodeTemplate); this.currentFuncion['instance-name'] = functionName; @@ -139,11 +142,11 @@ export class FunctionsAttributeComponent implements OnInit, OnDestroy { if (inputs) { for (const [key, value] of Object.entries(inputs)) { console.log(key + ' - ' + value); - /* if (typeof value === 'object' || this.isValidJson(value)) { - this.currentFuncion.inputs[key] = JSON.stringify(value); - } else {*/ + /* if (typeof value === 'object' || this.isValidJson(value)) { + this.currentFuncion.inputs[key] = JSON.stringify(value); + } else {*/ this.currentFuncion.inputs[key] = value; - // } + // } } } if (outputs) { @@ -183,11 +186,25 @@ export class FunctionsAttributeComponent implements OnInit, OnDestroy { addTemplates() { this.finalTemplates = new Map(this.selectedTemplates); + this.saveFunctionData(); } cancel() { this.selectedTemplates = new Map<string, TemplateAndMapping>(); } + setProcessAttr(isInput, key, e) { + console.log(e.target.value); + // tslint:disable-next-line: no-string-literal + if (isInput) { + this.currentFuncion['inputs'][key] = e.target.value; + } else { + this.currentFuncion['outputs'][key] = e.target.value; + } + + + this.saveFunctionData(); + } + saveFunctionData() { this.nodeTemplates = new NodeTemplate(''); // tslint:disable-next-line: variable-name @@ -196,6 +213,8 @@ export class FunctionsAttributeComponent implements OnInit, OnDestroy { // tslint:disable-next-line: no-string-literal const type = finalFunctionData['type']; const instanceName = finalFunctionData['instance-name']; + finalFunctionData.inputs['artifact-prefix-names'] = []; + // insert selected templates in nodeTemplates.artifacts this.selectedTemplates.forEach((value, key) => { console.log(key); @@ -226,7 +245,6 @@ export class FunctionsAttributeComponent implements OnInit, OnDestroy { } }); // instantiate the final node_template object to save - this.nodeTemplates.type = type; delete this.nodeTemplates.properties; node_templates[finalFunctionData['instance-name']] = this.nodeTemplates; @@ -254,7 +272,7 @@ export class FunctionsAttributeComponent implements OnInit, OnDestroy { // tslint:disable-next-line: no-unused-expression this.designerStore.addNodeTemplate(instanceName, type, node_templates[instanceName]); // create a new package - this.saveEvent.emit('save'); + // this.saveEvent.emit('save'); } // Template logic private setIsMappingOrTemplate(key: string, templateAndMapping: TemplateAndMapping, isFromTemplate: boolean) { @@ -286,7 +304,10 @@ export class FunctionsAttributeComponent implements OnInit, OnDestroy { setTemplate(file: string) { if (this.selectedTemplates.has(file)) { + console.log('Not exist'); this.selectedTemplates.delete(file); + this.finalTemplates.delete(file); + } else { this.selectedTemplates.set(file, this.templateAndMappingMap.get(file)); } |