diff options
author | 2020-10-24 19:30:57 +0200 | |
---|---|---|
committer | 2020-10-24 19:30:57 +0200 | |
commit | 7004cffc6b82c448abe62b1642b91f2e45ec2e0b (patch) | |
tree | c2fdc641719d2240fd6a1ccde527a2e41938af7f /cds-ui/designer-client/src/app/modules/feature-modules/packages/designer/functions-attribute | |
parent | cf1e08373c11c19ef6acf6f1390225c6e9ccf4eb (diff) |
save resource-resolution component to the package
Issue-ID: CCSDK-2900
Signed-off-by: Ahmedeldeeb50 <ahmed.eldeeb.ext@orange.com>
Change-Id: I7c1e88bfd8b367e8a7e598353416068ed017aba2
Diffstat (limited to 'cds-ui/designer-client/src/app/modules/feature-modules/packages/designer/functions-attribute')
-rw-r--r-- | cds-ui/designer-client/src/app/modules/feature-modules/packages/designer/functions-attribute/functions-attribute.component.ts | 23 |
1 files changed, 18 insertions, 5 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 624f9c7a8..20305e853 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 @@ -75,6 +75,12 @@ export class FunctionsAttributeComponent implements OnInit, OnDestroy { } displayFunctionData() { + + // tslint:disable-next-line: variable-name + const node_templates = {}; + const type = 'component-resource-resolution'; + const instanceName = this.currentFuncion['instance-name']; + // insert selected templates in nodeTemplates.artifacts this.selectedTemplates.forEach((value, key) => { console.log(key); console.log(value); @@ -93,20 +99,27 @@ export class FunctionsAttributeComponent implements OnInit, OnDestroy { }; } }); + // instantiate the final node_template object to save + + this.nodeTemplates.type = 'component-resource-resolution'; + node_templates[this.currentFuncion['instance-name']] = this.nodeTemplates; + + delete this.currentFuncion['instance-name']; + this.nodeTemplates.interfaces = { ResourceResolutionComponent: { operations: { process: { - ...this.currentFuncion + ...this.currentFuncion, } } } }; - setTimeout(() => { - console.log(this.currentFuncion); - console.log(this.nodeTemplates); - }, 1500); + console.log(this.currentFuncion); + console.log(node_templates); + // tslint:disable-next-line: no-unused-expression + this.designerStore.addNodeTemplate(instanceName, type, node_templates[instanceName]); } // Template logic private setIsMappingOrTemplate(key: string, templateAndMapping: TemplateAndMapping, isFromTemplate: boolean) { |