diff options
author | 2020-02-17 11:49:41 +0200 | |
---|---|---|
committer | 2020-02-17 11:57:42 +0200 | |
commit | e0e8b14e106cff2dccc76e6edcc1a7ee6ffe10da (patch) | |
tree | c2d2d97e259818abd87c1dbf8a0cd64f693fd607 /cds-ui/designer-client/src/app/modules/feature-modules/packages/package-creation/creationModes/DesignerCreationMode.ts | |
parent | b3c61a641e9a703c3bf6cf973e8cf0883678302b (diff) |
adding template and mapping import template files
Issue-ID: CCSDK-2102
Signed-off-by: shaaban Altanany <shaaban.eltanany.ext@orange.com>
Change-Id: I38260328f868f146dbdd16f0da8f26bbb1504c29
Diffstat (limited to 'cds-ui/designer-client/src/app/modules/feature-modules/packages/package-creation/creationModes/DesignerCreationMode.ts')
-rw-r--r-- | cds-ui/designer-client/src/app/modules/feature-modules/packages/package-creation/creationModes/DesignerCreationMode.ts | 35 |
1 files changed, 9 insertions, 26 deletions
diff --git a/cds-ui/designer-client/src/app/modules/feature-modules/packages/package-creation/creationModes/DesignerCreationMode.ts b/cds-ui/designer-client/src/app/modules/feature-modules/packages/package-creation/creationModes/DesignerCreationMode.ts index 1df011948..41b81eea3 100644 --- a/cds-ui/designer-client/src/app/modules/feature-modules/packages/package-creation/creationModes/DesignerCreationMode.ts +++ b/cds-ui/designer-client/src/app/modules/feature-modules/packages/package-creation/creationModes/DesignerCreationMode.ts @@ -1,5 +1,5 @@ import {PackageCreationModes} from './PackageCreationModes'; -import {CBAPackage, Definition, Scripts} from '../mapping-models/CBAPacakge.model'; +import {CBAPackage, Scripts} from '../mapping-models/CBAPacakge.model'; import {FilesContent} from '../mapping-models/metadata/MetaDataTab.model'; import {Import, Metadata, VlbDefinition} from '../mapping-models/definitions/VlbDefinition'; import {PackageCreationUtils} from '../package-creation.utils'; @@ -13,27 +13,18 @@ export class DesignerCreationMode extends PackageCreationModes { execute(cbaPackage: CBAPackage, packageCreationUtils: PackageCreationUtils) { this.addToscaMetaDataFile(cbaPackage.metaData); - this.createDefinitionsFolder(cbaPackage.definitions, packageCreationUtils); + this.createDefinitionsFolder(cbaPackage, packageCreationUtils); this.addScriptsFolder(cbaPackage.scripts); } - - /* private createDefinitionsFolder(definition: Definition) { - definition.imports.forEach((key, value) => { - console.log(key); - FilesContent.putData(key, value); - }); - - }*/ - private addScriptsFolder(scripts: Scripts) { scripts.files.forEach((key, value) => { FilesContent.putData(key, value); }); } - private createDefinitionsFolder(definition: Definition, packageCreationUtils: PackageCreationUtils) { - definition.imports.forEach((key, valueOfFile) => { + private createDefinitionsFolder(cbaPackage: CBAPackage, packageCreationUtils: PackageCreationUtils) { + cbaPackage.definitions.imports.forEach((key, valueOfFile) => { FilesContent.putData(key, valueOfFile); }); @@ -42,29 +33,21 @@ export class DesignerCreationMode extends PackageCreationModes { const metadata: Metadata = new Metadata(); metadata.template_author = 'Shaaban Ebrahim'; - metadata.template_name = definition.metaDataTab.name; - metadata.template_tags = definition.metaDataTab.tags; - metadata.template_version = definition.metaDataTab.version; + metadata.template_name = cbaPackage.metaData.name; + metadata.template_tags = cbaPackage.metaData.tags; + metadata.template_version = cbaPackage.metaData.version; metadata['author-email'] = 'shaaban.eltanany.ext@orange.com'; metadata['user-groups'] = 'test'; - definition.metaDataTab.mapOfCustomKey.forEach((key, customKeyValue) => { + cbaPackage.definitions.metaDataTab.mapOfCustomKey.forEach((key, customKeyValue) => { metadata[key] = customKeyValue; }); vlbDefinition.metadata = metadata; - // const files = Import[definition.imports.size]; const files: Import[] = []; - definition.imports.forEach((key, valueOfFile) => { + cbaPackage.definitions.imports.forEach((key, valueOfFile) => { files.push({file: valueOfFile}); }); console.log(vlbDefinition); vlbDefinition.imports = files; - /* vlbDefinition.imports = this.definition.imports; /!*[{ - this.this.definition.imports.forEach(key,value =>{ - - }); - file: 'Definitions/data_types.json' - }]; */ - const value = packageCreationUtils.transformToJson(vlbDefinition); FilesContent.putData(filenameEntry, value); console.log('hello there'); |