diff options
Diffstat (limited to 'openecomp-ui/src/sdc-app/onboarding/OnboardingPunchOut.jsx')
-rw-r--r-- | openecomp-ui/src/sdc-app/onboarding/OnboardingPunchOut.jsx | 57 |
1 files changed, 53 insertions, 4 deletions
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]: @@ -676,6 +708,18 @@ export default class OnboardingPunchOut { { key: enums.BREADCRUMS + .SOFTWARE_PRODUCT_VALIDATION, + displayText: i18n('Validation') + }, + { + key: + enums.BREADCRUMS + .SOFTWARE_PRODUCT_VALIDATION_RESULTS, + displayText: i18n('Validation Results') + }, + { + key: + enums.BREADCRUMS .SOFTWARE_PRODUCT_DEPENDENCIES, displayText: i18n('Components Dependencies') }, @@ -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; } |