Fix for VID-928: NullPointerException during deploy service instance with empty cds... 16/116316/2
authormarcinrzepeckiwroc <marcin.rzepecki@nokia.com>
Fri, 11 Dec 2020 13:52:17 +0000 (14:52 +0100)
committerIkram Ikramullah <ikram@research.att.com>
Mon, 21 Dec 2020 20:55:11 +0000 (20:55 +0000)
Flag "Skip post instantiation configuration" is not collected.

Issue-ID: VID-928
Signed-off-by: marcinrzepeckiwroc <marcin.rzepecki@nokia.com>
Change-Id: I3cabaf1b503160a6352fd89f511b3e6d7b706064

vid-app-common/src/main/java/org/onap/vid/job/command/MsoRequestBuilder.kt
vid-webpack-master/src/app/shared/components/genericForm/formControlsServices/control.generator.util.service.ts

index b69f76d..6146fec 100644 (file)
@@ -250,9 +250,10 @@ class MsoRequestBuilder
                 }
         }
 
-        val result: MutableMap<String, String> = instanceParams[0].entries.stream()
+        val result: MutableMap<String, String> = mutableMapOf();
+        instanceParams[0].entries.stream()
                 .filter { entry -> !keysToRemove.contains(entry.key) }
-                .collect(Collectors.toMap({ it.key }, { it.value }))
+                .forEach { t -> result.put(t.key, t.value) }
 
         return if (result.isEmpty()) emptyList() else listOf(result)
     }
index bcbcefa..fce6c6e 100644 (file)
@@ -147,7 +147,7 @@ export class ControlGeneratorUtil {
           case 'select' :
           case 'boolean' : {
             data.value = data.value || input.optionList.filter((option) => option.isDefault ? option.id || option.name : null);
-            data.onInit = this.getSubscribeInitResult.bind(null, this.getInputsOptions.bind(this, input.optionList));
+            data.onInit = this.getSubscribeInitResult.bind(null, input.optionList == null ? this.getBooleanOptions : this.getInputsOptions.bind(this, input.optionList));
             result.push(new DropdownFormControl(data));
             break;
           }
@@ -250,4 +250,11 @@ export class ControlGeneratorUtil {
     ]);
   };
 
+  getBooleanOptions = (): Observable<SelectOption[]> => {
+    return of([
+      new SelectOption({id: 'true', name: 'true'}),
+      new SelectOption({id: 'false', name: 'false'})
+    ]);
+  };
+
 }