summaryrefslogtreecommitdiffstats
path: root/cds-ui/designer-client/src/app/modules
diff options
context:
space:
mode:
authorKAPIL SINGAL <ks220y@att.com>2020-10-14 13:26:19 +0000
committerGerrit Code Review <gerrit@onap.org>2020-10-14 13:26:19 +0000
commit5122cccd4434bd9ff8974a1fc3e04c7621c771d4 (patch)
treefda3aaffca4509f1271df4100f858439aea9ede6 /cds-ui/designer-client/src/app/modules
parent0ec9be0908403dba346df1192c9fcb90eba3be81 (diff)
parent14d269437b19bd2f32d5f70f8dd9250881b64717 (diff)
Merge "make Template name & content as const to avoid unintented changes"
Diffstat (limited to 'cds-ui/designer-client/src/app/modules')
-rw-r--r--cds-ui/designer-client/src/app/modules/feature-modules/packages/package-creation/template-mapping/templ-mapp-creation/templ-mapp-creation.component.ts10
1 files changed, 6 insertions, 4 deletions
diff --git a/cds-ui/designer-client/src/app/modules/feature-modules/packages/package-creation/template-mapping/templ-mapp-creation/templ-mapp-creation.component.ts b/cds-ui/designer-client/src/app/modules/feature-modules/packages/package-creation/template-mapping/templ-mapp-creation/templ-mapp-creation.component.ts
index 56ed0422a..3a8a94bf2 100644
--- a/cds-ui/designer-client/src/app/modules/feature-modules/packages/package-creation/template-mapping/templ-mapp-creation/templ-mapp-creation.component.ts
+++ b/cds-ui/designer-client/src/app/modules/feature-modules/packages/package-creation/template-mapping/templ-mapp-creation/templ-mapp-creation.component.ts
@@ -328,7 +328,7 @@ export class TemplMappCreationComponent implements OnInit, OnDestroy {
textChanges(code: any, fileName: string) {
// this.packageCreationStore.addTemplate(fileName, code);
- this.templateFileContent = code;
+ // this.templateFileContent = code;
}
public fileOver(event) {
@@ -413,9 +413,11 @@ export class TemplMappCreationComponent implements OnInit, OnDestroy {
this.openListView();
}
saveToStore() {
- if (this.fileName) {
+ const filename = this.fileName;
+ if (filename) {
// check file duplication
console.log('----------- mode ' + this.edit);
+ const fileContent = this.templateFileContent;
if (
(!(this.packageCreationStore.fileExist('Templates/' + this.fileName + '-mapping.json')
|| this.packageCreationStore.fileExist('Templates/' + this.fileName + '-template' + this.getFileExtension())))
@@ -430,8 +432,8 @@ export class TemplMappCreationComponent implements OnInit, OnDestroy {
}
// Save Template to store
// if (this.templateFileContent) {
- this.packageCreationStore.addTemplate('Templates/' + this.fileName + '-template' + this.getFileExtension(),
- this.templateFileContent);
+ this.packageCreationStore.addTemplate('Templates/' + filename + '-template' + this.getFileExtension(),
+ fileContent);
this.templateFileContent = '';
// }
this.fileName = '';