diff options
author | 2020-02-23 15:23:50 +0200 | |
---|---|---|
committer | 2020-02-23 17:32:27 +0200 | |
commit | 4c1e01bdf2835f7c87ec0e7e6ef2630f72c0b728 (patch) | |
tree | c38723045cc9922d95a1c4d1d7df65f38ebbb752 /cds-ui/designer-client/src/app/modules/feature-modules/packages/package-creation/template-mapping/templ-mapp-listing/templ-mapp-listing.component.ts | |
parent | ebcc45b8c8703cadc49cf3a0b888545845ccb9e6 (diff) |
adding upload function and getting variables from template at template and mapping tab
Issue-ID: CCSDK-2102
Signed-off-by: shaaban Altanany <shaaban.eltanany.ext@orange.com>
Change-Id: Id92cbd183c700764a55ef016d681a568954dc18f
Diffstat (limited to 'cds-ui/designer-client/src/app/modules/feature-modules/packages/package-creation/template-mapping/templ-mapp-listing/templ-mapp-listing.component.ts')
-rw-r--r-- | cds-ui/designer-client/src/app/modules/feature-modules/packages/package-creation/template-mapping/templ-mapp-listing/templ-mapp-listing.component.ts | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/cds-ui/designer-client/src/app/modules/feature-modules/packages/package-creation/template-mapping/templ-mapp-listing/templ-mapp-listing.component.ts b/cds-ui/designer-client/src/app/modules/feature-modules/packages/package-creation/template-mapping/templ-mapp-listing/templ-mapp-listing.component.ts index 5cb41c35e..9a0cdcdac 100644 --- a/cds-ui/designer-client/src/app/modules/feature-modules/packages/package-creation/template-mapping/templ-mapp-listing/templ-mapp-listing.component.ts +++ b/cds-ui/designer-client/src/app/modules/feature-modules/packages/package-creation/template-mapping/templ-mapp-listing/templ-mapp-listing.component.ts @@ -1,6 +1,7 @@ import {Component, EventEmitter, OnInit, Output} from '@angular/core'; import {PackageCreationStore} from '../../package-creation.store'; import {Template} from '../../mapping-models/CBAPacakge.model'; +import {TemplateInfo, TemplateStore} from '../../template.store'; @Component({ selector: 'app-templ-mapp-listing', @@ -10,8 +11,12 @@ import {Template} from '../../mapping-models/CBAPacakge.model'; export class TemplMappListingComponent implements OnInit { @Output() showCreationViewParentNotification = new EventEmitter<any>(); private templates: Template; + private sourceCodeEditorContnet: string; - constructor(private packageCreationStore: PackageCreationStore) { + constructor(private packageCreationStore: PackageCreationStore, private templateStore: TemplateStore) { + } + + ngOnInit() { this.packageCreationStore.state$.subscribe(cba => { if (cba.templates) { this.templates = cba.templates; @@ -19,11 +24,19 @@ export class TemplMappListingComponent implements OnInit { }); } - ngOnInit() { - } - openCreationView() { this.showCreationViewParentNotification.emit('tell parent to open create views'); } + setSourceCodeEditor(key: string) { + this.packageCreationStore.state$.subscribe(cba => { + if (cba.templates) { + const fileContent = cba.templates.getValue(key); + const templateInfo = new TemplateInfo(); + templateInfo.fileContent = fileContent; + templateInfo.fileName = key; + this.templateStore.changeTemplateInfo(templateInfo); + } + }); + } } |