diff options
author | 2020-01-28 17:25:47 +0200 | |
---|---|---|
committer | 2020-01-29 14:22:46 +0200 | |
commit | c9b0f84a5812459aabdf59c00265dec09d771182 (patch) | |
tree | 4fcf4a8415e58d7791c29c115f65339abc4a509e /cds-ui/designer-client/src/app/modules/feature-modules/packages/package-creation/package-creation.store.ts | |
parent | 5064cb8bc7c7890283f810fbe27b284e5581c641 (diff) |
update imports-tab,source-editor and create scripts-tab component
Issue-ID: CCSDK-2016
Issue-ID: CCSDK-2042
Signed-off-by: shaaban Altanany <shaaban.eltanany.ext@orange.com>
Change-Id: I87dd0f6cf393c2d7cd78985928635bd2138ccc74
Diffstat (limited to 'cds-ui/designer-client/src/app/modules/feature-modules/packages/package-creation/package-creation.store.ts')
-rw-r--r-- | cds-ui/designer-client/src/app/modules/feature-modules/packages/package-creation/package-creation.store.ts | 29 |
1 files changed, 26 insertions, 3 deletions
diff --git a/cds-ui/designer-client/src/app/modules/feature-modules/packages/package-creation/package-creation.store.ts b/cds-ui/designer-client/src/app/modules/feature-modules/packages/package-creation/package-creation.store.ts index 214b516a2..f19ada820 100644 --- a/cds-ui/designer-client/src/app/modules/feature-modules/packages/package-creation/package-creation.store.ts +++ b/cds-ui/designer-client/src/app/modules/feature-modules/packages/package-creation/package-creation.store.ts @@ -23,9 +23,10 @@ import {Injectable} from '@angular/core'; import {Store} from '../../../../common/core/stores/Store'; -import {CBAPackage, Definition} from './mapping-models/CBAPacakge.model'; -import {Metadata} from './mapping-models/definitions/VlbDefinition'; +import {CBAPackage, Definition, Scripts} from './mapping-models/CBAPacakge.model'; import {PackageCreationService} from './package-creation.service'; +import {FolderNodeElement, MetaDataTabModel} from './mapping-models/metadata/MetaDataTab.model'; +import * as JSZip from 'jszip'; @Injectable({ @@ -33,11 +34,14 @@ import {PackageCreationService} from './package-creation.service'; }) export class PackageCreationStore extends Store<CBAPackage> { + private folder: FolderNodeElement = new FolderNodeElement(); + private zipFile: JSZip = new JSZip(); + constructor(private packageCreationService: PackageCreationService) { super(new CBAPackage()); } - changeMetaData(metaDataObject: Metadata) { + changeMetaData(metaDataObject: MetaDataTabModel) { this.setState({ ...this.state, @@ -52,4 +56,23 @@ export class PackageCreationStore extends Store<CBAPackage> { definitions: new Definition(this.state.definitions.files.set(name, content)) }); } + + addScripts(name: string, content: string) { + + this.setState({ + ...this.state, + scripts: new Scripts(this.state.scripts.files.set(name, content)) + }); + + } + + // type => refer to scripts || definitions + // from Files from scripts or imports + removeFromState(name: string, type: string) { + this.state[type].files.delete(name); + } + + saveBluePrint(blob) { + this.packageCreationService.savePackage(blob); + } } |