summaryrefslogtreecommitdiffstats
path: root/openecomp-ui/src/sdc-app/onboarding/licenseModel/limits/LimitEditor.js
blob: d483383472283494be3a1255692e3c22e627b69b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
import {connect} from 'react-redux';
import ValidationHelper from 'sdc-app/common/helpers/ValidationHelper.js';
import LimitEditor from './LimitEditor.jsx';

const mapStateToProps = ({licenseModel: {limitEditor}}) => {

	let {data, genericFieldInfo, formReady} = limitEditor;	
	let isFormValid = ValidationHelper.checkFormValid(genericFieldInfo);

	return {
		data,		
		genericFieldInfo,
		isFormValid,
		formReady
	};
};

const mapActionsToProps = (dispatch) => {
	return {
		onDataChanged: (deltaData, formName, customValidations) => ValidationHelper.dataChanged(dispatch, {deltaData, formName, customValidations}),
		onValidateForm: (formName) => ValidationHelper.validateForm(dispatch, formName)
	};
};

export default connect(mapStateToProps, mapActionsToProps)(LimitEditor);