summaryrefslogtreecommitdiffstats
path: root/openecomp-ui/src/sdc-app/common
diff options
context:
space:
mode:
Diffstat (limited to 'openecomp-ui/src/sdc-app/common')
-rw-r--r--openecomp-ui/src/sdc-app/common/reducers/PlainDataReducer.js7
1 files changed, 7 insertions, 0 deletions
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;