@redneckz/wildless-cms-uni-blocks 0.14.606 → 0.14.608
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/feedbackById.d.ts +1 -1
- package/bundle/blocks.schema.json +1 -1
- package/bundle/bundle.umd.js +33 -32
- package/bundle/bundle.umd.min.js +1 -1
- package/bundle/components/ApplicationLeadForm/getInitialFormState.d.ts +4 -3
- package/bundle/ui-kit/FormField/NameFieldDef.d.ts +1 -1
- package/dist/api/RetailAPI/doRequest.js +4 -4
- package/dist/api/RetailAPI/doRequest.js.map +1 -1
- package/dist/api/RetailAPI/feedbackById.d.ts +1 -1
- package/dist/api/RetailAPI/feedbackById.js +2 -2
- package/dist/api/RetailAPI/feedbackById.js.map +1 -1
- package/dist/components/ApplicationLeadForm/GroupedConsents.js +1 -1
- package/dist/components/ApplicationLeadForm/GroupedConsents.js.map +1 -1
- package/dist/components/ApplicationLeadForm/consents.js +4 -12
- package/dist/components/ApplicationLeadForm/consents.js.map +1 -1
- package/dist/components/ApplicationLeadForm/getInitialFormState.d.ts +4 -3
- package/dist/components/ApplicationLeadForm/getInitialFormState.js +1 -3
- package/dist/components/ApplicationLeadForm/getInitialFormState.js.map +1 -1
- package/dist/components/ApplicationLeadForm/useApplicationLeadApi.js +17 -2
- package/dist/components/ApplicationLeadForm/useApplicationLeadApi.js.map +1 -1
- package/dist/hooks/useLeadFormData.js +1 -1
- package/dist/hooks/useLeadFormData.js.map +1 -1
- package/dist/ui-kit/FormField/NameFieldDef.d.ts +1 -1
- package/dist/ui-kit/FormField/getField.js +1 -3
- package/dist/ui-kit/FormField/getField.js.map +1 -1
- package/dist/ui-kit/FormField/getObjectValidator.js +1 -3
- package/dist/ui-kit/FormField/getObjectValidator.js.map +1 -1
- package/lib/api/RetailAPI/doRequest.js +4 -4
- package/lib/api/RetailAPI/doRequest.js.map +1 -1
- package/lib/api/RetailAPI/feedbackById.d.ts +1 -1
- package/lib/api/RetailAPI/feedbackById.js +2 -2
- package/lib/api/RetailAPI/feedbackById.js.map +1 -1
- package/lib/components/ApplicationLeadForm/GroupedConsents.js +1 -1
- package/lib/components/ApplicationLeadForm/GroupedConsents.js.map +1 -1
- package/lib/components/ApplicationLeadForm/consents.js +4 -12
- package/lib/components/ApplicationLeadForm/consents.js.map +1 -1
- package/lib/components/ApplicationLeadForm/getInitialFormState.d.ts +4 -3
- package/lib/components/ApplicationLeadForm/getInitialFormState.js +1 -3
- package/lib/components/ApplicationLeadForm/getInitialFormState.js.map +1 -1
- package/lib/components/ApplicationLeadForm/useApplicationLeadApi.js +17 -2
- package/lib/components/ApplicationLeadForm/useApplicationLeadApi.js.map +1 -1
- package/lib/hooks/useLeadFormData.js +1 -1
- package/lib/hooks/useLeadFormData.js.map +1 -1
- package/lib/ui-kit/FormField/NameFieldDef.d.ts +1 -1
- package/lib/ui-kit/FormField/getField.js +1 -3
- package/lib/ui-kit/FormField/getField.js.map +1 -1
- package/lib/ui-kit/FormField/getObjectValidator.js +1 -3
- package/lib/ui-kit/FormField/getObjectValidator.js.map +1 -1
- package/mobile/bundle/api/RetailAPI/feedbackById.d.ts +1 -1
- package/mobile/bundle/bundle.umd.js +33 -32
- package/mobile/bundle/bundle.umd.min.js +1 -1
- package/mobile/bundle/components/ApplicationLeadForm/getInitialFormState.d.ts +4 -3
- package/mobile/bundle/ui-kit/FormField/NameFieldDef.d.ts +1 -1
- package/mobile/dist/api/RetailAPI/doRequest.js +4 -4
- package/mobile/dist/api/RetailAPI/doRequest.js.map +1 -1
- package/mobile/dist/api/RetailAPI/feedbackById.d.ts +1 -1
- package/mobile/dist/api/RetailAPI/feedbackById.js +2 -2
- package/mobile/dist/api/RetailAPI/feedbackById.js.map +1 -1
- package/mobile/dist/components/ApplicationLeadForm/GroupedConsents.js +1 -1
- package/mobile/dist/components/ApplicationLeadForm/GroupedConsents.js.map +1 -1
- package/mobile/dist/components/ApplicationLeadForm/consents.js +4 -12
- package/mobile/dist/components/ApplicationLeadForm/consents.js.map +1 -1
- package/mobile/dist/components/ApplicationLeadForm/getInitialFormState.d.ts +4 -3
- package/mobile/dist/components/ApplicationLeadForm/getInitialFormState.js +1 -3
- package/mobile/dist/components/ApplicationLeadForm/getInitialFormState.js.map +1 -1
- package/mobile/dist/components/ApplicationLeadForm/useApplicationLeadApi.js +17 -2
- package/mobile/dist/components/ApplicationLeadForm/useApplicationLeadApi.js.map +1 -1
- package/mobile/dist/hooks/useLeadFormData.js +1 -1
- package/mobile/dist/hooks/useLeadFormData.js.map +1 -1
- package/mobile/dist/ui-kit/FormField/NameFieldDef.d.ts +1 -1
- package/mobile/dist/ui-kit/FormField/getField.js +1 -3
- package/mobile/dist/ui-kit/FormField/getField.js.map +1 -1
- package/mobile/dist/ui-kit/FormField/getObjectValidator.js +1 -3
- package/mobile/dist/ui-kit/FormField/getObjectValidator.js.map +1 -1
- package/mobile/lib/api/RetailAPI/doRequest.js +4 -4
- package/mobile/lib/api/RetailAPI/doRequest.js.map +1 -1
- package/mobile/lib/api/RetailAPI/feedbackById.d.ts +1 -1
- package/mobile/lib/api/RetailAPI/feedbackById.js +2 -2
- package/mobile/lib/api/RetailAPI/feedbackById.js.map +1 -1
- package/mobile/lib/components/ApplicationLeadForm/GroupedConsents.js +1 -1
- package/mobile/lib/components/ApplicationLeadForm/GroupedConsents.js.map +1 -1
- package/mobile/lib/components/ApplicationLeadForm/consents.js +4 -12
- package/mobile/lib/components/ApplicationLeadForm/consents.js.map +1 -1
- package/mobile/lib/components/ApplicationLeadForm/getInitialFormState.d.ts +4 -3
- package/mobile/lib/components/ApplicationLeadForm/getInitialFormState.js +1 -3
- package/mobile/lib/components/ApplicationLeadForm/getInitialFormState.js.map +1 -1
- package/mobile/lib/components/ApplicationLeadForm/useApplicationLeadApi.js +17 -2
- package/mobile/lib/components/ApplicationLeadForm/useApplicationLeadApi.js.map +1 -1
- package/mobile/lib/hooks/useLeadFormData.js +1 -1
- package/mobile/lib/hooks/useLeadFormData.js.map +1 -1
- package/mobile/lib/ui-kit/FormField/NameFieldDef.d.ts +1 -1
- package/mobile/lib/ui-kit/FormField/getField.js +1 -3
- package/mobile/lib/ui-kit/FormField/getField.js.map +1 -1
- package/mobile/lib/ui-kit/FormField/getObjectValidator.js +1 -3
- package/mobile/lib/ui-kit/FormField/getObjectValidator.js.map +1 -1
- package/mobile/src/api/RetailAPI/doRequest.ts +10 -13
- package/mobile/src/api/RetailAPI/feedbackById.ts +2 -5
- package/mobile/src/components/ApplicationLeadForm/ApplicationLeadForm.example.json +2 -12
- package/mobile/src/components/ApplicationLeadForm/GroupedConsents.tsx +1 -1
- package/mobile/src/components/ApplicationLeadForm/consents.ts +4 -12
- package/mobile/src/components/ApplicationLeadForm/getInitialFormState.tsx +5 -6
- package/mobile/src/components/ApplicationLeadForm/useApplicationLeadApi.ts +20 -2
- package/mobile/src/hooks/useLeadFormData.ts +1 -3
- package/mobile/src/ui-kit/FormField/NameFieldDef.ts +1 -3
- package/mobile/src/ui-kit/FormField/getField.tsx +1 -3
- package/mobile/src/ui-kit/FormField/getObjectValidator.tsx +1 -3
- package/package.json +1 -1
- package/src/api/RetailAPI/doRequest.ts +10 -13
- package/src/api/RetailAPI/feedbackById.ts +2 -5
- package/src/components/ApplicationLeadForm/ApplicationLeadForm.example.json +2 -12
- package/src/components/ApplicationLeadForm/ApplicationLeadForm.fixture.mobile.tsx +2 -4
- package/src/components/ApplicationLeadForm/ApplicationLeadForm.fixture.tsx +1 -3
- package/src/components/ApplicationLeadForm/GroupedConsents.tsx +1 -1
- package/src/components/ApplicationLeadForm/consents.ts +4 -12
- package/src/components/ApplicationLeadForm/getInitialFormState.tsx +5 -6
- package/src/components/ApplicationLeadForm/useApplicationLeadApi.ts +20 -2
- package/src/hooks/useLeadFormData.ts +1 -3
- package/src/ui-kit/FormField/NameFieldDef.ts +1 -3
- package/src/ui-kit/FormField/getField.tsx +1 -3
- package/src/ui-kit/FormField/getObjectValidator.tsx +1 -3
package/bundle/bundle.umd.js
CHANGED
|
@@ -1488,10 +1488,8 @@
|
|
|
1488
1488
|
consentToReceiveMaterials: agreementValidator,
|
|
1489
1489
|
processPersonalDataLeadFlg: agreementValidator,
|
|
1490
1490
|
consentProviderFlg: agreementValidator,
|
|
1491
|
-
consentPhotoFlg: agreementValidator,
|
|
1492
1491
|
consentPfrFlg: agreementValidator,
|
|
1493
|
-
|
|
1494
|
-
consentCollectionFlg: agreementValidator,
|
|
1492
|
+
consentOthersFlg: agreementValidator,
|
|
1495
1493
|
consentInformFlg: agreementValidator,
|
|
1496
1494
|
familyStatus: defaultValidator('Выберите семейное положение'),
|
|
1497
1495
|
children: lengthStringValidator(2, 'Укажите количество детей'),
|
|
@@ -1719,7 +1717,7 @@
|
|
|
1719
1717
|
const AmountField = JSX(({ field }) => (jsx(InputRange, { title: "\u0421\u0443\u043C\u043C\u0430, \u20BD", items: ITEMS_CREDIT_AMOUNT, min: MIN_CREDIT_AMOUNT, max: MAX_CREDIT_AMOUNT, ...field('amount') })));
|
|
1720
1718
|
|
|
1721
1719
|
const useLeadFormData = (typeField) => {
|
|
1722
|
-
const { data, error } = useAsyncData(
|
|
1720
|
+
const { data, error } = useAsyncData(`/api/v1/dictionary?dictionaryType=${encodeURIComponent(typeField)}`, fetchData);
|
|
1723
1721
|
if (data && 'errorMessage' in data) {
|
|
1724
1722
|
return { error };
|
|
1725
1723
|
}
|
|
@@ -1980,18 +1978,6 @@
|
|
|
1980
1978
|
text: 'Согласие на запрос в ПФР',
|
|
1981
1979
|
docId: 3,
|
|
1982
1980
|
},
|
|
1983
|
-
consentPhotoFlg: {
|
|
1984
|
-
text: 'Прочие согласия (согласие на фотографирование)',
|
|
1985
|
-
docId: 1,
|
|
1986
|
-
},
|
|
1987
|
-
consentAssignmentClaimsFlg: {
|
|
1988
|
-
text: 'Прочие согласия (согласие на уступку прав требований)',
|
|
1989
|
-
docId: 1,
|
|
1990
|
-
},
|
|
1991
|
-
consentCollectionFlg: {
|
|
1992
|
-
text: 'Прочие согласия (согласие на взыскание по исполнительной надписи нотариуса)',
|
|
1993
|
-
docId: 1,
|
|
1994
|
-
},
|
|
1995
1981
|
consentInformFlg: {
|
|
1996
1982
|
text: 'Согласие на информирование о продуктах и услугах Банка',
|
|
1997
1983
|
docId: 14,
|
|
@@ -1999,6 +1985,10 @@
|
|
|
1999
1985
|
consentToReceiveMaterials: {
|
|
2000
1986
|
text: 'Согласен на получение информационных и аналитических материалов по электронной почте',
|
|
2001
1987
|
},
|
|
1988
|
+
consentOthersFlg: {
|
|
1989
|
+
text: 'Прочие согласия',
|
|
1990
|
+
docId: 1,
|
|
1991
|
+
},
|
|
2002
1992
|
};
|
|
2003
1993
|
|
|
2004
1994
|
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" }) })));
|
|
@@ -2013,27 +2003,27 @@
|
|
|
2013
2003
|
});
|
|
2014
2004
|
|
|
2015
2005
|
async function doRequest(url, method, body) {
|
|
2016
|
-
const response = await fetch(
|
|
2006
|
+
const response = await fetch(`${API_BASE_URI}${url}`, {
|
|
2017
2007
|
method,
|
|
2018
2008
|
headers: {
|
|
2019
2009
|
'Content-Type': 'application/json',
|
|
2020
|
-
...
|
|
2010
|
+
...getAuthorizationHeaders(),
|
|
2021
2011
|
},
|
|
2022
2012
|
credentials: 'include',
|
|
2023
2013
|
body: body ? JSON.stringify(body) : null,
|
|
2024
2014
|
});
|
|
2025
|
-
return isJSON(response) ? response.json() : response
|
|
2015
|
+
return isJSON(response) ? response.json() : response;
|
|
2026
2016
|
}
|
|
2027
2017
|
// TODO: Need delete isJSON
|
|
2028
2018
|
const isJSON = (response) => response.headers.get('Content-Type') === 'application/json';
|
|
2029
|
-
const
|
|
2019
|
+
const getAuthorizationHeaders = () => {
|
|
2030
2020
|
const token = sessionStorage.getItem('accessToken');
|
|
2031
2021
|
return token ? { Authorization: `Bearer ${token}` } : null;
|
|
2032
2022
|
};
|
|
2033
2023
|
|
|
2034
2024
|
const feedbackById = async (id) => {
|
|
2035
|
-
const
|
|
2036
|
-
return
|
|
2025
|
+
const response = await doRequest(`/feedback/file?id=${encodeURIComponent(id)}`, 'GET');
|
|
2026
|
+
return await response.blob();
|
|
2037
2027
|
};
|
|
2038
2028
|
|
|
2039
2029
|
const getDocument = async (id) => {
|
|
@@ -2430,9 +2420,7 @@
|
|
|
2430
2420
|
consentToReceiveMaterials: jsx(ConsentField, { field: field, input: input }),
|
|
2431
2421
|
processPersonalDataLeadFlg: jsx(ConsentField, { field: field, input: input }),
|
|
2432
2422
|
consentProviderFlg: jsx(ConsentField, { field: field, input: input }),
|
|
2433
|
-
|
|
2434
|
-
consentAssignmentClaimsFlg: jsx(ConsentField, { field: field, input: input }),
|
|
2435
|
-
consentCollectionFlg: jsx(ConsentField, { field: field, input: input }),
|
|
2423
|
+
consentOthersFlg: jsx(ConsentField, { field: field, input: input }),
|
|
2436
2424
|
consentInformFlg: jsx(ConsentField, { field: field, input: input }),
|
|
2437
2425
|
consentPfrFlg: jsx(ConsentField, { field: field, input: input }),
|
|
2438
2426
|
applicationDate: (jsx(InputControl, { label: "\u0414\u0430\u0442\u0430 \u0438 \u0432\u0440\u0435\u043C\u044F \u043E\u0431\u0440\u0430\u0449\u0435\u043D\u0438\u044F \u0432 \u0411\u0430\u043D\u043A", ...field('applicationDate') })),
|
|
@@ -2727,7 +2715,7 @@
|
|
|
2727
2715
|
?.some((_) => Boolean(withValidator(field(_?.name), validatorObj[_?.name]).error)), [inputs]);
|
|
2728
2716
|
return (jsx("div", { className: "w-fit", children: jsx(Foldable, { isFoldButtonOnTop: true, unfoldedByDefault: true, renderFoldableSection: ({ isUnfolded }) => (jsx(FoldableSection, { isUnfolded: isUnfolded, className: "flex flex-col pl-2xl", children: inputs.map(getField(field, typeForm)) })), renderFoldButton: renderGeneralCheckbox(jsxs("div", { children: [jsx(Checkbox, { value: isChecked, onChange: handleGeneralToggle, text: CONSENT_ALL_DOCS_TEXT }, key), renderErrorText(hasValidationErrors ? CONSENT_REQUIRED : '')] })) }) }));
|
|
2729
2717
|
});
|
|
2730
|
-
const renderGeneralCheckbox = (generalCheckBox) => (foldableData) => (jsxs("div", { className: "flex items-start", children: [generalCheckBox, jsx("button", { onClick: foldableData.onToggle, className: "px-m py-2xs", children: jsx(Icon, { className: "text-primary-text", name: foldableData.isUnfolded ? 'ArrowUpIcon' : 'ArrowDownIcon', width: "16", height: "16" }) })] }));
|
|
2718
|
+
const renderGeneralCheckbox = (generalCheckBox) => (foldableData) => (jsxs("div", { className: "flex items-start", children: [generalCheckBox, jsx("button", { onClick: foldableData.onToggle, className: "px-m py-2xs", type: "button", children: jsx(Icon, { className: "text-primary-text", name: foldableData.isUnfolded ? 'ArrowUpIcon' : 'ArrowDownIcon', width: "16", height: "16" }) })] }));
|
|
2731
2719
|
|
|
2732
2720
|
const renderInputs = ({ field, typeForm = '', inputs }) => {
|
|
2733
2721
|
const { consentInputs, restInputs } = splitInputs(inputs || []);
|
|
@@ -2765,9 +2753,7 @@
|
|
|
2765
2753
|
consentDataProcessing: false,
|
|
2766
2754
|
processPersonalDataLeadFlg: false,
|
|
2767
2755
|
consentProviderFlg: false,
|
|
2768
|
-
|
|
2769
|
-
consentAssignmentClaimsFlg: false,
|
|
2770
|
-
consentCollectionFlg: false,
|
|
2756
|
+
consentOthersFlg: false,
|
|
2771
2757
|
consentInformFlg: false,
|
|
2772
2758
|
participantAddress: '',
|
|
2773
2759
|
participantDateRegistration: undefined,
|
|
@@ -3122,15 +3108,21 @@
|
|
|
3122
3108
|
profile: { phone: formatPhone(formData.phone) },
|
|
3123
3109
|
});
|
|
3124
3110
|
const profileId = profile?.id;
|
|
3111
|
+
const transformedForm = transformOtherConsentsField(formData);
|
|
3125
3112
|
if (profileId && formData?.phone) {
|
|
3126
3113
|
const handleSuccessVerify = async () => {
|
|
3127
3114
|
try {
|
|
3128
|
-
await updateUserProfile(getUpdateUserProfileData(profileId,
|
|
3115
|
+
await updateUserProfile(getUpdateUserProfileData(profileId, transformedForm));
|
|
3129
3116
|
const { taskId, participantId } = await createDraftTask({
|
|
3130
3117
|
profileId,
|
|
3131
3118
|
programId,
|
|
3132
3119
|
});
|
|
3133
|
-
await updateUserTask(getUpdateUserTaskData({
|
|
3120
|
+
await updateUserTask(getUpdateUserTaskData({
|
|
3121
|
+
participantId,
|
|
3122
|
+
taskId,
|
|
3123
|
+
profileId,
|
|
3124
|
+
formData: transformedForm,
|
|
3125
|
+
}));
|
|
3134
3126
|
saveUserData(participantId, taskId, profileId);
|
|
3135
3127
|
saveForm(JSON.stringify(formData));
|
|
3136
3128
|
globalThis.location.href = '/credit-lead';
|
|
@@ -3167,6 +3159,15 @@
|
|
|
3167
3159
|
__html: `<span>Вводя код, я подтверждаю, что ознакомлен и подписываю:</span>${consentsToList(consents)}`,
|
|
3168
3160
|
});
|
|
3169
3161
|
const consentsToList = (consents) => `<ul>${consents?.map((_) => '<li>' + _ + '</li>').join('')}</ul>`;
|
|
3162
|
+
const transformOtherConsentsField = (formData) => {
|
|
3163
|
+
const { consentOthersFlg, ...form } = formData;
|
|
3164
|
+
return {
|
|
3165
|
+
...form,
|
|
3166
|
+
consentCollectionFlg: consentOthersFlg,
|
|
3167
|
+
consentAssignmentClaimsFlg: consentOthersFlg,
|
|
3168
|
+
consentPhotoFlg: consentOthersFlg,
|
|
3169
|
+
};
|
|
3170
|
+
};
|
|
3170
3171
|
|
|
3171
3172
|
const useInitApplicationLead = () => {
|
|
3172
3173
|
useEffect(() => {
|
|
@@ -7888,7 +7889,7 @@
|
|
|
7888
7889
|
slots: () => [HEADER_SLOT, FOOTER_SLOT, STICKY_FOOTER_SLOT],
|
|
7889
7890
|
});
|
|
7890
7891
|
|
|
7891
|
-
const packageVersion = "0.14.
|
|
7892
|
+
const packageVersion = "0.14.607";
|
|
7892
7893
|
|
|
7893
7894
|
exports.Blocks = Blocks;
|
|
7894
7895
|
exports.ContentPage = ContentPage;
|