From a4d84ebd1db8f9b881c33f5efefc4aa6c1fbf02f Mon Sep 17 00:00:00 2001 From: ShaabanEltanany Date: Wed, 23 Sep 2020 11:40:09 +0200 Subject: adding save for topology template content Issue-ID: CCSDK-2298 Signed-off-by: ShaabanEltanany Change-Id: I8333f84e1551bb49f016c25f1c98f8b0f15b7ed3 --- .../configuration-dashboard.component.html | 4 +- .../configuration-dashboard.component.ts | 19 ++++- .../packages/designer/designer.component.html | 87 +++++++++++++--------- .../packages/designer/designer.component.ts | 70 ++++++++++------- .../packages/designer/graph.generator.util.ts | 15 ++-- .../creationModes/DesignerCreationMode.ts | 7 ++ .../feature-modules/packages/packages.store.ts | 2 +- 7 files changed, 128 insertions(+), 76 deletions(-) (limited to 'cds-ui') diff --git a/cds-ui/designer-client/src/app/modules/feature-modules/packages/configuration-dashboard/configuration-dashboard.component.html b/cds-ui/designer-client/src/app/modules/feature-modules/packages/configuration-dashboard/configuration-dashboard.component.html index 879b9b94a..e006f23e6 100644 --- a/cds-ui/designer-client/src/app/modules/feature-modules/packages/configuration-dashboard/configuration-dashboard.component.html +++ b/cds-ui/designer-client/src/app/modules/feature-modules/packages/configuration-dashboard/configuration-dashboard.component.html @@ -167,8 +167,8 @@ --> - 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 228953eb9..eb121e98e 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 @@ -46,6 +46,7 @@ export class ConfigurationDashboardComponent extends ComponentCanDeactivate impl versionPattern = '^(\\d+\\.)?(\\d+\\.)?(\\*|\\d+)$'; metadataClasses = 'nav-item nav-link active'; private cbaPackage: CBAPackage = new CBAPackage(); + dataTarget: any = ''; constructor( private route: ActivatedRoute, @@ -159,8 +160,14 @@ export class ConfigurationDashboardComponent extends ComponentCanDeactivate impl } this.packageCreationStore.changeDslDefinition(dslDefinition); this.packageCreationStore.setCustomKeys(mapOfCustomKeys); - if (definition.topology_template && definition.topology_template.content) { - this.designerStore.saveSourceContent(definition.topology_template.content); + if (definition.topology_template) { + const content = {}; + const workflow = 'workflows'; + content[workflow] = definition.topology_template.workflows; + const nodeTemplates = 'node_templates'; + content[nodeTemplates] = definition.topology_template.node_templates; + this.designerStore.saveSourceContent(JSON.stringify(content)); + this.packageCreationStore.addTopologyTemplate(definition.topology_template); } } @@ -274,7 +281,6 @@ export class ConfigurationDashboardComponent extends ComponentCanDeactivate impl } goToDesignerMode(id) { - this.router.navigate(['/packages/designer', id, {actionName: this.customActionName}]); } @@ -344,4 +350,11 @@ export class ConfigurationDashboardComponent extends ComponentCanDeactivate impl return this.isSaveEnabled; } + checkSkipTypesOfAction() { + if (this.cbaPackage.templateTopology.node_templates && this.cbaPackage.templateTopology.workflows) { + this.goToDesignerMode(this.id); + } else { + this.dataTarget = '#exampleModalLong'; + } + } } diff --git a/cds-ui/designer-client/src/app/modules/feature-modules/packages/designer/designer.component.html b/cds-ui/designer-client/src/app/modules/feature-modules/packages/designer/designer.component.html index 88923229b..dd39cb243 100644 --- a/cds-ui/designer-client/src/app/modules/feature-modules/packages/designer/designer.component.html +++ b/cds-ui/designer-client/src/app/modules/feature-modules/packages/designer/designer.component.html @@ -10,9 +10,9 @@ @@ -22,13 +22,13 @@