aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorShaabanEltanany <shaaban.eltanany.ext@orange.com>2020-10-05 10:35:26 +0200
committerShaabanEltanany <shaaban.eltanany.ext@orange.com>2020-10-05 10:37:30 +0200
commit9ed89581b8f7c35a4574f82bf71bf22bae992eb6 (patch)
treeb4b21405139ee06d66e2fa3c87088f798a710503
parent133afdcc3d4580cb61e1a2134e0ab617c3901eb0 (diff)
improve selecting filenames of tempalte and mapping
Issue-ID: CCSDK-2795 Signed-off-by: ShaabanEltanany <shaaban.eltanany.ext@orange.com> Change-Id: I4dc0650ee287adbcf190e15f89db2114f318c54e
-rw-r--r--cds-ui/designer-client/src/app/modules/feature-modules/packages/package-creation/template-mapping/templ-mapp-listing/templ-mapp-listing.component.ts29
1 files changed, 17 insertions, 12 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.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 3f54f6742..93cd5ecd1 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,13 +1,12 @@
-import { Component, EventEmitter, OnDestroy, 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 { ActivatedRoute } from '@angular/router';
-import { SharedService } from '../shared-service';
-import { TourService } from 'ngx-tour-md-menu';
-import { TemplateType } from '../utils/TemplateType';
-import { of } from 'rxjs';
+import {Component, EventEmitter, OnDestroy, 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 {ActivatedRoute} from '@angular/router';
+import {SharedService} from '../shared-service';
+import {TourService} from 'ngx-tour-md-menu';
+import {TemplateType} from '../utils/TemplateType';
@Component({
@@ -32,9 +31,9 @@ export class TemplMappListingComponent implements OnInit, OnDestroy {
private route: ActivatedRoute,
private sharedService: SharedService,
private tourService: TourService,
-
) {
}
+
ngOnDestroy(): void {
// this.templateStore.unsubscribe();
// this.packageCreationStore.unsubscribe();
@@ -79,7 +78,9 @@ export class TemplMappListingComponent implements OnInit, OnDestroy {
}
private setIsMappingOrTemplate(key: string, templateAndMapping: TemplateAndMapping, isFromTemplate: boolean) {
- const nameOfFile = key.split('/')[1].split('.')[0].split('-')[0];
+ const nameOfFile = isFromTemplate ?
+ key.split('/')[1].split('.')[0].split('-template')[0]
+ : key.split('/')[1].split('.')[0].split('-mapping')[0];
// const fullName = nameOfFile + ',' + key.split('.');
if (this.templateAndMappingMap.has(nameOfFile)) {
const templateAndMappingExisted = this.templateAndMappingMap.get(nameOfFile);
@@ -112,10 +113,12 @@ export class TemplMappListingComponent implements OnInit, OnDestroy {
this.tourService.goto('tm-templateName');
}
}
+
openCreationView() {
this.showCreationView.emit('tell parent to open create views');
console.log('disable edit mode');
}
+
openListView() {
console.log('open list view');
this.showListView.emit('show full view');
@@ -163,6 +166,7 @@ export class TemplMappListingComponent implements OnInit, OnDestroy {
getValue(file: string) {
return this.templateAndMappingMap.get(file);
}
+
initDelete(file) {
console.log(file);
const templateKey = 'Templates/' + file + '-template';
@@ -176,6 +180,7 @@ export class TemplMappListingComponent implements OnInit, OnDestroy {
}
}
+
condifrmDelete() {
const file = this.fileToDelete.split('/')[1].split('-')[0];
const ext = this.fileToDelete.split('/')[1].split('.')[1];