@redneckz/wildless-cms-uni-blocks 0.14.812 → 0.14.814
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundle/bundle.umd.js +173 -132
- package/bundle/bundle.umd.min.js +1 -1
- package/bundle/components/ApplicationLeadForm/EsiaLoginBanner.d.ts +4 -0
- package/bundle/components/ApplicationLeadForm/applicationFormData.d.ts +0 -1
- package/bundle/components/ApplicationLeadForm/getInitialFormState.d.ts +1 -1
- package/bundle/components/ApplicationLeadForm/parseEsiaProfile.d.ts +2 -2
- package/bundle/components/ApplicationLeadForm/useApplicationLeadApi.d.ts +2 -2
- package/bundle/components/ApplicationLeadForm/useInitApplicationLead.d.ts +3 -1
- package/bundle/retail/api/checkCode.d.ts +1 -0
- package/bundle/retail/api/{updateProfileEsia.d.ts → esiaRequestProfile.d.ts} +11 -4
- package/bundle/retail/api/updateUserTask.d.ts +1 -0
- package/bundle/retail/api/uploadFile.d.ts +1 -1
- package/bundle/retail/model/NameFieldDef.d.ts +1 -1
- package/bundle/ui-kit/FormField/shouldRenderField.d.ts +1 -1
- package/dist/components/ApplicationLeadForm/ApplicationLeadForm.js +13 -3
- package/dist/components/ApplicationLeadForm/ApplicationLeadForm.js.map +1 -1
- package/dist/components/ApplicationLeadForm/EsiaLoginBanner.d.ts +4 -0
- package/dist/components/ApplicationLeadForm/EsiaLoginBanner.js +23 -0
- package/dist/components/ApplicationLeadForm/EsiaLoginBanner.js.map +1 -0
- package/dist/components/ApplicationLeadForm/applicationFormData.d.ts +0 -1
- package/dist/components/ApplicationLeadForm/applicationFormData.js +6 -31
- package/dist/components/ApplicationLeadForm/applicationFormData.js.map +1 -1
- package/dist/components/ApplicationLeadForm/getInitialFormState.d.ts +1 -1
- package/dist/components/ApplicationLeadForm/getInitialFormState.js +8 -2
- package/dist/components/ApplicationLeadForm/getInitialFormState.js.map +1 -1
- package/dist/components/ApplicationLeadForm/parseEsiaProfile.d.ts +2 -2
- package/dist/components/ApplicationLeadForm/parseEsiaProfile.js +54 -19
- package/dist/components/ApplicationLeadForm/parseEsiaProfile.js.map +1 -1
- package/dist/components/ApplicationLeadForm/useApplicationLeadApi.d.ts +2 -2
- package/dist/components/ApplicationLeadForm/useApplicationLeadApi.js +7 -10
- package/dist/components/ApplicationLeadForm/useApplicationLeadApi.js.map +1 -1
- package/dist/components/ApplicationLeadForm/useInitApplicationLead.d.ts +3 -1
- package/dist/components/ApplicationLeadForm/useInitApplicationLead.js +12 -16
- package/dist/components/ApplicationLeadForm/useInitApplicationLead.js.map +1 -1
- package/dist/components/CreditForm/SuccessStatusContent.js +1 -1
- package/dist/components/CreditForm/SuccessStatusContent.js.map +1 -1
- package/dist/retail/adaptors/getFamilyStatusAndIncomeData.js +2 -2
- package/dist/retail/adaptors/getFamilyStatusAndIncomeData.js.map +1 -1
- package/dist/retail/api/checkCode.d.ts +1 -0
- package/dist/retail/api/checkCode.js +3 -2
- package/dist/retail/api/checkCode.js.map +1 -1
- package/{lib/retail/api/updateProfileEsia.d.ts → dist/retail/api/esiaRequestProfile.d.ts} +11 -4
- package/dist/retail/api/esiaRequestProfile.js +10 -0
- package/dist/retail/api/esiaRequestProfile.js.map +1 -0
- package/dist/retail/api/updateUserTask.d.ts +1 -0
- package/dist/retail/api/updateUserTask.js.map +1 -1
- package/dist/retail/api/uploadFile.d.ts +1 -1
- package/dist/retail/api/uploadFile.js +2 -3
- package/dist/retail/api/uploadFile.js.map +1 -1
- package/dist/retail/components/DraftDialog/parseDraftTask.js +2 -1
- package/dist/retail/components/DraftDialog/parseDraftTask.js.map +1 -1
- package/dist/retail/content.js +10 -1
- package/dist/retail/content.js.map +1 -1
- package/dist/retail/model/NameFieldDef.d.ts +1 -1
- package/dist/retail/utils/mainFormStateMap.js +1 -0
- package/dist/retail/utils/mainFormStateMap.js.map +1 -1
- package/dist/ui-kit/FormField/Fields/PhoneField.js +2 -1
- package/dist/ui-kit/FormField/Fields/PhoneField.js.map +1 -1
- package/dist/ui-kit/FormField/shouldRenderField.d.ts +1 -1
- package/dist/ui-kit/FormField/shouldRenderField.js +1 -1
- package/dist/ui-kit/FormField/shouldRenderField.js.map +1 -1
- package/lib/common.css +1 -1
- package/lib/components/ApplicationLeadForm/ApplicationLeadForm.js +13 -3
- package/lib/components/ApplicationLeadForm/ApplicationLeadForm.js.map +1 -1
- package/lib/components/ApplicationLeadForm/EsiaLoginBanner.d.ts +4 -0
- package/lib/components/ApplicationLeadForm/EsiaLoginBanner.js +21 -0
- package/lib/components/ApplicationLeadForm/EsiaLoginBanner.js.map +1 -0
- package/lib/components/ApplicationLeadForm/applicationFormData.d.ts +0 -1
- package/lib/components/ApplicationLeadForm/applicationFormData.js +5 -30
- package/lib/components/ApplicationLeadForm/applicationFormData.js.map +1 -1
- package/lib/components/ApplicationLeadForm/getInitialFormState.d.ts +1 -1
- package/lib/components/ApplicationLeadForm/getInitialFormState.js +8 -2
- package/lib/components/ApplicationLeadForm/getInitialFormState.js.map +1 -1
- package/lib/components/ApplicationLeadForm/parseEsiaProfile.d.ts +2 -2
- package/lib/components/ApplicationLeadForm/parseEsiaProfile.js +54 -19
- package/lib/components/ApplicationLeadForm/parseEsiaProfile.js.map +1 -1
- package/lib/components/ApplicationLeadForm/useApplicationLeadApi.d.ts +2 -2
- package/lib/components/ApplicationLeadForm/useApplicationLeadApi.js +7 -10
- package/lib/components/ApplicationLeadForm/useApplicationLeadApi.js.map +1 -1
- package/lib/components/ApplicationLeadForm/useInitApplicationLead.d.ts +3 -1
- package/lib/components/ApplicationLeadForm/useInitApplicationLead.js +12 -16
- package/lib/components/ApplicationLeadForm/useInitApplicationLead.js.map +1 -1
- package/lib/components/CreditForm/SuccessStatusContent.js +1 -1
- package/lib/components/CreditForm/SuccessStatusContent.js.map +1 -1
- package/lib/retail/adaptors/getFamilyStatusAndIncomeData.js +2 -2
- package/lib/retail/adaptors/getFamilyStatusAndIncomeData.js.map +1 -1
- package/lib/retail/api/checkCode.d.ts +1 -0
- package/lib/retail/api/checkCode.js +1 -1
- package/lib/retail/api/checkCode.js.map +1 -1
- package/{mobile/bundle/retail/api/updateProfileEsia.d.ts → lib/retail/api/esiaRequestProfile.d.ts} +11 -4
- package/lib/retail/api/esiaRequestProfile.js +7 -0
- package/lib/retail/api/esiaRequestProfile.js.map +1 -0
- package/lib/retail/api/updateUserTask.d.ts +1 -0
- package/lib/retail/api/updateUserTask.js.map +1 -1
- package/lib/retail/api/uploadFile.d.ts +1 -1
- package/lib/retail/api/uploadFile.js +2 -3
- package/lib/retail/api/uploadFile.js.map +1 -1
- package/lib/retail/components/DraftDialog/parseDraftTask.js +2 -1
- package/lib/retail/components/DraftDialog/parseDraftTask.js.map +1 -1
- package/lib/retail/content.js +10 -1
- package/lib/retail/content.js.map +1 -1
- package/lib/retail/model/NameFieldDef.d.ts +1 -1
- package/lib/retail/utils/mainFormStateMap.js +1 -0
- package/lib/retail/utils/mainFormStateMap.js.map +1 -1
- package/lib/ui-kit/FormField/Fields/PhoneField.js +2 -1
- package/lib/ui-kit/FormField/Fields/PhoneField.js.map +1 -1
- package/lib/ui-kit/FormField/shouldRenderField.d.ts +1 -1
- package/lib/ui-kit/FormField/shouldRenderField.js +1 -1
- package/lib/ui-kit/FormField/shouldRenderField.js.map +1 -1
- package/mobile/bundle/bundle.umd.js +173 -132
- package/mobile/bundle/bundle.umd.min.js +1 -1
- package/mobile/bundle/components/ApplicationLeadForm/EsiaLoginBanner.d.ts +4 -0
- package/mobile/bundle/components/ApplicationLeadForm/applicationFormData.d.ts +0 -1
- package/mobile/bundle/components/ApplicationLeadForm/getInitialFormState.d.ts +1 -1
- package/mobile/bundle/components/ApplicationLeadForm/parseEsiaProfile.d.ts +2 -2
- package/mobile/bundle/components/ApplicationLeadForm/useApplicationLeadApi.d.ts +2 -2
- package/mobile/bundle/components/ApplicationLeadForm/useInitApplicationLead.d.ts +3 -1
- package/mobile/bundle/retail/api/checkCode.d.ts +1 -0
- package/{dist/retail/api/updateProfileEsia.d.ts → mobile/bundle/retail/api/esiaRequestProfile.d.ts} +11 -4
- package/mobile/bundle/retail/api/updateUserTask.d.ts +1 -0
- package/mobile/bundle/retail/api/uploadFile.d.ts +1 -1
- package/mobile/bundle/retail/model/NameFieldDef.d.ts +1 -1
- package/mobile/bundle/ui-kit/FormField/shouldRenderField.d.ts +1 -1
- package/mobile/dist/components/ApplicationLeadForm/ApplicationLeadForm.js +13 -3
- package/mobile/dist/components/ApplicationLeadForm/ApplicationLeadForm.js.map +1 -1
- package/mobile/dist/components/ApplicationLeadForm/EsiaLoginBanner.d.ts +4 -0
- package/mobile/dist/components/ApplicationLeadForm/EsiaLoginBanner.js +23 -0
- package/mobile/dist/components/ApplicationLeadForm/EsiaLoginBanner.js.map +1 -0
- package/mobile/dist/components/ApplicationLeadForm/applicationFormData.d.ts +0 -1
- package/mobile/dist/components/ApplicationLeadForm/applicationFormData.js +6 -31
- package/mobile/dist/components/ApplicationLeadForm/applicationFormData.js.map +1 -1
- package/mobile/dist/components/ApplicationLeadForm/getInitialFormState.d.ts +1 -1
- package/mobile/dist/components/ApplicationLeadForm/getInitialFormState.js +8 -2
- package/mobile/dist/components/ApplicationLeadForm/getInitialFormState.js.map +1 -1
- package/mobile/dist/components/ApplicationLeadForm/parseEsiaProfile.d.ts +2 -2
- package/mobile/dist/components/ApplicationLeadForm/parseEsiaProfile.js +54 -19
- package/mobile/dist/components/ApplicationLeadForm/parseEsiaProfile.js.map +1 -1
- package/mobile/dist/components/ApplicationLeadForm/useApplicationLeadApi.d.ts +2 -2
- package/mobile/dist/components/ApplicationLeadForm/useApplicationLeadApi.js +7 -10
- package/mobile/dist/components/ApplicationLeadForm/useApplicationLeadApi.js.map +1 -1
- package/mobile/dist/components/ApplicationLeadForm/useInitApplicationLead.d.ts +3 -1
- package/mobile/dist/components/ApplicationLeadForm/useInitApplicationLead.js +12 -16
- package/mobile/dist/components/ApplicationLeadForm/useInitApplicationLead.js.map +1 -1
- package/mobile/dist/components/CreditForm/SuccessStatusContent.js +1 -1
- package/mobile/dist/components/CreditForm/SuccessStatusContent.js.map +1 -1
- package/mobile/dist/retail/adaptors/getFamilyStatusAndIncomeData.js +2 -2
- package/mobile/dist/retail/adaptors/getFamilyStatusAndIncomeData.js.map +1 -1
- package/mobile/dist/retail/api/checkCode.d.ts +1 -0
- package/mobile/dist/retail/api/checkCode.js +3 -2
- package/mobile/dist/retail/api/checkCode.js.map +1 -1
- package/mobile/dist/retail/api/esiaRequestProfile.d.ts +84 -0
- package/mobile/dist/retail/api/esiaRequestProfile.js +10 -0
- package/mobile/dist/retail/api/esiaRequestProfile.js.map +1 -0
- package/mobile/dist/retail/api/updateUserTask.d.ts +1 -0
- package/mobile/dist/retail/api/updateUserTask.js.map +1 -1
- package/mobile/dist/retail/api/uploadFile.d.ts +1 -1
- package/mobile/dist/retail/api/uploadFile.js +2 -3
- package/mobile/dist/retail/api/uploadFile.js.map +1 -1
- package/mobile/dist/retail/components/DraftDialog/parseDraftTask.js +2 -1
- package/mobile/dist/retail/components/DraftDialog/parseDraftTask.js.map +1 -1
- package/mobile/dist/retail/content.js +10 -1
- package/mobile/dist/retail/content.js.map +1 -1
- package/mobile/dist/retail/model/NameFieldDef.d.ts +1 -1
- package/mobile/dist/retail/utils/mainFormStateMap.js +1 -0
- package/mobile/dist/retail/utils/mainFormStateMap.js.map +1 -1
- package/mobile/dist/ui-kit/FormField/Fields/PhoneField.js +2 -1
- package/mobile/dist/ui-kit/FormField/Fields/PhoneField.js.map +1 -1
- package/mobile/dist/ui-kit/FormField/shouldRenderField.d.ts +1 -1
- package/mobile/dist/ui-kit/FormField/shouldRenderField.js +1 -1
- package/mobile/dist/ui-kit/FormField/shouldRenderField.js.map +1 -1
- package/mobile/lib/common.css +1 -1
- package/mobile/lib/components/ApplicationLeadForm/ApplicationLeadForm.js +13 -3
- package/mobile/lib/components/ApplicationLeadForm/ApplicationLeadForm.js.map +1 -1
- package/mobile/lib/components/ApplicationLeadForm/EsiaLoginBanner.d.ts +4 -0
- package/mobile/lib/components/ApplicationLeadForm/EsiaLoginBanner.js +21 -0
- package/mobile/lib/components/ApplicationLeadForm/EsiaLoginBanner.js.map +1 -0
- package/mobile/lib/components/ApplicationLeadForm/applicationFormData.d.ts +0 -1
- package/mobile/lib/components/ApplicationLeadForm/applicationFormData.js +5 -30
- package/mobile/lib/components/ApplicationLeadForm/applicationFormData.js.map +1 -1
- package/mobile/lib/components/ApplicationLeadForm/getInitialFormState.d.ts +1 -1
- package/mobile/lib/components/ApplicationLeadForm/getInitialFormState.js +8 -2
- package/mobile/lib/components/ApplicationLeadForm/getInitialFormState.js.map +1 -1
- package/mobile/lib/components/ApplicationLeadForm/parseEsiaProfile.d.ts +2 -2
- package/mobile/lib/components/ApplicationLeadForm/parseEsiaProfile.js +54 -19
- package/mobile/lib/components/ApplicationLeadForm/parseEsiaProfile.js.map +1 -1
- package/mobile/lib/components/ApplicationLeadForm/useApplicationLeadApi.d.ts +2 -2
- package/mobile/lib/components/ApplicationLeadForm/useApplicationLeadApi.js +7 -10
- package/mobile/lib/components/ApplicationLeadForm/useApplicationLeadApi.js.map +1 -1
- package/mobile/lib/components/ApplicationLeadForm/useInitApplicationLead.d.ts +3 -1
- package/mobile/lib/components/ApplicationLeadForm/useInitApplicationLead.js +12 -16
- package/mobile/lib/components/ApplicationLeadForm/useInitApplicationLead.js.map +1 -1
- package/mobile/lib/components/CreditForm/SuccessStatusContent.js +1 -1
- package/mobile/lib/components/CreditForm/SuccessStatusContent.js.map +1 -1
- package/mobile/lib/retail/adaptors/getFamilyStatusAndIncomeData.js +2 -2
- package/mobile/lib/retail/adaptors/getFamilyStatusAndIncomeData.js.map +1 -1
- package/mobile/lib/retail/api/checkCode.d.ts +1 -0
- package/mobile/lib/retail/api/checkCode.js +1 -1
- package/mobile/lib/retail/api/checkCode.js.map +1 -1
- package/mobile/lib/retail/api/esiaRequestProfile.d.ts +84 -0
- package/mobile/lib/retail/api/esiaRequestProfile.js +7 -0
- package/mobile/lib/retail/api/esiaRequestProfile.js.map +1 -0
- package/mobile/lib/retail/api/updateUserTask.d.ts +1 -0
- package/mobile/lib/retail/api/updateUserTask.js.map +1 -1
- package/mobile/lib/retail/api/uploadFile.d.ts +1 -1
- package/mobile/lib/retail/api/uploadFile.js +2 -3
- package/mobile/lib/retail/api/uploadFile.js.map +1 -1
- package/mobile/lib/retail/components/DraftDialog/parseDraftTask.js +2 -1
- package/mobile/lib/retail/components/DraftDialog/parseDraftTask.js.map +1 -1
- package/mobile/lib/retail/content.js +10 -1
- package/mobile/lib/retail/content.js.map +1 -1
- package/mobile/lib/retail/model/NameFieldDef.d.ts +1 -1
- package/mobile/lib/retail/utils/mainFormStateMap.js +1 -0
- package/mobile/lib/retail/utils/mainFormStateMap.js.map +1 -1
- package/mobile/lib/ui-kit/FormField/Fields/PhoneField.js +2 -1
- package/mobile/lib/ui-kit/FormField/Fields/PhoneField.js.map +1 -1
- package/mobile/lib/ui-kit/FormField/shouldRenderField.d.ts +1 -1
- package/mobile/lib/ui-kit/FormField/shouldRenderField.js +1 -1
- package/mobile/lib/ui-kit/FormField/shouldRenderField.js.map +1 -1
- package/mobile/src/components/ApplicationLeadForm/ApplicationLeadForm.tsx +14 -2
- package/mobile/src/components/ApplicationLeadForm/EsiaLoginBanner.tsx +52 -0
- package/mobile/src/components/ApplicationLeadForm/applicationFormData.tsx +5 -31
- package/mobile/src/components/ApplicationLeadForm/getInitialFormState.tsx +8 -1
- package/mobile/src/components/ApplicationLeadForm/parseEsiaProfile.ts +68 -34
- package/mobile/src/components/ApplicationLeadForm/useApplicationLeadApi.tsx +58 -65
- package/mobile/src/components/ApplicationLeadForm/useInitApplicationLead.ts +31 -41
- package/mobile/src/components/CreditForm/SuccessStatusContent.tsx +3 -1
- package/mobile/src/retail/adaptors/getFamilyStatusAndIncomeData.ts +2 -1
- package/mobile/src/retail/api/checkCode.ts +1 -1
- package/mobile/src/retail/api/{updateProfileEsia.ts → esiaRequestProfile.ts} +16 -5
- package/mobile/src/retail/api/updateUserTask.ts +1 -0
- package/mobile/src/retail/api/uploadFile.ts +2 -3
- package/mobile/src/retail/components/DraftDialog/parseDraftTask.ts +2 -0
- package/mobile/src/retail/content.tsx +10 -1
- package/mobile/src/retail/model/NameFieldDef.ts +1 -0
- package/mobile/src/retail/utils/mainFormStateMap.ts +1 -0
- package/mobile/src/ui-kit/FormField/Fields/PhoneField.tsx +9 -1
- package/mobile/src/ui-kit/FormField/shouldRenderField.tsx +2 -1
- package/package.json +1 -1
- package/src/components/ApplicationLeadForm/ApplicationLeadForm.tsx +14 -2
- package/src/components/ApplicationLeadForm/EsiaLoginBanner.tsx +52 -0
- package/src/components/ApplicationLeadForm/applicationFormData.tsx +5 -31
- package/src/components/ApplicationLeadForm/getInitialFormState.tsx +8 -1
- package/src/components/ApplicationLeadForm/parseEsiaProfile.ts +68 -34
- package/src/components/ApplicationLeadForm/useApplicationLeadApi.tsx +58 -65
- package/src/components/ApplicationLeadForm/useInitApplicationLead.ts +31 -41
- package/src/components/CreditForm/SuccessStatusContent.tsx +3 -1
- package/src/retail/adaptors/getFamilyStatusAndIncomeData.ts +2 -1
- package/src/retail/api/checkCode.ts +1 -1
- package/src/retail/api/{updateProfileEsia.ts → esiaRequestProfile.ts} +16 -5
- package/src/retail/api/updateUserTask.ts +1 -0
- package/src/retail/api/uploadFile.ts +2 -3
- package/src/retail/components/DraftDialog/parseDraftTask.ts +2 -0
- package/src/retail/content.tsx +10 -1
- package/src/retail/model/NameFieldDef.ts +1 -0
- package/src/retail/utils/mainFormStateMap.ts +1 -0
- package/src/ui-kit/FormField/Fields/PhoneField.tsx +9 -1
- package/src/ui-kit/FormField/shouldRenderField.tsx +2 -1
- package/bundle/retail/components/EsiaLoginDialog/EsiaLoginDialog.d.ts +0 -4
- package/bundle/retail/components/EsiaLoginDialog/useEsiaLoginDialog.d.ts +0 -1
- package/dist/retail/api/updateProfileEsia.js +0 -6
- package/dist/retail/api/updateProfileEsia.js.map +0 -1
- package/dist/retail/components/EsiaLoginDialog/EsiaLoginDialog.d.ts +0 -4
- package/dist/retail/components/EsiaLoginDialog/EsiaLoginDialog.js +0 -34
- package/dist/retail/components/EsiaLoginDialog/EsiaLoginDialog.js.map +0 -1
- package/dist/retail/components/EsiaLoginDialog/useEsiaLoginDialog.d.ts +0 -1
- package/dist/retail/components/EsiaLoginDialog/useEsiaLoginDialog.js +0 -15
- package/dist/retail/components/EsiaLoginDialog/useEsiaLoginDialog.js.map +0 -1
- package/lib/retail/api/updateProfileEsia.js +0 -3
- package/lib/retail/api/updateProfileEsia.js.map +0 -1
- package/lib/retail/components/EsiaLoginDialog/EsiaLoginDialog.d.ts +0 -4
- package/lib/retail/components/EsiaLoginDialog/EsiaLoginDialog.fixture.d.ts +0 -5
- package/lib/retail/components/EsiaLoginDialog/EsiaLoginDialog.js +0 -32
- package/lib/retail/components/EsiaLoginDialog/EsiaLoginDialog.js.map +0 -1
- package/lib/retail/components/EsiaLoginDialog/useEsiaLoginDialog.d.ts +0 -1
- package/lib/retail/components/EsiaLoginDialog/useEsiaLoginDialog.js +0 -12
- package/lib/retail/components/EsiaLoginDialog/useEsiaLoginDialog.js.map +0 -1
- package/mobile/bundle/retail/components/EsiaLoginDialog/EsiaLoginDialog.d.ts +0 -4
- package/mobile/bundle/retail/components/EsiaLoginDialog/useEsiaLoginDialog.d.ts +0 -1
- package/mobile/dist/retail/api/updateProfileEsia.d.ts +0 -77
- package/mobile/dist/retail/api/updateProfileEsia.js +0 -6
- package/mobile/dist/retail/api/updateProfileEsia.js.map +0 -1
- package/mobile/dist/retail/components/EsiaLoginDialog/EsiaLoginDialog.d.ts +0 -4
- package/mobile/dist/retail/components/EsiaLoginDialog/EsiaLoginDialog.js +0 -34
- package/mobile/dist/retail/components/EsiaLoginDialog/EsiaLoginDialog.js.map +0 -1
- package/mobile/dist/retail/components/EsiaLoginDialog/useEsiaLoginDialog.d.ts +0 -1
- package/mobile/dist/retail/components/EsiaLoginDialog/useEsiaLoginDialog.js +0 -15
- package/mobile/dist/retail/components/EsiaLoginDialog/useEsiaLoginDialog.js.map +0 -1
- package/mobile/lib/retail/api/updateProfileEsia.d.ts +0 -77
- package/mobile/lib/retail/api/updateProfileEsia.js +0 -3
- package/mobile/lib/retail/api/updateProfileEsia.js.map +0 -1
- package/mobile/lib/retail/components/EsiaLoginDialog/EsiaLoginDialog.d.ts +0 -4
- package/mobile/lib/retail/components/EsiaLoginDialog/EsiaLoginDialog.js +0 -32
- package/mobile/lib/retail/components/EsiaLoginDialog/EsiaLoginDialog.js.map +0 -1
- package/mobile/lib/retail/components/EsiaLoginDialog/useEsiaLoginDialog.d.ts +0 -1
- package/mobile/lib/retail/components/EsiaLoginDialog/useEsiaLoginDialog.js +0 -12
- package/mobile/lib/retail/components/EsiaLoginDialog/useEsiaLoginDialog.js.map +0 -1
- package/mobile/src/retail/components/EsiaLoginDialog/EsiaLoginDialog.tsx +0 -65
- package/mobile/src/retail/components/EsiaLoginDialog/useEsiaLoginDialog.tsx +0 -13
- package/src/retail/components/EsiaLoginDialog/EsiaLoginDialog.fixture.tsx +0 -7
- package/src/retail/components/EsiaLoginDialog/EsiaLoginDialog.tsx +0 -65
- package/src/retail/components/EsiaLoginDialog/useEsiaLoginDialog.tsx +0 -13
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/* eslint-disable max-lines-per-function */
|
|
1
2
|
import { JSX } from '@redneckz/uni-jsx';
|
|
2
3
|
import { useEffect, useMemo } from '@redneckz/uni-jsx/lib/hooks';
|
|
3
4
|
import { useBool } from '@redneckz/uni-jsx/lib/hooks/useBool';
|
|
@@ -16,6 +17,7 @@ import { type UniBlockProps } from '../../UniBlock/UniBlockProps';
|
|
|
16
17
|
import { style } from '../../utils/style';
|
|
17
18
|
import { getApplicationFormData } from './applicationFormData';
|
|
18
19
|
import { type ApplicationLeadFormContent } from './ApplicationLeadFormContent';
|
|
20
|
+
import { EsiaLoginBanner } from './EsiaLoginBanner';
|
|
19
21
|
import { renderInputs } from './renderInputs';
|
|
20
22
|
import { renderSubmitButton } from './renderSubmitButton';
|
|
21
23
|
import { useApplicationLeadApi } from './useApplicationLeadApi';
|
|
@@ -35,6 +37,7 @@ export const ApplicationLeadForm = JSX<ApplicationLeadFormProps>(
|
|
|
35
37
|
...rest
|
|
36
38
|
}) => {
|
|
37
39
|
const [esiaError, { setTrue: setEsiaError }] = useBool(false);
|
|
40
|
+
const [esiaAuthSuccess, { setTrue: setEsiaAuthSuccess }] = useBool(false);
|
|
38
41
|
const applicationFormData = useMemo(() => getApplicationFormData(productType), [productType]);
|
|
39
42
|
const inputs = useMemo(
|
|
40
43
|
() => (applicationFormData?.flatMap((_) => _?.inputs) || []) as FieldRetailDef[],
|
|
@@ -48,16 +51,18 @@ export const ApplicationLeadForm = JSX<ApplicationLeadFormProps>(
|
|
|
48
51
|
nextStepLink,
|
|
49
52
|
productType,
|
|
50
53
|
setEsiaError,
|
|
54
|
+
setEsiaAuthSuccess,
|
|
55
|
+
esiaAuthSuccess,
|
|
51
56
|
});
|
|
52
57
|
const { isSending, ok, handleSubmit } = useApplicationLeadApi({
|
|
53
58
|
programId,
|
|
54
59
|
nextStepLink,
|
|
55
60
|
productType,
|
|
56
|
-
|
|
61
|
+
esiaAuthSuccess,
|
|
57
62
|
data,
|
|
58
63
|
});
|
|
59
64
|
|
|
60
|
-
const [, { field, onSubmit }] = useForm(initialFormState, {
|
|
65
|
+
const [, { field, onSubmit, reset }] = useForm(initialFormState, {
|
|
61
66
|
formValidator,
|
|
62
67
|
onSubmit: handleSubmit,
|
|
63
68
|
});
|
|
@@ -69,12 +74,19 @@ export const ApplicationLeadForm = JSX<ApplicationLeadFormProps>(
|
|
|
69
74
|
}
|
|
70
75
|
}, [ok]);
|
|
71
76
|
|
|
77
|
+
useEffect(() => {
|
|
78
|
+
if (initialFormState?.esiaAccountTypeCd) {
|
|
79
|
+
reset();
|
|
80
|
+
}
|
|
81
|
+
}, [initialFormState]);
|
|
82
|
+
|
|
72
83
|
return (
|
|
73
84
|
<ApplicationFormLayout
|
|
74
85
|
className={style('container space-y-m', className)}
|
|
75
86
|
title={title}
|
|
76
87
|
{...rest}
|
|
77
88
|
>
|
|
89
|
+
{!esiaAuthSuccess && !esiaError ? <EsiaLoginBanner /> : null}
|
|
78
90
|
<form onSubmit={onSubmit} className="space-y-m relative">
|
|
79
91
|
{isLoading ? <Loader blur={false} /> : null}
|
|
80
92
|
{applicationFormData.map((_, i) => (
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { JSX } from '@redneckz/uni-jsx';
|
|
2
|
+
import { useCallback } from '@redneckz/uni-jsx/lib/hooks';
|
|
3
|
+
import { locationNavigator } from '../../external/locationNavigator';
|
|
4
|
+
import { getLink } from '../../retail/api/getLink';
|
|
5
|
+
import { Button } from '../../ui-kit/Button/Button';
|
|
6
|
+
import { Img } from '../../ui-kit/Img/Img';
|
|
7
|
+
|
|
8
|
+
export interface EsiaLoginBannerProps {
|
|
9
|
+
onClose?: () => void;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export const EsiaLoginBanner = JSX<EsiaLoginBannerProps>(() => {
|
|
13
|
+
const navigator = locationNavigator();
|
|
14
|
+
|
|
15
|
+
const handleAuth = useCallback(async () => {
|
|
16
|
+
const resp = await getLink({
|
|
17
|
+
redirectUri: globalThis.location.origin + globalThis.location.pathname,
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
if (resp?.link) {
|
|
21
|
+
navigator.assign(resp.link);
|
|
22
|
+
globalThis.location.href = resp.link;
|
|
23
|
+
}
|
|
24
|
+
}, []);
|
|
25
|
+
|
|
26
|
+
return (
|
|
27
|
+
<div className="flex gap-lg items-center rounded-md bg-main-gray px-4 py-6 @md:p-9">
|
|
28
|
+
<div className="flex flex-col justify-around w-full">
|
|
29
|
+
<p className="mb-4 text-xl @md:text-2xl @md:mb-6">Заполните данные через Госуслуги</p>
|
|
30
|
+
<ul className="list-disc list-inside mb-9">
|
|
31
|
+
<li>Вероятность одобрения выше</li>
|
|
32
|
+
<li>Без справок о доходах и трудоустройстве</li>
|
|
33
|
+
<li>С защитой Ваших данных</li>
|
|
34
|
+
</ul>
|
|
35
|
+
<Img
|
|
36
|
+
className="block mb-6 self-center @md:hidden"
|
|
37
|
+
image={{ icon: 'GosUslugiIcon', iconVersion: 'normal' }}
|
|
38
|
+
height="80"
|
|
39
|
+
width="80"
|
|
40
|
+
/>
|
|
41
|
+
<Button type="button" onClick={handleAuth} className="w-full @md:w-fit">
|
|
42
|
+
Заполнить
|
|
43
|
+
</Button>
|
|
44
|
+
</div>
|
|
45
|
+
<Img
|
|
46
|
+
className="hidden @md:block"
|
|
47
|
+
image={{ icon: 'GosUslugiIcon', iconVersion: 'normal' }}
|
|
48
|
+
height="164"
|
|
49
|
+
/>
|
|
50
|
+
</div>
|
|
51
|
+
);
|
|
52
|
+
});
|
|
@@ -3,32 +3,6 @@ import { type FieldRetailDef } from '../../retail/model/RetailFormContent';
|
|
|
3
3
|
import { type ProductType } from './ApplicationLeadFormContent';
|
|
4
4
|
import { productTypeToConsentsMap } from './consents';
|
|
5
5
|
|
|
6
|
-
export const applicationFormData: SectionsRetailProps[] = [
|
|
7
|
-
{
|
|
8
|
-
columns: 2,
|
|
9
|
-
inputs: [
|
|
10
|
-
{ name: 'surname', required: true, dadata: true },
|
|
11
|
-
{ name: 'name', required: true, dadata: true },
|
|
12
|
-
{ name: 'middleName', dadata: true },
|
|
13
|
-
{ name: 'limitedBirthday', required: true },
|
|
14
|
-
{ name: 'phone', required: true },
|
|
15
|
-
{ name: 'email', required: true, dadata: true },
|
|
16
|
-
],
|
|
17
|
-
},
|
|
18
|
-
{
|
|
19
|
-
inputs: [
|
|
20
|
-
{ name: 'processPersonalDataFlg', required: true },
|
|
21
|
-
{ name: 'consentProviderFlg', required: true },
|
|
22
|
-
{ name: 'consentOthersFlg', required: true },
|
|
23
|
-
{ name: 'consentInformFlg' },
|
|
24
|
-
{ name: 'consentPfrFlg' },
|
|
25
|
-
{ name: 'consentInformMaterialsFlg' },
|
|
26
|
-
{ name: 'consentPhotoFlg' },
|
|
27
|
-
{ name: 'consentFATCA' },
|
|
28
|
-
],
|
|
29
|
-
},
|
|
30
|
-
];
|
|
31
|
-
|
|
32
6
|
export const getApplicationFormData = (productType: ProductType): SectionsRetailProps[] => {
|
|
33
7
|
const currentProductConsents = productTypeToConsentsMap[productType];
|
|
34
8
|
const allConsents: FieldRetailDef[] = [
|
|
@@ -46,11 +20,11 @@ export const getApplicationFormData = (productType: ProductType): SectionsRetail
|
|
|
46
20
|
{
|
|
47
21
|
columns: 2,
|
|
48
22
|
inputs: [
|
|
49
|
-
{ name: 'surname', required: true, dadata: true },
|
|
50
|
-
{ name: 'name', required: true, dadata: true },
|
|
51
|
-
{ name: 'middleName', dadata: true },
|
|
52
|
-
{ name: 'limitedBirthday', required: true },
|
|
53
|
-
{ name: 'phone', required: true },
|
|
23
|
+
{ name: 'surname', required: true, dadata: true, filledByEsia: true },
|
|
24
|
+
{ name: 'name', required: true, dadata: true, filledByEsia: true },
|
|
25
|
+
{ name: 'middleName', dadata: true, filledByEsia: true },
|
|
26
|
+
{ name: 'limitedBirthday', required: true, filledByEsia: true },
|
|
27
|
+
{ name: 'phone', required: true, filledByEsia: true },
|
|
54
28
|
{ name: 'email', required: true, dadata: true },
|
|
55
29
|
],
|
|
56
30
|
},
|
|
@@ -21,9 +21,16 @@ const initialFormState = {
|
|
|
21
21
|
export const getInitialFormState = (
|
|
22
22
|
inputs: FieldRetailDef[],
|
|
23
23
|
savedForm: LeadFormState | null,
|
|
24
|
+
esiaAuthSuccess: boolean,
|
|
24
25
|
): LeadFormState => {
|
|
25
26
|
if (savedForm) {
|
|
26
|
-
return {
|
|
27
|
+
return {
|
|
28
|
+
...savedForm,
|
|
29
|
+
limitedBirthday: new Date(savedForm?.limitedBirthday || 0),
|
|
30
|
+
...(!esiaAuthSuccess && {
|
|
31
|
+
esiaAccountTypeCd: { key: '' },
|
|
32
|
+
}),
|
|
33
|
+
};
|
|
27
34
|
}
|
|
28
35
|
|
|
29
36
|
const formState = Object.fromEntries(inputs.map((_) => [_.name, initialFormState[_.name || '']]));
|
|
@@ -1,33 +1,62 @@
|
|
|
1
1
|
/* eslint-disable max-lines */
|
|
2
|
-
|
|
2
|
+
/* eslint-disable max-lines-per-function */
|
|
3
|
+
import { type EsiaRequestProfileResponse } from '../../retail/api/esiaRequestProfile';
|
|
3
4
|
import { uploadFile, type DocumentCategory } from '../../retail/api/uploadFile';
|
|
4
5
|
import { type Address, type File, type LeadFormState } from '../../retail/model/LeadFormState';
|
|
5
6
|
import { normalizePhone } from '../../ui-kit/PhoneInput/normalizePhone';
|
|
6
7
|
|
|
8
|
+
type Document = {
|
|
9
|
+
file: string;
|
|
10
|
+
category: DocumentCategory;
|
|
11
|
+
isPDF: boolean;
|
|
12
|
+
};
|
|
13
|
+
|
|
7
14
|
export const parseEsiaProfile = async (
|
|
8
|
-
esiaProfile:
|
|
9
|
-
taskId: string,
|
|
15
|
+
esiaProfile: EsiaRequestProfileResponse,
|
|
10
16
|
isDebit: boolean,
|
|
11
17
|
): Promise<LeadFormState> => {
|
|
12
18
|
isDebit ? checkEsiaDataForDebit(esiaProfile) : checkEsiaDataForCredit(esiaProfile);
|
|
13
19
|
|
|
14
20
|
const { profile, addInfo, document, addressRegistration, addressFact, esiaAdditionalDocument } =
|
|
15
21
|
esiaProfile;
|
|
16
|
-
|
|
22
|
+
let files: File[] = [];
|
|
17
23
|
|
|
18
24
|
if (!isDebit) {
|
|
19
|
-
await
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
25
|
+
files = await saveDocuments([
|
|
26
|
+
{
|
|
27
|
+
file: esiaAdditionalDocument.pdfFileWorkbook,
|
|
28
|
+
category: 'CONFIRMING_INCOME_DOC',
|
|
29
|
+
isPDF: true,
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
file: esiaAdditionalDocument.pdfFilePayout,
|
|
33
|
+
category: 'CONFIRMING_EMPLOYMENT_DOC',
|
|
34
|
+
isPDF: true,
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
file: esiaAdditionalDocument.pdfFileSigPayout,
|
|
38
|
+
category: 'CONFIRMING_EMPLOYMENT_DOC',
|
|
39
|
+
isPDF: true,
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
file: esiaAdditionalDocument.xmlFilePayout,
|
|
43
|
+
category: 'CONFIRMING_EMPLOYMENT_DOC',
|
|
44
|
+
isPDF: false,
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
file: esiaAdditionalDocument.xmlFileSigPayout,
|
|
48
|
+
category: 'CONFIRMING_EMPLOYMENT_DOC',
|
|
49
|
+
isPDF: false,
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
file: esiaAdditionalDocument.xmlFileWorkbook,
|
|
53
|
+
category: 'CONFIRMING_INCOME_DOC',
|
|
54
|
+
isPDF: false,
|
|
55
|
+
},
|
|
56
|
+
//TODO: После тестирования добавить документы снизу
|
|
57
|
+
// {file: esiaAdditionalDocument.pdfFileSigWorkbook, category: 'CONFIRMING_INCOME_DOC', isPDF: true},
|
|
58
|
+
// {file: esiaAdditionalDocument.xmlFileSigWorkbook, category: 'CONFIRMING_INCOME_DOC', isPDF: false},
|
|
59
|
+
]);
|
|
31
60
|
}
|
|
32
61
|
|
|
33
62
|
const mainData = {
|
|
@@ -74,7 +103,7 @@ const concatFullAddress = (address: Array<string | undefined>): string => {
|
|
|
74
103
|
}, '');
|
|
75
104
|
};
|
|
76
105
|
|
|
77
|
-
const buildAddress = (fields:
|
|
106
|
+
const buildAddress = (fields: EsiaRequestProfileResponse['addressRegistration']): Address => {
|
|
78
107
|
const {
|
|
79
108
|
postcode,
|
|
80
109
|
region,
|
|
@@ -110,24 +139,22 @@ const buildAddress = (fields: UpdateProfileEsiaResponse['addressRegistration']):
|
|
|
110
139
|
|
|
111
140
|
const getYearFromMonth = (month: number) => Math.floor(month / 12);
|
|
112
141
|
|
|
113
|
-
const
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
.then((value) => uploadFile(value, taskId, category))
|
|
127
|
-
.then((file) => files.push(file));
|
|
142
|
+
const saveDocuments = async (documents: Document[]): Promise<File[]> => {
|
|
143
|
+
const files: File[] = [];
|
|
144
|
+
|
|
145
|
+
for (const doc of documents) {
|
|
146
|
+
const contentType = doc.isPDF ? 'data:application/pdf;base64' : 'data:application/xml;base64';
|
|
147
|
+
|
|
148
|
+
await fetch(`${contentType},${doc.file}`)
|
|
149
|
+
.then((res) => res.blob())
|
|
150
|
+
.then((value) => uploadFile(value, doc.category, doc.isPDF))
|
|
151
|
+
.then((file) => files.push(file));
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
return files;
|
|
128
155
|
};
|
|
129
156
|
|
|
130
|
-
const checkEsiaDataForCredit = (esiaProfile:
|
|
157
|
+
const checkEsiaDataForCredit = (esiaProfile: EsiaRequestProfileResponse) => {
|
|
131
158
|
const { profile, document, addressRegistration, esiaAdditionalDocument } = esiaProfile;
|
|
132
159
|
|
|
133
160
|
const data = [
|
|
@@ -153,6 +180,13 @@ const checkEsiaDataForCredit = (esiaProfile: UpdateProfileEsiaResponse) => {
|
|
|
153
180
|
esiaAdditionalDocument.jobsNumberInFiveYears.toString(),
|
|
154
181
|
esiaAdditionalDocument.pdfFilePayout,
|
|
155
182
|
esiaAdditionalDocument.pdfFileWorkbook,
|
|
183
|
+
esiaAdditionalDocument.pdfFileSigPayout,
|
|
184
|
+
esiaAdditionalDocument.xmlFilePayout,
|
|
185
|
+
esiaAdditionalDocument.xmlFileSigPayout,
|
|
186
|
+
esiaAdditionalDocument.xmlFileWorkbook,
|
|
187
|
+
//TODO: После тестирования добавить документы снизу
|
|
188
|
+
// esiaAdditionalDocument.pdfFileSigWorkbook,
|
|
189
|
+
// esiaAdditionalDocument.xmlFileSigWorkbook
|
|
156
190
|
];
|
|
157
191
|
|
|
158
192
|
if (!data.every((_) => Boolean(_))) {
|
|
@@ -160,7 +194,7 @@ const checkEsiaDataForCredit = (esiaProfile: UpdateProfileEsiaResponse) => {
|
|
|
160
194
|
}
|
|
161
195
|
};
|
|
162
196
|
|
|
163
|
-
const checkEsiaDataForDebit = (esiaProfile:
|
|
197
|
+
const checkEsiaDataForDebit = (esiaProfile: EsiaRequestProfileResponse) => {
|
|
164
198
|
const { profile, document, addressRegistration } = esiaProfile;
|
|
165
199
|
|
|
166
200
|
const data = [
|
|
@@ -12,7 +12,6 @@ import { updateUserProfile } from '../../retail/api/updateUserProfile';
|
|
|
12
12
|
import { updateUserTask } from '../../retail/api/updateUserTask';
|
|
13
13
|
import { useConsentBkiDialog } from '../../retail/components/ConsentBkiDialog/useConsentBkiDialog';
|
|
14
14
|
import { useDraftDialog } from '../../retail/components/DraftDialog/useDraftDialog';
|
|
15
|
-
import { useEsiaLoginDialog } from '../../retail/components/EsiaLoginDialog/useEsiaLoginDialog';
|
|
16
15
|
import { VerifyPhoneDialog } from '../../retail/components/VerifyPhoneDialog/VerifyPhoneDialog';
|
|
17
16
|
import { type FormRetailConsents, type LeadFormState } from '../../retail/model/LeadFormState';
|
|
18
17
|
import { getUpdateUserProfileData } from '../../retail/utils/getUpdateUserProfile';
|
|
@@ -28,7 +27,7 @@ interface ApplicationLeadApiProps extends AspectsProps {
|
|
|
28
27
|
programId: string;
|
|
29
28
|
nextStepLink: string;
|
|
30
29
|
productType: ProductType;
|
|
31
|
-
|
|
30
|
+
esiaAuthSuccess: boolean;
|
|
32
31
|
}
|
|
33
32
|
|
|
34
33
|
// eslint-disable-next-line max-lines-per-function
|
|
@@ -36,7 +35,6 @@ export const useApplicationLeadApi = ({
|
|
|
36
35
|
programId,
|
|
37
36
|
nextStepLink,
|
|
38
37
|
productType,
|
|
39
|
-
esiaError,
|
|
40
38
|
data,
|
|
41
39
|
}: ApplicationLeadApiProps) => {
|
|
42
40
|
const [isSending, { setTrue: startSending, setFalse: endSending }] = useBool(false);
|
|
@@ -45,77 +43,72 @@ export const useApplicationLeadApi = ({
|
|
|
45
43
|
const sendAspects = useSendLeadFormAspects({ data });
|
|
46
44
|
const navigator = locationNavigator();
|
|
47
45
|
|
|
48
|
-
const
|
|
49
|
-
|
|
46
|
+
const goToNextStep = useCallback(() => {
|
|
47
|
+
navigator.assign(nextStepLink);
|
|
48
|
+
}, []);
|
|
49
|
+
|
|
50
|
+
const consentBkiDialog = useConsentBkiDialog(goToNextStep);
|
|
50
51
|
const verifyPhoneDialog = useDialog(VerifyPhoneDialog);
|
|
51
52
|
const draftDialog = useDraftDialog();
|
|
52
53
|
|
|
53
|
-
const handleSubmit = useCallback(
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
}
|
|
60
|
-
try {
|
|
61
|
-
startSending();
|
|
62
|
-
const profileId = await createUserProfile({
|
|
63
|
-
profile: { phone: formatPhone(formData.phone as string) },
|
|
64
|
-
});
|
|
54
|
+
const handleSubmit = useCallback(async (formData: LeadFormState) => {
|
|
55
|
+
try {
|
|
56
|
+
startSending();
|
|
57
|
+
const profileId = await createUserProfile({
|
|
58
|
+
profile: { phone: formatPhone(formData.phone as string) },
|
|
59
|
+
});
|
|
65
60
|
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
61
|
+
if (profileId && formData?.phone) {
|
|
62
|
+
const sendCurrentTask = async () => {
|
|
63
|
+
await updateUserData({
|
|
64
|
+
programId,
|
|
65
|
+
profileId,
|
|
66
|
+
formData,
|
|
67
|
+
productType,
|
|
68
|
+
saveUserData,
|
|
69
|
+
sendAspects,
|
|
70
|
+
});
|
|
71
|
+
verifyPhoneDialog.close();
|
|
72
|
+
if (productType === 'debitCard') {
|
|
73
|
+
goToNextStep();
|
|
74
|
+
} else {
|
|
75
|
+
consentBkiDialog.open(formData.phone, profileId);
|
|
76
|
+
}
|
|
77
|
+
};
|
|
78
|
+
const handleSuccessVerify = async () => {
|
|
79
|
+
try {
|
|
80
|
+
const lastTaskId = await getLastTaskStatus({ profileId, programId });
|
|
81
|
+
|
|
82
|
+
if (lastTaskId) {
|
|
83
|
+
const task = await getTaskById({ taskId: lastTaskId });
|
|
84
|
+
verifyPhoneDialog.close();
|
|
85
|
+
draftDialog.open({
|
|
86
|
+
task,
|
|
87
|
+
isFromLead: true,
|
|
88
|
+
sendAspects,
|
|
89
|
+
onClose: sendCurrentTask,
|
|
90
|
+
});
|
|
79
91
|
} else {
|
|
80
|
-
|
|
81
|
-
}
|
|
82
|
-
};
|
|
83
|
-
const handleSuccessVerify = async () => {
|
|
84
|
-
try {
|
|
85
|
-
const lastTaskId = await getLastTaskStatus({ profileId, programId });
|
|
86
|
-
|
|
87
|
-
if (lastTaskId) {
|
|
88
|
-
const task = await getTaskById({ taskId: lastTaskId });
|
|
89
|
-
verifyPhoneDialog.close();
|
|
90
|
-
draftDialog.open({
|
|
91
|
-
task,
|
|
92
|
-
isFromLead: true,
|
|
93
|
-
sendAspects,
|
|
94
|
-
onClose: sendCurrentTask,
|
|
95
|
-
});
|
|
96
|
-
} else {
|
|
97
|
-
await sendCurrentTask();
|
|
98
|
-
}
|
|
99
|
-
} catch {
|
|
100
|
-
setOK(false);
|
|
92
|
+
await sendCurrentTask();
|
|
101
93
|
}
|
|
102
|
-
}
|
|
94
|
+
} catch {
|
|
95
|
+
setOK(false);
|
|
96
|
+
}
|
|
97
|
+
};
|
|
103
98
|
|
|
104
|
-
|
|
99
|
+
const acceptedConsents = getAcceptedConsents(formData, productType);
|
|
105
100
|
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
}
|
|
113
|
-
} catch {
|
|
114
|
-
setOK(false);
|
|
101
|
+
verifyPhoneDialog.open({
|
|
102
|
+
phone: formData?.phone,
|
|
103
|
+
consents: acceptedConsents,
|
|
104
|
+
onSuccess: handleSuccessVerify,
|
|
105
|
+
});
|
|
106
|
+
endSending();
|
|
115
107
|
}
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
|
|
108
|
+
} catch {
|
|
109
|
+
setOK(false);
|
|
110
|
+
}
|
|
111
|
+
}, []);
|
|
119
112
|
|
|
120
113
|
return { isSending, ok, handleSubmit };
|
|
121
114
|
};
|
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
import { useCallback, useEffect, useMemo } from '@redneckz/uni-jsx/lib/hooks';
|
|
2
2
|
import { useBool } from '@redneckz/uni-jsx/lib/hooks/useBool';
|
|
3
|
-
import { locationNavigator } from '../../external/locationNavigator';
|
|
4
3
|
import { useSetter } from '../../hooks/useSetter';
|
|
5
|
-
import {
|
|
4
|
+
import { esiaRequestProfile } from '../../retail/api/esiaRequestProfile';
|
|
6
5
|
import { type LeadFormState } from '../../retail/model/LeadFormState';
|
|
7
6
|
import { type FieldRetailDef } from '../../retail/model/RetailFormContent';
|
|
8
|
-
import { safeJsonParse } from '../../utils/safeJsonParse';
|
|
9
7
|
import { type ProductType } from './ApplicationLeadFormContent';
|
|
10
8
|
import { getInitialFormState } from './getInitialFormState';
|
|
11
9
|
import { parseEsiaProfile } from './parseEsiaProfile';
|
|
@@ -16,70 +14,62 @@ type InitApplicationLeadProps = {
|
|
|
16
14
|
nextStepLink: string;
|
|
17
15
|
productType: ProductType;
|
|
18
16
|
setEsiaError: () => void;
|
|
17
|
+
setEsiaAuthSuccess: () => void;
|
|
18
|
+
esiaAuthSuccess: boolean;
|
|
19
19
|
};
|
|
20
20
|
|
|
21
21
|
export const useInitApplicationLead = ({
|
|
22
22
|
inputs,
|
|
23
|
-
nextStepLink,
|
|
24
23
|
productType,
|
|
25
24
|
setEsiaError,
|
|
25
|
+
setEsiaAuthSuccess,
|
|
26
|
+
esiaAuthSuccess,
|
|
26
27
|
}: InitApplicationLeadProps): [LeadFormState, { isLoading: boolean }] => {
|
|
27
|
-
const navigator = locationNavigator();
|
|
28
28
|
const [isLoading, { setTrue: startLoading, setFalse: endLoading }] = useBool(false);
|
|
29
29
|
|
|
30
30
|
const leadFormStore = useLeadFormStore();
|
|
31
31
|
const saveForm = useSetter(leadFormStore, 'leadForm');
|
|
32
32
|
|
|
33
33
|
const initialFormState = useMemo(
|
|
34
|
-
() => getInitialFormState(inputs, leadFormStore.leadForm),
|
|
34
|
+
() => getInitialFormState(inputs, leadFormStore.leadForm, esiaAuthSuccess),
|
|
35
35
|
[inputs, leadFormStore.leadForm],
|
|
36
36
|
);
|
|
37
37
|
|
|
38
|
-
const
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
});
|
|
38
|
+
const requestEsiaProfile = useCallback(async (code: string, state: string) => {
|
|
39
|
+
startLoading();
|
|
40
|
+
try {
|
|
41
|
+
const data = await esiaRequestProfile({
|
|
42
|
+
code,
|
|
43
|
+
state,
|
|
44
|
+
redirectUri: globalThis.location?.href,
|
|
45
|
+
authorize: true,
|
|
46
|
+
});
|
|
48
47
|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
data,
|
|
52
|
-
leadFormStore.taskId.toString(),
|
|
53
|
-
productType === 'debitCard',
|
|
54
|
-
);
|
|
48
|
+
if (data) {
|
|
49
|
+
const parsedData = await parseEsiaProfile(data, productType === 'debitCard');
|
|
55
50
|
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
navigator.assign(nextStepLink);
|
|
63
|
-
} catch {
|
|
64
|
-
setEsiaError();
|
|
65
|
-
} finally {
|
|
66
|
-
endLoading();
|
|
51
|
+
saveForm((_) => ({
|
|
52
|
+
..._,
|
|
53
|
+
...parsedData,
|
|
54
|
+
}));
|
|
55
|
+
setEsiaAuthSuccess();
|
|
67
56
|
}
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
|
|
57
|
+
} catch {
|
|
58
|
+
setEsiaError();
|
|
59
|
+
} finally {
|
|
60
|
+
endLoading();
|
|
61
|
+
}
|
|
62
|
+
}, []);
|
|
71
63
|
|
|
72
64
|
useEffect(() => {
|
|
73
65
|
leadFormStore.productType = productType;
|
|
74
|
-
|
|
75
|
-
safeJsonParse(globalThis.localStorage?.getItem('profileId') ?? '')
|
|
76
|
-
);
|
|
66
|
+
|
|
77
67
|
const params = new URLSearchParams(decodeURIComponent(globalThis.location?.search));
|
|
78
68
|
const code = params.get('code');
|
|
79
69
|
const state = params.get('state');
|
|
80
70
|
|
|
81
|
-
if (
|
|
82
|
-
|
|
71
|
+
if (code && state) {
|
|
72
|
+
requestEsiaProfile(code, state);
|
|
83
73
|
} else {
|
|
84
74
|
sessionStorage.removeItem('accessToken');
|
|
85
75
|
sessionStorage.removeItem('refreshToken');
|
|
@@ -20,7 +20,9 @@ export const SuccessStatusContent = JSX(() => {
|
|
|
20
20
|
},
|
|
21
21
|
{
|
|
22
22
|
label: 'Ежемесячный платеж',
|
|
23
|
-
description: `${Math.round(
|
|
23
|
+
description: `${Math.round(
|
|
24
|
+
statusInfo?.calculator?.monthlyPayment ?? 0,
|
|
25
|
+
).toLocaleString()} ₽`,
|
|
24
26
|
},
|
|
25
27
|
{
|
|
26
28
|
label: 'Срок кредита',
|
|
@@ -19,12 +19,13 @@ export const getFamilyStatusAndIncomeData = (formData: LeadFormState): Partial<P
|
|
|
19
19
|
snils,
|
|
20
20
|
armyIdFlg,
|
|
21
21
|
conscription,
|
|
22
|
+
esiaAccountTypeCd,
|
|
22
23
|
} = formData;
|
|
23
24
|
|
|
24
25
|
return {
|
|
25
26
|
maritalStatusCd: familyStatus,
|
|
26
27
|
totalDependents: familyMembers,
|
|
27
|
-
incomeCertificateCd: confirmationIncome,
|
|
28
|
+
incomeCertificateCd: esiaAccountTypeCd?.key ? { key: 'SFR_CERTIFICATE' } : confirmationIncome,
|
|
28
29
|
otherDependents: dependents,
|
|
29
30
|
childrenDependents: children,
|
|
30
31
|
militaryStatusCd: conscription,
|
|
@@ -16,7 +16,7 @@ export type CheckCodeResponse = {
|
|
|
16
16
|
export const checkCode = async (body: CheckCodeBody) =>
|
|
17
17
|
fetchRetailJSON<CheckCodeResponse>('/sms/checkCode', 'POST', body).then(saveToken);
|
|
18
18
|
|
|
19
|
-
const saveToken = (data: CheckCodeResponse | null) => {
|
|
19
|
+
export const saveToken = (data: CheckCodeResponse | null) => {
|
|
20
20
|
if (data) {
|
|
21
21
|
globalThis.sessionStorage.setItem('accessToken', data.access_token);
|
|
22
22
|
globalThis.sessionStorage.setItem('refreshToken', data.refresh_token);
|