summaryrefslogtreecommitdiffstats
path: root/cds-ui/designer-client/src/app/modules/feature-modules/packages/package-creation/template-mapping/templ-mapp-listing/templ-mapp-listing.component.ts
diff options
context:
space:
mode:
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.ts21
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);
+ }
+ });
+ }
}