diff options
author | 2020-02-21 11:34:03 +0000 | |
---|---|---|
committer | 2020-02-24 06:24:36 +0000 | |
commit | 1c0e11d0e8221eedbc86577501d5fd40d4890d7e (patch) | |
tree | b20d544f5a67b60f4ac1babf32c266679649879a /usecaseui-portal/src/app/views/services/services-list/mdons-creation | |
parent | 324c150c6bc6c81bfc35af23aa865cba2a1fccf4 (diff) |
USECASEUI-388 fixed and with additional changes
Fixed i18Resource, subtittle wrap and directive folder Path. Alos added few changes for adapting multiple templates.
Change-Id: Ie64485d24d11bcfd59be6c3c119dbccbc6c9b499
Issue-ID: USECASEUI-388
Signed-off-by: root <preethamshyam.sathiyaseelan@us.fujitsu.com>
Diffstat (limited to 'usecaseui-portal/src/app/views/services/services-list/mdons-creation')
2 files changed, 50 insertions, 19 deletions
diff --git a/usecaseui-portal/src/app/views/services/services-list/mdons-creation/mdons-creation.component.html b/usecaseui-portal/src/app/views/services/services-list/mdons-creation/mdons-creation.component.html index 47e22fe9..a3dec5aa 100644 --- a/usecaseui-portal/src/app/views/services/services-list/mdons-creation/mdons-creation.component.html +++ b/usecaseui-portal/src/app/views/services/services-list/mdons-creation/mdons-creation.component.html @@ -19,21 +19,26 @@ <li *ngFor="let parameter of templateParameters.inputs; let i = index;"> <span *ngIf="parameter.isRequired.includes('true')" style="color: red;width:10px;min-width:1px;">*</span> <span title="{{parameter.name}}">{{parameter.name}}:</span> - <input *ngIf="!(parameter.name.includes('uni_id') || parameter.name.includes('enni_id') || parameter.name.includes('date'))" formControlName="{{parameter.name}}" nz-input [(ngModel)]="parameter.value" style="margin-left: auto;"> + <input *ngIf="!(((parameter.name.includes('uni') || parameter.name.includes('enni') || parameter.name.includes('nni')) && parameter.name.includes('id')) || parameter.name.includes('date'))" formControlName="{{parameter.name}}" nz-input [(ngModel)]="parameter.value" style="margin-left: auto;"> <!--<pre>{{mdons_creation_form.get(parameter.name).valid}}</pre>--> <input style="margin-left: 2px;" *ngIf="parameter.name.includes('date')" type="date" formControlName="{{parameter.name}}" nz-input [(ngModel)]="parameter.value" placeholder="yyyy-MM-dd"/> <span style="color: red;width:10px;" *ngIf="mdons_creation_form.controls[parameter.name].errors?.required && (mdons_creation_form.controls[parameter.name].dirty || mdons_creation_form.controls[parameter.name].touched)">Required</span> - <nz-dropdown class = "customclass" [nzTrigger]="'click'" [nzPlacement]="'bottomLeft'" *ngIf="(parameter.name.includes('uni_id') || parameter.name.includes('enni_id'))"> - <button style="width: 300px;" nz-button nz-dropdown><span *ngIf="parameter.name.includes('uni_id')">{{uniIdSelected.id}}</span><span *ngIf="parameter.name.includes('enni_id')">{{enniIdSelected.id}}</span> <i class="anticon anticon-down"></i> + <nz-dropdown class = "customclass" [nzTrigger]="'click'" [nzPlacement]="'bottomLeft'" *ngIf="(parameter.name.includes('uni') || parameter.name.includes('enni') || parameter.name.includes('nni')) && parameter.name.includes('id')"> + <button style="width: 300px;" nz-button nz-dropdown><span *ngIf="(parameter.name.includes('uni') && parameter.name.includes('id'))">{{nniMap.get(parameter.name) == undefined ? uniIdSelected.id : nniMap.get(parameter.name).id}}</span><span *ngIf="(parameter.name.includes('enni')&& parameter.name.includes('id'))">{{nniMap.get(parameter.name) == undefined ? enniIdSelected.id : nniMap.get(parameter.name).id}}</span><span *ngIf="(parameter.name.includes('nni') && parameter.name.includes('id') && !parameter.name.includes('e'))">{{nniMap.get(parameter.name) == undefined ? nniIdSelected.id : nniMap.get(parameter.name).id}}</span> <i class="anticon anticon-down"></i> </button> - <ul nz-menu *ngIf="parameter.name.includes('uni_id')" class="dropDownScroller"> - <li nz-menu-item (click)="chooseUni(item)" *ngFor="let item of uniList" > + <ul nz-menu *ngIf="(parameter.name.includes('uni') && parameter.name.includes('id'))" class="dropDownScroller"> + <li nz-menu-item (click)="chooseUni(parameter.name,item)" *ngFor="let item of uniList" > <a title="{{item.id}}">{{item.id}}</a> </li> </ul> - <ul nz-menu *ngIf="parameter.name.includes('enni_id')" class="dropDownScroller" > - <li nz-menu-item (click)="chooseEnni(item)" *ngFor="let item of enniList" > - <a title="{{item.id}}">{{item.id}}</a> + <ul nz-menu *ngIf="(parameter.name.includes('enni') && parameter.name.includes('id'))" class="dropDownScroller" > + <li nz-menu-item (click)="chooseEnni(parameter.name,item)" *ngFor="let item of enniList" > + <a title="{{nniMap.get(parameter.name) == undefined ? item.id : nniMap.get(parameter.name)}}">{{nniMap.get(parameter.name) == undefined ? item.id : nniMap.get(parameter.name)}}</a> + </li> + </ul> + <ul nz-menu *ngIf="(parameter.name.includes('nni') && parameter.name.includes('id') && !parameter.name.includes('e'))" class="dropDownScroller"> + <li nz-menu-item (click)="chooseNni(parameter.name,item)" *ngFor="let item of nniList" > + <a title="{{item.id}}">{{item.id}}</a> </li> </ul> </nz-dropdown> diff --git a/usecaseui-portal/src/app/views/services/services-list/mdons-creation/mdons-creation.component.ts b/usecaseui-portal/src/app/views/services/services-list/mdons-creation/mdons-creation.component.ts index 3123bfc8..232de474 100644 --- a/usecaseui-portal/src/app/views/services/services-list/mdons-creation/mdons-creation.component.ts +++ b/usecaseui-portal/src/app/views/services/services-list/mdons-creation/mdons-creation.component.ts @@ -16,6 +16,11 @@ export class MdonsCreationComponent implements OnInit { uniIdSelected = { id: null }; enniList= []; enniIdSelected = { id: null }; + nniList= []; + nniIdSelected = { id: null }; + + nniMap : Map<any, any> = new Map<any, any>(); + templateParameters = { invariantUUID: "", uuid: "", @@ -67,6 +72,7 @@ export class MdonsCreationComponent implements OnInit { ngOnInit() { this.getalluni(); this.getallenni(); + this.getallnni(); this.templateParameters=this.mdons_temParametersContent; this.mdonsModelShow = true; this.mdons_creation_form = this.fb.group({}); @@ -76,7 +82,7 @@ export class MdonsCreationComponent implements OnInit { buildFormArrayOfGroupsFromArr() { for(let i of this.templateParameters.inputs){ - if(i.isRequired === "true" && !(i.name.includes('uni_id') || i.name.includes('enni_id'))){ + if(i.isRequired === "true" && !(i.name.includes('_id'))){ this.mdons_creation_form.addControl(i.name, this.fb.control('', [Validators.required])) } else { this.mdons_creation_form.addControl(i.name, this.fb.control('')) @@ -95,7 +101,7 @@ export class MdonsCreationComponent implements OnInit { } getallenni() { - this.myhttp.getAllNI("NNI") + this.myhttp.getAllNI("ENNI") .subscribe((data) => { this.enniList = data.map(item => ({id: item }) ); if(data.length !== 0){ @@ -104,12 +110,29 @@ getallenni() { }) } -chooseUni(item = this.uniIdSelected){ - if(this.uniIdSelected !== item) this.uniIdSelected = item; +getallnni() { + this.myhttp.getAllNI("NNI") + .subscribe((data) => { + this.nniList = data.map(item => ({id: item }) ); + if(data.length !== 0){ + this.nniIdSelected = this.nniList[0]; + } + }) } -chooseEnni(item = this.enniIdSelected){ - if(this.enniIdSelected !== item) this.enniIdSelected = item; +chooseUni(parameterName, item){ + //if(this.uniIdSelected !== item) this.uniIdSelected = item; + this.nniMap.set(parameterName,item); +} + +chooseEnni(parameterName, item){ + //if(this.enniIdSelected !== item) this.enniIdSelected = item; + this.nniMap.set(parameterName,item); +} + +chooseNni(parameterName, item){ + //if(this.nniIdSelected !== item) this.nniIdSelected = item; + this.nniMap.set(parameterName,item); } goback() { @@ -131,11 +154,14 @@ chooseEnni(item = this.enniIdSelected){ this.templateParameters.inputs.forEach((ipnut) => { this.service.parameters.requestInputs[ipnut.name] = ipnut.value == undefined ? ipnut.defaultValue : ipnut.value; - if(ipnut.name.includes('uni_id')) { - this.service.parameters.requestInputs[ipnut.name] = this.uniIdSelected.id == undefined ? ipnut.defaultValue : this.uniIdSelected.id; + if(ipnut.name.includes('uni') && ipnut.name.includes('id')) { + this.service.parameters.requestInputs[ipnut.name] = this.nniMap.get(ipnut.name) == undefined ? this.uniIdSelected.id : this.nniMap.get(ipnut.name).id; + } + if(ipnut.name.includes('enni') && ipnut.name.includes('id')) { + this.service.parameters.requestInputs[ipnut.name] = this.nniMap.get(ipnut.name) == undefined ? this.enniIdSelected.id : this.nniMap.get(ipnut.name).id; } - if(ipnut.name.includes('enni_id')) { - this.service.parameters.requestInputs[ipnut.name] = this.enniIdSelected.id == undefined ? ipnut.defaultValue : this.enniIdSelected.id; + if(ipnut.name.includes('nni') && ipnut.name.includes('id')) { + this.service.parameters.requestInputs[ipnut.name] = this.nniMap.get(ipnut.name) == undefined ? this.nniIdSelected.id : this.nniMap.get(ipnut.name).id; } if(ipnut.name==='name') { this.service.name = ipnut.value == undefined ? ipnut.defaultValue : ipnut.value; @@ -157,4 +183,4 @@ chooseEnni(item = this.enniIdSelected){ -}
\ No newline at end of file +} |