aboutsummaryrefslogtreecommitdiffstats
path: root/cds-ui/designer-client/src/app/modules/feature-modules/packages/package-creation/template-mapping/templ-mapp-listing
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')
-rw-r--r--cds-ui/designer-client/src/app/modules/feature-modules/packages/package-creation/template-mapping/templ-mapp-listing/templ-mapp-listing.component.html7
-rw-r--r--cds-ui/designer-client/src/app/modules/feature-modules/packages/package-creation/template-mapping/templ-mapp-listing/templ-mapp-listing.component.ts14
2 files changed, 13 insertions, 8 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.html b/cds-ui/designer-client/src/app/modules/feature-modules/packages/package-creation/template-mapping/templ-mapp-listing/templ-mapp-listing.component.html
index a47963a72..8c92f0dc2 100644
--- a/cds-ui/designer-client/src/app/modules/feature-modules/packages/package-creation/template-mapping/templ-mapp-listing/templ-mapp-listing.component.html
+++ b/cds-ui/designer-client/src/app/modules/feature-modules/packages/package-creation/template-mapping/templ-mapp-listing/templ-mapp-listing.component.html
@@ -1,9 +1,9 @@
-<a *ngIf="isCreate" (click)="openCreationView()" class="create-template-mapping-button">
+<a (click)="openCreationView()" class="create-template-mapping-button">
<i class="fa fa-plus"></i> <span>Create</span>
</a>
-<div class="template-mapping-accordion">
+<div class="template-mapping-accordion" [hidden]="templateAndMappingMap?.size <= 0">
<div class="accordion" id="listAccordion">
<div class="card">
<div class="card-header" id="headingThree">
@@ -21,7 +21,8 @@
<div class="row">
<!-- <div class="col-4" style="color:white" *ngFor="let file of templates.files | keyvalue; let mapIndex = index">-->
<div class="col-4" *ngFor="let file of getKeys(templateAndMappingMap)">
- <a (click)="setSourceCodeEditor(file)" class="template-mapping-list" [ngClass]="{'active':currentFile == file}">{{file}}
+ <a (click)="setSourceCodeEditor(file)" class="template-mapping-list"
+ [ngClass]="{'active':currentFile == file}">{{file}}
<span *ngIf="getValue(file).isMapping">Mapping</span>
<span *ngIf="getValue(file).isTemplate">Template</span>
</a>
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 448899019..ed9f3eeb3 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
@@ -13,6 +13,7 @@ import { ActivatedRoute } from '@angular/router';
})
export class TemplMappListingComponent implements OnInit {
@Output() showCreationViewParentNotification = new EventEmitter<any>();
+ @Output() showFullView = new EventEmitter<any>();
private templateAndMappingMap = new Map<string, TemplateAndMapping>();
private templates: Template;
private mapping: Mapping;
@@ -71,6 +72,9 @@ export class TemplMappListingComponent implements OnInit {
openCreationView() {
this.showCreationViewParentNotification.emit('tell parent to open create views');
}
+ FullView() {
+ this.showFullView.emit('show full view');
+ }
setSourceCodeEditor(key: string) {
this.currentFile = key;
@@ -80,23 +84,23 @@ export class TemplMappListingComponent implements OnInit {
console.log(cba);
console.log(key);
console.log(this.templateAndMappingMap);
+ const templateInfo = new TemplateInfo();
if (cba.templates && cba.templates.files.has(templateKey)) {
const fileContent = cba.templates.getValue(templateKey.trim());
console.log(fileContent);
- const templateInfo = new TemplateInfo();
templateInfo.fileContent = fileContent;
templateInfo.fileName = templateKey;
- this.templateStore.changeTemplateInfo(templateInfo);
+ templateInfo.type = 'template';
}
const mappingKey = 'Templates/' + key + '-mapping.json';
if (cba.mapping && cba.mapping.files.has(mappingKey)) {
const obj = JSON.parse(cba.mapping.getValue(mappingKey));
- const templateInfo = new TemplateInfo();
templateInfo.mapping = obj;
templateInfo.fileName = mappingKey;
- templateInfo.type = 'mapping';
- this.templateStore.changeTemplateInfo(templateInfo);
+ templateInfo.type += 'mapping';
}
+ this.templateStore.changeTemplateInfo(templateInfo);
+ this.FullView();
});
}