diff --git a/actions/questionnaireActions.js b/actions/questionnaireActions.js index 209d4ec..dccd5a9 100644 --- a/actions/questionnaireActions.js +++ b/actions/questionnaireActions.js @@ -96,7 +96,7 @@ export const getQuestionnaire = ({ dispatch, id }) => questionnaire.main.email = response.data.email; questionnaire.main.websiteurl = response.data.websiteurl !== null ? response.data.websiteurl : ""; questionnaire.main.financial_loan = response.data.financial_loan !== null ? response.data.financial_loan : ""; - questionnaire.main.evo_mail_delivery_address_type = response.data.inn.length > 10 ? 100000001 : 100000000; + questionnaire.main.mail_delivery_address_type = response.data.mail_delivery_address_type !== null ? response.data.mail_delivery_address_type : response.data.inn.length > 10 ? 100000001 : 100000000; questionnaire.contacts.fact_address = response.data.fact_address; questionnaire.contacts.postal_address = response.data.postal_address; diff --git a/components/questionnaire/forms/Form_2_Contacts/index.js b/components/questionnaire/forms/Form_2_Contacts/index.js index 709f6ca..e344cff 100644 --- a/components/questionnaire/forms/Form_2_Contacts/index.js +++ b/components/questionnaire/forms/Form_2_Contacts/index.js @@ -22,7 +22,7 @@ class Form_2_Contacts extends QuestionnaireForm super(props); this.state = { contacts: { - evo_mail_delivery_address_type: 100000000, + mail_delivery_address_type: 100000000, loading: false, fact_address: { @@ -58,11 +58,11 @@ class Form_2_Contacts extends QuestionnaireForm componentDidMount() { const { company } = this.props; - const { evo_mail_delivery_address_type } = this.state.main; + const { mail_delivery_address_type } = this.state.main; - if(company.inn.length > 10 && evo_mail_delivery_address_type === 100000000) + if(company.inn.length > 10 && parseInt(mail_delivery_address_type, 10) === 100000000) { - this._handle_onCheckboxFieldChange("main.evo_mail_delivery_address_type", 100000001); + this._handle_onCheckboxFieldChange("main.mail_delivery_address_type", 100000001); } } @@ -90,7 +90,7 @@ class Form_2_Contacts extends QuestionnaireForm errors.push(`contacts.fact_address`); } - if(main.evo_mail_delivery_address_type === 100000002) + if(main.mail_delivery_address_type === 100000002) { if(contacts.postal_address.name === "") { @@ -110,7 +110,7 @@ class Form_2_Contacts extends QuestionnaireForm const { company, checking } = this.props; const { main, contacts, loading, status, step, errors } = this.state; const { fact_address, postal_address, } = contacts; - const { evo_mail_delivery_address_type } = main; + const { mail_delivery_address_type } = main; return ( @@ -151,8 +151,8 @@ class Form_2_Contacts extends QuestionnaireForm { this._removeError("contacts.postal_address"); this._handle_onCheckboxFieldChange(event.target.name, event.target.value); } } disabled={ checking } /> @@ -164,8 +164,8 @@ class Form_2_Contacts extends QuestionnaireForm { this._removeError("contacts.postal_address"); this._handle_onCheckboxFieldChange(event.target.name, event.target.value); } } disabled={ checking } /> @@ -176,20 +176,20 @@ class Form_2_Contacts extends QuestionnaireForm this._handle_onCheckboxFieldChange(event.target.name, event.target.value) } disabled={ checking } /> diff --git a/components/questionnaire/forms/Form_4_Shareholders/index.js b/components/questionnaire/forms/Form_4_Shareholders/index.js index 672c30a..a3753bf 100644 --- a/components/questionnaire/forms/Form_4_Shareholders/index.js +++ b/components/questionnaire/forms/Form_4_Shareholders/index.js @@ -338,6 +338,8 @@ class Shareholder extends React.Component const { index, shareholders, removeShareholder, signatories, contacts, changeFounderSelectionFromList, clearFounderFromListSelection, checking, errors, } = this.props; const shareholder = shareholders[index]; + console.log({ contacts }); + return (
diff --git a/pages/api/questionnaire/download.js b/pages/api/questionnaire/download.js index d3f9e40..a5d2a3b 100644 --- a/pages/api/questionnaire/download.js +++ b/pages/api/questionnaire/download.js @@ -37,7 +37,7 @@ const fields = { collective_executive: { name: "execution_team", type: "text", bind: null, size: 6 }, individual_executive: { name: "execution_sole", type: "text", bind: null, size: 6 }, other_control: { name: "execution_another", type: "text", bind: null, size: 6 }, - evo_mail_delivery_address_type: { name: "evo_mail_delivery_address_type", type: "radio", bind: null }, + mail_delivery_address_type: { name: "mail_delivery_address_type", type: "radio", bind: null }, }, contacts: { fact_address: { name: "address_fact", type: "text", bind: null }, @@ -247,10 +247,10 @@ export default async function handler(req, res) fields[group][field].bind.setText(questionnaire[group].fact_address.name.toUpperCase()); } } - else if(field === "evo_mail_delivery_address_type") + else if(field === "mail_delivery_address_type") { fields[group][field].bind = form.getRadioGroup(fields[group][field].name); - fields[group][field].bind.select(address[ questionnaire[group].evo_mail_delivery_address_type ]); + fields[group][field].bind.select(address[ questionnaire[group].mail_delivery_address_type ]); } /* else if(field === "foreign_payers") diff --git a/reducers/initialState.js b/reducers/initialState.js index 1a08a40..d0b08a7 100644 --- a/reducers/initialState.js +++ b/reducers/initialState.js @@ -25,7 +25,7 @@ export const questionnaire_template = { }, delegation_files: [], contacts: { - evo_mail_delivery_address_type: 100000000, + mail_delivery_address_type: 100000000, legal_address: { name: null, fias_id: null,