diff options
author | 2020-02-27 17:15:30 +0200 | |
---|---|---|
committer | 2020-02-28 09:32:13 +0000 | |
commit | d20383f0b00a363b0193e162ac297dd731088ca2 (patch) | |
tree | 2a4f43c7e3b69a07514c5c3cdfafacbefcb0111b /cds-ui/designer-client/src/app/modules/feature-modules/packages/package-creation/template-mapping/templ-mapp-listing | |
parent | b2b847587d7c06db5737a06820d1809b9aeb73e1 (diff) |
adding dependacies to mapping table
Issue-ID: CCSDK-2065
Signed-off-by: ahmedeldeeb50 <ahmed.eldeeb.ext@orange.com>
Change-Id: I4e91ceaec3327df8f3d92ac339bc96dc2ba8e63a
Diffstat (limited to 'cds-ui/designer-client/src/app/modules/feature-modules/packages/package-creation/template-mapping/templ-mapp-listing')
2 files changed, 18 insertions, 15 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 62bdb5918..129576cbe 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 @@ -9,8 +9,7 @@ <div class="card-header" id="headingThree"> <h5 class="mb-0 d-flex justify-content-between"> <button class="btn btn-link" data-toggle="collapse" data-target="#collapseThree" - aria-expanded="true" - aria-controls="collapseThree"> + aria-expanded="true" aria-controls="collapseThree"> Template and Mapping List </button> @@ -22,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)" - class="template-mapping-list active">{{file}} + <a (click)="setSourceCodeEditor(file.split(',')[1])" + class="template-mapping-list active">{{file.split(',')[0]}} <span *ngIf="getValue(file).isMapping">Mapping</span> <span *ngIf="getValue(file).isTemplate">Template</span> </a> @@ -34,4 +33,4 @@ </div> </div> -</div> +</div>
\ No newline at end of file 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 46e67fc07..61c376c51 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,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', @@ -45,13 +45,14 @@ export class TemplMappListingComponent implements OnInit { private setIsMappingOrTemplate(key: string, templateAndMapping: TemplateAndMapping, isFromTemplate: boolean) { const nameOfFile = key.split('/')[1].split('.')[0].split('-')[0]; - if (this.templateAndMappingMap.has(nameOfFile)) { - const templateAndMappingExisted = this.templateAndMappingMap.get(nameOfFile); + const fullName = nameOfFile + ',' + key; + if (this.templateAndMappingMap.has(fullName)) { + const templateAndMappingExisted = this.templateAndMappingMap.get(fullName); !isFromTemplate ? templateAndMappingExisted.isMapping = true : templateAndMappingExisted.isTemplate = true; - this.templateAndMappingMap.set(nameOfFile, templateAndMappingExisted); + this.templateAndMappingMap.set(fullName, templateAndMappingExisted); } else { - this.templateAndMappingMap.set(nameOfFile, templateAndMapping); + this.templateAndMappingMap.set(fullName, templateAndMapping); } } @@ -63,7 +64,10 @@ export class TemplMappListingComponent implements OnInit { setSourceCodeEditor(key: string) { this.packageCreationStore.state$.subscribe(cba => { if (cba.templates) { - const fileContent = cba.templates.getValue(key); + console.log(cba.templates); + console.log(key); + const fileContent = cba.templates.getValue(key.trim()); + console.log(fileContent); const templateInfo = new TemplateInfo(); templateInfo.fileContent = fileContent; templateInfo.fileName = key; |