diff options
author | AhmedEldeeb50 <ahmed.eldeeb.ext@orange.com> | 2020-05-07 16:10:33 +0200 |
---|---|---|
committer | AhmedEldeeb50 <ahmed.eldeeb.ext@orange.com> | 2020-05-07 17:54:30 +0200 |
commit | bf566c138c513af95f01657cec75d97bc442777b (patch) | |
tree | f970e48642e36087836ef1b259208eb0eb4a6e52 /cds-ui/designer-client/src/app/modules/feature-modules/packages/package-creation/template-mapping/templ-mapp-listing | |
parent | 7dee8dfd6cd0aa55491e4b5f8487d1731bed9a29 (diff) |
update template&mapping create view.
add alert messages for success and error
Issue-ID: CCSDK-2323
Signed-off-by: AhmedEldeeb50 <ahmed.eldeeb.ext@orange.com>
Change-Id: Id05c73abad2342685971e2e57409b4a471f9242f
Diffstat (limited to 'cds-ui/designer-client/src/app/modules/feature-modules/packages/package-creation/template-mapping/templ-mapp-listing')
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(); }); } |