heat validation fix 73/57173/3
authorsvishnev <shlomo-stanisla.vishnevetskiy@amdocs.com>
Mon, 23 Jul 2018 14:01:41 +0000 (17:01 +0300)
committerVitaly Emporopulo <Vitaliy.Emporopulo@amdocs.com>
Mon, 23 Jul 2018 17:01:47 +0000 (17:01 +0000)
ASDC onboarding is not showing error message from nested files inside volume in HEAT zip

Issue-ID: SDC-1554
Change-Id: If348c5d506c2334c9d4db87872c574f00ea92c62
Signed-off-by: svishnev <shlomo-stanisla.vishnevetskiy@amdocs.com>
openecomp-ui/src/sdc-app/onboarding/softwareProduct/attachments/validation/HeatValidationReducer.js

index 67e36ca..1968451 100644 (file)
 import { actionTypes as softwareProductsActionTypes } from 'sdc-app/onboarding/softwareProduct/SoftwareProductConstants.js';
 import { actionTypes, nodeFilters } from './HeatValidationConstants.js';
 
-const mapVolumeData = ({ fileName, env, errors }) => ({
+const mapNestedData = ({ fileName, env, errors }) => ({
     name: fileName,
     expanded: true,
-    type: 'volume',
+    type: 'heat',
     children: env && [
         {
             name: env.fileName,
@@ -30,6 +30,25 @@ const mapVolumeData = ({ fileName, env, errors }) => ({
     errors
 });
 
+const mapVolumeData = ({ fileName, env, errors, nested }) => ({
+    name: fileName,
+    expanded: true,
+    type: 'volume',
+    children: [
+        ...(env
+            ? [
+                  {
+                      name: env.fileName,
+                      errors: env.errors,
+                      type: 'env'
+                  }
+              ]
+            : []),
+        ...(nested ? nested.map(mapNestedData) : [])
+    ],
+    errors
+});
+
 const mapNetworkData = ({ fileName, env, errors }) => ({
     name: fileName,
     expanded: true,