fixing some ui issues 75/102675/1
authorshaaban Altanany <shaaban.eltanany.ext@orange.com>
Sun, 1 Mar 2020 17:33:18 +0000 (19:33 +0200)
committershaaban Altanany <shaaban.eltanany.ext@orange.com>
Sun, 1 Mar 2020 17:33:18 +0000 (19:33 +0200)
Issue-ID: CCSDK-2123

Signed-off-by: shaaban Altanany <shaaban.eltanany.ext@orange.com>
Change-Id: I60ef330b39f8c9165ab3bd18bbabc2200f81bf66

cds-ui/designer-client/src/app/modules/feature-modules/packages/package-creation/template-mapping/templ-mapp-listing/templ-mapp-listing.component.html
cds-ui/designer-client/src/app/modules/feature-modules/packages/package-creation/template-mapping/templ-mapp-listing/templ-mapp-listing.component.ts

index 129576c..3ed055c 100644 (file)
@@ -21,8 +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" 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>
@@ -33,4 +33,4 @@
         </div>
 
     </div>
-</div>
\ No newline at end of file
+</div>
index 61c376c..d459dac 100644 (file)
@@ -1,8 +1,8 @@
-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',
@@ -23,6 +23,7 @@ export class TemplMappListingComponent implements OnInit {
             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) => {
@@ -45,14 +46,13 @@ export class TemplMappListingComponent implements OnInit {
 
     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);
         }
 
     }
@@ -62,6 +62,7 @@ export class TemplMappListingComponent implements OnInit {
     }
 
     setSourceCodeEditor(key: string) {
+        key = 'Templates/' + key + '-template.vtl';
         this.packageCreationStore.state$.subscribe(cba => {
             if (cba.templates) {
                 console.log(cba.templates);