delivery step actions

This commit is contained in:
Almira Krdzic
2018-10-30 17:20:56 +01:00
parent f5766cda99
commit 5aca4e8572
23 changed files with 1651 additions and 218 deletions

View File

@@ -1,6 +1,6 @@
import React, {Component} from 'react';
import {connect} from 'react-redux';
import {fetchCustomerDocuments, fetchValidationComments} from '../../../../actions/orders/processActions';
import {fetchCustomerQuestionnaires} from '../../../../actions/orders/customerQuestionnairesActions';
import ValidateQuestionnaireItem from './ValidateQuestionnaireItem.jsx';
import '../../style/ValidateQuestionnaire.css';
@@ -8,7 +8,7 @@ class ValidateQuestionnaire extends Component {
componentDidMount(){
const {idOrder, idProcessStep} = this.props.step;
//this.props.dispatch(fetchCustomerDocuments(idOrder, 'orderQuestionaire'));
this.props.dispatch(fetchCustomerQuestionnaires(idOrder));
//this.props.dispatch(fetchValidationComments(idOrder, idProcessStep, 'invalidQuestionnaireComment'));
}
@@ -18,18 +18,18 @@ class ValidateQuestionnaire extends Component {
}
render() {
const {customerDocuments, validationComments, orderPackages} = this.props;
const {customerQuestionnaires, orderPackages} = this.props;
return (
<div id="validate-questionnaire" className="validate-questionnaire">
{
customerDocuments &&
Object.keys(customerDocuments).map((idOrderPackagePair) =>
customerQuestionnaires && customerQuestionnaires.actions &&
customerQuestionnaires.actions.map((customerQuestionnaryAction) =>
<ValidateQuestionnaireItem
customerDocuments={customerDocuments[idOrderPackagePair]}
validationComments={validationComments && validationComments[idOrderPackagePair] ? validationComments[idOrderPackagePair] : []}
orderPackage={orderPackages.find((orderPackage)=>{ return this.findById(orderPackage, idOrderPackagePair)})}
key={'validate-questionnaire-' + idOrderPackagePair}/>
action={customerQuestionnaryAction}
key={'validate-questionnaire-' + customerQuestionnaryAction.action_id}
orderPackage={orderPackages.find( orderPackage => orderPackage.orderItemId === customerQuestionnaryAction.item_id)}
/>
)
}
</div>
@@ -38,8 +38,7 @@ class ValidateQuestionnaire extends Component {
}
const mapStateToProps = (state) => ({
customerDocuments: state.processReducer.customerDocuments,
validationComments: state.processReducer.validationComments,
customerQuestionnaires: state.processReducer.customerQuestionnaires,
orderPackages: state.processReducer.orderInfo.packages
});