From 3014f76845b6f17b2b389ec08773bec506494f6f Mon Sep 17 00:00:00 2001 From: ShaabanEltanany Date: Wed, 30 Sep 2020 10:48:55 +0200 Subject: improving creating the package Issue-ID: CCSDK-2298 Signed-off-by: ShaabanEltanany Change-Id: Id50c6d0ee1bf4336e1eba6a9491b15c778cec4e8 --- .../creationModes/DesignerCreationMode.ts | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'cds-ui/designer-client/src/app/modules/feature-modules/packages/package-creation/creationModes') 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 a9deb675a..e2790d552 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 @@ -80,24 +80,25 @@ export class DesignerCreationMode extends PackageCreationModes { if (!key.includes(cbaPackage.metaData.name)) { files.push({file: key}); } else { - // it means this is entry definition insideVlbDefinition = JSON.parse(valueOfFile); } }); } console.log(vlbDefinition); - vlbDefinition.imports = files; - if (insideVlbDefinition && insideVlbDefinition.topology_template) { - vlbDefinition.topology_template = insideVlbDefinition.topology_template; - } console.log(cbaPackage.definitions.dslDefinition.content); - if (cbaPackage.definitions.dslDefinition.content) { + if (cbaPackage.definitions && cbaPackage.definitions.dslDefinition && + cbaPackage.definitions.dslDefinition.content) { vlbDefinition.dsl_definitions = JSON.parse(cbaPackage.definitions.dslDefinition.content); } - if (cbaPackage.templateTopology.content) { + vlbDefinition.imports = files; + if (insideVlbDefinition && insideVlbDefinition.topology_template) { + vlbDefinition.topology_template = insideVlbDefinition.topology_template; + } else if (cbaPackage.templateTopology && cbaPackage.templateTopology.content) { vlbDefinition.topology_template = JSON.parse(cbaPackage.templateTopology.content); } + + console.log(vlbDefinition); const value = packageCreationUtils.transformToJson(vlbDefinition); -- cgit 1.2.3-korg