@redneckz/wildless-cms-uni-blocks 0.14.816 → 0.14.818
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 +129 -122
- package/bundle/bundle.umd.min.js +1 -1
- package/bundle/components/ApplicationLeadForm/ApplicationLeadForm.d.ts +5 -0
- package/bundle/components/ApplicationLeadForm/useApplicationLeadApi.d.ts +0 -1
- package/bundle/components/ApplicationLeadForm/useInitApplicationLead.d.ts +3 -5
- package/bundle/ui-kit/BaseProductTile/BaseProductTileContent.d.ts +2 -0
- package/dist/components/ApplicationLeadForm/ApplicationLeadForm.d.ts +5 -0
- package/dist/components/ApplicationLeadForm/ApplicationLeadForm.js +20 -12
- package/dist/components/ApplicationLeadForm/ApplicationLeadForm.js.map +1 -1
- package/dist/components/ApplicationLeadForm/EsiaLoginBanner.js +0 -1
- package/dist/components/ApplicationLeadForm/EsiaLoginBanner.js.map +1 -1
- package/dist/components/ApplicationLeadForm/parseEsiaProfile.js +65 -70
- package/dist/components/ApplicationLeadForm/parseEsiaProfile.js.map +1 -1
- package/dist/components/ApplicationLeadForm/useApplicationLeadApi.d.ts +0 -1
- package/dist/components/ApplicationLeadForm/useApplicationLeadApi.js.map +1 -1
- package/dist/components/ApplicationLeadForm/useInitApplicationLead.d.ts +3 -5
- package/dist/components/ApplicationLeadForm/useInitApplicationLead.js +6 -10
- package/dist/components/ApplicationLeadForm/useInitApplicationLead.js.map +1 -1
- package/dist/components/GalleryLayout/GalleryLayout.js +18 -8
- package/dist/components/GalleryLayout/GalleryLayout.js.map +1 -1
- package/dist/retail/adaptors/getFamilyStatusAndIncomeData.js +2 -2
- package/dist/retail/adaptors/getFamilyStatusAndIncomeData.js.map +1 -1
- package/dist/retail/components/Fields/BeginDateField.js +2 -1
- package/dist/retail/components/Fields/BeginDateField.js.map +1 -1
- package/dist/retail/components/Fields/ConfirmationIncomeField.js +4 -1
- package/dist/retail/components/Fields/ConfirmationIncomeField.js.map +1 -1
- package/dist/retail/components/Fields/DaDataInnField.js +2 -1
- package/dist/retail/components/Fields/DaDataInnField.js.map +1 -1
- package/dist/retail/components/Fields/Experience5YearsField.js +2 -1
- package/dist/retail/components/Fields/Experience5YearsField.js.map +1 -1
- package/dist/retail/components/Fields/GeneralSeniorityField.js +2 -1
- package/dist/retail/components/Fields/GeneralSeniorityField.js.map +1 -1
- package/dist/retail/components/Fields/JobsNumberField.js +2 -1
- package/dist/retail/components/Fields/JobsNumberField.js.map +1 -1
- package/dist/retail/components/Fields/LastJobExperienceField.js +2 -1
- package/dist/retail/components/Fields/LastJobExperienceField.js.map +1 -1
- package/dist/retail/components/Fields/OrganizationNameField.js +2 -1
- package/dist/retail/components/Fields/OrganizationNameField.js.map +1 -1
- package/dist/retail/components/Fields/WagesField.js +2 -1
- package/dist/retail/components/Fields/WagesField.js.map +1 -1
- package/dist/retail/content.js +7 -10
- package/dist/retail/content.js.map +1 -1
- package/dist/ui-kit/BaseProductTile/BaseProductTile.js +2 -2
- package/dist/ui-kit/BaseProductTile/BaseProductTile.js.map +1 -1
- package/dist/ui-kit/BaseProductTile/BaseProductTileContent.d.ts +2 -0
- package/lib/common.css +1 -1
- package/lib/components/ApplicationLeadForm/ApplicationLeadForm.d.ts +5 -0
- package/lib/components/ApplicationLeadForm/ApplicationLeadForm.js +20 -12
- package/lib/components/ApplicationLeadForm/ApplicationLeadForm.js.map +1 -1
- package/lib/components/ApplicationLeadForm/EsiaLoginBanner.js +0 -1
- package/lib/components/ApplicationLeadForm/EsiaLoginBanner.js.map +1 -1
- package/lib/components/ApplicationLeadForm/parseEsiaProfile.js +65 -70
- package/lib/components/ApplicationLeadForm/parseEsiaProfile.js.map +1 -1
- package/lib/components/ApplicationLeadForm/useApplicationLeadApi.d.ts +0 -1
- package/lib/components/ApplicationLeadForm/useApplicationLeadApi.js.map +1 -1
- package/lib/components/ApplicationLeadForm/useInitApplicationLead.d.ts +3 -5
- package/lib/components/ApplicationLeadForm/useInitApplicationLead.js +6 -10
- package/lib/components/ApplicationLeadForm/useInitApplicationLead.js.map +1 -1
- package/lib/components/GalleryLayout/GalleryLayout.js +18 -8
- package/lib/components/GalleryLayout/GalleryLayout.js.map +1 -1
- package/lib/retail/adaptors/getFamilyStatusAndIncomeData.js +2 -2
- package/lib/retail/adaptors/getFamilyStatusAndIncomeData.js.map +1 -1
- package/lib/retail/components/Fields/BeginDateField.js +2 -1
- package/lib/retail/components/Fields/BeginDateField.js.map +1 -1
- package/lib/retail/components/Fields/ConfirmationIncomeField.js +5 -2
- package/lib/retail/components/Fields/ConfirmationIncomeField.js.map +1 -1
- package/lib/retail/components/Fields/DaDataInnField.js +2 -1
- package/lib/retail/components/Fields/DaDataInnField.js.map +1 -1
- package/lib/retail/components/Fields/Experience5YearsField.js +2 -1
- package/lib/retail/components/Fields/Experience5YearsField.js.map +1 -1
- package/lib/retail/components/Fields/GeneralSeniorityField.js +2 -1
- package/lib/retail/components/Fields/GeneralSeniorityField.js.map +1 -1
- package/lib/retail/components/Fields/JobsNumberField.js +2 -1
- package/lib/retail/components/Fields/JobsNumberField.js.map +1 -1
- package/lib/retail/components/Fields/LastJobExperienceField.js +2 -1
- package/lib/retail/components/Fields/LastJobExperienceField.js.map +1 -1
- package/lib/retail/components/Fields/OrganizationNameField.js +2 -1
- package/lib/retail/components/Fields/OrganizationNameField.js.map +1 -1
- package/lib/retail/components/Fields/WagesField.js +2 -1
- package/lib/retail/components/Fields/WagesField.js.map +1 -1
- package/lib/retail/content.js +7 -10
- package/lib/retail/content.js.map +1 -1
- package/lib/ui-kit/BaseProductTile/BaseProductTile.js +2 -2
- package/lib/ui-kit/BaseProductTile/BaseProductTile.js.map +1 -1
- package/lib/ui-kit/BaseProductTile/BaseProductTileContent.d.ts +2 -0
- package/mobile/bundle/bundle.umd.js +129 -122
- package/mobile/bundle/bundle.umd.min.js +1 -1
- package/mobile/bundle/components/ApplicationLeadForm/ApplicationLeadForm.d.ts +5 -0
- package/mobile/bundle/components/ApplicationLeadForm/useApplicationLeadApi.d.ts +0 -1
- package/mobile/bundle/components/ApplicationLeadForm/useInitApplicationLead.d.ts +3 -5
- package/mobile/bundle/ui-kit/BaseProductTile/BaseProductTileContent.d.ts +2 -0
- package/mobile/dist/components/ApplicationLeadForm/ApplicationLeadForm.d.ts +5 -0
- package/mobile/dist/components/ApplicationLeadForm/ApplicationLeadForm.js +20 -12
- package/mobile/dist/components/ApplicationLeadForm/ApplicationLeadForm.js.map +1 -1
- package/mobile/dist/components/ApplicationLeadForm/EsiaLoginBanner.js +0 -1
- package/mobile/dist/components/ApplicationLeadForm/EsiaLoginBanner.js.map +1 -1
- package/mobile/dist/components/ApplicationLeadForm/parseEsiaProfile.js +65 -70
- package/mobile/dist/components/ApplicationLeadForm/parseEsiaProfile.js.map +1 -1
- package/mobile/dist/components/ApplicationLeadForm/useApplicationLeadApi.d.ts +0 -1
- package/mobile/dist/components/ApplicationLeadForm/useApplicationLeadApi.js.map +1 -1
- package/mobile/dist/components/ApplicationLeadForm/useInitApplicationLead.d.ts +3 -5
- package/mobile/dist/components/ApplicationLeadForm/useInitApplicationLead.js +6 -10
- package/mobile/dist/components/ApplicationLeadForm/useInitApplicationLead.js.map +1 -1
- package/mobile/dist/components/GalleryLayout/GalleryLayout.js +18 -8
- package/mobile/dist/components/GalleryLayout/GalleryLayout.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/components/Fields/BeginDateField.js +2 -1
- package/mobile/dist/retail/components/Fields/BeginDateField.js.map +1 -1
- package/mobile/dist/retail/components/Fields/ConfirmationIncomeField.js +4 -1
- package/mobile/dist/retail/components/Fields/ConfirmationIncomeField.js.map +1 -1
- package/mobile/dist/retail/components/Fields/DaDataInnField.js +2 -1
- package/mobile/dist/retail/components/Fields/DaDataInnField.js.map +1 -1
- package/mobile/dist/retail/components/Fields/Experience5YearsField.js +2 -1
- package/mobile/dist/retail/components/Fields/Experience5YearsField.js.map +1 -1
- package/mobile/dist/retail/components/Fields/GeneralSeniorityField.js +2 -1
- package/mobile/dist/retail/components/Fields/GeneralSeniorityField.js.map +1 -1
- package/mobile/dist/retail/components/Fields/JobsNumberField.js +2 -1
- package/mobile/dist/retail/components/Fields/JobsNumberField.js.map +1 -1
- package/mobile/dist/retail/components/Fields/LastJobExperienceField.js +2 -1
- package/mobile/dist/retail/components/Fields/LastJobExperienceField.js.map +1 -1
- package/mobile/dist/retail/components/Fields/OrganizationNameField.js +2 -1
- package/mobile/dist/retail/components/Fields/OrganizationNameField.js.map +1 -1
- package/mobile/dist/retail/components/Fields/WagesField.js +2 -1
- package/mobile/dist/retail/components/Fields/WagesField.js.map +1 -1
- package/mobile/dist/retail/content.js +7 -10
- package/mobile/dist/retail/content.js.map +1 -1
- package/mobile/dist/ui-kit/BaseProductTile/BaseProductTile.js +2 -2
- package/mobile/dist/ui-kit/BaseProductTile/BaseProductTile.js.map +1 -1
- package/mobile/dist/ui-kit/BaseProductTile/BaseProductTileContent.d.ts +2 -0
- package/mobile/lib/common.css +1 -1
- package/mobile/lib/components/ApplicationLeadForm/ApplicationLeadForm.d.ts +5 -0
- package/mobile/lib/components/ApplicationLeadForm/ApplicationLeadForm.js +20 -12
- package/mobile/lib/components/ApplicationLeadForm/ApplicationLeadForm.js.map +1 -1
- package/mobile/lib/components/ApplicationLeadForm/EsiaLoginBanner.js +0 -1
- package/mobile/lib/components/ApplicationLeadForm/EsiaLoginBanner.js.map +1 -1
- package/mobile/lib/components/ApplicationLeadForm/parseEsiaProfile.js +65 -70
- package/mobile/lib/components/ApplicationLeadForm/parseEsiaProfile.js.map +1 -1
- package/mobile/lib/components/ApplicationLeadForm/useApplicationLeadApi.d.ts +0 -1
- package/mobile/lib/components/ApplicationLeadForm/useApplicationLeadApi.js.map +1 -1
- package/mobile/lib/components/ApplicationLeadForm/useInitApplicationLead.d.ts +3 -5
- package/mobile/lib/components/ApplicationLeadForm/useInitApplicationLead.js +6 -10
- package/mobile/lib/components/ApplicationLeadForm/useInitApplicationLead.js.map +1 -1
- package/mobile/lib/components/GalleryLayout/GalleryLayout.js +18 -8
- package/mobile/lib/components/GalleryLayout/GalleryLayout.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/components/Fields/BeginDateField.js +2 -1
- package/mobile/lib/retail/components/Fields/BeginDateField.js.map +1 -1
- package/mobile/lib/retail/components/Fields/ConfirmationIncomeField.js +5 -2
- package/mobile/lib/retail/components/Fields/ConfirmationIncomeField.js.map +1 -1
- package/mobile/lib/retail/components/Fields/DaDataInnField.js +2 -1
- package/mobile/lib/retail/components/Fields/DaDataInnField.js.map +1 -1
- package/mobile/lib/retail/components/Fields/Experience5YearsField.js +2 -1
- package/mobile/lib/retail/components/Fields/Experience5YearsField.js.map +1 -1
- package/mobile/lib/retail/components/Fields/GeneralSeniorityField.js +2 -1
- package/mobile/lib/retail/components/Fields/GeneralSeniorityField.js.map +1 -1
- package/mobile/lib/retail/components/Fields/JobsNumberField.js +2 -1
- package/mobile/lib/retail/components/Fields/JobsNumberField.js.map +1 -1
- package/mobile/lib/retail/components/Fields/LastJobExperienceField.js +2 -1
- package/mobile/lib/retail/components/Fields/LastJobExperienceField.js.map +1 -1
- package/mobile/lib/retail/components/Fields/OrganizationNameField.js +2 -1
- package/mobile/lib/retail/components/Fields/OrganizationNameField.js.map +1 -1
- package/mobile/lib/retail/components/Fields/WagesField.js +2 -1
- package/mobile/lib/retail/components/Fields/WagesField.js.map +1 -1
- package/mobile/lib/retail/content.js +7 -10
- package/mobile/lib/retail/content.js.map +1 -1
- package/mobile/lib/ui-kit/BaseProductTile/BaseProductTile.js +2 -2
- package/mobile/lib/ui-kit/BaseProductTile/BaseProductTile.js.map +1 -1
- package/mobile/lib/ui-kit/BaseProductTile/BaseProductTileContent.d.ts +2 -0
- package/mobile/src/components/ApplicationLeadForm/ApplicationLeadForm.tsx +24 -15
- package/mobile/src/components/ApplicationLeadForm/EsiaLoginBanner.tsx +0 -1
- package/mobile/src/components/ApplicationLeadForm/parseEsiaProfile.ts +71 -80
- package/mobile/src/components/ApplicationLeadForm/useApplicationLeadApi.tsx +0 -1
- package/mobile/src/components/ApplicationLeadForm/useInitApplicationLead.ts +8 -14
- package/mobile/src/components/GalleryLayout/GalleryLayout.tsx +20 -9
- package/mobile/src/retail/adaptors/getFamilyStatusAndIncomeData.ts +1 -2
- package/mobile/src/retail/components/Fields/BeginDateField.tsx +2 -0
- package/mobile/src/retail/components/Fields/ConfirmationIncomeField.tsx +18 -7
- package/mobile/src/retail/components/Fields/DaDataInnField.tsx +2 -0
- package/mobile/src/retail/components/Fields/Experience5YearsField.tsx +2 -0
- package/mobile/src/retail/components/Fields/GeneralSeniorityField.tsx +2 -0
- package/mobile/src/retail/components/Fields/JobsNumberField.tsx +2 -0
- package/mobile/src/retail/components/Fields/LastJobExperienceField.tsx +2 -0
- package/mobile/src/retail/components/Fields/OrganizationNameField.tsx +2 -0
- package/mobile/src/retail/components/Fields/WagesField.tsx +2 -0
- package/mobile/src/retail/content.tsx +7 -10
- package/mobile/src/ui-kit/BaseProductTile/BaseProductTile.tsx +2 -1
- package/mobile/src/ui-kit/BaseProductTile/BaseProductTileContent.ts +2 -0
- package/package.json +1 -1
- package/src/components/ApplicationLeadForm/ApplicationLeadForm.tsx +24 -15
- package/src/components/ApplicationLeadForm/EsiaLoginBanner.tsx +0 -1
- package/src/components/ApplicationLeadForm/parseEsiaProfile.ts +71 -80
- package/src/components/ApplicationLeadForm/useApplicationLeadApi.tsx +0 -1
- package/src/components/ApplicationLeadForm/useInitApplicationLead.ts +8 -14
- package/src/components/GalleryLayout/GalleryLayout.fixture.tsx +4 -15
- package/src/components/GalleryLayout/GalleryLayout.tsx +20 -9
- package/src/retail/adaptors/getFamilyStatusAndIncomeData.ts +1 -2
- package/src/retail/components/Fields/BeginDateField.tsx +2 -0
- package/src/retail/components/Fields/ConfirmationIncomeField.tsx +18 -7
- package/src/retail/components/Fields/DaDataInnField.tsx +2 -0
- package/src/retail/components/Fields/Experience5YearsField.tsx +2 -0
- package/src/retail/components/Fields/GeneralSeniorityField.tsx +2 -0
- package/src/retail/components/Fields/JobsNumberField.tsx +2 -0
- package/src/retail/components/Fields/LastJobExperienceField.tsx +2 -0
- package/src/retail/components/Fields/OrganizationNameField.tsx +2 -0
- package/src/retail/components/Fields/WagesField.tsx +2 -0
- package/src/retail/content.tsx +7 -10
- package/src/ui-kit/BaseProductTile/BaseProductTile.tsx +2 -1
- package/src/ui-kit/BaseProductTile/BaseProductTileContent.ts +2 -0
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { useCallback, useEffect, useMemo } from '@redneckz/uni-jsx/lib/hooks';
|
|
2
|
-
import { useBool } from '@redneckz/uni-jsx/lib/hooks/useBool';
|
|
3
2
|
import { useSetter } from '../../hooks/useSetter';
|
|
4
3
|
import { esiaRequestProfile } from '../../retail/api/esiaRequestProfile';
|
|
5
4
|
import { type LeadFormState } from '../../retail/model/LeadFormState';
|
|
6
5
|
import { type FieldRetailDef } from '../../retail/model/RetailFormContent';
|
|
6
|
+
import { EsiaStatuses } from './ApplicationLeadForm';
|
|
7
7
|
import { type ProductType } from './ApplicationLeadFormContent';
|
|
8
8
|
import { getInitialFormState } from './getInitialFormState';
|
|
9
9
|
import { parseEsiaProfile } from './parseEsiaProfile';
|
|
@@ -13,20 +13,16 @@ type InitApplicationLeadProps = {
|
|
|
13
13
|
inputs: FieldRetailDef[];
|
|
14
14
|
nextStepLink: string;
|
|
15
15
|
productType: ProductType;
|
|
16
|
-
|
|
17
|
-
setEsiaAuthSuccess: () => void;
|
|
16
|
+
setEsiaStatus: (status: EsiaStatuses) => void;
|
|
18
17
|
esiaAuthSuccess: boolean;
|
|
19
18
|
};
|
|
20
19
|
|
|
21
20
|
export const useInitApplicationLead = ({
|
|
22
21
|
inputs,
|
|
23
22
|
productType,
|
|
24
|
-
|
|
25
|
-
setEsiaAuthSuccess,
|
|
23
|
+
setEsiaStatus,
|
|
26
24
|
esiaAuthSuccess,
|
|
27
|
-
}: InitApplicationLeadProps):
|
|
28
|
-
const [isLoading, { setTrue: startLoading, setFalse: endLoading }] = useBool(false);
|
|
29
|
-
|
|
25
|
+
}: InitApplicationLeadProps): LeadFormState => {
|
|
30
26
|
const leadFormStore = useLeadFormStore();
|
|
31
27
|
const saveForm = useSetter(leadFormStore, 'leadForm');
|
|
32
28
|
|
|
@@ -36,7 +32,7 @@ export const useInitApplicationLead = ({
|
|
|
36
32
|
);
|
|
37
33
|
|
|
38
34
|
const requestEsiaProfile = useCallback(async (code: string, state: string) => {
|
|
39
|
-
|
|
35
|
+
setEsiaStatus(EsiaStatuses.Pending);
|
|
40
36
|
try {
|
|
41
37
|
const data = await esiaRequestProfile({
|
|
42
38
|
code,
|
|
@@ -52,12 +48,10 @@ export const useInitApplicationLead = ({
|
|
|
52
48
|
..._,
|
|
53
49
|
...parsedData,
|
|
54
50
|
}));
|
|
55
|
-
|
|
51
|
+
setEsiaStatus(EsiaStatuses.Success);
|
|
56
52
|
}
|
|
57
53
|
} catch {
|
|
58
|
-
|
|
59
|
-
} finally {
|
|
60
|
-
endLoading();
|
|
54
|
+
setEsiaStatus(EsiaStatuses.Error);
|
|
61
55
|
}
|
|
62
56
|
}, []);
|
|
63
57
|
|
|
@@ -76,5 +70,5 @@ export const useInitApplicationLead = ({
|
|
|
76
70
|
}
|
|
77
71
|
}, []);
|
|
78
72
|
|
|
79
|
-
return
|
|
73
|
+
return initialFormState;
|
|
80
74
|
};
|
|
@@ -33,7 +33,7 @@ const LINK_SCHEMA: Record<string, JSONSchema7Definition> = {
|
|
|
33
33
|
},
|
|
34
34
|
},
|
|
35
35
|
],
|
|
36
|
-
title: 'Ссылка',
|
|
36
|
+
title: 'Ссылка (если заполнено, то кнопка скрывается)',
|
|
37
37
|
required: ['href'],
|
|
38
38
|
},
|
|
39
39
|
};
|
|
@@ -109,15 +109,18 @@ const blockDecoratorWrapper =
|
|
|
109
109
|
|
|
110
110
|
const productBlockDecorator =
|
|
111
111
|
(idx: number): BlockDecorator =>
|
|
112
|
-
({ blockClassName, block, render }, i) =>
|
|
113
|
-
(
|
|
114
|
-
|
|
112
|
+
({ blockClassName, block, render }, i) => {
|
|
113
|
+
const modifiedBlock = modifyBlock(block, idx);
|
|
114
|
+
|
|
115
|
+
return (
|
|
116
|
+
<LinkWrapper key={String(i)} {...modifiedBlock.content?.link} className={getChildStyle(idx)}>
|
|
115
117
|
{render({
|
|
116
118
|
blockClassName: style(blockClassName, 'h-full'),
|
|
117
|
-
block:
|
|
119
|
+
block: modifiedBlock,
|
|
118
120
|
})}
|
|
119
121
|
</LinkWrapper>
|
|
120
122
|
);
|
|
123
|
+
};
|
|
121
124
|
|
|
122
125
|
const getChildStyle = (index: number) =>
|
|
123
126
|
SHORT_TILE_INDEXES.includes(index)
|
|
@@ -127,13 +130,21 @@ const getChildStyle = (index: number) =>
|
|
|
127
130
|
const modifyBlock = (block: BlockDef, i: number) => {
|
|
128
131
|
const content: ProductBlockContent & { link?: LinkProps } = { ...block.content };
|
|
129
132
|
|
|
130
|
-
|
|
133
|
+
const isSmallTile = SHORT_TILE_INDEXES.includes(i);
|
|
134
|
+
|
|
135
|
+
if (isSmallTile) {
|
|
131
136
|
delete content.description;
|
|
132
137
|
delete content.benefits;
|
|
133
|
-
}
|
|
134
138
|
|
|
135
|
-
|
|
136
|
-
|
|
139
|
+
if (content.link?.href) {
|
|
140
|
+
delete content.buttons;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
content.imageOptions = { ...content.imageOptions, className: 'max-w-max !h-auto' };
|
|
144
|
+
} else {
|
|
145
|
+
if ((content.buttons ?? []).length) {
|
|
146
|
+
delete content.link;
|
|
147
|
+
}
|
|
137
148
|
}
|
|
138
149
|
|
|
139
150
|
return { ...block, content };
|
|
@@ -19,13 +19,12 @@ export const getFamilyStatusAndIncomeData = (formData: LeadFormState): Partial<P
|
|
|
19
19
|
snils,
|
|
20
20
|
armyIdFlg,
|
|
21
21
|
conscription,
|
|
22
|
-
esiaAccountTypeCd,
|
|
23
22
|
} = formData;
|
|
24
23
|
|
|
25
24
|
return {
|
|
26
25
|
maritalStatusCd: familyStatus,
|
|
27
26
|
totalDependents: familyMembers,
|
|
28
|
-
incomeCertificateCd:
|
|
27
|
+
incomeCertificateCd: confirmationIncome,
|
|
29
28
|
otherDependents: dependents,
|
|
30
29
|
childrenDependents: children,
|
|
31
30
|
militaryStatusCd: conscription,
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import { JSX } from '@redneckz/uni-jsx';
|
|
2
2
|
import { DatePickerControl } from '../../../ui-kit/DatePicker/DatePickerControl';
|
|
3
3
|
import { type CustomFieldProps } from '../../../ui-kit/FormField/CustomFieldProps';
|
|
4
|
+
import { isEsiaAuthorize } from '../../utils/isEsiaAuthorize';
|
|
4
5
|
|
|
5
6
|
export const BeginDateField = JSX<CustomFieldProps>(({ field, input }) => (
|
|
6
7
|
<DatePickerControl
|
|
7
8
|
label="Дата начала работы на текущем месте"
|
|
8
9
|
{...field(input?.name ?? '')}
|
|
9
10
|
{...input}
|
|
11
|
+
disabled={input?.filledByEsia && isEsiaAuthorize(field, input?.name ?? '')}
|
|
10
12
|
/>
|
|
11
13
|
));
|
|
@@ -1,18 +1,29 @@
|
|
|
1
1
|
import { JSX } from '@redneckz/uni-jsx';
|
|
2
2
|
import { type CustomFieldProps } from '../../../ui-kit/FormField/CustomFieldProps';
|
|
3
|
+
import { InfoCard } from '../../../ui-kit/InfoCard/InfoCard';
|
|
3
4
|
import { useLeadFormData } from '../../hooks/useLeadFormData';
|
|
5
|
+
import { isEsiaAuthorize } from '../../utils/isEsiaAuthorize';
|
|
4
6
|
import { SelectField } from './SelectField';
|
|
5
7
|
|
|
6
8
|
export const ConfirmationIncomeField = JSX<CustomFieldProps>(({ field, input }) => {
|
|
7
9
|
const { data: confirmationIncome } = useLeadFormData('INCOME_CERT_UNITED');
|
|
10
|
+
const filledByEsia = input?.filledByEsia && isEsiaAuthorize(field, input?.name ?? '');
|
|
8
11
|
|
|
9
12
|
return (
|
|
10
|
-
<
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
13
|
+
<div>
|
|
14
|
+
{filledByEsia ? (
|
|
15
|
+
<div className="mb-6">
|
|
16
|
+
<InfoCard __html="Для выбора иного способа подтверждения дохода, оформите новую заявку на кредит без авторизации на портале Госуслуги" />
|
|
17
|
+
</div>
|
|
18
|
+
) : null}
|
|
19
|
+
<SelectField
|
|
20
|
+
field={field}
|
|
21
|
+
source={confirmationIncome}
|
|
22
|
+
label="Способ подтверждения дохода"
|
|
23
|
+
fieldName="confirmationIncome"
|
|
24
|
+
input={input}
|
|
25
|
+
disabled={filledByEsia}
|
|
26
|
+
/>
|
|
27
|
+
</div>
|
|
17
28
|
);
|
|
18
29
|
});
|
|
@@ -4,6 +4,7 @@ import { type CustomFieldProps } from '../../../ui-kit/FormField/CustomFieldProp
|
|
|
4
4
|
import { type DaDataSuggestion } from '../../api/dadataHints/dadataHintsType';
|
|
5
5
|
import { getOrganizationFromInn } from '../../api/getOrganizationFromInn';
|
|
6
6
|
import { useRetailFormStore } from '../../hooks/useRetailFormStore';
|
|
7
|
+
import { isEsiaAuthorize } from '../../utils/isEsiaAuthorize';
|
|
7
8
|
import { updateOrganizationFields } from '../../utils/updateOrganizationFields';
|
|
8
9
|
import { DaDataInputControl } from '../DaDataInputControl/DaDataInputControl';
|
|
9
10
|
|
|
@@ -41,6 +42,7 @@ export const DaDataInnField = JSX<CustomFieldProps>(({ field, input }) => {
|
|
|
41
42
|
{...input}
|
|
42
43
|
{...field(input?.name ?? '')}
|
|
43
44
|
onDaDataChange={onDaDataChange}
|
|
45
|
+
disabled={input?.filledByEsia && isEsiaAuthorize(field, input?.name ?? '')}
|
|
44
46
|
/>
|
|
45
47
|
);
|
|
46
48
|
});
|
|
@@ -2,6 +2,7 @@ import { JSX } from '@redneckz/uni-jsx';
|
|
|
2
2
|
import { useCallback } from '@redneckz/uni-jsx/lib/hooks';
|
|
3
3
|
import { type CustomFieldProps } from '../../../ui-kit/FormField/CustomFieldProps';
|
|
4
4
|
import { clamp } from '../../../utils/clamp';
|
|
5
|
+
import { isEsiaAuthorize } from '../../utils/isEsiaAuthorize';
|
|
5
6
|
import { DaDataInputControl } from '../DaDataInputControl/DaDataInputControl';
|
|
6
7
|
|
|
7
8
|
const MAX_YEARS = 5;
|
|
@@ -22,6 +23,7 @@ export const Experience5YearsField = JSX<CustomFieldProps>(({ field, input }) =>
|
|
|
22
23
|
{...field(input?.name ?? '')}
|
|
23
24
|
{...input}
|
|
24
25
|
onChange={onChange}
|
|
26
|
+
disabled={input?.filledByEsia && isEsiaAuthorize(field, input?.name ?? '')}
|
|
25
27
|
/>
|
|
26
28
|
);
|
|
27
29
|
});
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { JSX } from '@redneckz/uni-jsx';
|
|
2
2
|
import { type CustomFieldProps } from '../../../ui-kit/FormField/CustomFieldProps';
|
|
3
|
+
import { isEsiaAuthorize } from '../../utils/isEsiaAuthorize';
|
|
3
4
|
import { DaDataInputControl } from '../DaDataInputControl/DaDataInputControl';
|
|
4
5
|
|
|
5
6
|
export const GeneralSeniorityField = JSX<CustomFieldProps>(({ field, input }) => (
|
|
@@ -10,5 +11,6 @@ export const GeneralSeniorityField = JSX<CustomFieldProps>(({ field, input }) =>
|
|
|
10
11
|
placeholder="Количество лет"
|
|
11
12
|
{...field(input?.name ?? '')}
|
|
12
13
|
{...input}
|
|
14
|
+
disabled={input?.filledByEsia && isEsiaAuthorize(field, input?.name ?? '')}
|
|
13
15
|
/>
|
|
14
16
|
));
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { JSX } from '@redneckz/uni-jsx';
|
|
2
2
|
import { type CustomFieldProps } from '../../../ui-kit/FormField/CustomFieldProps';
|
|
3
|
+
import { isEsiaAuthorize } from '../../utils/isEsiaAuthorize';
|
|
3
4
|
import { DaDataInputControl } from '../DaDataInputControl/DaDataInputControl';
|
|
4
5
|
|
|
5
6
|
export const JobsNumberField = JSX<CustomFieldProps>(({ field, input }) => (
|
|
@@ -10,5 +11,6 @@ export const JobsNumberField = JSX<CustomFieldProps>(({ field, input }) => (
|
|
|
10
11
|
maxLength={2}
|
|
11
12
|
{...field(input?.name ?? '')}
|
|
12
13
|
{...input}
|
|
14
|
+
disabled={input?.filledByEsia && isEsiaAuthorize(field, input?.name ?? '')}
|
|
13
15
|
/>
|
|
14
16
|
));
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { JSX } from '@redneckz/uni-jsx';
|
|
2
2
|
import { type CustomFieldProps } from '../../../ui-kit/FormField/CustomFieldProps';
|
|
3
|
+
import { isEsiaAuthorize } from '../../utils/isEsiaAuthorize';
|
|
3
4
|
import { DaDataInputControl } from '../DaDataInputControl/DaDataInputControl';
|
|
4
5
|
|
|
5
6
|
export const LastJobExperienceField = JSX<CustomFieldProps>(({ field, input }) => (
|
|
@@ -10,5 +11,6 @@ export const LastJobExperienceField = JSX<CustomFieldProps>(({ field, input }) =
|
|
|
10
11
|
maxLength={2}
|
|
11
12
|
{...field(input?.name ?? '')}
|
|
12
13
|
{...input}
|
|
14
|
+
disabled={input?.filledByEsia && isEsiaAuthorize(field, input?.name ?? '')}
|
|
13
15
|
/>
|
|
14
16
|
));
|
|
@@ -3,6 +3,7 @@ import { useCallback } from '@redneckz/uni-jsx/lib/hooks';
|
|
|
3
3
|
import { type CustomFieldProps } from '../../../ui-kit/FormField/CustomFieldProps';
|
|
4
4
|
import { type DaDataSuggestion } from '../../api/dadataHints/dadataHintsType';
|
|
5
5
|
import { useRetailFormStore } from '../../hooks/useRetailFormStore';
|
|
6
|
+
import { isEsiaAuthorize } from '../../utils/isEsiaAuthorize';
|
|
6
7
|
import { updateOrganizationFields } from '../../utils/updateOrganizationFields';
|
|
7
8
|
import { DaDataInputControl } from '../DaDataInputControl/DaDataInputControl';
|
|
8
9
|
|
|
@@ -19,6 +20,7 @@ export const OrganizationNameField = JSX<CustomFieldProps>(({ field, input }) =>
|
|
|
19
20
|
label="Наименование организации"
|
|
20
21
|
{...input}
|
|
21
22
|
{...field(input?.name ?? '')}
|
|
23
|
+
disabled={input?.filledByEsia && isEsiaAuthorize(field, input?.name ?? '')}
|
|
22
24
|
onDaDataChange={onDaDataChange}
|
|
23
25
|
/>
|
|
24
26
|
);
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { JSX } from '@redneckz/uni-jsx';
|
|
2
2
|
import { type CustomFieldProps } from '../../../ui-kit/FormField/CustomFieldProps';
|
|
3
|
+
import { isEsiaAuthorize } from '../../utils/isEsiaAuthorize';
|
|
3
4
|
import { DaDataInputControl } from '../DaDataInputControl/DaDataInputControl';
|
|
4
5
|
|
|
5
6
|
export const WagesField = JSX<CustomFieldProps>(({ field, input }) => (
|
|
@@ -9,5 +10,6 @@ export const WagesField = JSX<CustomFieldProps>(({ field, input }) => (
|
|
|
9
10
|
isInteger={true}
|
|
10
11
|
{...field(input?.name ?? '')}
|
|
11
12
|
{...input}
|
|
13
|
+
disabled={input?.filledByEsia && isEsiaAuthorize(field, input?.name ?? '')}
|
|
12
14
|
/>
|
|
13
15
|
));
|
|
@@ -139,7 +139,7 @@ const EMPLOYMENT_CONTENT: CreditCardSectionsProps[] = [
|
|
|
139
139
|
label: 'Телефон работодателя',
|
|
140
140
|
required: true,
|
|
141
141
|
},
|
|
142
|
-
{ name: 'beginDate', required: true },
|
|
142
|
+
{ name: 'beginDate', required: true, filledByEsia: true },
|
|
143
143
|
],
|
|
144
144
|
},
|
|
145
145
|
{
|
|
@@ -181,23 +181,20 @@ const FAMILY_STATUS_AND_INCOME_CONTENT: CreditCardSectionsProps[] = [
|
|
|
181
181
|
title: 'Совокупный доход',
|
|
182
182
|
},
|
|
183
183
|
{
|
|
184
|
+
columns: 1,
|
|
184
185
|
inputs: [
|
|
185
186
|
{
|
|
186
|
-
name: '
|
|
187
|
-
|
|
187
|
+
name: 'confirmationIncome',
|
|
188
|
+
required: true,
|
|
189
|
+
filledByEsia: true,
|
|
188
190
|
},
|
|
189
191
|
],
|
|
190
192
|
},
|
|
191
193
|
{
|
|
192
|
-
columns: 1,
|
|
193
194
|
inputs: [
|
|
194
195
|
{
|
|
195
|
-
name: '
|
|
196
|
-
|
|
197
|
-
condition: {
|
|
198
|
-
name: 'esiaAccountTypeCd',
|
|
199
|
-
values: [''],
|
|
200
|
-
},
|
|
196
|
+
name: 'infoCard',
|
|
197
|
+
label: 'Сумма основного и дополнительных доходов после вычета налога',
|
|
201
198
|
},
|
|
202
199
|
],
|
|
203
200
|
},
|
|
@@ -54,12 +54,13 @@ export const BaseProductTile = JSX<BaseProductTileProps>(
|
|
|
54
54
|
directionRight = true,
|
|
55
55
|
isImageAlwaysOnRight,
|
|
56
56
|
isImageSecondary = false,
|
|
57
|
+
className: imageClassName,
|
|
57
58
|
} = {},
|
|
58
59
|
backwardButton,
|
|
59
60
|
children,
|
|
60
61
|
...rest
|
|
61
62
|
}) => {
|
|
62
|
-
const img = image?.src ? <Img image={image} /> : null;
|
|
63
|
+
const img = image?.src ? <Img image={image} imageClassName={imageClassName} /> : null;
|
|
63
64
|
const headline = (
|
|
64
65
|
<Headline
|
|
65
66
|
title={title}
|
package/package.json
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
/* eslint-disable max-lines-per-function */
|
|
2
2
|
import { JSX } from '@redneckz/uni-jsx';
|
|
3
|
-
import { useEffect, useMemo } from '@redneckz/uni-jsx/lib/hooks';
|
|
4
|
-
import { useBool } from '@redneckz/uni-jsx/lib/hooks/useBool';
|
|
3
|
+
import { useEffect, useMemo, useRef, useState } from '@redneckz/uni-jsx/lib/hooks';
|
|
5
4
|
import { useForm } from '../../hooks/useForm/useForm';
|
|
6
5
|
import { type FieldRetailDef } from '../../retail/model/RetailFormContent';
|
|
7
6
|
import { validatorObj } from '../../retail/validator/validatorObj';
|
|
@@ -25,6 +24,12 @@ import { useInitApplicationLead } from './useInitApplicationLead';
|
|
|
25
24
|
|
|
26
25
|
interface ApplicationLeadFormProps extends ApplicationLeadFormContent, UniBlockProps {}
|
|
27
26
|
|
|
27
|
+
export enum EsiaStatuses {
|
|
28
|
+
Success = 'SUCCESS',
|
|
29
|
+
Error = 'ERROR',
|
|
30
|
+
Pending = 'PENDING',
|
|
31
|
+
}
|
|
32
|
+
|
|
28
33
|
export const ApplicationLeadForm = JSX<ApplicationLeadFormProps>(
|
|
29
34
|
({
|
|
30
35
|
className,
|
|
@@ -36,8 +41,8 @@ export const ApplicationLeadForm = JSX<ApplicationLeadFormProps>(
|
|
|
36
41
|
data,
|
|
37
42
|
...rest
|
|
38
43
|
}) => {
|
|
39
|
-
const [
|
|
40
|
-
const
|
|
44
|
+
const [esiaStatus, setEsiaStatus] = useState<EsiaStatuses>();
|
|
45
|
+
const leadForm = useRef<HTMLFormElement | null>(null);
|
|
41
46
|
const applicationFormData = useMemo(() => getApplicationFormData(productType), [productType]);
|
|
42
47
|
const inputs = useMemo(
|
|
43
48
|
() => (applicationFormData?.flatMap((_) => _?.inputs) || []) as FieldRetailDef[],
|
|
@@ -46,19 +51,17 @@ export const ApplicationLeadForm = JSX<ApplicationLeadFormProps>(
|
|
|
46
51
|
|
|
47
52
|
const formValidator = useMemo(() => getFormValidator(inputs, validatorObj), [inputs]);
|
|
48
53
|
|
|
49
|
-
const
|
|
54
|
+
const initialFormState = useInitApplicationLead({
|
|
50
55
|
inputs,
|
|
51
56
|
nextStepLink,
|
|
52
57
|
productType,
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
esiaAuthSuccess,
|
|
58
|
+
setEsiaStatus,
|
|
59
|
+
esiaAuthSuccess: esiaStatus === EsiaStatuses.Success,
|
|
56
60
|
});
|
|
57
61
|
const { isSending, ok, handleSubmit } = useApplicationLeadApi({
|
|
58
62
|
programId,
|
|
59
63
|
nextStepLink,
|
|
60
64
|
productType,
|
|
61
|
-
esiaAuthSuccess,
|
|
62
65
|
data,
|
|
63
66
|
});
|
|
64
67
|
|
|
@@ -75,10 +78,16 @@ export const ApplicationLeadForm = JSX<ApplicationLeadFormProps>(
|
|
|
75
78
|
}, [ok]);
|
|
76
79
|
|
|
77
80
|
useEffect(() => {
|
|
78
|
-
if (
|
|
81
|
+
if (esiaStatus && leadForm?.current) {
|
|
82
|
+
leadForm.current.scrollIntoView({
|
|
83
|
+
block: 'start',
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
if (esiaStatus === EsiaStatuses.Success) {
|
|
79
88
|
reset();
|
|
80
89
|
}
|
|
81
|
-
}, [
|
|
90
|
+
}, [leadForm?.current, esiaStatus]);
|
|
82
91
|
|
|
83
92
|
return (
|
|
84
93
|
<ApplicationFormLayout
|
|
@@ -86,9 +95,9 @@ export const ApplicationLeadForm = JSX<ApplicationLeadFormProps>(
|
|
|
86
95
|
title={title}
|
|
87
96
|
{...rest}
|
|
88
97
|
>
|
|
89
|
-
{!
|
|
90
|
-
<form onSubmit={onSubmit} className="space-y-m relative">
|
|
91
|
-
{
|
|
98
|
+
{!esiaStatus ? <EsiaLoginBanner /> : null}
|
|
99
|
+
<form onSubmit={onSubmit} className="space-y-m relative" ref={leadForm}>
|
|
100
|
+
{esiaStatus === EsiaStatuses.Pending ? <Loader blur={false} /> : null}
|
|
92
101
|
{applicationFormData.map((_, i) => (
|
|
93
102
|
<div
|
|
94
103
|
key={`section-${i}`}
|
|
@@ -99,7 +108,7 @@ export const ApplicationLeadForm = JSX<ApplicationLeadFormProps>(
|
|
|
99
108
|
</div>
|
|
100
109
|
))}
|
|
101
110
|
{renderSubmitButton(button, isSending)}
|
|
102
|
-
{
|
|
111
|
+
{esiaStatus === EsiaStatuses.Error ? (
|
|
103
112
|
<Text size="text-m" font="font-medium" color="text-error">
|
|
104
113
|
Использовать Госуслуги для оформления заявки невозможно, необходимо заполнить поля
|
|
105
114
|
вручную.
|