@redneckz/wildless-cms-uni-blocks 0.14.608 → 0.14.609
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/updateUserProfile.d.ts +2 -0
- package/bundle/bundle.umd.js +100 -28
- package/bundle/bundle.umd.min.js +1 -1
- package/bundle/ui-kit/ConsentBkiDialog/ConsentBkiDialog.d.ts +5 -0
- package/bundle/ui-kit/ConsentBkiDialog/useConsentBkiDialog.d.ts +3 -0
- package/bundle/ui-kit/DialogManager/openDocument.d.ts +2 -0
- package/bundle/ui-kit/VerifyPhoneDialog/VerifyPhoneDialog.d.ts +1 -1
- package/bundle/ui-kit/VerifyPhoneDialog/useVerifyPhoneDialog.d.ts +2 -3
- package/bundle/ui-kit/VerifyPhoneDialog/useVerifyPhoneDialogSubmit.d.ts +1 -1
- package/dist/api/RetailAPI/updateUserProfile.d.ts +2 -0
- package/dist/api/RetailAPI/updateUserProfile.js +1 -1
- package/dist/api/RetailAPI/updateUserProfile.js.map +1 -1
- package/dist/components/ApplicationLeadForm/useApplicationLeadApi.js +8 -7
- package/dist/components/ApplicationLeadForm/useApplicationLeadApi.js.map +1 -1
- package/dist/ui-kit/Checkbox/CheckboxWithDoc.js +2 -7
- package/dist/ui-kit/Checkbox/CheckboxWithDoc.js.map +1 -1
- package/dist/ui-kit/ConsentBkiDialog/ConsentBkiDialog.d.ts +5 -0
- package/dist/ui-kit/ConsentBkiDialog/ConsentBkiDialog.js +44 -0
- package/dist/ui-kit/ConsentBkiDialog/ConsentBkiDialog.js.map +1 -0
- package/dist/ui-kit/ConsentBkiDialog/useConsentBkiDialog.d.ts +3 -0
- package/dist/ui-kit/ConsentBkiDialog/useConsentBkiDialog.js +49 -0
- package/dist/ui-kit/ConsentBkiDialog/useConsentBkiDialog.js.map +1 -0
- package/dist/ui-kit/DialogManager/openDocument.d.ts +2 -0
- package/dist/ui-kit/DialogManager/openDocument.js +11 -0
- package/dist/ui-kit/DialogManager/openDocument.js.map +1 -0
- package/dist/ui-kit/VerifyPhoneDialog/VerifyPhoneDialog.d.ts +1 -1
- package/dist/ui-kit/VerifyPhoneDialog/useVerifyPhoneDialog.d.ts +2 -3
- package/dist/ui-kit/VerifyPhoneDialog/useVerifyPhoneDialog.js +2 -2
- package/dist/ui-kit/VerifyPhoneDialog/useVerifyPhoneDialog.js.map +1 -1
- package/dist/ui-kit/VerifyPhoneDialog/useVerifyPhoneDialogSubmit.d.ts +1 -1
- package/dist/ui-kit/VerifyPhoneDialog/useVerifyPhoneDialogSubmit.js +1 -1
- package/dist/ui-kit/VerifyPhoneDialog/useVerifyPhoneDialogSubmit.js.map +1 -1
- package/lib/api/RetailAPI/updateUserProfile.d.ts +2 -0
- package/lib/api/RetailAPI/updateUserProfile.js +1 -1
- package/lib/api/RetailAPI/updateUserProfile.js.map +1 -1
- package/lib/common.css +1 -1
- package/lib/components/ApplicationLeadForm/useApplicationLeadApi.js +8 -7
- package/lib/components/ApplicationLeadForm/useApplicationLeadApi.js.map +1 -1
- package/lib/ui-kit/Checkbox/CheckboxWithDoc.js +2 -7
- package/lib/ui-kit/Checkbox/CheckboxWithDoc.js.map +1 -1
- package/lib/ui-kit/ConsentBkiDialog/ConsentBkiDialog.d.ts +5 -0
- package/lib/ui-kit/ConsentBkiDialog/ConsentBkiDialog.fixture.d.ts +6 -0
- package/lib/ui-kit/ConsentBkiDialog/ConsentBkiDialog.js +42 -0
- package/lib/ui-kit/ConsentBkiDialog/ConsentBkiDialog.js.map +1 -0
- package/lib/ui-kit/ConsentBkiDialog/useConsentBkiDialog.d.ts +3 -0
- package/lib/ui-kit/ConsentBkiDialog/useConsentBkiDialog.js +46 -0
- package/lib/ui-kit/ConsentBkiDialog/useConsentBkiDialog.js.map +1 -0
- package/lib/ui-kit/DialogManager/openDocument.d.ts +2 -0
- package/lib/ui-kit/DialogManager/openDocument.js +8 -0
- package/lib/ui-kit/DialogManager/openDocument.js.map +1 -0
- package/lib/ui-kit/VerifyPhoneDialog/VerifyPhoneDialog.d.ts +1 -1
- package/lib/ui-kit/VerifyPhoneDialog/useVerifyPhoneDialog.d.ts +2 -3
- package/lib/ui-kit/VerifyPhoneDialog/useVerifyPhoneDialog.js +2 -2
- package/lib/ui-kit/VerifyPhoneDialog/useVerifyPhoneDialog.js.map +1 -1
- package/lib/ui-kit/VerifyPhoneDialog/useVerifyPhoneDialogSubmit.d.ts +1 -1
- package/lib/ui-kit/VerifyPhoneDialog/useVerifyPhoneDialogSubmit.js +1 -1
- package/lib/ui-kit/VerifyPhoneDialog/useVerifyPhoneDialogSubmit.js.map +1 -1
- package/mobile/bundle/api/RetailAPI/updateUserProfile.d.ts +2 -0
- package/mobile/bundle/bundle.umd.js +100 -28
- package/mobile/bundle/bundle.umd.min.js +1 -1
- package/mobile/bundle/ui-kit/ConsentBkiDialog/ConsentBkiDialog.d.ts +5 -0
- package/mobile/bundle/ui-kit/ConsentBkiDialog/useConsentBkiDialog.d.ts +3 -0
- package/mobile/bundle/ui-kit/DialogManager/openDocument.d.ts +2 -0
- package/mobile/bundle/ui-kit/VerifyPhoneDialog/VerifyPhoneDialog.d.ts +1 -1
- package/mobile/bundle/ui-kit/VerifyPhoneDialog/useVerifyPhoneDialog.d.ts +2 -3
- package/mobile/bundle/ui-kit/VerifyPhoneDialog/useVerifyPhoneDialogSubmit.d.ts +1 -1
- package/mobile/dist/api/RetailAPI/updateUserProfile.d.ts +2 -0
- package/mobile/dist/api/RetailAPI/updateUserProfile.js +1 -1
- package/mobile/dist/api/RetailAPI/updateUserProfile.js.map +1 -1
- package/mobile/dist/components/ApplicationLeadForm/useApplicationLeadApi.js +8 -7
- package/mobile/dist/components/ApplicationLeadForm/useApplicationLeadApi.js.map +1 -1
- package/mobile/dist/ui-kit/Checkbox/CheckboxWithDoc.js +2 -7
- package/mobile/dist/ui-kit/Checkbox/CheckboxWithDoc.js.map +1 -1
- package/mobile/dist/ui-kit/ConsentBkiDialog/ConsentBkiDialog.d.ts +5 -0
- package/mobile/dist/ui-kit/ConsentBkiDialog/ConsentBkiDialog.js +44 -0
- package/mobile/dist/ui-kit/ConsentBkiDialog/ConsentBkiDialog.js.map +1 -0
- package/mobile/dist/ui-kit/ConsentBkiDialog/useConsentBkiDialog.d.ts +3 -0
- package/mobile/dist/ui-kit/ConsentBkiDialog/useConsentBkiDialog.js +49 -0
- package/mobile/dist/ui-kit/ConsentBkiDialog/useConsentBkiDialog.js.map +1 -0
- package/mobile/dist/ui-kit/DialogManager/openDocument.d.ts +2 -0
- package/mobile/dist/ui-kit/DialogManager/openDocument.js +11 -0
- package/mobile/dist/ui-kit/DialogManager/openDocument.js.map +1 -0
- package/mobile/dist/ui-kit/VerifyPhoneDialog/VerifyPhoneDialog.d.ts +1 -1
- package/mobile/dist/ui-kit/VerifyPhoneDialog/useVerifyPhoneDialog.d.ts +2 -3
- package/mobile/dist/ui-kit/VerifyPhoneDialog/useVerifyPhoneDialog.js +2 -2
- package/mobile/dist/ui-kit/VerifyPhoneDialog/useVerifyPhoneDialog.js.map +1 -1
- package/mobile/dist/ui-kit/VerifyPhoneDialog/useVerifyPhoneDialogSubmit.d.ts +1 -1
- package/mobile/dist/ui-kit/VerifyPhoneDialog/useVerifyPhoneDialogSubmit.js +1 -1
- package/mobile/dist/ui-kit/VerifyPhoneDialog/useVerifyPhoneDialogSubmit.js.map +1 -1
- package/mobile/lib/api/RetailAPI/updateUserProfile.d.ts +2 -0
- package/mobile/lib/api/RetailAPI/updateUserProfile.js +1 -1
- package/mobile/lib/api/RetailAPI/updateUserProfile.js.map +1 -1
- package/mobile/lib/common.css +1 -1
- package/mobile/lib/components/ApplicationLeadForm/useApplicationLeadApi.js +8 -7
- package/mobile/lib/components/ApplicationLeadForm/useApplicationLeadApi.js.map +1 -1
- package/mobile/lib/ui-kit/Checkbox/CheckboxWithDoc.js +2 -7
- package/mobile/lib/ui-kit/Checkbox/CheckboxWithDoc.js.map +1 -1
- package/mobile/lib/ui-kit/ConsentBkiDialog/ConsentBkiDialog.d.ts +5 -0
- package/mobile/lib/ui-kit/ConsentBkiDialog/ConsentBkiDialog.js +42 -0
- package/mobile/lib/ui-kit/ConsentBkiDialog/ConsentBkiDialog.js.map +1 -0
- package/mobile/lib/ui-kit/ConsentBkiDialog/useConsentBkiDialog.d.ts +3 -0
- package/mobile/lib/ui-kit/ConsentBkiDialog/useConsentBkiDialog.js +46 -0
- package/mobile/lib/ui-kit/ConsentBkiDialog/useConsentBkiDialog.js.map +1 -0
- package/mobile/lib/ui-kit/DialogManager/openDocument.d.ts +2 -0
- package/mobile/lib/ui-kit/DialogManager/openDocument.js +8 -0
- package/mobile/lib/ui-kit/DialogManager/openDocument.js.map +1 -0
- package/mobile/lib/ui-kit/VerifyPhoneDialog/VerifyPhoneDialog.d.ts +1 -1
- package/mobile/lib/ui-kit/VerifyPhoneDialog/useVerifyPhoneDialog.d.ts +2 -3
- package/mobile/lib/ui-kit/VerifyPhoneDialog/useVerifyPhoneDialog.js +2 -2
- package/mobile/lib/ui-kit/VerifyPhoneDialog/useVerifyPhoneDialog.js.map +1 -1
- package/mobile/lib/ui-kit/VerifyPhoneDialog/useVerifyPhoneDialogSubmit.d.ts +1 -1
- package/mobile/lib/ui-kit/VerifyPhoneDialog/useVerifyPhoneDialogSubmit.js +1 -1
- package/mobile/lib/ui-kit/VerifyPhoneDialog/useVerifyPhoneDialogSubmit.js.map +1 -1
- package/mobile/src/api/RetailAPI/updateUserProfile.ts +3 -1
- package/mobile/src/components/ApplicationLeadForm/useApplicationLeadApi.ts +12 -7
- package/mobile/src/ui-kit/Checkbox/CheckboxWithDoc.tsx +2 -16
- package/mobile/src/ui-kit/ConsentBkiDialog/ConsentBkiDialog.tsx +73 -0
- package/mobile/src/ui-kit/ConsentBkiDialog/useConsentBkiDialog.tsx +58 -0
- package/mobile/src/ui-kit/DialogManager/openDocument.tsx +13 -0
- package/mobile/src/ui-kit/VerifyPhoneDialog/VerifyPhoneDialog.tsx +1 -1
- package/mobile/src/ui-kit/VerifyPhoneDialog/useVerifyPhoneDialog.tsx +4 -4
- package/mobile/src/ui-kit/VerifyPhoneDialog/useVerifyPhoneDialogSubmit.tsx +2 -2
- package/package.json +1 -1
- package/src/api/RetailAPI/updateUserProfile.ts +3 -1
- package/src/components/ApplicationLeadForm/useApplicationLeadApi.ts +12 -7
- package/src/ui-kit/Checkbox/CheckboxWithDoc.tsx +2 -16
- package/src/ui-kit/ConsentBkiDialog/ConsentBkiDialog.fixture.tsx +7 -0
- package/src/ui-kit/ConsentBkiDialog/ConsentBkiDialog.tsx +73 -0
- package/src/ui-kit/ConsentBkiDialog/useConsentBkiDialog.tsx +58 -0
- package/src/ui-kit/DialogManager/openDocument.tsx +13 -0
- package/src/ui-kit/VerifyPhoneDialog/VerifyPhoneDialog.tsx +1 -1
- package/src/ui-kit/VerifyPhoneDialog/useVerifyPhoneDialog.tsx +4 -4
- package/src/ui-kit/VerifyPhoneDialog/useVerifyPhoneDialogSubmit.tsx +2 -2
|
@@ -1999,17 +1999,6 @@
|
|
|
1999
1999
|
},
|
|
2000
2000
|
};
|
|
2001
2001
|
|
|
2002
|
-
const CloseButton = JSX(({ className, onClose }) => (jsx("button", { className: style('flex justify-center items-center w-12 h-12 p-2xs bg-transparent border-none', className), onClick: onClose, title: "\u0417\u0430\u043A\u0440\u044B\u0442\u044C", type: "button", children: jsx(Icon, { name: "CloseIcon", width: "20", height: "20", iconVersion: "gray" }) })));
|
|
2003
|
-
|
|
2004
|
-
const Dialog = JSX(({ className, head, children, onClose, onClick }) => {
|
|
2005
|
-
const { close } = useDialogManager();
|
|
2006
|
-
const handleClose = useCallback(() => {
|
|
2007
|
-
close();
|
|
2008
|
-
onClose && onClose();
|
|
2009
|
-
}, [onClose]);
|
|
2010
|
-
return (jsxs("div", { onClick: onClick, className: style('relative min-h-full bg-white pt-0 p-lg', className), role: "dialog", children: [jsxs("div", { className: "sticky py-xl top-0 bg-white z-10", children: [jsx(CloseButton, { className: "absolute top-0 right-0", onClose: handleClose }), jsx("div", { className: "container", children: head })] }), jsx("div", { className: "container pb-6xl", children: children })] }));
|
|
2011
|
-
});
|
|
2012
|
-
|
|
2013
2002
|
async function doRequest(url, method, body) {
|
|
2014
2003
|
const response = await fetch(`${API_BASE_URI}${url}`, {
|
|
2015
2004
|
method,
|
|
@@ -2039,16 +2028,28 @@
|
|
|
2039
2028
|
return URL.createObjectURL(response);
|
|
2040
2029
|
};
|
|
2041
2030
|
|
|
2042
|
-
const
|
|
2043
|
-
|
|
2044
|
-
|
|
2045
|
-
|
|
2031
|
+
const CloseButton = JSX(({ className, onClose }) => (jsx("button", { className: style('flex justify-center items-center w-12 h-12 p-2xs bg-transparent border-none', className), onClick: onClose, title: "\u0417\u0430\u043A\u0440\u044B\u0442\u044C", type: "button", children: jsx(Icon, { name: "CloseIcon", width: "20", height: "20", iconVersion: "gray" }) })));
|
|
2032
|
+
|
|
2033
|
+
const Dialog = JSX(({ className, head, children, onClose, onClick }) => {
|
|
2034
|
+
const { close } = useDialogManager();
|
|
2035
|
+
const handleClose = useCallback(() => {
|
|
2036
|
+
close();
|
|
2037
|
+
onClose && onClose();
|
|
2038
|
+
}, [onClose]);
|
|
2039
|
+
return (jsxs("div", { onClick: onClick, className: style('relative min-h-full bg-white pt-0 p-lg', className), role: "dialog", children: [jsxs("div", { className: "sticky py-xl top-0 bg-white z-10", children: [jsx(CloseButton, { className: "absolute top-0 right-0", onClose: handleClose }), jsx("div", { className: "container", children: head })] }), jsx("div", { className: "container pb-6xl", children: children })] }));
|
|
2046
2040
|
});
|
|
2047
|
-
|
|
2041
|
+
|
|
2042
|
+
const openDocument = async (id, open) => {
|
|
2048
2043
|
const document = await getDocument(id);
|
|
2049
2044
|
open(jsx(Dialog, { className: "my-6xl max-w-4xl mx-auto px-0 min-h-0 pb-0", children: jsx("iframe", { src: `${document}#toolbar=0`, className: "w-full h-[80vh]", id: "iframe-dialog" }) }));
|
|
2050
2045
|
};
|
|
2051
2046
|
|
|
2047
|
+
const OPEN_DOC_BUTTON_TEXT = 'Ознакомиться';
|
|
2048
|
+
const CheckboxWithDoc = JSX(({ className, error, docId, ...props }) => {
|
|
2049
|
+
const { open } = useDialogManager();
|
|
2050
|
+
return (jsxs("div", { className: className, children: [jsxs("div", { className: "flex flex-wrap gap-x-m", children: [jsx(Checkbox, { ...props }), docId ? (jsx(LinkButton, { className: "text-primary-main", onClick: () => openDocument(docId, open), children: jsx(Text, { children: OPEN_DOC_BUTTON_TEXT }) })) : null] }), renderErrorText(error)] }));
|
|
2051
|
+
});
|
|
2052
|
+
|
|
2052
2053
|
const ConsentField = JSX(({ field, input }) => input && input.name ? (jsx(CheckboxWithDoc, { text: CONSENTS[input.name]?.text, docId: CONSENTS[input.name]?.docId, ...getValidation(field(input.name), validatorObj[input.name], input?.required) })) : null);
|
|
2053
2054
|
|
|
2054
2055
|
const LABEL_TEXT =
|
|
@@ -2785,7 +2786,7 @@
|
|
|
2785
2786
|
|
|
2786
2787
|
const createUserProfile = (body) => doRequest('/public-data/createUserProfile', 'POST', body);
|
|
2787
2788
|
|
|
2788
|
-
const updateUserProfile = (body) => doRequest('/user-data/updateUserProfile', '
|
|
2789
|
+
const updateUserProfile = (body) => doRequest('/user-data/updateUserProfile', 'PUT', body);
|
|
2789
2790
|
|
|
2790
2791
|
const updateUserTask = (body) => doRequest('/user-data/updateUserTask', 'PUT', body);
|
|
2791
2792
|
|
|
@@ -3036,7 +3037,7 @@
|
|
|
3036
3037
|
smsCodesSetName: { key: 'AUTHENTICATION' },
|
|
3037
3038
|
});
|
|
3038
3039
|
resetError();
|
|
3039
|
-
close && close();
|
|
3040
|
+
close && close(values.join(''));
|
|
3040
3041
|
}
|
|
3041
3042
|
catch {
|
|
3042
3043
|
setIsLoading(false);
|
|
@@ -3087,19 +3088,92 @@
|
|
|
3087
3088
|
const renderTextButton = (textButton, isDisabled, handleSubmit) => textButton ? (jsx(SubmitButton, { isDisabled: isDisabled, onClick: handleSubmit, text: textButton })) : null;
|
|
3088
3089
|
const renderText$2 = (timeNextReq, setTimeNextReq, sendCode) => timeNextReq ? (jsxs("div", { className: "flex flex-row text-l font-light text-primary-main", children: ["\u041F\u043E\u043B\u0443\u0447\u0438\u0442\u044C \u043D\u043E\u0432\u044B\u0439 \u043A\u043E\u0434 \u043C\u043E\u0436\u043D\u043E \u0447\u0435\u0440\u0435\u0437", jsx(Timer, { className: "text-primary-main ml-1", time: timeNextReq, setTime: setTimeNextReq })] })) : (jsx(LinkButton, { onClick: sendCode, className: "text-primary-main", children: "\u041F\u043E\u043B\u0443\u0447\u0438\u0442\u044C \u043D\u043E\u0432\u044B\u0439 \u043A\u043E\u0434" }));
|
|
3089
3090
|
|
|
3090
|
-
const useVerifyPhoneDialog = (
|
|
3091
|
+
const useVerifyPhoneDialog = () => {
|
|
3091
3092
|
const { open, close } = useDialogManager();
|
|
3092
3093
|
return {
|
|
3093
|
-
open: (
|
|
3094
|
+
open: (handleClose, props) => open(jsx(VerifyPhoneDialog, { onClose: close, close: handleClose, ...props })),
|
|
3094
3095
|
close,
|
|
3095
3096
|
};
|
|
3096
3097
|
};
|
|
3097
3098
|
|
|
3099
|
+
const defaultConsentText = {
|
|
3100
|
+
title: 'Подпишите согласие на запрос в БКИ',
|
|
3101
|
+
description: 'Согласие на запрос в Бюро кредитных историй (БКИ) ускорит решение по кредиту',
|
|
3102
|
+
};
|
|
3103
|
+
const refuseConsentText = {
|
|
3104
|
+
title: 'Вы уверены, что хотите отказаться от запроса в БКИ',
|
|
3105
|
+
description: 'Согласие на запрос в Бюро кредитных историй (БКИ) повысит вероятность одобрения',
|
|
3106
|
+
};
|
|
3107
|
+
const ConsentBkiDialog = JSX(function ({ handleSubmit = noop, onClose = noop, }) {
|
|
3108
|
+
const [confirmStatus, setConfirmStatus] = useState('');
|
|
3109
|
+
const [showRefuceContent, setShowRefuceContent] = useState(false);
|
|
3110
|
+
const { open, close } = useDialogManager();
|
|
3111
|
+
const handleClose = useCallback(() => {
|
|
3112
|
+
close();
|
|
3113
|
+
handleSubmit(confirmStatus);
|
|
3114
|
+
}, [confirmStatus]);
|
|
3115
|
+
const handleConfirmChange = useCallback((value) => {
|
|
3116
|
+
setConfirmStatus(value);
|
|
3117
|
+
if (value === 'REFUSE') {
|
|
3118
|
+
setShowRefuceContent(true);
|
|
3119
|
+
}
|
|
3120
|
+
}, []);
|
|
3121
|
+
const consentText = showRefuceContent ? refuseConsentText : defaultConsentText;
|
|
3122
|
+
return (jsx(Dialog, { className: "my-6xl max-w-3xl w-full min-h-fit mx-auto rounded-lg", onClose: onClose, children: jsxs("div", { className: "flex flex-col gap-lg items-center", children: [jsx("div", { role: "button", onClick: () => openDocument(CONSENT_BKI_ID, open), children: jsx(Heading, { className: "text-center text-balance", title: consentText.title }) }), jsx(Paragraph, { align: "text-center", children: consentText.description }), jsx(RadioButtonGroup, { className: "whitespace-normal", orientation: "horizontal", items: ITEMS$1, value: confirmStatus, onChange: handleConfirmChange }), jsx(Button, { disabled: !confirmStatus, type: "button", onClick: handleClose, children: "\u041F\u0440\u043E\u0434\u043E\u043B\u0436\u0438\u0442\u044C" })] }) }));
|
|
3123
|
+
});
|
|
3124
|
+
const ITEMS$1 = [
|
|
3125
|
+
{ id: 'SIGNED', text: 'Подписать' },
|
|
3126
|
+
{ id: 'REFUSE', text: 'Отказаться' },
|
|
3127
|
+
];
|
|
3128
|
+
const CONSENT_BKI_ID = 2;
|
|
3129
|
+
|
|
3130
|
+
const useConsentBkiDialog = () => {
|
|
3131
|
+
const { open, closeAll } = useDialogManager();
|
|
3132
|
+
const verifyPhoneDialog = useVerifyPhoneDialog();
|
|
3133
|
+
const redirectToCreditForm = () => {
|
|
3134
|
+
globalThis.location.href = '/credit-lead';
|
|
3135
|
+
};
|
|
3136
|
+
const handleSuccessVerify = (profileId) => async (smsCode) => {
|
|
3137
|
+
if (profileId) {
|
|
3138
|
+
await updateUserProfile({
|
|
3139
|
+
profile: {
|
|
3140
|
+
id: profileId,
|
|
3141
|
+
consentBkiFlg: true,
|
|
3142
|
+
smsConsentBki: smsCode,
|
|
3143
|
+
},
|
|
3144
|
+
});
|
|
3145
|
+
}
|
|
3146
|
+
redirectToCreditForm();
|
|
3147
|
+
};
|
|
3148
|
+
const handleSubmitBkiConstent = (phone, profileId) => async (confirmStatus) => {
|
|
3149
|
+
await closeAll();
|
|
3150
|
+
if (confirmStatus === 'SIGNED' && phone) {
|
|
3151
|
+
verifyPhoneDialog.open(handleSuccessVerify(profileId), verifyPhoneContent$1(phone));
|
|
3152
|
+
}
|
|
3153
|
+
else {
|
|
3154
|
+
redirectToCreditForm();
|
|
3155
|
+
}
|
|
3156
|
+
};
|
|
3157
|
+
return {
|
|
3158
|
+
open: (phone, profileId) => open(jsx(ConsentBkiDialog, { handleSubmit: handleSubmitBkiConstent(phone, profileId), onClose: redirectToCreditForm })),
|
|
3159
|
+
};
|
|
3160
|
+
};
|
|
3161
|
+
const verifyPhoneContent$1 = (phone) => ({
|
|
3162
|
+
title: 'Подтвердите номер телефона',
|
|
3163
|
+
description: `Мы отправили код на ${phone}`,
|
|
3164
|
+
phoneNumber: formatPhone(phone),
|
|
3165
|
+
textButton: 'Отправить',
|
|
3166
|
+
__html: `<span>Вводя код, я подтверждаю, что ознакомлен и подписываю:</span>
|
|
3167
|
+
<ul><li>согласие на запрос информации в БКИ</li></ul>`,
|
|
3168
|
+
});
|
|
3169
|
+
|
|
3098
3170
|
const useApplicationLeadApi = ({ inputs, programId, saveForm }) => {
|
|
3099
3171
|
const [responseStatus, setResponseStatus] = useState('');
|
|
3100
3172
|
const [, setTaskId] = useLocalStorage('taskId');
|
|
3101
3173
|
const [, setProfileId] = useLocalStorage('profileId');
|
|
3102
3174
|
const [, setParticipantId] = useLocalStorage('participantId');
|
|
3175
|
+
const consentBkiDialog = useConsentBkiDialog();
|
|
3176
|
+
const verifyPhoneDialog = useVerifyPhoneDialog();
|
|
3103
3177
|
const saveUserData = useCallback((participantId, taskId, profileId) => {
|
|
3104
3178
|
setParticipantId(participantId);
|
|
3105
3179
|
setTaskId(taskId);
|
|
@@ -3133,21 +3207,19 @@
|
|
|
3133
3207
|
}));
|
|
3134
3208
|
saveUserData(participantId, taskId, profileId);
|
|
3135
3209
|
saveForm(JSON.stringify(formData));
|
|
3136
|
-
globalThis.location.href = '/credit-lead';
|
|
3137
3210
|
}
|
|
3138
3211
|
catch {
|
|
3139
3212
|
setResponseStatus('Fail');
|
|
3140
3213
|
}
|
|
3141
3214
|
};
|
|
3215
|
+
const handleCloseVerify = async () => {
|
|
3216
|
+
await handleSuccessVerify();
|
|
3217
|
+
consentBkiDialog.open(formData.phone, profileId);
|
|
3218
|
+
};
|
|
3142
3219
|
const acceptedConsents = Object.keys(CONSENTS)
|
|
3143
3220
|
.filter((_) => formData[_])
|
|
3144
3221
|
.map((_) => CONSENTS[_]?.text);
|
|
3145
|
-
|
|
3146
|
-
const verifyPhoneDialog = useVerifyPhoneDialog({
|
|
3147
|
-
close: handleSuccessVerify,
|
|
3148
|
-
...verifyPhoneContent(formData?.phone, acceptedConsents),
|
|
3149
|
-
});
|
|
3150
|
-
verifyPhoneDialog.open();
|
|
3222
|
+
verifyPhoneDialog.open(handleCloseVerify, verifyPhoneContent(formData?.phone, acceptedConsents));
|
|
3151
3223
|
}
|
|
3152
3224
|
}
|
|
3153
3225
|
catch {
|
|
@@ -7516,7 +7588,7 @@
|
|
|
7516
7588
|
slots: () => [HEADER_SLOT, FOOTER_SLOT, STICKY_FOOTER_SLOT],
|
|
7517
7589
|
});
|
|
7518
7590
|
|
|
7519
|
-
const packageVersion = "0.14.
|
|
7591
|
+
const packageVersion = "0.14.608";
|
|
7520
7592
|
|
|
7521
7593
|
exports.Blocks = Blocks;
|
|
7522
7594
|
exports.ContentPage = ContentPage;
|