From 611cbc8440e3371c9d0f98504eeee3f2dbe1917f Mon Sep 17 00:00:00 2001 From: Ahmedeldeeb50 Date: Thu, 1 Oct 2020 21:17:47 +0200 Subject: add checkboxs for Required & Template input columns. add alert message for empty or invalid template file. Issue-ID: CCSDK-2795 Signed-off-by: Ahmedeldeeb50 Change-Id: Ic03b633b0ce51d0193f9c7c589bd69e4b72b2d92 --- .../templ-mapp-creation.component.html | 32 +++++++++++++--------- .../templ-mapp-creation.component.ts | 15 ++++++++++ .../templ-mapp-listing.component.ts | 8 ++++-- .../template-mapping/template-mapping.component.ts | 9 ++++-- 4 files changed, 47 insertions(+), 17 deletions(-) (limited to 'cds-ui/designer-client/src/app/modules/feature-modules/packages/package-creation/template-mapping') diff --git a/cds-ui/designer-client/src/app/modules/feature-modules/packages/package-creation/template-mapping/templ-mapp-creation/templ-mapp-creation.component.html b/cds-ui/designer-client/src/app/modules/feature-modules/packages/package-creation/template-mapping/templ-mapp-creation/templ-mapp-creation.component.html index d93d49dba..429fa4193 100644 --- a/cds-ui/designer-client/src/app/modules/feature-modules/packages/package-creation/template-mapping/templ-mapp-creation/templ-mapp-creation.component.html +++ b/cds-ui/designer-client/src/app/modules/feature-modules/packages/package-creation/template-mapping/templ-mapp-creation/templ-mapp-creation.component.html @@ -149,6 +149,7 @@ Required + Template Input Parameter Name Dictionary Name Dictionary Source @@ -173,16 +174,18 @@
- - + + +
+ + +
+ +
- - - {{ dict.name }} {{ dict.name }} @@ -230,6 +233,7 @@ Required + Template Input Parameter Name Dictionary Name Dictionary Source @@ -251,10 +255,12 @@ --> - - + + + + + + {{ dict['name'] }} {{ dict['name'] }} diff --git a/cds-ui/designer-client/src/app/modules/feature-modules/packages/package-creation/template-mapping/templ-mapp-creation/templ-mapp-creation.component.ts b/cds-ui/designer-client/src/app/modules/feature-modules/packages/package-creation/template-mapping/templ-mapp-creation/templ-mapp-creation.component.ts index a99f65b86..2971ecad9 100644 --- a/cds-ui/designer-client/src/app/modules/feature-modules/packages/package-creation/template-mapping/templ-mapp-creation/templ-mapp-creation.component.ts +++ b/cds-ui/designer-client/src/app/modules/feature-modules/packages/package-creation/template-mapping/templ-mapp-creation/templ-mapp-creation.component.ts @@ -126,6 +126,14 @@ export class TemplMappCreationComponent implements OnInit, OnDestroy { pageLength: 25, destroy: true, retrieve: true, + columnDefs: [ + { + targets: [0, 1, 2], // column or columns numbers + orderable: false, // set orderable for selected columns + searchable: false, + }, + + ], }; this.dtOptions = { pagingType: 'full_numbers', @@ -135,6 +143,10 @@ export class TemplMappCreationComponent implements OnInit, OnDestroy { }; } + setProp(e, propName, index) { + this.resourceDictionaryRes[index][propName] = e.checked; + console.log(this.resourceDictionaryRes[index]); + } selectProp(value) { console.log(value); if (this.selectedProps.has(value)) { @@ -374,6 +386,8 @@ export class TemplMappCreationComponent implements OnInit, OnDestroy { }, err => { this.toastr.error('Error'); }); + } else { + this.toastr.error('Empty or Invalid file format. Validate your file first'); } } @@ -466,6 +480,7 @@ export class TemplMappCreationComponent implements OnInit, OnDestroy { // Do not forget to unsubscribe the event this.dtTrigger.unsubscribe(); this.resTableDtTrigger.unsubscribe(); + // this.templateStore.unsubscribe(); } } 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 722be321c..3f54f6742 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,4 +1,4 @@ -import { Component, EventEmitter, OnInit, Output } from '@angular/core'; +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'; @@ -15,7 +15,7 @@ import { of } from 'rxjs'; templateUrl: './templ-mapp-listing.component.html', styleUrls: ['./templ-mapp-listing.component.css'] }) -export class TemplMappListingComponent implements OnInit { +export class TemplMappListingComponent implements OnInit, OnDestroy { @Output() showCreationView = new EventEmitter(); @Output() showListView = new EventEmitter(); templateAndMappingMap = new Map(); @@ -35,6 +35,10 @@ export class TemplMappListingComponent implements OnInit { ) { } + ngOnDestroy(): void { + // this.templateStore.unsubscribe(); + // this.packageCreationStore.unsubscribe(); + } ngOnInit() { if (this.route.snapshot.paramMap.has('id')) { diff --git a/cds-ui/designer-client/src/app/modules/feature-modules/packages/package-creation/template-mapping/template-mapping.component.ts b/cds-ui/designer-client/src/app/modules/feature-modules/packages/package-creation/template-mapping/template-mapping.component.ts index 341d29f66..15361b8ad 100644 --- a/cds-ui/designer-client/src/app/modules/feature-modules/packages/package-creation/template-mapping/template-mapping.component.ts +++ b/cds-ui/designer-client/src/app/modules/feature-modules/packages/package-creation/template-mapping/template-mapping.component.ts @@ -1,4 +1,4 @@ -import { Component, OnInit } from '@angular/core'; +import { Component, OnDestroy, OnInit } from '@angular/core'; import { ActivatedRoute } from '@angular/router'; import { PackageCreationStore } from '../package-creation.store'; import { SharedService } from './shared-service'; @@ -8,7 +8,7 @@ import { SharedService } from './shared-service'; templateUrl: './template-mapping.component.html', styleUrls: ['./template-mapping.component.css'] }) -export class TemplateMappingComponent implements OnInit { +export class TemplateMappingComponent implements OnInit, OnDestroy { creationView = false; listView = true; @@ -18,6 +18,11 @@ export class TemplateMappingComponent implements OnInit { private sharedService: SharedService ) { } + ngOnDestroy(): void { + // this.sharedService.list.unsubscribe(); + // this.sharedService.mode.unsubscribe(); + // this.pakcageStore.unsubscribe(); + } ngOnInit() { -- cgit 1.2.3-korg