diff options
author | 2020-02-24 20:10:40 +0200 | |
---|---|---|
committer | 2020-02-25 22:34:59 +0200 | |
commit | e70a0e413947cc3e5e21d041f0ed3d7582b44d7a (patch) | |
tree | c9d769d4ab2251f38a23ef6c771c713941d244c3 /cds-ui/designer-client/src/app/modules/feature-modules/packages/package-creation/package-creation.store.ts | |
parent | 568ff4d867dd09c087246fe7cc343c1d581e6255 (diff) |
import maaping from CSV file or the current template
Issue-ID: CCSDK-2065
Signed-off-by: ahmedeldeeb50 <ahmed.eldeeb.ext@orange.com>
Change-Id: Idc5b1deccf2966438aed13329290df6d9b3f0da7
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 | 23 |
1 files changed, 15 insertions, 8 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 565603ad1..6a9d9c4b3 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 @@ -19,14 +19,16 @@ limitations under the License. ============LICENSE_END============================================ */ -import {Injectable} from '@angular/core'; +import { Injectable } from '@angular/core'; -import {Store} from '../../../../common/core/stores/Store'; +import { Store } from '../../../../common/core/stores/Store'; -import {CBAPackage, DslDefinition} from './mapping-models/CBAPacakge.model'; -import {PackageCreationService} from './package-creation.service'; -import {FolderNodeElement, MetaDataTabModel} from './mapping-models/metadata/MetaDataTab.model'; +import { CBAPackage, DslDefinition } 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'; +import { Observable } from 'rxjs'; +import { ResourceDictionary } from './mapping-models/ResourceDictionary.model'; @Injectable({ @@ -94,9 +96,14 @@ export class PackageCreationStore extends Store<CBAPackage> { }); } - getTemplateAndMapping(variables: string[]) { - this.packageCreationService.getTemplateAndMapping(variables).subscribe(element => { - console.log('the element is ' + element); + addMapping(filePath: string, fileContent: string) { + this.setState({ + ...this.state, + mapping: this.state.mapping.setContent(filePath, fileContent) }); } + + getTemplateAndMapping(variables: string[]): Observable<ResourceDictionary[]> { + return this.packageCreationService.getTemplateAndMapping(variables); + } } |