<div class="row">
<!-- <div class="col-4" style="color:white" *ngFor="let file of templates.files | keyvalue; let mapIndex = index">-->
<div class="col-4" style="color:white" *ngFor="let file of getKeys(templateAndMappingMap)">
- <a (click)="setSourceCodeEditor(file.split(',')[1])"
- class="template-mapping-list active">{{file.split(',')[0]}}
+ <a (click)="setSourceCodeEditor(file)"
+ class="template-mapping-list active">{{file}}
<span *ngIf="getValue(file).isMapping">Mapping</span>
<span *ngIf="getValue(file).isTemplate">Template</span>
</a>
</div>
</div>
-</div>
\ No newline at end of file
+</div>
-import { Component, EventEmitter, OnInit, Output } from '@angular/core';
-import { PackageCreationStore } from '../../package-creation.store';
-import { Mapping, Template } from '../../mapping-models/CBAPacakge.model';
-import { TemplateInfo, TemplateStore } from '../../template.store';
-import { TemplateAndMapping } from '../TemplateAndMapping';
+import {Component, EventEmitter, OnInit, Output} from '@angular/core';
+import {PackageCreationStore} from '../../package-creation.store';
+import {Mapping, Template} from '../../mapping-models/CBAPacakge.model';
+import {TemplateInfo, TemplateStore} from '../../template.store';
+import {TemplateAndMapping} from '../TemplateAndMapping';
@Component({
selector: 'app-templ-mapp-listing',
if (cba.templates) {
this.templates = cba.templates;
this.mapping = cba.mapping;
+ console.log(this.mapping);
let templateAndMapping;
this.templateAndMappingMap.clear();
this.templates.files.forEach((value, key) => {
private setIsMappingOrTemplate(key: string, templateAndMapping: TemplateAndMapping, isFromTemplate: boolean) {
const nameOfFile = key.split('/')[1].split('.')[0].split('-')[0];
- const fullName = nameOfFile + ',' + key;
- if (this.templateAndMappingMap.has(fullName)) {
- const templateAndMappingExisted = this.templateAndMappingMap.get(fullName);
+ // const fullName = nameOfFile + ',' + key.split('.');
+ if (this.templateAndMappingMap.has(nameOfFile)) {
+ const templateAndMappingExisted = this.templateAndMappingMap.get(nameOfFile);
!isFromTemplate ? templateAndMappingExisted.isMapping = true : templateAndMappingExisted.isTemplate = true;
- this.templateAndMappingMap.set(fullName, templateAndMappingExisted);
+ this.templateAndMappingMap.set(nameOfFile, templateAndMappingExisted);
} else {
-
- this.templateAndMappingMap.set(fullName, templateAndMapping);
+ this.templateAndMappingMap.set(nameOfFile, templateAndMapping);
}
}
}
setSourceCodeEditor(key: string) {
+ key = 'Templates/' + key + '-template.vtl';
this.packageCreationStore.state$.subscribe(cba => {
if (cba.templates) {
console.log(cba.templates);