From a03d4f6e227d1dbe9f1fa79365f4c6da73f609d9 Mon Sep 17 00:00:00 2001 From: ShaabanEltanany Date: Wed, 21 Oct 2020 10:08:19 +0200 Subject: fixing forming cba package definition Issue-ID: CCSDK-2928 Signed-off-by: ShaabanEltanany Change-Id: If45b35e9077246faac7490291879df419e0d5ff5 --- .../configuration-dashboard.component.ts | 19 ++++++++++++++++--- .../packages/designer/designer.store.ts | 4 +++- .../creationModes/DesignerCreationMode.ts | 8 +++++--- 3 files changed, 24 insertions(+), 7 deletions(-) (limited to 'cds-ui/designer-client/src') diff --git a/cds-ui/designer-client/src/app/modules/feature-modules/packages/configuration-dashboard/configuration-dashboard.component.ts b/cds-ui/designer-client/src/app/modules/feature-modules/packages/configuration-dashboard/configuration-dashboard.component.ts index dc5697f78..a78fe4ed1 100644 --- a/cds-ui/designer-client/src/app/modules/feature-modules/packages/configuration-dashboard/configuration-dashboard.component.ts +++ b/cds-ui/designer-client/src/app/modules/feature-modules/packages/configuration-dashboard/configuration-dashboard.component.ts @@ -19,7 +19,7 @@ import {PackageCreationService} from '../package-creation/package-creation.servi import {ComponentCanDeactivate} from '../../../../common/core/canDactivate/ComponentCanDeactivate'; import {PackageCreationExtractionService} from '../package-creation/package-creation-extraction.service'; import {distinctUntilChanged, takeUntil} from 'rxjs/operators'; -import {Subject} from 'rxjs'; +import {Subject, throwError} from 'rxjs'; @Component({ selector: 'app-configuration-dashboard', @@ -264,8 +264,7 @@ export class ConfigurationDashboardComponent extends ComponentCanDeactivate impl this.router.navigate(['/packages/package/' + id]); }); }, error => { - this.toastService.error('error happened when deploying ' + error.message); - console.log('Error -' + error.message); + this.handleError(error); }); } @@ -291,5 +290,19 @@ export class ConfigurationDashboardComponent extends ComponentCanDeactivate impl this.dataTarget = '#exampleModalLong'; } } + + handleError(error) { + let errorMessage = ''; + if (error.error instanceof ErrorEvent) { + // client-side error + errorMessage = `Error: ${error.error.message}`; + } else { + // server-side error + errorMessage = `Error Code: ${error.status}\nMessage: ${error.message}`; + } + this.toastService.error('error happened when deploying ' + errorMessage); + console.log('Error -' + errorMessage); + return throwError(errorMessage); + } } diff --git a/cds-ui/designer-client/src/app/modules/feature-modules/packages/designer/designer.store.ts b/cds-ui/designer-client/src/app/modules/feature-modules/packages/designer/designer.store.ts index 923d59e91..37fc64051 100644 --- a/cds-ui/designer-client/src/app/modules/feature-modules/packages/designer/designer.store.ts +++ b/cds-ui/designer-client/src/app/modules/feature-modules/packages/designer/designer.store.ts @@ -146,7 +146,9 @@ export class DesignerStore extends Store { } setInputsToSpecificWorkflow(inputs: Map) { - const mapOfWorkflows = this.state.template.workflows; + /* tslint:disable:no-string-literal */ + let mapOfWorkflows = this.state.template.workflows['Action1']['steps']; + mapOfWorkflows += inputs; /*mapOfWorkflows.forEach(((value, key) => { if (value.includes('resource-assignment')) { value += inputs; 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 61de5078b..d6e15ed09 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 @@ -78,19 +78,21 @@ export class DesignerCreationMode extends PackageCreationModes { if (cbaPackage.definitions.imports && cbaPackage.definitions.imports.size > 0) { cbaPackage.definitions.imports.forEach((valueOfFile, key) => { if (!key.includes(cbaPackage.metaData.name)) { - files.push({file: key}); + if (!key.includes('resources_definition_types')) { + files.push({file: key}); + } } else { insideVlbDefinition = JSON.parse(valueOfFile); } }); } - + vlbDefinition.imports = files; if (cbaPackage.definitions && cbaPackage.definitions.dslDefinition && cbaPackage.definitions.dslDefinition.content) { vlbDefinition.dsl_definitions = JSON.parse(cbaPackage.definitions.dslDefinition.content); } - vlbDefinition.imports = files; + // vlbDefinition.imports = files; if (cbaPackage.templateTopology && cbaPackage.templateTopology.content) { vlbDefinition.topology_template = JSON.parse(cbaPackage.templateTopology.content); } else if (insideVlbDefinition && insideVlbDefinition.topology_template) { -- cgit 1.2.3-korg