@redneckz/wildless-cms-uni-blocks 0.14.619 → 0.14.620
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/api/RetailAPI/getLink.d.ts +7 -0
- package/bundle/api/RetailAPI/updateProfileEsia.d.ts +66 -0
- package/bundle/blocks.schema.json +1 -1
- package/bundle/bundle.umd.js +100 -39
- package/bundle/bundle.umd.min.js +1 -1
- package/bundle/components/ApplicationLeadForm/ApplicationLeadFormContent.d.ts +2 -0
- package/bundle/components/ApplicationLeadForm/useApplicationLeadApi.d.ts +2 -1
- package/bundle/components/ApplicationLeadForm/useInitApplicationLead.d.ts +3 -1
- package/bundle/icons/IconName.d.ts +4 -2
- package/bundle/ui-kit/ConsentBkiDialog/useConsentBkiDialog.d.ts +1 -1
- package/bundle/ui-kit/EsiaLoginDialog/EsiaLoginDialog.d.ts +4 -0
- package/bundle/ui-kit/EsiaLoginDialog/useEsiaLoginDialog.d.ts +9 -0
- package/cosmos-static/icons/GosUslugiIcon.svg +1 -0
- package/dist/api/RetailAPI/getLink.d.ts +7 -0
- package/dist/api/RetailAPI/getLink.js +6 -0
- package/dist/api/RetailAPI/getLink.js.map +1 -0
- package/dist/api/RetailAPI/updateProfileEsia.d.ts +66 -0
- package/dist/api/RetailAPI/updateProfileEsia.js +6 -0
- package/dist/api/RetailAPI/updateProfileEsia.js.map +1 -0
- package/dist/components/ApplicationLeadForm/ApplicationLeadForm.js +5 -3
- package/dist/components/ApplicationLeadForm/ApplicationLeadForm.js.map +1 -1
- package/dist/components/ApplicationLeadForm/ApplicationLeadFormContent.d.ts +2 -0
- package/dist/components/ApplicationLeadForm/useApplicationLeadApi.d.ts +2 -1
- package/dist/components/ApplicationLeadForm/useApplicationLeadApi.js +28 -21
- package/dist/components/ApplicationLeadForm/useApplicationLeadApi.js.map +1 -1
- package/dist/components/ApplicationLeadForm/useInitApplicationLead.d.ts +3 -1
- package/dist/components/ApplicationLeadForm/useInitApplicationLead.js +34 -3
- package/dist/components/ApplicationLeadForm/useInitApplicationLead.js.map +1 -1
- package/dist/icons/IconName.d.ts +4 -2
- package/dist/icons/IconName.js +3 -1
- package/dist/icons/IconName.js.map +1 -1
- package/dist/ui-kit/ConsentBkiDialog/useConsentBkiDialog.d.ts +1 -1
- package/dist/ui-kit/ConsentBkiDialog/useConsentBkiDialog.js +4 -7
- package/dist/ui-kit/ConsentBkiDialog/useConsentBkiDialog.js.map +1 -1
- package/dist/ui-kit/EsiaLoginDialog/EsiaLoginDialog.d.ts +4 -0
- package/dist/ui-kit/EsiaLoginDialog/EsiaLoginDialog.js +21 -0
- package/dist/ui-kit/EsiaLoginDialog/EsiaLoginDialog.js.map +1 -0
- package/dist/ui-kit/EsiaLoginDialog/useEsiaLoginDialog.d.ts +9 -0
- package/dist/ui-kit/EsiaLoginDialog/useEsiaLoginDialog.js +19 -0
- package/dist/ui-kit/EsiaLoginDialog/useEsiaLoginDialog.js.map +1 -0
- package/lib/api/RetailAPI/getLink.d.ts +7 -0
- package/lib/api/RetailAPI/getLink.js +3 -0
- package/lib/api/RetailAPI/getLink.js.map +1 -0
- package/lib/api/RetailAPI/updateProfileEsia.d.ts +66 -0
- package/lib/api/RetailAPI/updateProfileEsia.js +3 -0
- package/lib/api/RetailAPI/updateProfileEsia.js.map +1 -0
- package/lib/common.css +1 -1
- package/lib/components/ApplicationLeadForm/ApplicationLeadForm.js +6 -4
- package/lib/components/ApplicationLeadForm/ApplicationLeadForm.js.map +1 -1
- package/lib/components/ApplicationLeadForm/ApplicationLeadFormContent.d.ts +2 -0
- package/lib/components/ApplicationLeadForm/useApplicationLeadApi.d.ts +2 -1
- package/lib/components/ApplicationLeadForm/useApplicationLeadApi.js +28 -21
- package/lib/components/ApplicationLeadForm/useApplicationLeadApi.js.map +1 -1
- package/lib/components/ApplicationLeadForm/useInitApplicationLead.d.ts +3 -1
- package/lib/components/ApplicationLeadForm/useInitApplicationLead.js +35 -4
- package/lib/components/ApplicationLeadForm/useInitApplicationLead.js.map +1 -1
- package/lib/icons/IconName.d.ts +4 -2
- package/lib/icons/IconName.js +3 -1
- package/lib/icons/IconName.js.map +1 -1
- package/lib/ui-kit/ConsentBkiDialog/useConsentBkiDialog.d.ts +1 -1
- package/lib/ui-kit/ConsentBkiDialog/useConsentBkiDialog.js +4 -7
- package/lib/ui-kit/ConsentBkiDialog/useConsentBkiDialog.js.map +1 -1
- package/lib/ui-kit/EsiaLoginDialog/EsiaLoginDialog.d.ts +4 -0
- package/lib/ui-kit/EsiaLoginDialog/EsiaLoginDialog.fixture.d.ts +6 -0
- package/lib/ui-kit/EsiaLoginDialog/EsiaLoginDialog.js +19 -0
- package/lib/ui-kit/EsiaLoginDialog/EsiaLoginDialog.js.map +1 -0
- package/lib/ui-kit/EsiaLoginDialog/useEsiaLoginDialog.d.ts +9 -0
- package/lib/ui-kit/EsiaLoginDialog/useEsiaLoginDialog.js +16 -0
- package/lib/ui-kit/EsiaLoginDialog/useEsiaLoginDialog.js.map +1 -0
- package/mobile/bundle/api/RetailAPI/getLink.d.ts +7 -0
- package/mobile/bundle/api/RetailAPI/updateProfileEsia.d.ts +66 -0
- package/mobile/bundle/bundle.umd.js +100 -39
- package/mobile/bundle/bundle.umd.min.js +1 -1
- package/mobile/bundle/components/ApplicationLeadForm/ApplicationLeadFormContent.d.ts +2 -0
- package/mobile/bundle/components/ApplicationLeadForm/useApplicationLeadApi.d.ts +2 -1
- package/mobile/bundle/components/ApplicationLeadForm/useInitApplicationLead.d.ts +3 -1
- package/mobile/bundle/icons/IconName.d.ts +4 -2
- package/mobile/bundle/ui-kit/ConsentBkiDialog/useConsentBkiDialog.d.ts +1 -1
- package/mobile/bundle/ui-kit/EsiaLoginDialog/EsiaLoginDialog.d.ts +4 -0
- package/mobile/bundle/ui-kit/EsiaLoginDialog/useEsiaLoginDialog.d.ts +9 -0
- package/mobile/dist/api/RetailAPI/getLink.d.ts +7 -0
- package/mobile/dist/api/RetailAPI/getLink.js +6 -0
- package/mobile/dist/api/RetailAPI/getLink.js.map +1 -0
- package/mobile/dist/api/RetailAPI/updateProfileEsia.d.ts +66 -0
- package/mobile/dist/api/RetailAPI/updateProfileEsia.js +6 -0
- package/mobile/dist/api/RetailAPI/updateProfileEsia.js.map +1 -0
- package/mobile/dist/components/ApplicationLeadForm/ApplicationLeadForm.js +5 -3
- package/mobile/dist/components/ApplicationLeadForm/ApplicationLeadForm.js.map +1 -1
- package/mobile/dist/components/ApplicationLeadForm/ApplicationLeadFormContent.d.ts +2 -0
- package/mobile/dist/components/ApplicationLeadForm/useApplicationLeadApi.d.ts +2 -1
- package/mobile/dist/components/ApplicationLeadForm/useApplicationLeadApi.js +28 -21
- 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 +34 -3
- package/mobile/dist/components/ApplicationLeadForm/useInitApplicationLead.js.map +1 -1
- package/mobile/dist/icons/IconName.d.ts +4 -2
- package/mobile/dist/icons/IconName.js +3 -1
- package/mobile/dist/icons/IconName.js.map +1 -1
- package/mobile/dist/ui-kit/ConsentBkiDialog/useConsentBkiDialog.d.ts +1 -1
- package/mobile/dist/ui-kit/ConsentBkiDialog/useConsentBkiDialog.js +4 -7
- package/mobile/dist/ui-kit/ConsentBkiDialog/useConsentBkiDialog.js.map +1 -1
- package/mobile/dist/ui-kit/EsiaLoginDialog/EsiaLoginDialog.d.ts +4 -0
- package/mobile/dist/ui-kit/EsiaLoginDialog/EsiaLoginDialog.js +21 -0
- package/mobile/dist/ui-kit/EsiaLoginDialog/EsiaLoginDialog.js.map +1 -0
- package/mobile/dist/ui-kit/EsiaLoginDialog/useEsiaLoginDialog.d.ts +9 -0
- package/mobile/dist/ui-kit/EsiaLoginDialog/useEsiaLoginDialog.js +19 -0
- package/mobile/dist/ui-kit/EsiaLoginDialog/useEsiaLoginDialog.js.map +1 -0
- package/mobile/lib/api/RetailAPI/getLink.d.ts +7 -0
- package/mobile/lib/api/RetailAPI/getLink.js +3 -0
- package/mobile/lib/api/RetailAPI/getLink.js.map +1 -0
- package/mobile/lib/api/RetailAPI/updateProfileEsia.d.ts +66 -0
- package/mobile/lib/api/RetailAPI/updateProfileEsia.js +3 -0
- package/mobile/lib/api/RetailAPI/updateProfileEsia.js.map +1 -0
- package/mobile/lib/common.css +1 -1
- package/mobile/lib/components/ApplicationLeadForm/ApplicationLeadForm.js +6 -4
- package/mobile/lib/components/ApplicationLeadForm/ApplicationLeadForm.js.map +1 -1
- package/mobile/lib/components/ApplicationLeadForm/ApplicationLeadFormContent.d.ts +2 -0
- package/mobile/lib/components/ApplicationLeadForm/useApplicationLeadApi.d.ts +2 -1
- package/mobile/lib/components/ApplicationLeadForm/useApplicationLeadApi.js +28 -21
- 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 +35 -4
- package/mobile/lib/components/ApplicationLeadForm/useInitApplicationLead.js.map +1 -1
- package/mobile/lib/icons/IconName.d.ts +4 -2
- package/mobile/lib/icons/IconName.js +3 -1
- package/mobile/lib/icons/IconName.js.map +1 -1
- package/mobile/lib/ui-kit/ConsentBkiDialog/useConsentBkiDialog.d.ts +1 -1
- package/mobile/lib/ui-kit/ConsentBkiDialog/useConsentBkiDialog.js +4 -7
- package/mobile/lib/ui-kit/ConsentBkiDialog/useConsentBkiDialog.js.map +1 -1
- package/mobile/lib/ui-kit/EsiaLoginDialog/EsiaLoginDialog.d.ts +4 -0
- package/mobile/lib/ui-kit/EsiaLoginDialog/EsiaLoginDialog.js +19 -0
- package/mobile/lib/ui-kit/EsiaLoginDialog/EsiaLoginDialog.js.map +1 -0
- package/mobile/lib/ui-kit/EsiaLoginDialog/useEsiaLoginDialog.d.ts +9 -0
- package/mobile/lib/ui-kit/EsiaLoginDialog/useEsiaLoginDialog.js +16 -0
- package/mobile/lib/ui-kit/EsiaLoginDialog/useEsiaLoginDialog.js.map +1 -0
- package/mobile/src/api/RetailAPI/getLink.ts +12 -0
- package/mobile/src/api/RetailAPI/updateProfileEsia.ts +71 -0
- package/mobile/src/components/ApplicationLeadForm/ApplicationLeadForm.tsx +16 -3
- package/mobile/src/components/ApplicationLeadForm/ApplicationLeadFormContent.ts +2 -0
- package/mobile/src/components/ApplicationLeadForm/useApplicationLeadApi.ts +53 -26
- package/mobile/src/components/ApplicationLeadForm/useInitApplicationLead.ts +40 -4
- package/mobile/src/icons/GosUslugiIcon.svg +11 -0
- package/mobile/src/icons/IconName.ts +5 -5
- package/mobile/src/ui-kit/ConsentBkiDialog/useConsentBkiDialog.tsx +4 -8
- package/mobile/src/ui-kit/EsiaLoginDialog/EsiaLoginDialog.tsx +44 -0
- package/mobile/src/ui-kit/EsiaLoginDialog/useEsiaLoginDialog.tsx +23 -0
- package/package.json +1 -1
- package/src/api/RetailAPI/getLink.ts +12 -0
- package/src/api/RetailAPI/updateProfileEsia.ts +71 -0
- package/src/components/ApplicationLeadForm/ApplicationLeadForm.tsx +16 -3
- package/src/components/ApplicationLeadForm/ApplicationLeadFormContent.ts +2 -0
- package/src/components/ApplicationLeadForm/useApplicationLeadApi.ts +53 -26
- package/src/components/ApplicationLeadForm/useInitApplicationLead.ts +40 -4
- package/src/icons/GosUslugiIcon.svg +11 -0
- package/src/icons/IconName.ts +360 -6
- package/src/ui-kit/ConsentBkiDialog/useConsentBkiDialog.tsx +4 -8
- package/src/ui-kit/EsiaLoginDialog/EsiaLoginDialog.fixture.tsx +7 -0
- package/src/ui-kit/EsiaLoginDialog/EsiaLoginDialog.tsx +44 -0
- package/src/ui-kit/EsiaLoginDialog/useEsiaLoginDialog.tsx +23 -0
package/bundle/bundle.umd.js
CHANGED
|
@@ -2756,6 +2756,10 @@
|
|
|
2756
2756
|
return [storedValue, setValue];
|
|
2757
2757
|
}
|
|
2758
2758
|
|
|
2759
|
+
const Loader = JSX(({ color = 'text-primary-main', position = 'absolute', blur = true }) => (jsx("div", { className: style('flex justify-center items-center h-full w-full z-50', position, {
|
|
2760
|
+
'backdrop-blur': blur,
|
|
2761
|
+
}), children: jsx("div", { className: style('inline-block h-28 w-28', 'animate-spin rounded-full', 'border-8 border-solid border-current', 'border-r-transparent', color), role: "status" }) })));
|
|
2762
|
+
|
|
2759
2763
|
const Foldable = JSX(({ className = '', isFoldButtonOnTop = false, unfoldedByDefault = false, renderFoldableSection, renderFoldButton, }) => {
|
|
2760
2764
|
const [isUnfolded, setIsUnfolded] = useState(unfoldedByDefault);
|
|
2761
2765
|
const onToggle = useCallback(() => {
|
|
@@ -3011,10 +3015,6 @@
|
|
|
3011
3015
|
};
|
|
3012
3016
|
};
|
|
3013
3017
|
|
|
3014
|
-
const Loader = JSX(({ color = 'text-primary-main', position = 'absolute', blur = true }) => (jsx("div", { className: style('flex justify-center items-center h-full w-full z-50', position, {
|
|
3015
|
-
'backdrop-blur': blur,
|
|
3016
|
-
}), children: jsx("div", { className: style('inline-block h-28 w-28', 'animate-spin rounded-full', 'border-8 border-solid border-current', 'border-r-transparent', color), role: "status" }) })));
|
|
3017
|
-
|
|
3018
3018
|
const Timer = JSX(({ time, setTime, className }) => {
|
|
3019
3019
|
useEffect(() => {
|
|
3020
3020
|
const timer = setInterval(() => {
|
|
@@ -3218,12 +3218,9 @@
|
|
|
3218
3218
|
];
|
|
3219
3219
|
const CONSENT_BKI_ID = 2;
|
|
3220
3220
|
|
|
3221
|
-
const useConsentBkiDialog = () => {
|
|
3221
|
+
const useConsentBkiDialog = (onClose) => {
|
|
3222
3222
|
const { open, closeAll } = useDialogManager();
|
|
3223
3223
|
const verifyPhoneDialog = useVerifyPhoneDialog();
|
|
3224
|
-
const redirectToCreditForm = () => {
|
|
3225
|
-
globalThis.location.href = '/credit-lead';
|
|
3226
|
-
};
|
|
3227
3224
|
const handleSuccessVerify = (profileId) => async (smsCode) => {
|
|
3228
3225
|
if (profileId) {
|
|
3229
3226
|
await updateUserProfile({
|
|
@@ -3234,7 +3231,7 @@
|
|
|
3234
3231
|
},
|
|
3235
3232
|
});
|
|
3236
3233
|
}
|
|
3237
|
-
|
|
3234
|
+
onClose();
|
|
3238
3235
|
};
|
|
3239
3236
|
const handleSubmitBkiConstent = (phone, profileId) => async (confirmStatus) => {
|
|
3240
3237
|
await closeAll();
|
|
@@ -3242,11 +3239,11 @@
|
|
|
3242
3239
|
verifyPhoneDialog.open(handleSuccessVerify(profileId), verifyPhoneContent$1(phone));
|
|
3243
3240
|
}
|
|
3244
3241
|
else {
|
|
3245
|
-
|
|
3242
|
+
onClose();
|
|
3246
3243
|
}
|
|
3247
3244
|
};
|
|
3248
3245
|
return {
|
|
3249
|
-
open: (phone, profileId) => open(jsx(ConsentBkiDialog, { handleSubmit: handleSubmitBkiConstent(phone, profileId), onClose:
|
|
3246
|
+
open: (phone, profileId) => open(jsx(ConsentBkiDialog, { handleSubmit: handleSubmitBkiConstent(phone, profileId), onClose: onClose })),
|
|
3250
3247
|
};
|
|
3251
3248
|
};
|
|
3252
3249
|
const verifyPhoneContent$1 = (phone) => ({
|
|
@@ -3258,12 +3255,39 @@
|
|
|
3258
3255
|
<ul><li>согласие на запрос информации в БКИ</li></ul>`,
|
|
3259
3256
|
});
|
|
3260
3257
|
|
|
3261
|
-
const
|
|
3258
|
+
const getLink = (body) => doRequest('/esia/getLink', 'POST', body);
|
|
3259
|
+
|
|
3260
|
+
const EsiaLoginDialog = JSX(function ({ handleClose }) {
|
|
3261
|
+
const handleAuth = useCallback(async () => {
|
|
3262
|
+
const resp = await getLink({
|
|
3263
|
+
redirectUri: globalThis.location.href + '&esiaAuth=true',
|
|
3264
|
+
});
|
|
3265
|
+
if (resp) {
|
|
3266
|
+
globalThis.location.href = resp.link;
|
|
3267
|
+
}
|
|
3268
|
+
}, []);
|
|
3269
|
+
return (jsx(Dialog, { className: "my-6xl max-w-lg w-full min-h-fit mx-auto rounded-lg", onClose: handleClose, children: jsxs("div", { className: "flex flex-col gap-lg items-center rounded-md", children: [jsxs("div", { className: "flex items-center justify-around w-full", children: [jsxs("ul", { className: "list-disc", children: [jsx("li", { children: "\u0412\u0435\u0440\u043E\u044F\u0442\u043D\u043E\u0441\u0442\u044C \u043E\u0434\u043E\u0431\u0440\u0435\u043D\u0438\u044F \u0432\u044B\u0448\u0435" }), jsx("li", { children: "\u0411\u0435\u0437 \u0441\u043F\u0440\u0430\u0432\u043E\u043A \u043E \u0434\u043E\u0445\u043E\u0434\u0430\u0445 \u0438 \u0442\u0440\u0443\u0434\u043E\u0443\u0441\u0442\u0440\u043E\u0439\u0441\u0442\u0432\u0435" }), jsx("li", { children: "\u0421 \u0437\u0430\u0449\u0438\u0442\u043E\u0439 \u0412\u0430\u0448\u0438\u0445 \u0434\u0430\u043D\u043D\u044B\u0445" })] }), jsx(Img, { image: { icon: 'GosUslugiIcon', iconVersion: 'normal' }, height: "70" })] }), jsxs("div", { className: "flex items-center justify-between w-full m-0", children: [jsx(Button, { type: "button", onClick: handleAuth, children: "\u0417\u0430\u043F\u043E\u043B\u043D\u0438\u0442\u044C \u0447\u0435\u0440\u0435\u0437 \u0413\u043E\u0441\u0443\u0441\u043B\u0443\u0433\u0438" }), jsx(Button, { type: "button", version: "secondary", onClick: handleClose, children: "\u041F\u0440\u043E\u043F\u0443\u0441\u0442\u0438\u0442\u044C" })] })] }) }));
|
|
3270
|
+
});
|
|
3271
|
+
|
|
3272
|
+
const useEsiaLoginDialog = (nextStepLink) => {
|
|
3273
|
+
const { open, close } = useDialogManager();
|
|
3274
|
+
const handleClose = useCallback(() => {
|
|
3275
|
+
close();
|
|
3276
|
+
globalThis.location.href = nextStepLink;
|
|
3277
|
+
}, []);
|
|
3278
|
+
return {
|
|
3279
|
+
open: (options = {}) => open(jsx(EsiaLoginDialog, { handleClose: handleClose }), options),
|
|
3280
|
+
close,
|
|
3281
|
+
};
|
|
3282
|
+
};
|
|
3283
|
+
|
|
3284
|
+
const useApplicationLeadApi = ({ inputs, programId, nextStepLink, saveForm, }) => {
|
|
3262
3285
|
const [responseStatus, setResponseStatus] = useState('');
|
|
3263
3286
|
const [, setTaskId] = useLocalStorage('taskId');
|
|
3264
3287
|
const [, setProfileId] = useLocalStorage('profileId');
|
|
3265
3288
|
const [, setParticipantId] = useLocalStorage('participantId');
|
|
3266
|
-
const
|
|
3289
|
+
const esiaLoginDialog = useEsiaLoginDialog(nextStepLink);
|
|
3290
|
+
const consentBkiDialog = useConsentBkiDialog(esiaLoginDialog.open);
|
|
3267
3291
|
const verifyPhoneDialog = useVerifyPhoneDialog();
|
|
3268
3292
|
const saveUserData = useCallback((participantId, taskId, profileId) => {
|
|
3269
3293
|
setParticipantId(participantId);
|
|
@@ -3277,40 +3301,29 @@
|
|
|
3277
3301
|
return 'Fail';
|
|
3278
3302
|
}
|
|
3279
3303
|
try {
|
|
3280
|
-
const { profile } = await createUserProfile({
|
|
3304
|
+
const { profile: { id: profileId }, } = await createUserProfile({
|
|
3281
3305
|
profile: { phone: formatPhone(formData.phone) },
|
|
3282
3306
|
});
|
|
3283
|
-
const profileId = profile?.id;
|
|
3284
|
-
const transformedForm = transformOtherConsentsField(formData);
|
|
3285
3307
|
if (profileId && formData?.phone) {
|
|
3286
3308
|
const handleSuccessVerify = async () => {
|
|
3287
3309
|
try {
|
|
3288
|
-
await
|
|
3289
|
-
const { taskId, participantId } = await createDraftTask({
|
|
3290
|
-
profileId,
|
|
3310
|
+
await updateUserData({
|
|
3291
3311
|
programId,
|
|
3292
|
-
});
|
|
3293
|
-
await updateUserTask(getUpdateUserTaskData({
|
|
3294
|
-
participantId,
|
|
3295
|
-
taskId,
|
|
3296
3312
|
profileId,
|
|
3297
|
-
formData
|
|
3298
|
-
|
|
3299
|
-
|
|
3300
|
-
|
|
3313
|
+
formData,
|
|
3314
|
+
saveUserData,
|
|
3315
|
+
saveForm,
|
|
3316
|
+
});
|
|
3317
|
+
consentBkiDialog.open(formData.phone, profileId);
|
|
3301
3318
|
}
|
|
3302
3319
|
catch {
|
|
3303
3320
|
setResponseStatus('Fail');
|
|
3304
3321
|
}
|
|
3305
3322
|
};
|
|
3306
|
-
const handleCloseVerify = async () => {
|
|
3307
|
-
await handleSuccessVerify();
|
|
3308
|
-
consentBkiDialog.open(formData.phone, profileId);
|
|
3309
|
-
};
|
|
3310
3323
|
const acceptedConsents = Object.keys(CONSENTS)
|
|
3311
3324
|
.filter((_) => formData[_])
|
|
3312
3325
|
.map((_) => CONSENTS[_]?.text);
|
|
3313
|
-
verifyPhoneDialog.open(
|
|
3326
|
+
verifyPhoneDialog.open(handleSuccessVerify, verifyPhoneContent(formData?.phone, acceptedConsents));
|
|
3314
3327
|
}
|
|
3315
3328
|
}
|
|
3316
3329
|
catch {
|
|
@@ -3322,6 +3335,22 @@
|
|
|
3322
3335
|
responseStatus,
|
|
3323
3336
|
};
|
|
3324
3337
|
};
|
|
3338
|
+
const updateUserData = async ({ programId, profileId, formData, saveUserData, saveForm, }) => {
|
|
3339
|
+
const transformedForm = transformOtherConsentsField(formData);
|
|
3340
|
+
await updateUserProfile(getUpdateUserProfileData(profileId, transformedForm));
|
|
3341
|
+
const { taskId, participantId } = await createDraftTask({
|
|
3342
|
+
profileId,
|
|
3343
|
+
programId,
|
|
3344
|
+
});
|
|
3345
|
+
await updateUserTask(getUpdateUserTaskData({
|
|
3346
|
+
participantId,
|
|
3347
|
+
taskId,
|
|
3348
|
+
profileId,
|
|
3349
|
+
formData: transformedForm,
|
|
3350
|
+
}));
|
|
3351
|
+
saveUserData(participantId, taskId, profileId);
|
|
3352
|
+
saveForm(formData);
|
|
3353
|
+
};
|
|
3325
3354
|
const verifyPhoneContent = (phone, consents) => ({
|
|
3326
3355
|
title: 'Подтвердите номер телефона',
|
|
3327
3356
|
description: `Мы отправили код на ${phone}`,
|
|
@@ -3340,22 +3369,54 @@
|
|
|
3340
3369
|
};
|
|
3341
3370
|
};
|
|
3342
3371
|
|
|
3343
|
-
const
|
|
3372
|
+
const updateProfileEsia = (body) => doRequest('/esia/updateProfileEsia', 'POST', body);
|
|
3373
|
+
|
|
3374
|
+
const useInitApplicationLead = (nextStepLink) => {
|
|
3375
|
+
const [isLoading, setIsLoading] = useState(false);
|
|
3376
|
+
const [profileId] = useLocalStorage('profileId');
|
|
3377
|
+
const [, setEsiaData] = useLocalStorage('esiaData');
|
|
3378
|
+
const params = new URLSearchParams(decodeURIComponent(window.location.search));
|
|
3379
|
+
const esiaAuth = params.get('esiaAuth');
|
|
3380
|
+
const updateEsiaProfile = useCallback(async () => {
|
|
3381
|
+
const code = params.get('code');
|
|
3382
|
+
const state = params.get('state');
|
|
3383
|
+
if (profileId && code && state) {
|
|
3384
|
+
const data = await updateProfileEsia({
|
|
3385
|
+
profileId: profileId,
|
|
3386
|
+
code,
|
|
3387
|
+
state,
|
|
3388
|
+
redirectUri: globalThis.location.href,
|
|
3389
|
+
});
|
|
3390
|
+
setEsiaData(JSON.stringify(data));
|
|
3391
|
+
globalThis.location.href = nextStepLink;
|
|
3392
|
+
}
|
|
3393
|
+
}, []);
|
|
3344
3394
|
useEffect(() => {
|
|
3345
|
-
|
|
3346
|
-
|
|
3395
|
+
if (esiaAuth) {
|
|
3396
|
+
setIsLoading(true);
|
|
3397
|
+
updateEsiaProfile();
|
|
3398
|
+
}
|
|
3399
|
+
else {
|
|
3400
|
+
setEsiaData('');
|
|
3401
|
+
sessionStorage.removeItem('accessToken');
|
|
3402
|
+
sessionStorage.removeItem('refreshToken');
|
|
3403
|
+
}
|
|
3347
3404
|
}, []);
|
|
3405
|
+
return {
|
|
3406
|
+
isLoading,
|
|
3407
|
+
};
|
|
3348
3408
|
};
|
|
3349
3409
|
|
|
3350
|
-
const ApplicationLeadForm = JSX(({ className, title, programId = '', typeForm = '', sections = [], button, ...rest }) => {
|
|
3410
|
+
const ApplicationLeadForm = JSX(({ className, title, programId = '', nextStepLink = '/credit-lead', typeForm = '', sections = [], button, ...rest }) => {
|
|
3351
3411
|
const inputs = (sections?.flatMap((_) => _?.inputs) || []);
|
|
3352
3412
|
const [responseType, setResponseType] = useState('');
|
|
3353
|
-
useInitApplicationLead();
|
|
3413
|
+
const { isLoading } = useInitApplicationLead(nextStepLink);
|
|
3354
3414
|
const [leadForm, setLeadForm] = useLocalStorage('leadForm');
|
|
3355
3415
|
const initialFormState = getInitialFormState$1(inputs, leadForm, typeForm);
|
|
3356
3416
|
const { handleSubmit, responseStatus } = useApplicationLeadApi({
|
|
3357
3417
|
inputs,
|
|
3358
3418
|
programId,
|
|
3419
|
+
nextStepLink,
|
|
3359
3420
|
saveForm: setLeadForm,
|
|
3360
3421
|
});
|
|
3361
3422
|
if (responseStatus) {
|
|
@@ -3369,7 +3430,7 @@
|
|
|
3369
3430
|
reset();
|
|
3370
3431
|
}
|
|
3371
3432
|
}, [responseType]);
|
|
3372
|
-
return (jsx(ApplicationFormLayout, { className: style('container space-y-m', className), title: title, ...rest, children: jsxs("form", { onSubmit: onSubmit, className: "space-y-m", children: [sections.map((_, i) => (jsxs("div", { className: style(inputColumnStyles(_.columns), 'grid gap-x-m'), children: [renderTitle(_.title), renderInputs$1({ field, inputs: _?.inputs })] }, `section-${i}`))), renderSubmitButton(button)] }) }));
|
|
3433
|
+
return (jsx(ApplicationFormLayout, { className: style('container space-y-m', className), title: title, ...rest, children: jsxs("form", { onSubmit: onSubmit, className: "space-y-m relative", children: [isLoading ? jsx(Loader, { blur: false }) : null, sections.map((_, i) => (jsxs("div", { className: style(inputColumnStyles(_.columns), 'grid gap-x-m'), children: [renderTitle(_.title), renderInputs$1({ field, inputs: _?.inputs })] }, `section-${i}`))), renderSubmitButton(button)] }) }));
|
|
3373
3434
|
});
|
|
3374
3435
|
|
|
3375
3436
|
const InfoCard = JSX(({ __html, icon = 'InfoCircleIcon', iconVersion = 'black', link }) => (jsxs("div", { className: "flex flex-row items-center w-full min-h-14 bg-main-gray rounded-lg gap-m p-m", children: [jsx("div", { className: "rounded-full bg-white p-xs", children: jsx(Icon, { name: icon, width: "24", height: "24", iconVersion: iconVersion }) }), jsxs("div", { className: "", children: [jsx(RichText, { __html: __html }), link?.text ? jsx(LinkButton, { className: "text-primary-main", children: link.text }) : null] })] })));
|
|
@@ -8186,7 +8247,7 @@
|
|
|
8186
8247
|
slots: () => [HEADER_SLOT, FOOTER_SLOT, STICKY_FOOTER_SLOT],
|
|
8187
8248
|
});
|
|
8188
8249
|
|
|
8189
|
-
const packageVersion = "0.14.
|
|
8250
|
+
const packageVersion = "0.14.619";
|
|
8190
8251
|
|
|
8191
8252
|
exports.Blocks = Blocks;
|
|
8192
8253
|
exports.ContentPage = ContentPage;
|