<label for="vdu-id"> {{'VDUID' | translate}} *</label>
</div>
<div class="col-sm-6">
- <ng-select formControlName="vduId" [clearable]="false"
- placeholder="{{'SELECT' | translate}} {{'VDUID' | translate}}" [items]="vdu" bindLabel="VDU"
+ <ng-select formControlName="vduId" [clearable]="false" (change)="getCountIndex($event.VDU)"
+ placeholder="{{'SELECT' | translate}} {{'VDUID' | translate}}" [items]="vduId" bindLabel="VDU"
bindValue="VDU" [ngClass]="{ 'is-invalid': submitted && f.vduId.errors }">
</ng-select>
</div>
</div>
<div class="col-sm-6">
<ng-select formControlName="countIndex" [clearable]="false"
- placeholder="{{'SELECT' | translate}} {{'COUNTINDEX' | translate}}" [items]="vdu"
+ placeholder="{{'SELECT' | translate}} {{'COUNTINDEX' | translate}}" [items]="countIndex"
bindLabel="count-index" bindValue="count-index"
[ngClass]="{ 'is-invalid': submitted && f.countIndex.errors }">
</ng-select>
public nsIdFilteredData: {}[] = [];
/** Form valid on submit trigger @public */
public submitted: boolean = false;
+ /** Contains vduId @public */
+ public vduId: {};
+ /** Items for countIndex @public */
+ public countIndex: {}[];
/** Input contains Modal dialog component Instance @public */
@Input() public instanceType: string;
/** Input contains Modal dialog component Instance @public */
/** Getting vdu-id & count-index from VNFInstance API */
public getVdu(id: string): void {
const vnfInstanceData: {}[] = [];
- const vnfrDetails: {}[] = [];
this.getFormControl('vduId').setValue(null);
this.getFormControl('countIndex').setValue(null);
if (!isNullOrUndefined(id)) {
vnfInstanceData.push(vnfInstanceDataObj);
});
this.vdu = vnfInstanceData;
+ const vduName: string = 'VDU';
+ this.vduId = this.vdu.filter((vdu: {}, index: number, self: {}[]): {} =>
+ index === self.findIndex((t: {}): {} => (
+ t[vduName] === vdu[vduName]
+ ))
+ );
}
this.checkDay12Operation(this.selectedvnfId);
}, (error: ERRORDATA): void => {
}
}
+ /** Getting count-index by filtering id */
+ public getCountIndex(id: string): void {
+ const VDU: string = 'VDU';
+ this.countIndex = this.vdu.filter((vnfdData: {}[]): boolean => vnfdData[VDU] === id);
+ }
+
/** To check primitve actions from VNFR */
public checkDay12Operation(id: string): void {
const apiUrl: string = environment.VNFPACKAGES_URL + '?id=' + id;
<label for="vdu-id"> {{'VDUID' | translate}} *</label>
</div>
<div class="col-sm-6">
- <ng-select formControlName="vduId" [clearable]="false"
- placeholder="{{'SELECT' | translate}} {{'VDUID' | translate}}" [items]="vdu" bindLabel="VDU"
+ <ng-select formControlName="vduId" [clearable]="false" (change)="getCountIndex($event.VDU)"
+ placeholder="{{'SELECT' | translate}} {{'VDUID' | translate}}" [items]="vduId" bindLabel="VDU"
bindValue="VDU" [ngClass]="{ 'is-invalid': submitted && f.vduId.errors }">
</ng-select>
</div>
</div>
<div class="col-sm-6">
<ng-select formControlName="countIndex" [clearable]="false"
- placeholder="{{'SELECT' | translate}} {{'COUNTINDEX' | translate}}" [items]="vdu"
+ placeholder="{{'SELECT' | translate}} {{'COUNTINDEX' | translate}}" [items]="countIndex"
bindLabel="count-index" bindValue="count-index"
[ngClass]="{ 'is-invalid': submitted && f.countIndex.errors }">
</ng-select>
public nsIdFilteredData: {}[] = [];
/** Form valid on submit trigger @public */
public submitted: boolean = false;
+ /** Contains vduId @public */
+ public vduId: {};
+ /** Items for countIndex @public */
+ public countIndex: {}[];
/** Input contains component objects @private */
@Input() private params: URLPARAMS;
/** FormBuilder instance added to the formBuilder @private */
vnfInstanceData.push(vnfInstanceDataObj);
});
this.vdu = vnfInstanceData;
+ const vduName: string = 'VDU';
+ this.vduId = this.vdu.filter((vdu: {}, index: number, self: {}[]): {} =>
+ index === self.findIndex((t: {}): {} => (
+ t[vduName] === vdu[vduName]
+ ))
+ );
}
}, (error: ERRORDATA): void => {
this.restService.handleError(error, 'get');
}
}
+ /** Getting count-index by filtering id */
+ public getCountIndex(id: string): void {
+ const VDU: string = 'VDU';
+ this.countIndex = this.vdu.filter((vnfdData: {}[]): boolean => vnfdData[VDU] === id);
+ }
+
/** Vertical Scaling on submit */
public triggerVerticalScaling(): void {
this.submitted = true;
<label for="vduid"> {{'VDUID' | translate}}</label>
</div>
<div class="col-sm-6">
- <ng-select formControlName="vduId" [clearable]="false"
- placeholder="{{'SELECT' | translate}} {{'VDUID' | translate}}" [items]="vdu" bindLabel="VDU"
+ <ng-select formControlName="vduId" [clearable]="false" (change)="getCountIndex($event.VDU)"
+ placeholder="{{'SELECT' | translate}} {{'VDUID' | translate}}" [items]="vduId" bindLabel="VDU"
bindValue="VDU" [ngClass]="{ 'is-invalid': submitted && f.vduId.errors }">
</ng-select>
</div>
</div>
<div class="col-sm-6">
<ng-select formControlName="countIndex" [clearable]="false"
- placeholder="{{'SELECT' | translate}} {{'COUNTINDEX' | translate}}" [items]="vdu"
+ placeholder="{{'SELECT' | translate}} {{'COUNTINDEX' | translate}}" [items]="countIndex"
bindLabel="count-index" bindValue="count-index"
[ngClass]="{ 'is-invalid': submitted && f.countIndex.errors }">
</ng-select>
public instanceId: string;
/** Form valid on submit trigger @public */
public submitted: boolean = false;
+ /** Contains vduId @public */
+ public vduId: {};
+ /** Items for countIndex @public */
+ public countIndex: {}[];
/** Input contains component objects @private */
@Input() private params: URLPARAMS;
/** FormBuilder instance added to the formBuilder @private */
vnfInstanceData.push(vnfInstanceDataObj);
});
this.vdu = vnfInstanceData;
+ const vduName: string = 'VDU';
+ this.vduId = this.vdu.filter((vdu: {}, index: number, self: {}[]): {} =>
+ index === self.findIndex((t: {}): {} => (
+ t[vduName] === vdu[vduName]
+ ))
+ );
}
}, (error: ERRORDATA): void => {
this.restService.handleError(error, 'get');
}
}
+ /** Getting count-index by filtering id */
+ public getCountIndex(id: string): void {
+ const VDU: string = 'VDU';
+ this.countIndex = this.vdu.filter((vnfdData: {}[]): boolean => vnfdData[VDU] === id);
+ }
+
/** Trigger VM Migration on submit */
public triggerMigration(): void {
this.submitted = true;