From 804ec686128a49628e9f656397e4a4512e4c5714 Mon Sep 17 00:00:00 2001
From: Vodafone <onap@vodafone.com>
Date: Mon, 18 Mar 2019 15:46:53 +0530
Subject: List of Input Parameters for VSP: FE

Change-Id: I17697b5646c1a201678dbab11fef28a7483fbf8c
Issue-ID: SDC-2049
Co-authored-by: rahul.ghugikar@vodafone.com, soumyarup.paul@vodafone.com
Signed-off-by: Vodafone <onap@vodafone.com>
---
 .../src/sdc-app/onboarding/OnboardingPunchOut.jsx  | 57 ++++++++++++++++++++--
 1 file changed, 53 insertions(+), 4 deletions(-)

(limited to 'openecomp-ui/src/sdc-app/onboarding/OnboardingPunchOut.jsx')

diff --git a/openecomp-ui/src/sdc-app/onboarding/OnboardingPunchOut.jsx b/openecomp-ui/src/sdc-app/onboarding/OnboardingPunchOut.jsx
index a73501468c..d50fcccf09 100644
--- a/openecomp-ui/src/sdc-app/onboarding/OnboardingPunchOut.jsx
+++ b/openecomp-ui/src/sdc-app/onboarding/OnboardingPunchOut.jsx
@@ -26,7 +26,7 @@ import Application from 'sdc-app/Application.jsx';
 import store from 'sdc-app/AppStore.js';
 import Configuration from 'sdc-app/config/Configuration.js';
 import ScreensHelper from 'sdc-app/common/helpers/ScreensHelper.js';
-
+import ConfigHelper from 'sdc-app/common/helpers/ConfigHelper.js';
 import {
     onboardingMethod as onboardingMethodTypes,
     onboardingOriginTypes
@@ -38,9 +38,32 @@ import { AppContainer } from 'react-hot-loader';
 import HeatSetupActionHelper from './softwareProduct/attachments/setup/HeatSetupActionHelper.js';
 
 import { actionTypes, enums, screenTypes } from './OnboardingConstants.js';
+import { actionTypes as modalActionTypes } from 'nfvo-components/modal/GlobalModalConstants.js';
 import OnboardingActionHelper from './OnboardingActionHelper.js';
 import Onboarding from './Onboarding.js';
 
+ConfigHelper.fetchVspConfig()
+    .then(response => {
+        let dispatch = action => store.dispatch(action);
+        OnboardingActionHelper.saveIsValidationDisabled(dispatch, {
+            isValidationDisabled:
+                response.enabled === undefined || response.enabled === ''
+                    ? true
+                    : !response.enabled
+        });
+    })
+    .catch(error => {
+        let dispatch = action => store.dispatch(action);
+        dispatch({
+            type: modalActionTypes.GLOBAL_MODAL_ERROR,
+            data: {
+                title: i18n('ERROR'),
+                msg: error.message || error.responseJSON.message,
+                cancelButtonText: i18n('OK')
+            }
+        });
+    });
+
 export default class OnboardingPunchOut {
     render({ options: { data, apiRoot, apiHeaders }, onEvent }, element) {
         if (!this.unsubscribeFromStore) {
@@ -360,7 +383,8 @@ export default class OnboardingPunchOut {
                 softwareProductEditor: {
                     data: currentSoftwareProduct = { onboardingMethod: '' }
                 },
-                softwareProductComponents: { componentsList }
+                softwareProductComponents: { componentsList },
+                softwareProductValidation: { isValidationDisabled }
             },
             licenseModel: {
                 licenseModelEditor: { data: currentLicenseModel = {} }
@@ -373,7 +397,8 @@ export default class OnboardingPunchOut {
             currentScreen,
             currentSoftwareProduct,
             currentLicenseModel,
-            componentsList
+            componentsList,
+            isValidationDisabled
         };
 
         if (
@@ -402,7 +427,8 @@ export default class OnboardingPunchOut {
         itemId,
         currentSoftwareProduct,
         currentLicenseModel,
-        componentsList
+        componentsList,
+        isValidationDisabled
     }) {
         let {
             onboardingMethod,
@@ -553,6 +579,8 @@ export default class OnboardingPunchOut {
             case enums.SCREEN.SOFTWARE_PRODUCT_PROCESSES:
             case enums.SCREEN.SOFTWARE_PRODUCT_DEPLOYMENT:
             case enums.SCREEN.SOFTWARE_PRODUCT_NETWORKS:
+            case enums.SCREEN.SOFTWARE_PRODUCT_VALIDATION:
+            case enums.SCREEN.SOFTWARE_PRODUCT_VALIDATION_RESULTS:
             case enums.SCREEN.SOFTWARE_PRODUCT_DEPENDENCIES:
             case enums.SCREEN.SOFTWARE_PRODUCT_ACTIVITY_LOG:
             case enums.SCREEN.SOFTWARE_PRODUCT_COMPONENTS:
@@ -578,6 +606,10 @@ export default class OnboardingPunchOut {
                         enums.BREADCRUMS.SOFTWARE_PRODUCT_DEPLOYMENT,
                     [enums.SCREEN.SOFTWARE_PRODUCT_NETWORKS]:
                         enums.BREADCRUMS.SOFTWARE_PRODUCT_NETWORKS,
+                    [enums.SCREEN.SOFTWARE_PRODUCT_VALIDATION]:
+                        enums.BREADCRUMS.SOFTWARE_PRODUCT_VALIDATION,
+                    [enums.SCREEN.SOFTWARE_PRODUCT_VALIDATION_RESULTS]:
+                        enums.BREADCRUMS.SOFTWARE_PRODUCT_VALIDATION_RESULTS,
                     [enums.SCREEN.SOFTWARE_PRODUCT_DEPENDENCIES]:
                         enums.BREADCRUMS.SOFTWARE_PRODUCT_DEPENDENCIES,
                     [enums.SCREEN.SOFTWARE_PRODUCT_COMPONENTS]:
@@ -673,6 +705,18 @@ export default class OnboardingPunchOut {
                                             .SOFTWARE_PRODUCT_NETWORKS,
                                     displayText: i18n('Networks')
                                 },
+                                {
+                                    key:
+                                        enums.BREADCRUMS
+                                            .SOFTWARE_PRODUCT_VALIDATION,
+                                    displayText: i18n('Validation')
+                                },
+                                {
+                                    key:
+                                        enums.BREADCRUMS
+                                            .SOFTWARE_PRODUCT_VALIDATION_RESULTS,
+                                    displayText: i18n('Validation Results')
+                                },
                                 {
                                     key:
                                         enums.BREADCRUMS
@@ -719,6 +763,11 @@ export default class OnboardingPunchOut {
                                     case enums.BREADCRUMS
                                         .SOFTWARE_PRODUCT_DEPENDENCIES:
                                         return componentsList.length > 1;
+                                    case enums.BREADCRUMS
+                                        .SOFTWARE_PRODUCT_VALIDATION:
+                                    case enums.BREADCRUMS
+                                        .SOFTWARE_PRODUCT_VALIDATION_RESULTS:
+                                        return !isValidationDisabled;
                                     default:
                                         return true;
                                 }
-- 
cgit 1.2.3-korg

