BUG 1175 Unable to execute VNF-Level Primitives 82/9582/2 v8.0.1 v8.0.1rc1
authorBarath Kumar R <barath.r@tataelxsi.co.in>
Thu, 13 Aug 2020 06:14:01 +0000 (11:44 +0530)
committerBarath Kumar R <barath.r@tataelxsi.co.in>
Thu, 13 Aug 2020 13:00:34 +0000 (18:30 +0530)
 * Fixed the bug the for the Primitives Level execution.

Change-Id: I3ac9bf309037666d17ac11c80f350fefbe2f98e7
Signed-off-by: Barath Kumar R <barath.r@tataelxsi.co.in>
src/app/instances/ns-primitive/NSPrimitiveComponent.html
src/app/instances/ns-primitive/NSPrimitiveComponent.ts
src/app/utilities/ns-instances-action/NSInstancesActionComponent.ts

index 3c96d80..324642a 100644 (file)
@@ -29,7 +29,8 @@ Author: KUMARAN M (kumaran.m@tataelxsi.co.in), RAJESH S (rajesh.s@tataelxsi.co.i
                 <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'">
index ab026dc..1086f49 100644 (file)
@@ -230,6 +230,9 @@ export class NSPrimitiveComponent implements OnInit {
             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 */
@@ -289,12 +292,13 @@ export class NSPrimitiveComponent implements OnInit {
         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);
@@ -317,8 +321,12 @@ export class NSPrimitiveComponent implements OnInit {
         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;
index 6ccfb1e..e68ce63 100644 (file)
@@ -144,7 +144,7 @@ export class NSInstancesActionComponent {
 
   /** 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