From 61070c9c6b665fdea79b3ccdfeafc3a6b50d262e Mon Sep 17 00:00:00 2001 From: Avi Ziv Date: Wed, 26 Jul 2017 17:37:57 +0300 Subject: [SDC] Full OnBoard health-check and NFoD support Change-Id: I606f8a52c7e6d2bd5558f824957d890e552c5423 Signed-off-by: Avi Ziv --- openecomp-ui/src/sdc-app/common/reducers/PlainDataReducer.js | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'openecomp-ui/src/sdc-app/common') diff --git a/openecomp-ui/src/sdc-app/common/reducers/PlainDataReducer.js b/openecomp-ui/src/sdc-app/common/reducers/PlainDataReducer.js index 0bbb5e63be..2276984f7a 100644 --- a/openecomp-ui/src/sdc-app/common/reducers/PlainDataReducer.js +++ b/openecomp-ui/src/sdc-app/common/reducers/PlainDataReducer.js @@ -16,6 +16,7 @@ import {actionTypes} from './PlainDataReducerConstants.js'; import Validator from 'nfvo-utils/Validator.js'; import forOwn from 'lodash/forOwn.js'; +import {other as optionInputOther} from 'nfvo-components/input/inputOptions/InputOptions.jsx'; function updateDataAndValidateReducer(state = {}, action) { let genericFieldInfoCopy; @@ -46,6 +47,12 @@ function updateDataAndValidateReducer(state = {}, action) { forOwn(state.genericFieldInfo,(value, key) => { let val = state.data && state.data[key] ? state.data[key] : ''; let result = Validator.validate(key, val, state.genericFieldInfo[key].validations, state, {}); + if(val.choice !== undefined) { + result = Validator.validate(key, val.choice, state.genericFieldInfo[key].validations, state, {}); + } + if(val.choice !== undefined && val.choice === optionInputOther.OTHER) { + result = Validator.validate(key, val.other, state.genericFieldInfo[key].validations, state, {}); + } genericFieldInfoCopy[key] = {...genericFieldInfoCopy[key], isValid: result.isValid, errorText: result.errorText}; if (!result.isValid) { formReady = false; -- cgit 1.2.3-korg