diff options
author | shaaban Altanany <shaaban.eltanany.ext@orange.com> | 2020-03-03 22:33:41 +0200 |
---|---|---|
committer | Shaaban Ebrahim <shaaban.eltanany.ext@orange.com> | 2020-03-04 07:56:31 +0000 |
commit | 2201f57353c27995b08892f311429b400538c492 (patch) | |
tree | 85d9a17611aeb0e8bdd9480c39980f70f9fc58fe /cds-ui/designer-client/src | |
parent | 2fce8bf2891f3ce472f4b06d09d0e987fbc44149 (diff) |
add integrating with designer from viewing package
Issue-ID: CCSDK-2123
Signed-off-by: shaaban Altanany <shaaban.eltanany.ext@orange.com>
Change-Id: I52e512424d1366bdc2504995823c8a214a691ac0
Diffstat (limited to 'cds-ui/designer-client/src')
5 files changed, 25 insertions, 7 deletions
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 bb7647449..df1911a7d 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 @@ -70,7 +70,7 @@ (click)="downloadPackage(viewedPackage.artifactName,viewedPackage.artifactVersion)"><i class="fa"></i> Download</button> - <button class="btn btn-sm btn-primary">Designer Mode</button> + <button class="btn btn-sm btn-primary" (click)="goToDesignerMode()">Designer Mode</button> </div> </div> @@ -130,4 +130,4 @@ </div> </div> </div> -</div>
\ No newline at end of file +</div> 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 c67331c3e..6de76f949 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 @@ -12,6 +12,7 @@ import {PackageCreationUtils} from '../package-creation/package-creation.utils'; import {PackageCreationModes} from '../package-creation/creationModes/PackageCreationModes'; import {PackageCreationBuilder} from '../package-creation/creationModes/PackageCreationBuilder'; import {saveAs} from 'file-saver'; +import {DesignerStore} from '../designer/designer.store'; @Component({ selector: 'app-configuration-dashboard', @@ -37,7 +38,8 @@ export class ConfigurationDashboardComponent implements OnInit { constructor(private route: ActivatedRoute, private configurationDashboardService: ConfigurationDashboardService, private packageCreationStore: PackageCreationStore, private packageCreationUtils: PackageCreationUtils, - private router: Router) { + private router: Router, + private designerStore: DesignerStore) { } ngOnInit() { @@ -104,6 +106,10 @@ export class ConfigurationDashboardComponent implements OnInit { } this.packageCreationStore.changeDslDefinition(dslDefinition); this.packageCreationStore.setCustomKeys(mapOfCustomKeys); + // console.log(definition.topology_template.content); + if (definition.topology_template.content) { + this.designerStore.saveSourceContent(definition.topology_template.content); + } } else { this.packageCreationStore.addDefinition(filename, fileData); @@ -200,4 +206,7 @@ export class ConfigurationDashboardComponent implements OnInit { this.router.navigate(['/packages']); } + goToDesignerMode() { + this.router.navigate(['/packages/designer']); + } } 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 b72a5bc47..ba8b2f0f1 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 @@ -76,11 +76,11 @@ export class DesignerStore extends Store<DesignerDashboardState> { } saveSourceContent(code: string) { - const topologtTemplate = JSON.parse(code); + const topologyTemplate = JSON.parse(code); this.setState({ ...this.state, sourceContent: code, - template: topologtTemplate + template: topologyTemplate }); } diff --git a/cds-ui/designer-client/src/app/modules/feature-modules/packages/package-creation/mapping-models/CBAPacakge.model.ts b/cds-ui/designer-client/src/app/modules/feature-modules/packages/package-creation/mapping-models/CBAPacakge.model.ts index 45a00ff06..a37339d90 100644 --- a/cds-ui/designer-client/src/app/modules/feature-modules/packages/package-creation/mapping-models/CBAPacakge.model.ts +++ b/cds-ui/designer-client/src/app/modules/feature-modules/packages/package-creation/mapping-models/CBAPacakge.model.ts @@ -1,4 +1,6 @@ -import { MetaDataTabModel } from './metadata/MetaDataTab.model'; +import {MetaDataTabModel} from './metadata/MetaDataTab.model'; + + export class Definition { @@ -50,6 +52,7 @@ export class Base { return this.files.get(key); } } + export class Scripts { public files: Map<string, string>; @@ -83,6 +86,7 @@ export class Template { export class Mapping extends Base { } + export class CBAPackage { public metaData: MetaDataTabModel; diff --git a/cds-ui/designer-client/src/app/modules/feature-modules/packages/package-creation/mapping-models/definitions/VlbDefinition.ts b/cds-ui/designer-client/src/app/modules/feature-modules/packages/package-creation/mapping-models/definitions/VlbDefinition.ts index 8e2ff475e..630baa1ac 100644 --- a/cds-ui/designer-client/src/app/modules/feature-modules/packages/package-creation/mapping-models/definitions/VlbDefinition.ts +++ b/cds-ui/designer-client/src/app/modules/feature-modules/packages/package-creation/mapping-models/definitions/VlbDefinition.ts @@ -1,5 +1,9 @@ import { Any, JsonObject, JsonProperty } from 'json2typescript'; +@JsonObject('topology_template') +export class TemplateTopology { + public content: string; +} @JsonObject export class VlbDefinition { @@ -10,7 +14,8 @@ export class VlbDefinition { imports: Import[]; // tslint:disable-next-line: variable-name dsl_definitions: DslContent; - // topology_template: TopologyTemplate; + // tslint:disable-next-line: variable-name + topology_template: TemplateTopology; } @JsonObject('dsl_definitions') |