@redneckz/wildless-cms-uni-blocks 0.14.973 → 0.14.975
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/blocks.schema.json +1 -1
- package/bundle/bundle.umd.js +39 -143
- package/bundle/bundle.umd.min.js +1 -1
- package/bundle/components/ApplicationLeadForm/getLeadFormTaskData.d.ts +1 -7
- package/bundle/components/ApplicationLeadForm/useInitApplicationLead.d.ts +0 -1
- package/bundle/components/GalleryLayout/utils.d.ts +2 -2
- package/bundle/components/ProductBlock/ProductBlock.d.ts +4 -0
- package/bundle/components/ProductBlock/ProductBlockContent.d.ts +2 -2
- package/bundle/model/HeadlineType.d.ts +14 -1
- package/bundle/retail/api/createUserTaskDebit.d.ts +0 -1
- package/dist/components/ApplicationLeadForm/getLeadFormTaskData.d.ts +1 -7
- package/dist/components/ApplicationLeadForm/getLeadFormTaskData.js +1 -2
- package/dist/components/ApplicationLeadForm/getLeadFormTaskData.js.map +1 -1
- package/dist/components/ApplicationLeadForm/useApplicationLeadApi.js +4 -24
- package/dist/components/ApplicationLeadForm/useApplicationLeadApi.js.map +1 -1
- package/dist/components/ApplicationLeadForm/useInitApplicationLead.d.ts +0 -1
- package/dist/components/ApplicationLeadForm/useInitApplicationLead.js +0 -4
- package/dist/components/ApplicationLeadForm/useInitApplicationLead.js.map +1 -1
- package/dist/components/GalleryLayout/utils.d.ts +2 -2
- package/dist/components/ProductBlock/ProductBlock.d.ts +4 -0
- package/dist/components/ProductBlock/ProductBlock.js +16 -1
- package/dist/components/ProductBlock/ProductBlock.js.map +1 -1
- package/dist/components/ProductBlock/ProductBlockContent.d.ts +2 -2
- package/dist/model/HeadlineType.d.ts +14 -1
- package/dist/retail/api/createUserTaskDebit.d.ts +0 -1
- package/dist/retail/api/createUserTaskDebit.js.map +1 -1
- package/dist/retail/components/Fields/AddressRetailField.js +0 -20
- package/dist/retail/components/Fields/AddressRetailField.js.map +1 -1
- package/dist/retail/components/Fields/PaymentSystemField.js +2 -14
- package/dist/retail/components/Fields/PaymentSystemField.js.map +1 -1
- package/dist/retail/components/Fields/RegionRetailField.js +7 -20
- package/dist/retail/components/Fields/RegionRetailField.js.map +1 -1
- package/lib/components/ApplicationLeadForm/getLeadFormTaskData.d.ts +1 -7
- package/lib/components/ApplicationLeadForm/getLeadFormTaskData.js +1 -2
- package/lib/components/ApplicationLeadForm/getLeadFormTaskData.js.map +1 -1
- package/lib/components/ApplicationLeadForm/useApplicationLeadApi.js +4 -24
- package/lib/components/ApplicationLeadForm/useApplicationLeadApi.js.map +1 -1
- package/lib/components/ApplicationLeadForm/useInitApplicationLead.d.ts +0 -1
- package/lib/components/ApplicationLeadForm/useInitApplicationLead.js +0 -4
- package/lib/components/ApplicationLeadForm/useInitApplicationLead.js.map +1 -1
- package/lib/components/GalleryLayout/utils.d.ts +2 -2
- package/lib/components/ProductBlock/ProductBlock.d.ts +4 -0
- package/lib/components/ProductBlock/ProductBlock.fixture.d.ts +1 -0
- package/lib/components/ProductBlock/ProductBlock.js +16 -1
- package/lib/components/ProductBlock/ProductBlock.js.map +1 -1
- package/lib/components/ProductBlock/ProductBlockContent.d.ts +2 -2
- package/lib/model/HeadlineType.d.ts +14 -1
- package/lib/retail/api/createUserTaskDebit.d.ts +0 -1
- package/lib/retail/api/createUserTaskDebit.js.map +1 -1
- package/lib/retail/components/Fields/AddressRetailField.js +0 -20
- package/lib/retail/components/Fields/AddressRetailField.js.map +1 -1
- package/lib/retail/components/Fields/PaymentSystemField.js +2 -14
- package/lib/retail/components/Fields/PaymentSystemField.js.map +1 -1
- package/lib/retail/components/Fields/RegionRetailField.js +7 -20
- package/lib/retail/components/Fields/RegionRetailField.js.map +1 -1
- package/mobile/bundle/bundle.umd.js +39 -143
- package/mobile/bundle/bundle.umd.min.js +1 -1
- package/mobile/bundle/components/ApplicationLeadForm/getLeadFormTaskData.d.ts +1 -7
- package/mobile/bundle/components/ApplicationLeadForm/useInitApplicationLead.d.ts +0 -1
- package/mobile/bundle/components/GalleryLayout/utils.d.ts +2 -2
- package/mobile/bundle/components/ProductBlock/ProductBlock.d.ts +4 -0
- package/mobile/bundle/components/ProductBlock/ProductBlockContent.d.ts +2 -2
- package/mobile/bundle/model/HeadlineType.d.ts +14 -1
- package/mobile/bundle/retail/api/createUserTaskDebit.d.ts +0 -1
- package/mobile/dist/components/ApplicationLeadForm/getLeadFormTaskData.d.ts +1 -7
- package/mobile/dist/components/ApplicationLeadForm/getLeadFormTaskData.js +1 -2
- package/mobile/dist/components/ApplicationLeadForm/getLeadFormTaskData.js.map +1 -1
- package/mobile/dist/components/ApplicationLeadForm/useApplicationLeadApi.js +4 -24
- package/mobile/dist/components/ApplicationLeadForm/useApplicationLeadApi.js.map +1 -1
- package/mobile/dist/components/ApplicationLeadForm/useInitApplicationLead.d.ts +0 -1
- package/mobile/dist/components/ApplicationLeadForm/useInitApplicationLead.js +0 -4
- package/mobile/dist/components/ApplicationLeadForm/useInitApplicationLead.js.map +1 -1
- package/mobile/dist/components/GalleryLayout/utils.d.ts +2 -2
- package/mobile/dist/components/ProductBlock/ProductBlock.d.ts +4 -0
- package/mobile/dist/components/ProductBlock/ProductBlock.js +16 -1
- package/mobile/dist/components/ProductBlock/ProductBlock.js.map +1 -1
- package/mobile/dist/components/ProductBlock/ProductBlockContent.d.ts +2 -2
- package/mobile/dist/model/HeadlineType.d.ts +14 -1
- package/mobile/dist/retail/api/createUserTaskDebit.d.ts +0 -1
- package/mobile/dist/retail/api/createUserTaskDebit.js.map +1 -1
- package/mobile/dist/retail/components/Fields/AddressRetailField.js +0 -20
- package/mobile/dist/retail/components/Fields/AddressRetailField.js.map +1 -1
- package/mobile/dist/retail/components/Fields/PaymentSystemField.js +2 -14
- package/mobile/dist/retail/components/Fields/PaymentSystemField.js.map +1 -1
- package/mobile/dist/retail/components/Fields/RegionRetailField.js +7 -20
- package/mobile/dist/retail/components/Fields/RegionRetailField.js.map +1 -1
- package/mobile/lib/components/ApplicationLeadForm/getLeadFormTaskData.d.ts +1 -7
- package/mobile/lib/components/ApplicationLeadForm/getLeadFormTaskData.js +1 -2
- package/mobile/lib/components/ApplicationLeadForm/getLeadFormTaskData.js.map +1 -1
- package/mobile/lib/components/ApplicationLeadForm/useApplicationLeadApi.js +4 -24
- package/mobile/lib/components/ApplicationLeadForm/useApplicationLeadApi.js.map +1 -1
- package/mobile/lib/components/ApplicationLeadForm/useInitApplicationLead.d.ts +0 -1
- package/mobile/lib/components/ApplicationLeadForm/useInitApplicationLead.js +0 -4
- package/mobile/lib/components/ApplicationLeadForm/useInitApplicationLead.js.map +1 -1
- package/mobile/lib/components/GalleryLayout/utils.d.ts +2 -2
- package/mobile/lib/components/ProductBlock/ProductBlock.d.ts +4 -0
- package/mobile/lib/components/ProductBlock/ProductBlock.js +16 -1
- package/mobile/lib/components/ProductBlock/ProductBlock.js.map +1 -1
- package/mobile/lib/components/ProductBlock/ProductBlockContent.d.ts +2 -2
- package/mobile/lib/model/HeadlineType.d.ts +14 -1
- package/mobile/lib/retail/api/createUserTaskDebit.d.ts +0 -1
- package/mobile/lib/retail/api/createUserTaskDebit.js.map +1 -1
- package/mobile/lib/retail/components/Fields/AddressRetailField.js +0 -20
- package/mobile/lib/retail/components/Fields/AddressRetailField.js.map +1 -1
- package/mobile/lib/retail/components/Fields/PaymentSystemField.js +2 -14
- package/mobile/lib/retail/components/Fields/PaymentSystemField.js.map +1 -1
- package/mobile/lib/retail/components/Fields/RegionRetailField.js +7 -20
- package/mobile/lib/retail/components/Fields/RegionRetailField.js.map +1 -1
- package/mobile/src/components/ApplicationLeadForm/getLeadFormTaskData.ts +5 -14
- package/mobile/src/components/ApplicationLeadForm/useApplicationLeadApi.tsx +3 -32
- package/mobile/src/components/ApplicationLeadForm/useInitApplicationLead.ts +0 -6
- package/mobile/src/components/ProductBlock/ProductBlock.tsx +57 -14
- package/mobile/src/components/ProductBlock/ProductBlockContent.ts +6 -2
- package/mobile/src/model/HeadlineType.ts +20 -1
- package/mobile/src/retail/api/createUserTaskDebit.ts +0 -1
- package/mobile/src/retail/components/Fields/AddressRetailField.tsx +0 -26
- package/mobile/src/retail/components/Fields/PaymentSystemField.tsx +2 -21
- package/mobile/src/retail/components/Fields/RegionRetailField.tsx +7 -22
- package/package.json +2 -2
- package/src/components/ApplicationLeadForm/getLeadFormTaskData.ts +5 -14
- package/src/components/ApplicationLeadForm/useApplicationLeadApi.tsx +3 -32
- package/src/components/ApplicationLeadForm/useInitApplicationLead.ts +0 -6
- package/src/components/ProductBlock/ProductBlock.fixture.tsx +22 -0
- package/src/components/ProductBlock/ProductBlock.tsx +57 -14
- package/src/components/ProductBlock/ProductBlockContent.ts +6 -2
- package/src/icons/IconName.ts +4 -4
- package/src/model/HeadlineType.ts +20 -1
- package/src/retail/api/createUserTaskDebit.ts +0 -1
- package/src/retail/components/Fields/AddressRetailField.tsx +0 -26
- package/src/retail/components/Fields/PaymentSystemField.tsx +2 -21
- package/src/retail/components/Fields/RegionRetailField.tsx +7 -22
- package/bundle/retail/api/getClaimChannel.d.ts +0 -8
- package/bundle/retail/hooks/useBiblioglobusDefaultRegion.d.ts +0 -14
- package/bundle/retail/utils/filterPaymentSystems.d.ts +0 -4
- package/bundle/retail/utils/hasDelivery.d.ts +0 -10
- package/bundle/utils/getSlugFromUrl.d.ts +0 -1
- package/dist/retail/api/getClaimChannel.d.ts +0 -8
- package/dist/retail/api/getClaimChannel.js +0 -9
- package/dist/retail/api/getClaimChannel.js.map +0 -1
- package/dist/retail/hooks/useBiblioglobusDefaultRegion.d.ts +0 -14
- package/dist/retail/hooks/useBiblioglobusDefaultRegion.js +0 -34
- package/dist/retail/hooks/useBiblioglobusDefaultRegion.js.map +0 -1
- package/dist/retail/utils/filterPaymentSystems.d.ts +0 -4
- package/dist/retail/utils/filterPaymentSystems.js +0 -13
- package/dist/retail/utils/filterPaymentSystems.js.map +0 -1
- package/dist/retail/utils/hasDelivery.d.ts +0 -10
- package/dist/retail/utils/hasDelivery.js +0 -13
- package/dist/retail/utils/hasDelivery.js.map +0 -1
- package/dist/utils/getSlugFromUrl.d.ts +0 -1
- package/dist/utils/getSlugFromUrl.js +0 -12
- package/dist/utils/getSlugFromUrl.js.map +0 -1
- package/lib/retail/api/getClaimChannel.d.ts +0 -8
- package/lib/retail/api/getClaimChannel.js +0 -6
- package/lib/retail/api/getClaimChannel.js.map +0 -1
- package/lib/retail/hooks/useBiblioglobusDefaultRegion.d.ts +0 -14
- package/lib/retail/hooks/useBiblioglobusDefaultRegion.js +0 -31
- package/lib/retail/hooks/useBiblioglobusDefaultRegion.js.map +0 -1
- package/lib/retail/utils/filterPaymentSystems.d.ts +0 -4
- package/lib/retail/utils/filterPaymentSystems.js +0 -10
- package/lib/retail/utils/filterPaymentSystems.js.map +0 -1
- package/lib/retail/utils/hasDelivery.d.ts +0 -10
- package/lib/retail/utils/hasDelivery.js +0 -9
- package/lib/retail/utils/hasDelivery.js.map +0 -1
- package/lib/utils/getSlugFromUrl.d.ts +0 -1
- package/lib/utils/getSlugFromUrl.js +0 -9
- package/lib/utils/getSlugFromUrl.js.map +0 -1
- package/mobile/bundle/retail/api/getClaimChannel.d.ts +0 -8
- package/mobile/bundle/retail/hooks/useBiblioglobusDefaultRegion.d.ts +0 -14
- package/mobile/bundle/retail/utils/filterPaymentSystems.d.ts +0 -4
- package/mobile/bundle/retail/utils/hasDelivery.d.ts +0 -10
- package/mobile/bundle/utils/getSlugFromUrl.d.ts +0 -1
- package/mobile/dist/retail/api/getClaimChannel.d.ts +0 -8
- package/mobile/dist/retail/api/getClaimChannel.js +0 -9
- package/mobile/dist/retail/api/getClaimChannel.js.map +0 -1
- package/mobile/dist/retail/hooks/useBiblioglobusDefaultRegion.d.ts +0 -14
- package/mobile/dist/retail/hooks/useBiblioglobusDefaultRegion.js +0 -34
- package/mobile/dist/retail/hooks/useBiblioglobusDefaultRegion.js.map +0 -1
- package/mobile/dist/retail/utils/filterPaymentSystems.d.ts +0 -4
- package/mobile/dist/retail/utils/filterPaymentSystems.js +0 -13
- package/mobile/dist/retail/utils/filterPaymentSystems.js.map +0 -1
- package/mobile/dist/retail/utils/hasDelivery.d.ts +0 -10
- package/mobile/dist/retail/utils/hasDelivery.js +0 -13
- package/mobile/dist/retail/utils/hasDelivery.js.map +0 -1
- package/mobile/dist/utils/getSlugFromUrl.d.ts +0 -1
- package/mobile/dist/utils/getSlugFromUrl.js +0 -12
- package/mobile/dist/utils/getSlugFromUrl.js.map +0 -1
- package/mobile/lib/retail/api/getClaimChannel.d.ts +0 -8
- package/mobile/lib/retail/api/getClaimChannel.js +0 -6
- package/mobile/lib/retail/api/getClaimChannel.js.map +0 -1
- package/mobile/lib/retail/hooks/useBiblioglobusDefaultRegion.d.ts +0 -14
- package/mobile/lib/retail/hooks/useBiblioglobusDefaultRegion.js +0 -31
- package/mobile/lib/retail/hooks/useBiblioglobusDefaultRegion.js.map +0 -1
- package/mobile/lib/retail/utils/filterPaymentSystems.d.ts +0 -4
- package/mobile/lib/retail/utils/filterPaymentSystems.js +0 -10
- package/mobile/lib/retail/utils/filterPaymentSystems.js.map +0 -1
- package/mobile/lib/retail/utils/hasDelivery.d.ts +0 -10
- package/mobile/lib/retail/utils/hasDelivery.js +0 -9
- package/mobile/lib/retail/utils/hasDelivery.js.map +0 -1
- package/mobile/lib/utils/getSlugFromUrl.d.ts +0 -1
- package/mobile/lib/utils/getSlugFromUrl.js +0 -9
- package/mobile/lib/utils/getSlugFromUrl.js.map +0 -1
- package/mobile/src/retail/api/getClaimChannel.ts +0 -18
- package/mobile/src/retail/hooks/useBiblioglobusDefaultRegion.ts +0 -56
- package/mobile/src/retail/utils/filterPaymentSystems.ts +0 -14
- package/mobile/src/retail/utils/hasDelivery.ts +0 -22
- package/mobile/src/utils/getSlugFromUrl.ts +0 -10
- package/src/retail/api/getClaimChannel.ts +0 -18
- package/src/retail/hooks/useBiblioglobusDefaultRegion.ts +0 -56
- package/src/retail/utils/filterPaymentSystems.ts +0 -14
- package/src/retail/utils/hasDelivery.ts +0 -22
- package/src/utils/getSlugFromUrl.ts +0 -10
|
@@ -8,7 +8,6 @@ import { createDraftTask } from '../../retail/api/createDraftTask';
|
|
|
8
8
|
import { createParticipant } from '../../retail/api/createParticipant';
|
|
9
9
|
import { createUserProfile } from '../../retail/api/createUserProfile';
|
|
10
10
|
import { createUserTaskDebit } from '../../retail/api/createUserTaskDebit';
|
|
11
|
-
import { getClaimChannel } from '../../retail/api/getClaimChannel';
|
|
12
11
|
import { getLastTaskStatus } from '../../retail/api/getLastTaskStatus';
|
|
13
12
|
import { getTaskById } from '../../retail/api/getTaskById';
|
|
14
13
|
import { saveReferalInfo } from '../../retail/api/saveReferalInfo';
|
|
@@ -19,11 +18,9 @@ import { useDraftDialog } from '../../retail/components/DraftDialog/useDraftDial
|
|
|
19
18
|
import { VerifyPhoneDialog } from '../../retail/components/VerifyPhoneDialog/VerifyPhoneDialog';
|
|
20
19
|
import { type FormRetailConsents, type LeadFormState } from '../../retail/model/LeadFormState';
|
|
21
20
|
import { type ReferalData } from '../../retail/model/ReferalData';
|
|
22
|
-
import { BIBLIOGLOBUS_SLUG } from '../../retail/utils/filterPaymentSystems';
|
|
23
21
|
import { getUpdateUserProfileData } from '../../retail/utils/getUpdateUserProfile';
|
|
24
22
|
import { useDialog } from '../../ui-kit/DialogManager/useDialog';
|
|
25
23
|
import { formatPhone } from '../../utils/formatPhone';
|
|
26
|
-
import { getCardSlugFromUrl } from '../../utils/getSlugFromUrl';
|
|
27
24
|
import { type ProductType } from './ApplicationLeadFormContent';
|
|
28
25
|
import { productTypeToConsentsMap } from './consents';
|
|
29
26
|
import { getCreditLeadFormTaskData, getDebitLeadFormTaskData } from './getLeadFormTaskData';
|
|
@@ -79,7 +76,6 @@ export const useApplicationLeadApi = ({
|
|
|
79
76
|
|
|
80
77
|
const referalData = leadFormStore.referalData;
|
|
81
78
|
const marketingInfo = sessionStore.marketingInfo;
|
|
82
|
-
const referrerUrl = sessionStore.referrerUrl;
|
|
83
79
|
|
|
84
80
|
if (!profileId) {
|
|
85
81
|
throw new Error();
|
|
@@ -95,7 +91,6 @@ export const useApplicationLeadApi = ({
|
|
|
95
91
|
marketingInfo,
|
|
96
92
|
saveUserData,
|
|
97
93
|
sendAspects,
|
|
98
|
-
referrerUrl,
|
|
99
94
|
});
|
|
100
95
|
verifyPhoneDialog.close();
|
|
101
96
|
if (productType === 'debitCard') {
|
|
@@ -219,18 +214,6 @@ const getAcceptedConsents = (formData: LeadFormState, productType: ProductType):
|
|
|
219
214
|
.map((_) => consents[_]?.text);
|
|
220
215
|
};
|
|
221
216
|
|
|
222
|
-
// Padding line to fix eslint padding-line-between-statements
|
|
223
|
-
|
|
224
|
-
const computeClaimChannel = async (slug: string | null): Promise<string | undefined> => {
|
|
225
|
-
if (slug !== BIBLIOGLOBUS_SLUG) {
|
|
226
|
-
return undefined;
|
|
227
|
-
}
|
|
228
|
-
|
|
229
|
-
const claimData = await getClaimChannel();
|
|
230
|
-
|
|
231
|
-
return claimData.find((item) => item.key === slug)?.code;
|
|
232
|
-
};
|
|
233
|
-
|
|
234
217
|
const updateUserData = async ({
|
|
235
218
|
programId,
|
|
236
219
|
profileId,
|
|
@@ -240,7 +223,6 @@ const updateUserData = async ({
|
|
|
240
223
|
marketingInfo,
|
|
241
224
|
saveUserData,
|
|
242
225
|
sendAspects,
|
|
243
|
-
referrerUrl,
|
|
244
226
|
}: {
|
|
245
227
|
programId: string;
|
|
246
228
|
profileId: number;
|
|
@@ -250,27 +232,17 @@ const updateUserData = async ({
|
|
|
250
232
|
marketingInfo: MarketingInfo | null;
|
|
251
233
|
saveUserData: (userData: UserData) => void;
|
|
252
234
|
sendAspects: (profileId: number, taskId: number) => void;
|
|
253
|
-
referrerUrl: string | null;
|
|
254
235
|
}) => {
|
|
236
|
+
let taskId: number;
|
|
237
|
+
let participantId: number;
|
|
255
238
|
const transformedConsents = transformConsentsFields(formData, productType);
|
|
256
|
-
const slug = getCardSlugFromUrl(referrerUrl as string);
|
|
257
239
|
|
|
258
240
|
await updateUserProfile(getUpdateUserProfileData(profileId, formData, transformedConsents));
|
|
259
241
|
|
|
260
242
|
try {
|
|
261
|
-
let taskId: number;
|
|
262
|
-
let participantId: number;
|
|
263
|
-
|
|
264
243
|
if (productType === 'debitCard') {
|
|
265
|
-
const claimChannelCode = await computeClaimChannel(slug);
|
|
266
|
-
|
|
267
244
|
const debitData = await createUserTaskDebit(
|
|
268
|
-
getDebitLeadFormTaskData(
|
|
269
|
-
formData,
|
|
270
|
-
programId,
|
|
271
|
-
marketingInfo,
|
|
272
|
-
claimChannelCode,
|
|
273
|
-
}),
|
|
245
|
+
getDebitLeadFormTaskData(formData, programId, marketingInfo),
|
|
274
246
|
);
|
|
275
247
|
|
|
276
248
|
taskId = debitData.taskId;
|
|
@@ -293,7 +265,6 @@ const updateUserData = async ({
|
|
|
293
265
|
}),
|
|
294
266
|
);
|
|
295
267
|
}
|
|
296
|
-
|
|
297
268
|
if (referalData?.referalCode) {
|
|
298
269
|
await saveReferalInfo({
|
|
299
270
|
taskId,
|
|
@@ -25,7 +25,6 @@ type InitApplicationLeadProps = {
|
|
|
25
25
|
export interface ApplicationLeadStore {
|
|
26
26
|
marketingInfo: MarketingInfo | null;
|
|
27
27
|
isNewMicroservice: boolean | null;
|
|
28
|
-
referrerUrl: string | null;
|
|
29
28
|
}
|
|
30
29
|
|
|
31
30
|
export const useInitApplicationLead = ({
|
|
@@ -79,11 +78,6 @@ export const useInitApplicationLead = ({
|
|
|
79
78
|
|
|
80
79
|
sessionStore.marketingInfo = getMarketingInfo(queryFromStorage, sessionStore);
|
|
81
80
|
sessionStore.isNewMicroservice = isNewMicroservice || null;
|
|
82
|
-
|
|
83
|
-
const referrer = globalThis.document.referrer;
|
|
84
|
-
if (referrer) {
|
|
85
|
-
sessionStore.referrerUrl = referrer as string;
|
|
86
|
-
}
|
|
87
81
|
}, [queryFromStorage]);
|
|
88
82
|
|
|
89
83
|
useEffect(() => {
|
|
@@ -1,25 +1,68 @@
|
|
|
1
|
+
import type { JSONRefObject } from '../../data/JSONRefObject';
|
|
2
|
+
import { type DynamicDescription } from '../../model/HeadlineType';
|
|
1
3
|
import { BaseProductTile } from '../../ui-kit/BaseProductTile/BaseProductTile';
|
|
2
4
|
import { BlockWrapper } from '../../ui-kit/BlockWrapper';
|
|
3
5
|
import { UniBlock } from '../../UniBlock/UniBlock';
|
|
4
6
|
import { type UniBlockProps } from '../../UniBlock/UniBlockProps';
|
|
7
|
+
import { saveSessionQuery } from '../../utils/getSessionQuery';
|
|
5
8
|
import { style } from '../../utils/style';
|
|
6
9
|
import { type ProductBlockContent } from './ProductBlockContent';
|
|
7
10
|
|
|
8
|
-
export interface ProductBlockProps extends UniBlockProps, ProductBlockContent {
|
|
11
|
+
export interface ProductBlockProps extends UniBlockProps, ProductBlockContent {
|
|
12
|
+
dynamicDescriptionSource?: JSONRefObject & {
|
|
13
|
+
list?: Record<string, string>[];
|
|
14
|
+
};
|
|
15
|
+
}
|
|
9
16
|
|
|
10
17
|
export const ProductBlock = UniBlock<ProductBlockProps>(
|
|
11
|
-
({
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
18
|
+
({
|
|
19
|
+
className,
|
|
20
|
+
padding,
|
|
21
|
+
defaultPadding,
|
|
22
|
+
dynamicUtmDescription,
|
|
23
|
+
dynamicDescriptionSource,
|
|
24
|
+
description,
|
|
25
|
+
...rest
|
|
26
|
+
}) => {
|
|
27
|
+
const formatDescription = getFormatDescription(
|
|
28
|
+
dynamicUtmDescription,
|
|
29
|
+
dynamicDescriptionSource?.list,
|
|
30
|
+
description,
|
|
31
|
+
);
|
|
32
|
+
|
|
33
|
+
return (
|
|
34
|
+
<BlockWrapper
|
|
35
|
+
className={style('overflow-hidden flex flex-col gap-3xl box-border', className)}
|
|
36
|
+
padding="p-0"
|
|
21
37
|
{...rest}
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
38
|
+
>
|
|
39
|
+
<BaseProductTile
|
|
40
|
+
defaultPadding={defaultPadding || 'p-6xl'}
|
|
41
|
+
padding={padding}
|
|
42
|
+
description={formatDescription}
|
|
43
|
+
className="grow h-full"
|
|
44
|
+
{...rest}
|
|
45
|
+
/>
|
|
46
|
+
</BlockWrapper>
|
|
47
|
+
);
|
|
48
|
+
},
|
|
25
49
|
);
|
|
50
|
+
|
|
51
|
+
const getFormatDescription = (
|
|
52
|
+
dynamicUtmDescription: DynamicDescription = {},
|
|
53
|
+
valuesList: Record<string, string>[] = [],
|
|
54
|
+
description = '',
|
|
55
|
+
) => {
|
|
56
|
+
const { utm, value } = dynamicUtmDescription;
|
|
57
|
+
const sessionQuery = saveSessionQuery();
|
|
58
|
+
const utmValue = getUtmValue(utm ?? 'utm_source', sessionQuery);
|
|
59
|
+
const dynamicValue = valuesList.find((item) => item?.id === utmValue)?.value;
|
|
60
|
+
|
|
61
|
+
return dynamicValue ? description.replace(String(value), dynamicValue) : description;
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
const getUtmValue = (utm: string, queryString: string) => {
|
|
65
|
+
const params = new URLSearchParams(queryString);
|
|
66
|
+
|
|
67
|
+
return params.get(utm);
|
|
68
|
+
};
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
type AdditionalDescriptionProps,
|
|
3
|
+
type DynamicDescriptionProps,
|
|
4
|
+
} from '../../model/HeadlineType';
|
|
2
5
|
import { type BaseProductTileContent } from '../../ui-kit/BaseProductTile/BaseProductTileContent';
|
|
3
6
|
import { type UniBlockContent } from '../../UniBlock/UniBlockProps';
|
|
4
7
|
|
|
@@ -7,7 +10,8 @@ import { type UniBlockContent } from '../../UniBlock/UniBlockProps';
|
|
|
7
10
|
*/
|
|
8
11
|
export type ProductBlockContent = UniBlockContent &
|
|
9
12
|
BaseProductTileContent &
|
|
10
|
-
AdditionalDescriptionProps &
|
|
13
|
+
AdditionalDescriptionProps &
|
|
14
|
+
DynamicDescriptionProps & {
|
|
11
15
|
/** @title Отображать кнопку возврата */
|
|
12
16
|
backwardButton?: boolean;
|
|
13
17
|
};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type JSONRefObject } from '../data/JSONRefObject';
|
|
1
2
|
import { type TextAlign } from '../ui-kit/Text/TextProps';
|
|
2
3
|
|
|
3
4
|
/**
|
|
@@ -45,8 +46,26 @@ export type AdditionalDescriptionProps = {
|
|
|
45
46
|
additionalDescription?: string;
|
|
46
47
|
};
|
|
47
48
|
|
|
48
|
-
export type
|
|
49
|
+
export type DynamicDescriptionProps = {
|
|
50
|
+
/** @title Динамическое описание по значению utm-метки */
|
|
51
|
+
dynamicUtmDescription?: DynamicDescription;
|
|
52
|
+
/** @title Справочник значений */
|
|
53
|
+
dynamicDescriptionSource?: JSONRefObject;
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
export type HeadlineCommonProps = TitleProps &
|
|
57
|
+
DescriptionProps &
|
|
58
|
+
AlignProps &
|
|
59
|
+
AdditionalDescriptionProps &
|
|
60
|
+
DynamicDescriptionProps;
|
|
49
61
|
|
|
50
62
|
export type HeadlineProps = HeadlineCommonProps & {
|
|
51
63
|
headlineVersion?: HeadlineVersion;
|
|
52
64
|
};
|
|
65
|
+
|
|
66
|
+
export type DynamicDescription = {
|
|
67
|
+
/** @title utm-метка */
|
|
68
|
+
utm?: string;
|
|
69
|
+
/** @title Заменяемый текст */
|
|
70
|
+
value?: string;
|
|
71
|
+
};
|
|
@@ -1,26 +1,18 @@
|
|
|
1
1
|
import { JSX } from '@redneckz/uni-jsx';
|
|
2
2
|
import { useEffect, useState } from '@redneckz/uni-jsx/lib/hooks';
|
|
3
|
-
import { useSessionStore } from '@redneckz/uni-jsx/lib/Store/useSessionStore';
|
|
4
3
|
import { getOfficePoint } from '../../../components/OfficesAtmsMap/renderOfficeCard';
|
|
5
4
|
import { useOfficesAtmsMapData } from '../../../components/OfficesAtmsMap/useOfficesAtmsMapData';
|
|
6
5
|
import { ClientOnly } from '../../../ui-kit/ClientOnly';
|
|
7
6
|
import { type CustomFieldProps } from '../../../ui-kit/FormField/CustomFieldProps';
|
|
8
7
|
import { SelectControl } from '../../../ui-kit/Select/SelectControl';
|
|
9
8
|
import { YandexMap } from '../../../ui-kit/YandexMap/YandexMap';
|
|
10
|
-
import { getCardSlugFromUrl } from '../../../utils/getSlugFromUrl';
|
|
11
9
|
import { fetchRegionOffices, type OfficeType } from '../../api/regionOffices';
|
|
12
10
|
import { useLeadFormData } from '../../hooks/useLeadFormData';
|
|
13
|
-
import { BIBLIOGLOBUS_SLUG } from '../../utils/filterPaymentSystems';
|
|
14
|
-
|
|
15
|
-
const BIBLIOGLOBUS_OFFICE_ID = '714680716';
|
|
16
11
|
|
|
17
12
|
export const AddressRetailField = JSX<CustomFieldProps>(({ field, input }) => {
|
|
18
13
|
const [offices, setOffices] = useState<OfficeType[]>([]);
|
|
19
14
|
const { data } = useLeadFormData('REGION_RF');
|
|
20
15
|
|
|
21
|
-
const sessionStore = useSessionStore<{ referrerUrl?: string }>();
|
|
22
|
-
const referrerUrl = sessionStore.referrerUrl;
|
|
23
|
-
|
|
24
16
|
const regionValue = field('regionRetail')?.value || {};
|
|
25
17
|
const addressField = field(input?.name ?? '');
|
|
26
18
|
|
|
@@ -35,24 +27,6 @@ export const AddressRetailField = JSX<CustomFieldProps>(({ field, input }) => {
|
|
|
35
27
|
}
|
|
36
28
|
}, [regionValue.key]);
|
|
37
29
|
|
|
38
|
-
// Логика для biblioglobus - выбор отделения по умолчанию
|
|
39
|
-
useEffect(() => {
|
|
40
|
-
if (!referrerUrl || !offices.length) {
|
|
41
|
-
return;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
const slug = getCardSlugFromUrl(referrerUrl);
|
|
45
|
-
if (slug === BIBLIOGLOBUS_SLUG) {
|
|
46
|
-
const defaultOffice = offices.find(
|
|
47
|
-
(office) => office.id?.toString() === BIBLIOGLOBUS_OFFICE_ID,
|
|
48
|
-
);
|
|
49
|
-
addressField.onChange?.({
|
|
50
|
-
key: defaultOffice?.id?.toString() || '',
|
|
51
|
-
text: defaultOffice?.address || '',
|
|
52
|
-
});
|
|
53
|
-
}
|
|
54
|
-
}, [referrerUrl, offices]);
|
|
55
|
-
|
|
56
30
|
const { points } = useOfficesAtmsMapData({
|
|
57
31
|
data: offices,
|
|
58
32
|
filtrationState: {},
|
|
@@ -1,14 +1,11 @@
|
|
|
1
1
|
import { JSX } from '@redneckz/uni-jsx';
|
|
2
2
|
import { useMemo, useState } from '@redneckz/uni-jsx/lib/hooks';
|
|
3
3
|
import { useLocalStore } from '@redneckz/uni-jsx/lib/Store/useLocalStore';
|
|
4
|
-
import { useSessionStore } from '@redneckz/uni-jsx/lib/Store/useSessionStore';
|
|
5
4
|
import { useAsyncEffect } from '../../../hooks/useAsyncEffect';
|
|
6
5
|
import { type CustomFieldProps } from '../../../ui-kit/FormField/CustomFieldProps';
|
|
7
6
|
import { RadioButtonGroupControl } from '../../../ui-kit/RadioButtonGroup/RadioButtonGroupControl';
|
|
8
7
|
import { type Option } from '../../../ui-kit/Select/Option';
|
|
9
|
-
import { getCardSlugFromUrl } from '../../../utils/getSlugFromUrl';
|
|
10
8
|
import { getPaymentSystems } from '../../api/getPaymentSystems';
|
|
11
|
-
import { filterPaymentSystems } from '../../utils/filterPaymentSystems';
|
|
12
9
|
|
|
13
10
|
const optionKey = (option: { key?: string } | undefined) => option?.key;
|
|
14
11
|
|
|
@@ -16,28 +13,12 @@ export const PaymentSystemField = JSX<CustomFieldProps>(({ field, input }) => {
|
|
|
16
13
|
const [paymentSystemOptions, setPaymentSystemOptions] = useState<Option[]>([]);
|
|
17
14
|
|
|
18
15
|
const localStore = useLocalStore<{ programId: string }>();
|
|
19
|
-
const sessionStore = useSessionStore<{ referrerUrl?: string }>();
|
|
20
|
-
|
|
21
16
|
useAsyncEffect(async () => {
|
|
22
17
|
const { programId } = localStore;
|
|
23
|
-
if (
|
|
24
|
-
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
const fetchedPaymentSystems = await getPaymentSystems(programId);
|
|
28
|
-
|
|
29
|
-
const referrerUrl = sessionStore.referrerUrl;
|
|
30
|
-
|
|
31
|
-
if (!referrerUrl) {
|
|
18
|
+
if (programId) {
|
|
19
|
+
const fetchedPaymentSystems = await getPaymentSystems(programId);
|
|
32
20
|
setPaymentSystemOptions(fetchedPaymentSystems ?? []);
|
|
33
|
-
|
|
34
|
-
return;
|
|
35
21
|
}
|
|
36
|
-
|
|
37
|
-
const slug = getCardSlugFromUrl(referrerUrl);
|
|
38
|
-
const filteredSystems = filterPaymentSystems(fetchedPaymentSystems ?? [], slug);
|
|
39
|
-
|
|
40
|
-
setPaymentSystemOptions(filteredSystems);
|
|
41
22
|
}, []);
|
|
42
23
|
|
|
43
24
|
const items = useMemo(
|
|
@@ -1,24 +1,19 @@
|
|
|
1
1
|
import { JSX } from '@redneckz/uni-jsx';
|
|
2
2
|
import { useCallback, useEffect } from '@redneckz/uni-jsx/lib/hooks';
|
|
3
3
|
import { useAsyncData } from '@redneckz/uni-jsx/lib/hooks/useAsyncData';
|
|
4
|
-
import { useSessionStore } from '@redneckz/uni-jsx/lib/Store/useSessionStore';
|
|
5
4
|
import { type ProductType } from '../../../components/ApplicationLeadForm/ApplicationLeadFormContent';
|
|
6
5
|
import { type CustomFieldProps } from '../../../ui-kit/FormField/CustomFieldProps';
|
|
7
6
|
import { type Option } from '../../../ui-kit/Select/Option';
|
|
8
7
|
import { SelectControl } from '../../../ui-kit/Select/SelectControl';
|
|
9
8
|
import { getRegionsCardDelivery } from '../../api/getRegionsCardDelivery';
|
|
10
|
-
import { useBiblioglobusDefaultRegion } from '../../hooks/useBiblioglobusDefaultRegion';
|
|
11
9
|
import { useLeadFormData } from '../../hooks/useLeadFormData';
|
|
12
10
|
import { useRetailFormStore } from '../../hooks/useRetailFormStore';
|
|
13
|
-
import { calculateRegionHasDelivery, getRegionDeliveryStatus } from '../../utils/hasDelivery';
|
|
14
11
|
|
|
15
12
|
export const RegionRetailField = JSX<CustomFieldProps>(({ field, input }) => {
|
|
16
13
|
const { programId, productType } = useRetailFormStore();
|
|
17
14
|
const { data: regions } = useLeadFormData('REGION_RF');
|
|
18
15
|
const { data: regionsDelivery } = useAsyncData('regionsDelivery', getRegionsCardDelivery);
|
|
19
16
|
const { data: productSettings } = useLeadFormData(getCurrentProductSettings(productType));
|
|
20
|
-
const sessionStore = useSessionStore<{ referrerUrl?: string }>();
|
|
21
|
-
|
|
22
17
|
const isDebit = productType === 'debitCard';
|
|
23
18
|
const isSalaryCard = programId === '38';
|
|
24
19
|
const isEsiaAuth = Boolean(field('esiaAccountTypeCd')?.value?.key);
|
|
@@ -29,30 +24,20 @@ export const RegionRetailField = JSX<CustomFieldProps>(({ field, input }) => {
|
|
|
29
24
|
const handleChangeRegionHasDelivery = field('regionHasDelivery')?.onChange;
|
|
30
25
|
const handleChangeMethodObtain = field('methodObtain')?.onChange;
|
|
31
26
|
|
|
32
|
-
useBiblioglobusDefaultRegion({
|
|
33
|
-
referrerUrl: sessionStore.referrerUrl ?? undefined,
|
|
34
|
-
regions,
|
|
35
|
-
regionsDelivery,
|
|
36
|
-
onRegionChange: handleChangeRegion,
|
|
37
|
-
onRegionHasDeliveryChange: handleChangeRegionHasDelivery,
|
|
38
|
-
onMethodObtainChange: handleChangeMethodObtain,
|
|
39
|
-
});
|
|
40
|
-
|
|
41
27
|
const onChange = useCallback(
|
|
42
28
|
(value: Option) => {
|
|
43
|
-
const regionHasDelivery =
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
});
|
|
29
|
+
const regionHasDelivery = isDebit
|
|
30
|
+
? isEsiaAuth &&
|
|
31
|
+
!isSalaryCard &&
|
|
32
|
+
isDeliveryActive &&
|
|
33
|
+
regionsDelivery?.find((_) => _.regionCode === value.key)?.deliveryFlg
|
|
34
|
+
: isDeliveryActive && regionsDelivery?.find((_) => _.regionCode === value.key)?.deliveryFlg;
|
|
50
35
|
|
|
51
36
|
handleChangeRegionHasDelivery?.(regionHasDelivery);
|
|
52
37
|
handleChangeMethodObtain?.(regionHasDelivery ? 'courier' : 'office');
|
|
53
38
|
handleChangeRegion?.(value);
|
|
54
39
|
},
|
|
55
|
-
[
|
|
40
|
+
[regionsDelivery, isDeliveryActive, isEsiaAuth],
|
|
56
41
|
);
|
|
57
42
|
|
|
58
43
|
useEffect(() => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@redneckz/wildless-cms-uni-blocks",
|
|
3
|
-
"version": "0.14.
|
|
3
|
+
"version": "0.14.975",
|
|
4
4
|
"private": false,
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "ЦК",
|
|
@@ -205,7 +205,7 @@
|
|
|
205
205
|
"path": "lib/common.css"
|
|
206
206
|
},
|
|
207
207
|
{
|
|
208
|
-
"limit": "
|
|
208
|
+
"limit": "105 kB",
|
|
209
209
|
"path": "bundle/bundle.umd.min.js"
|
|
210
210
|
}
|
|
211
211
|
],
|
|
@@ -83,19 +83,11 @@ export const getParticipant = ({
|
|
|
83
83
|
};
|
|
84
84
|
};
|
|
85
85
|
|
|
86
|
-
|
|
87
|
-
formData: LeadFormState
|
|
88
|
-
programId: string
|
|
89
|
-
marketingInfo: MarketingInfo | null
|
|
90
|
-
|
|
91
|
-
};
|
|
92
|
-
|
|
93
|
-
export const getDebitLeadFormTaskData = ({
|
|
94
|
-
formData,
|
|
95
|
-
programId,
|
|
96
|
-
marketingInfo,
|
|
97
|
-
claimChannelCode,
|
|
98
|
-
}: GetDebitLeadFormTaskDataProps): CreateUserTaskDebitBody => {
|
|
86
|
+
export const getDebitLeadFormTaskData = (
|
|
87
|
+
formData: LeadFormState,
|
|
88
|
+
programId: string,
|
|
89
|
+
marketingInfo: MarketingInfo | null,
|
|
90
|
+
): CreateUserTaskDebitBody => {
|
|
99
91
|
const { name, surname, middleName, limitedBirthday, phone, email } = formData;
|
|
100
92
|
const taskSource = getTaskSource(marketingInfo?.utm_source);
|
|
101
93
|
|
|
@@ -119,7 +111,6 @@ export const getDebitLeadFormTaskData = ({
|
|
|
119
111
|
],
|
|
120
112
|
marketingInfo,
|
|
121
113
|
},
|
|
122
|
-
...(claimChannelCode ? { claimChannelCode } : {}),
|
|
123
114
|
};
|
|
124
115
|
};
|
|
125
116
|
|
|
@@ -8,7 +8,6 @@ import { createDraftTask } from '../../retail/api/createDraftTask';
|
|
|
8
8
|
import { createParticipant } from '../../retail/api/createParticipant';
|
|
9
9
|
import { createUserProfile } from '../../retail/api/createUserProfile';
|
|
10
10
|
import { createUserTaskDebit } from '../../retail/api/createUserTaskDebit';
|
|
11
|
-
import { getClaimChannel } from '../../retail/api/getClaimChannel';
|
|
12
11
|
import { getLastTaskStatus } from '../../retail/api/getLastTaskStatus';
|
|
13
12
|
import { getTaskById } from '../../retail/api/getTaskById';
|
|
14
13
|
import { saveReferalInfo } from '../../retail/api/saveReferalInfo';
|
|
@@ -19,11 +18,9 @@ import { useDraftDialog } from '../../retail/components/DraftDialog/useDraftDial
|
|
|
19
18
|
import { VerifyPhoneDialog } from '../../retail/components/VerifyPhoneDialog/VerifyPhoneDialog';
|
|
20
19
|
import { type FormRetailConsents, type LeadFormState } from '../../retail/model/LeadFormState';
|
|
21
20
|
import { type ReferalData } from '../../retail/model/ReferalData';
|
|
22
|
-
import { BIBLIOGLOBUS_SLUG } from '../../retail/utils/filterPaymentSystems';
|
|
23
21
|
import { getUpdateUserProfileData } from '../../retail/utils/getUpdateUserProfile';
|
|
24
22
|
import { useDialog } from '../../ui-kit/DialogManager/useDialog';
|
|
25
23
|
import { formatPhone } from '../../utils/formatPhone';
|
|
26
|
-
import { getCardSlugFromUrl } from '../../utils/getSlugFromUrl';
|
|
27
24
|
import { type ProductType } from './ApplicationLeadFormContent';
|
|
28
25
|
import { productTypeToConsentsMap } from './consents';
|
|
29
26
|
import { getCreditLeadFormTaskData, getDebitLeadFormTaskData } from './getLeadFormTaskData';
|
|
@@ -79,7 +76,6 @@ export const useApplicationLeadApi = ({
|
|
|
79
76
|
|
|
80
77
|
const referalData = leadFormStore.referalData;
|
|
81
78
|
const marketingInfo = sessionStore.marketingInfo;
|
|
82
|
-
const referrerUrl = sessionStore.referrerUrl;
|
|
83
79
|
|
|
84
80
|
if (!profileId) {
|
|
85
81
|
throw new Error();
|
|
@@ -95,7 +91,6 @@ export const useApplicationLeadApi = ({
|
|
|
95
91
|
marketingInfo,
|
|
96
92
|
saveUserData,
|
|
97
93
|
sendAspects,
|
|
98
|
-
referrerUrl,
|
|
99
94
|
});
|
|
100
95
|
verifyPhoneDialog.close();
|
|
101
96
|
if (productType === 'debitCard') {
|
|
@@ -219,18 +214,6 @@ const getAcceptedConsents = (formData: LeadFormState, productType: ProductType):
|
|
|
219
214
|
.map((_) => consents[_]?.text);
|
|
220
215
|
};
|
|
221
216
|
|
|
222
|
-
// Padding line to fix eslint padding-line-between-statements
|
|
223
|
-
|
|
224
|
-
const computeClaimChannel = async (slug: string | null): Promise<string | undefined> => {
|
|
225
|
-
if (slug !== BIBLIOGLOBUS_SLUG) {
|
|
226
|
-
return undefined;
|
|
227
|
-
}
|
|
228
|
-
|
|
229
|
-
const claimData = await getClaimChannel();
|
|
230
|
-
|
|
231
|
-
return claimData.find((item) => item.key === slug)?.code;
|
|
232
|
-
};
|
|
233
|
-
|
|
234
217
|
const updateUserData = async ({
|
|
235
218
|
programId,
|
|
236
219
|
profileId,
|
|
@@ -240,7 +223,6 @@ const updateUserData = async ({
|
|
|
240
223
|
marketingInfo,
|
|
241
224
|
saveUserData,
|
|
242
225
|
sendAspects,
|
|
243
|
-
referrerUrl,
|
|
244
226
|
}: {
|
|
245
227
|
programId: string;
|
|
246
228
|
profileId: number;
|
|
@@ -250,27 +232,17 @@ const updateUserData = async ({
|
|
|
250
232
|
marketingInfo: MarketingInfo | null;
|
|
251
233
|
saveUserData: (userData: UserData) => void;
|
|
252
234
|
sendAspects: (profileId: number, taskId: number) => void;
|
|
253
|
-
referrerUrl: string | null;
|
|
254
235
|
}) => {
|
|
236
|
+
let taskId: number;
|
|
237
|
+
let participantId: number;
|
|
255
238
|
const transformedConsents = transformConsentsFields(formData, productType);
|
|
256
|
-
const slug = getCardSlugFromUrl(referrerUrl as string);
|
|
257
239
|
|
|
258
240
|
await updateUserProfile(getUpdateUserProfileData(profileId, formData, transformedConsents));
|
|
259
241
|
|
|
260
242
|
try {
|
|
261
|
-
let taskId: number;
|
|
262
|
-
let participantId: number;
|
|
263
|
-
|
|
264
243
|
if (productType === 'debitCard') {
|
|
265
|
-
const claimChannelCode = await computeClaimChannel(slug);
|
|
266
|
-
|
|
267
244
|
const debitData = await createUserTaskDebit(
|
|
268
|
-
getDebitLeadFormTaskData(
|
|
269
|
-
formData,
|
|
270
|
-
programId,
|
|
271
|
-
marketingInfo,
|
|
272
|
-
claimChannelCode,
|
|
273
|
-
}),
|
|
245
|
+
getDebitLeadFormTaskData(formData, programId, marketingInfo),
|
|
274
246
|
);
|
|
275
247
|
|
|
276
248
|
taskId = debitData.taskId;
|
|
@@ -293,7 +265,6 @@ const updateUserData = async ({
|
|
|
293
265
|
}),
|
|
294
266
|
);
|
|
295
267
|
}
|
|
296
|
-
|
|
297
268
|
if (referalData?.referalCode) {
|
|
298
269
|
await saveReferalInfo({
|
|
299
270
|
taskId,
|
|
@@ -25,7 +25,6 @@ type InitApplicationLeadProps = {
|
|
|
25
25
|
export interface ApplicationLeadStore {
|
|
26
26
|
marketingInfo: MarketingInfo | null;
|
|
27
27
|
isNewMicroservice: boolean | null;
|
|
28
|
-
referrerUrl: string | null;
|
|
29
28
|
}
|
|
30
29
|
|
|
31
30
|
export const useInitApplicationLead = ({
|
|
@@ -79,11 +78,6 @@ export const useInitApplicationLead = ({
|
|
|
79
78
|
|
|
80
79
|
sessionStore.marketingInfo = getMarketingInfo(queryFromStorage, sessionStore);
|
|
81
80
|
sessionStore.isNewMicroservice = isNewMicroservice || null;
|
|
82
|
-
|
|
83
|
-
const referrer = globalThis.document.referrer;
|
|
84
|
-
if (referrer) {
|
|
85
|
-
sessionStore.referrerUrl = referrer as string;
|
|
86
|
-
}
|
|
87
81
|
}, [queryFromStorage]);
|
|
88
82
|
|
|
89
83
|
useEffect(() => {
|
|
@@ -264,6 +264,28 @@ export default {
|
|
|
264
264
|
/>
|
|
265
265
|
</div>
|
|
266
266
|
),
|
|
267
|
+
'secondary with benefits and utm': (
|
|
268
|
+
<div className="container grid grid-cols-12">
|
|
269
|
+
<ProductBlock
|
|
270
|
+
className="col-span-12"
|
|
271
|
+
title="Потребительский кредит наличными"
|
|
272
|
+
headlineVersion="L"
|
|
273
|
+
description="Для всех зарплатных клиентов вашей компании действует специальная программа:"
|
|
274
|
+
benefits={benefits}
|
|
275
|
+
benefitsVersion="white"
|
|
276
|
+
buttons={buttonsSecond}
|
|
277
|
+
image={image}
|
|
278
|
+
version="secondary"
|
|
279
|
+
dynamicUtmDescription={{
|
|
280
|
+
utm: 'utm_source',
|
|
281
|
+
value: 'вашей компании',
|
|
282
|
+
}}
|
|
283
|
+
dynamicDescriptionSource={{
|
|
284
|
+
$ref: '/wcms-resources/referal-programm.json',
|
|
285
|
+
}}
|
|
286
|
+
/>
|
|
287
|
+
</div>
|
|
288
|
+
),
|
|
267
289
|
'secondary with list': (
|
|
268
290
|
<div className="container grid grid-cols-12">
|
|
269
291
|
<ProductBlock className="col-span-12" {...PRODUCT_BLOCK} image={image} version="secondary" />
|