- { signatories.map((signatory, s_index) => {
+ { signatories !== undefined && signatories !== null && signatories.map((signatory, s_index) => {
const disabled = signatory.signatoryid !== shareholder.signatory_id ? this._checkSignatoryDisabled(signatory.signatoryid) : false;
+
+ if(checking)
+ {
+ if(shareholder.signatory_id !== signatory.signatoryid)
+ {
+ return null;
+ }
+ }
+
return (
+ {
+ this.props.onNextStep("regulatory");
+ }, 10);
}
- _check_fields_disabled = (values) =>
+ _checkDisabled = () =>
{
- for(let i in values)
+ const { founded_persons } = this.state;
+ const check_all = [
+ "founder_part",
+ ];
+
+ const check = [
+ "lastname",
+ "firstname",
+ "telephone",
+ "email",
+ "identity_document.seria",
+ "identity_document.docnumber",
+ "identity_document.issuedate",
+ "identity_document.icode",
+ "identity_document.issueby",
+ "identity_document.placebirth",
+ "identity_document.citizenship_code",
+ "identity_document.registration_address.title",
+ ];
+
+ for(let f in founded_persons)
{
- if(values[i] === "")
+ for(let i in check_all)
{
- return true;
+ if(_get(founded_persons[f], check_all[i]) === "")
+ {
+ console.log("1. EMPTY", f, check_all[i]);
+ return true;
+ }
+ }
+
+ if(!founded_persons[f].founder_from_list)
+ {
+ for(let i in check)
+ {
+ if(_get(founded_persons[f], check[i]) === "")
+ {
+ console.log("2. EMPTY", f, check[i]);
+ return true;
+ }
+ }
+ }
+ else
+ {
+ if(founded_persons[f].signatory_id === null)
+ {
+ console.log("3. EMPTY", f, "signatory_id");
+ console.log("founded_persons[f]");
+ console.log(founded_persons[f]);
+
+ return true;
+ }
}
}
@@ -427,11 +542,11 @@ class Form_4_Shareholders extends QuestionnaireForm
render()
{
- const { signatories } = this.props;
+ const { signatories, checking } = this.props;
const { founded_persons, loading, address, } = this.state;
return (
-
)
}
@@ -472,8 +589,7 @@ class Form_4_Shareholders extends QuestionnaireForm
function mapStateToProps(state, ownProps)
{
return {
- founded_persons: state.questionnaire.founded_persons,
- founded_persons_template: state.questionnaire.founded_persons_template,
+ questionnaire: state.questionnaire,
}
}
diff --git a/components/questionnaire/forms/Form_5_Regulatory/index.js b/components/questionnaire/forms/Form_5_Regulatory/index.js
index bd1165b..39af908 100644
--- a/components/questionnaire/forms/Form_5_Regulatory/index.js
+++ b/components/questionnaire/forms/Form_5_Regulatory/index.js
@@ -18,10 +18,6 @@ class Form_5_Regulatory extends QuestionnaireForm
{
super(props);
this.state = {
- address: "",
- phone_check_loading: false,
- phone_number_format_error: false,
-
main: {
title: "",
inn: "",
@@ -51,7 +47,7 @@ class Form_5_Regulatory extends QuestionnaireForm
static getDerivedStateFromProps(nextProps, prevState)
{
return {
- main: nextProps.main,
+ main: nextProps.questionnaire.main,
};
}
@@ -63,28 +59,43 @@ class Form_5_Regulatory extends QuestionnaireForm
{
event.preventDefault();
console.log("Form_5_Regulatory", "_handle_onFormSubmit");
+
+ this._handle_onCheckboxFieldChange("step", 6);
+ setTimeout(() =>
+ {
+ this.props.onNextStep("non-profit");
+ }, 10);
}
- _check_fields_disabled = (values) =>
+ _checkDisabled = () =>
{
- for(let i in values)
+ const { main } = this.state;
+ const check = ["high_level", "board_of_directors", "collective_executive", "individual_executive"];
+
+ for(let i in check)
{
- if(values[i] === "")
+ if(main[check[i]] === "")
{
return true;
}
}
+ if(!main.accept)
+ {
+ return true;
+ }
+
return false;
}
render()
{
+ const { checking } = this.props;
const { main, loading } = this.state;
return (
-
)
@@ -208,7 +221,7 @@ class Form_5_Regulatory extends QuestionnaireForm
function mapStateToProps(state, ownProps)
{
return {
- main: state.questionnaire.main,
+ questionnaire: state.questionnaire,
}
}
diff --git a/components/questionnaire/forms/Form_6_NonProfit/index.js b/components/questionnaire/forms/Form_6_NonProfit/index.js
index 0e5dc08..8a495fa 100644
--- a/components/questionnaire/forms/Form_6_NonProfit/index.js
+++ b/components/questionnaire/forms/Form_6_NonProfit/index.js
@@ -36,7 +36,7 @@ class Form_6_NonProfit extends QuestionnaireForm
static getDerivedStateFromProps(nextProps, prevState)
{
return {
- non_profit: nextProps.non_profit,
+ non_profit: nextProps.questionnaire.non_profit,
};
}
@@ -48,28 +48,51 @@ class Form_6_NonProfit extends QuestionnaireForm
{
event.preventDefault();
console.log("Form_6_NonProfit", "_handle_onFormSubmit");
+
+ this._handle_onCheckboxFieldChange("step", 7);
+ setTimeout(() =>
+ {
+ this.props.onNextStep("check");
+ }, 10);
}
- _check_fields_disabled = (values) =>
+ _checkDisabled = () =>
{
- for(let i in values)
+ const { non_profit } = this.state;
+ const check = ["fin_goals_cars", "fin_goals_trucks", "fin_goals_special"];
+
+ for(let i in check)
{
- if(values[i] === "")
+ if(non_profit[check[i]] === "")
{
return true;
}
}
+ if(non_profit.fin_source_another)
+ {
+ if(non_profit.fin_source_another_description === "")
+ {
+ return true;
+ }
+ }
+
+ if(!non_profit.fin_source_business && !non_profit.fin_source_donate && !non_profit.fin_source_fees)
+ {
+ return true;
+ }
+
return false;
}
render()
{
+ const { checking } = this.props;
const { non_profit, loading } = this.state;
return (
-
+ ) }
)
@@ -208,7 +233,7 @@ class Form_6_NonProfit extends QuestionnaireForm
function mapStateToProps(state, ownProps)
{
return {
- non_profit: state.questionnaire.non_profit,
+ questionnaire: state.questionnaire,
}
}
diff --git a/components/questionnaire/forms/Form_7_Check/index.js b/components/questionnaire/forms/Form_7_Check/index.js
index f304cee..39d6be6 100644
--- a/components/questionnaire/forms/Form_7_Check/index.js
+++ b/components/questionnaire/forms/Form_7_Check/index.js
@@ -11,6 +11,12 @@ import { withRouter } from 'next/router';
import QuestionnaireForm from "../QuestionnaireForm";
import { reduxWrapper } from '../../../../store';
+import Form_1_Main from "../Form_1_Main";
+import Form_2_Contacts from "../Form_2_Contacts";
+import Form_3_Signer from "../Form_3_Signer";
+import Form_4_Shareholders from "../Form_4_Shareholders";
+import Form_5_Regulatory from "../Form_5_Regulatory";
+import Form_6_NonProfit from "../Form_6_NonProfit";
class Form_7_Check extends QuestionnaireForm
{
@@ -19,7 +25,7 @@ class Form_7_Check extends QuestionnaireForm
super(props);
this.state = {
address: "",
- phone_check_loading: false,
+ loading: false,
phone_number_format_error: false,
step: 7,
@@ -64,6 +70,13 @@ class Form_7_Check extends QuestionnaireForm
{
event.preventDefault();
console.log("FormAddress", "_handle_onFormSubmit");
+
+ this._handle_onCheckboxFieldChange("step", 8);
+ setTimeout(() =>
+ {
+ this.props.onNextStep("signing");
+ }, 10);
+
}
_handle_onAddressChange = (value) =>
@@ -88,10 +101,19 @@ class Form_7_Check extends QuestionnaireForm
render()
{
- const { address, phone_check_loading, phone_number_format_error } = this.state;
+ const { signatories } = this.props;
+ const { address, loading, phone_number_format_error } = this.state;
return (