diff options
author | 2020-09-23 04:25:36 +0000 | |
---|---|---|
committer | 2020-09-23 04:25:36 +0000 | |
commit | 15e4b8a1204cb1acad60c0f3ff6e2fc88fb3ab62 (patch) | |
tree | e75d4440152f5573a72b5099440acf96f3e29c1b /cds-ui/designer-client/src/app/modules/feature-modules/packages/package-creation/package-creation.component.ts | |
parent | 31ec7420e2b289419fd15acbef5e83d516a66a23 (diff) | |
parent | 81d82489f5592770a9e5f9ee137bfc1558b48153 (diff) |
Merge "adding saving simple function at designer"
Diffstat (limited to 'cds-ui/designer-client/src/app/modules/feature-modules/packages/package-creation/package-creation.component.ts')
-rw-r--r-- | cds-ui/designer-client/src/app/modules/feature-modules/packages/package-creation/package-creation.component.ts | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/cds-ui/designer-client/src/app/modules/feature-modules/packages/package-creation/package-creation.component.ts b/cds-ui/designer-client/src/app/modules/feature-modules/packages/package-creation/package-creation.component.ts index f74015956..25f5c5996 100644 --- a/cds-ui/designer-client/src/app/modules/feature-modules/packages/package-creation/package-creation.component.ts +++ b/cds-ui/designer-client/src/app/modules/feature-modules/packages/package-creation/package-creation.component.ts @@ -24,7 +24,7 @@ import {FilesContent, FolderNodeElement, MetaDataTabModel} from './mapping-model import * as JSZip from 'jszip'; import {PackageCreationStore} from './package-creation.store'; -import {Definition} from './mapping-models/CBAPacakge.model'; +import {CBAPackage, Definition} from './mapping-models/CBAPacakge.model'; import {PackageCreationModes} from './creationModes/PackageCreationModes'; import {PackageCreationBuilder} from './creationModes/PackageCreationBuilder'; import {PackageCreationUtils} from './package-creation.utils'; @@ -78,11 +78,13 @@ export class PackageCreationComponent extends ComponentCanDeactivate implements elementRef: ElementRef; versionPattern = '^(\\d+\\.)?(\\d+\\.)?(\\*|\\d+)$'; metadataClasses = 'nav-item nav-link active complete'; + private cbaPackage: CBAPackage; ngOnInit() { this.elementRef.nativeElement.focus(); const regexp = RegExp(this.versionPattern); this.packageCreationStore.state$.subscribe(cbaPackage => { + this.cbaPackage = cbaPackage; if (cbaPackage && cbaPackage.metaData && cbaPackage.metaData.description && cbaPackage.metaData.name && cbaPackage.metaData.version && regexp.test(cbaPackage.metaData.version)) { @@ -104,19 +106,17 @@ export class PackageCreationComponent extends ComponentCanDeactivate implements } saveBluePrint() { - this.packageCreationStore.state$.subscribe( - cbaPackage => { - console.log(cbaPackage); - FilesContent.clear(); - let packageCreationModes: PackageCreationModes; - cbaPackage = PackageCreationModes.mapModeType(cbaPackage); - cbaPackage.metaData = PackageCreationModes.setEntryPoint(cbaPackage.metaData); - packageCreationModes = PackageCreationBuilder.getCreationMode(cbaPackage); - cbaPackage.templateTopology.content = this.designerStore.state.sourceContent; - packageCreationModes.execute(cbaPackage, this.packageCreationUtils); - this.filesData.push(this.folder.TREE_DATA); - this.saveBluePrintToDataBase(); - }); + console.log(this.cbaPackage); + FilesContent.clear(); + let packageCreationModes: PackageCreationModes; + this.cbaPackage = PackageCreationModes.mapModeType(this.cbaPackage); + this.cbaPackage.metaData = PackageCreationModes.setEntryPoint(this.cbaPackage.metaData); + packageCreationModes = PackageCreationBuilder.getCreationMode(this.cbaPackage); + + // this.cbaPackage.templateTopology.content = this.designerStore.state.sourceContent; + packageCreationModes.execute(this.cbaPackage, this.packageCreationUtils); + this.filesData.push(this.folder.TREE_DATA); + this.saveBluePrintToDataBase(); } |