<ng-select (change)="primitiveTypeChange($event)" [clearable]="false"
placeholder="{{'SELECT' | translate}}" [items]="primitiveTypeList" bindLabel="title"
bindValue="value" [(ngModel)]="primitiveType" id="primitiveType"
- [ngModelOptions]="{standalone: true}"></ng-select>
+ [ngModelOptions]="{standalone: true}"
+ [ngClass]="{ 'is-invalid': submitted && !primitiveType }"></ng-select>
</div>
</div>
<div class="form-group row" *ngIf="primitiveType === 'VNF_Primitive' || primitiveType === 'VDU_Primitive'">
this.getFormControl('vnf_member_index').updateValueAndValidity();
this.getFormControl('vdu_id').setValidators([]);
this.getFormControl('vdu_id').updateValueAndValidity();
+ } else if (data.value === 'VNF_Primitive') {
+ this.getFormControl('vdu_id').setValidators([]);
+ this.getFormControl('vdu_id').updateValueAndValidity();
}
}
/** Member index change event */
this.isLoadingResults = true;
this.restService.getResource(apiUrl)
.subscribe((vnfdInfo: {}) => {
- if (vnfdInfo[0]['vnf-configuration']) {
+ if (vnfdInfo[0]['vnf-configuration'] !== undefined && vnfdInfo[0]['vnf-configuration']) {
this.getFormControl('vdu_id').setValidators([]);
this.primitiveList = vnfdInfo[0]['vnf-configuration']['config-primitive'];
}
if (getType === 'VDU_Primitive') {
this.vduList = [];
+ this.primitiveList = [];
vnfdInfo[0].vdu.forEach((vduData: VDUPRIMITIVELEVEL) => {
if (vduData['vdu-configuration']) {
const vduDataObj: VDUPRIMITIVELEVEL = this.generateVDUData(vduData);
this.isLoadingResults = true;
this.restService.getResource(apiUrl)
.subscribe((nsdInfo: {}) => {
- this.primitiveList = !isNullOrUndefined(nsdInfo[0]['ns-configuration']['config-primitive']) ?
- nsdInfo[0]['ns-configuration']['config-primitive'] : [];
+ if (!isNullOrUndefined(nsdInfo[0]['ns-configuration'])) {
+ this.primitiveList = !isNullOrUndefined(nsdInfo[0]['ns-configuration']['config-primitive']) ?
+ nsdInfo[0]['ns-configuration']['config-primitive'] : [];
+ } else {
+ this.primitiveList = [];
+ }
this.isLoadingResults = false;
}, (error: ERRORDATA) => {
this.isLoadingResults = false;
/** Exec NS Primitive @public */
public execNSPrimitiveModal(): void {
- this.modalService.open(NSPrimitiveComponent).componentInstance.params = {
+ this.modalService.open(NSPrimitiveComponent, { backdrop: 'static' }).componentInstance.params = {
memberIndex: this.value.memberIndex,
nsConfig: this.value.nsConfig,
name: this.value.NsdName