@redneckz/wildless-cms-uni-blocks 0.14.1070 → 0.14.1072
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundle/bundle.umd.js +47 -24
- package/bundle/bundle.umd.min.js +1 -1
- package/bundle/components/Header/HeaderQuickActionsMenu.d.ts +1 -0
- package/bundle/retail/model/ApplicationLeadFormTypes.d.ts +1 -1
- package/dist/components/ApplicationLeadForm/useApplicationLeadApi.js +34 -22
- package/dist/components/ApplicationLeadForm/useApplicationLeadApi.js.map +1 -1
- package/dist/components/Header/HeaderQuickActionsMenu.d.ts +1 -0
- package/dist/components/Header/HeaderQuickActionsMenu.js +11 -0
- package/dist/components/Header/HeaderQuickActionsMenu.js.map +1 -1
- package/dist/retail/api/createParticipant.js +1 -1
- package/dist/retail/api/createParticipant.js.map +1 -1
- package/dist/retail/model/ApplicationLeadFormTypes.d.ts +1 -1
- package/lib/components/ApplicationLeadForm/useApplicationLeadApi.js +34 -22
- package/lib/components/ApplicationLeadForm/useApplicationLeadApi.js.map +1 -1
- package/lib/components/Header/HeaderQuickActionsMenu.d.ts +1 -0
- package/lib/components/Header/HeaderQuickActionsMenu.js +11 -0
- package/lib/components/Header/HeaderQuickActionsMenu.js.map +1 -1
- package/lib/retail/api/createParticipant.js +1 -1
- package/lib/retail/api/createParticipant.js.map +1 -1
- package/lib/retail/model/ApplicationLeadFormTypes.d.ts +1 -1
- package/mobile/bundle/bundle.umd.js +47 -24
- package/mobile/bundle/bundle.umd.min.js +1 -1
- package/mobile/bundle/components/Header/HeaderQuickActionsMenu.d.ts +1 -0
- package/mobile/bundle/retail/model/ApplicationLeadFormTypes.d.ts +1 -1
- package/mobile/dist/components/ApplicationLeadForm/useApplicationLeadApi.js +34 -22
- package/mobile/dist/components/ApplicationLeadForm/useApplicationLeadApi.js.map +1 -1
- package/mobile/dist/components/Header/HeaderQuickActionsMenu.d.ts +1 -0
- package/mobile/dist/components/Header/HeaderQuickActionsMenu.js +11 -0
- package/mobile/dist/components/Header/HeaderQuickActionsMenu.js.map +1 -1
- package/mobile/dist/retail/api/createParticipant.js +1 -1
- package/mobile/dist/retail/api/createParticipant.js.map +1 -1
- package/mobile/dist/retail/model/ApplicationLeadFormTypes.d.ts +1 -1
- package/mobile/lib/components/ApplicationLeadForm/useApplicationLeadApi.js +34 -22
- package/mobile/lib/components/ApplicationLeadForm/useApplicationLeadApi.js.map +1 -1
- package/mobile/lib/components/Header/HeaderQuickActionsMenu.d.ts +1 -0
- package/mobile/lib/components/Header/HeaderQuickActionsMenu.js +11 -0
- package/mobile/lib/components/Header/HeaderQuickActionsMenu.js.map +1 -1
- package/mobile/lib/retail/api/createParticipant.js +1 -1
- package/mobile/lib/retail/api/createParticipant.js.map +1 -1
- package/mobile/lib/retail/model/ApplicationLeadFormTypes.d.ts +1 -1
- package/mobile/src/components/ApplicationLeadForm/useApplicationLeadApi.tsx +47 -28
- package/mobile/src/components/Header/HeaderQuickActionsMenu.tsx +12 -0
- package/mobile/src/retail/api/createParticipant.ts +1 -1
- package/mobile/src/retail/model/ApplicationLeadFormTypes.ts +1 -1
- package/package.json +1 -1
- package/src/components/ApplicationLeadForm/useApplicationLeadApi.tsx +47 -28
- package/src/components/Header/HeaderQuickActionsMenu.tsx +12 -0
- package/src/retail/api/createParticipant.ts +1 -1
- package/src/retail/model/ApplicationLeadFormTypes.ts +1 -1
package/package.json
CHANGED
|
@@ -152,26 +152,11 @@ export const useApplicationLeadApi = ({
|
|
|
152
152
|
try {
|
|
153
153
|
startSending();
|
|
154
154
|
const transformedFormData = transformFormData(formData);
|
|
155
|
-
const participantData = await createParticipant({
|
|
156
|
-
phone: formatPhone(transformedFormData.phone as string),
|
|
157
|
-
email: transformedFormData.email as string,
|
|
158
|
-
});
|
|
159
|
-
|
|
160
155
|
const referalData = leadFormStore.referalData;
|
|
161
156
|
const marketingInfo = sessionStore.marketingInfo;
|
|
162
157
|
|
|
163
|
-
if (!participantData) {
|
|
164
|
-
throw new Error();
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
const { participantId, userId } = participantData;
|
|
168
|
-
|
|
169
|
-
if (!participantId) {
|
|
170
|
-
throw new Error();
|
|
171
|
-
}
|
|
172
158
|
const common: CommonLeadProps = {
|
|
173
159
|
programId,
|
|
174
|
-
userId,
|
|
175
160
|
productType,
|
|
176
161
|
sendAspects,
|
|
177
162
|
verifyPhoneDialog,
|
|
@@ -179,23 +164,17 @@ export const useApplicationLeadApi = ({
|
|
|
179
164
|
};
|
|
180
165
|
|
|
181
166
|
const taskData: TaskDataProps = {
|
|
182
|
-
participantId,
|
|
183
167
|
formData: transformedFormData,
|
|
184
168
|
referalData,
|
|
185
169
|
marketingInfo,
|
|
186
170
|
saveUserData,
|
|
187
171
|
};
|
|
188
172
|
|
|
189
|
-
const sendCurrentTask = createSendCurrentTaskNew({
|
|
190
|
-
common,
|
|
191
|
-
taskData,
|
|
192
|
-
consentBkiDialog,
|
|
193
|
-
});
|
|
194
|
-
|
|
195
173
|
const handleSuccessVerify = createHandleSuccessVerifyNew({
|
|
196
174
|
common,
|
|
175
|
+
taskData,
|
|
197
176
|
draftDialog,
|
|
198
|
-
|
|
177
|
+
consentBkiDialog,
|
|
199
178
|
});
|
|
200
179
|
|
|
201
180
|
const acceptedConsents = getAcceptedConsents(transformedFormData, productType);
|
|
@@ -233,6 +212,11 @@ const createSendCurrentTaskNew =
|
|
|
233
212
|
const { programId, userId, productType, sendAspects, verifyPhoneDialog, handleFailSendForm } =
|
|
234
213
|
common;
|
|
235
214
|
const { participantId, formData, referalData, marketingInfo, saveUserData } = taskData;
|
|
215
|
+
|
|
216
|
+
if (!participantId) {
|
|
217
|
+
throw new Error();
|
|
218
|
+
}
|
|
219
|
+
|
|
236
220
|
const taskId = await updateUserDataNewMicroservice({
|
|
237
221
|
programId,
|
|
238
222
|
participantId,
|
|
@@ -257,17 +241,51 @@ const createSendCurrentTaskNew =
|
|
|
257
241
|
const createHandleSuccessVerifyNew =
|
|
258
242
|
({
|
|
259
243
|
common,
|
|
244
|
+
taskData,
|
|
260
245
|
draftDialog,
|
|
261
|
-
|
|
246
|
+
consentBkiDialog,
|
|
262
247
|
}: {
|
|
263
248
|
common: CommonLeadProps;
|
|
249
|
+
taskData: TaskDataProps;
|
|
264
250
|
draftDialog: any;
|
|
265
|
-
|
|
251
|
+
consentBkiDialog: ReturnType<typeof useConsentBkiDialog>;
|
|
266
252
|
}) =>
|
|
267
253
|
async () => {
|
|
268
|
-
const {
|
|
269
|
-
|
|
254
|
+
const { programId, productType, sendAspects, verifyPhoneDialog, handleFailSendForm } = common;
|
|
255
|
+
const { formData } = taskData;
|
|
256
|
+
|
|
270
257
|
try {
|
|
258
|
+
const participantData = await createParticipant({
|
|
259
|
+
phone: formatPhone(formData.phone as string),
|
|
260
|
+
email: formData.email as string,
|
|
261
|
+
});
|
|
262
|
+
|
|
263
|
+
if (!participantData) {
|
|
264
|
+
throw new Error();
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
const { participantId, userId } = participantData;
|
|
268
|
+
|
|
269
|
+
if (!participantId) {
|
|
270
|
+
throw new Error();
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
const updatedCommon: CommonLeadProps = {
|
|
274
|
+
...common,
|
|
275
|
+
userId,
|
|
276
|
+
};
|
|
277
|
+
|
|
278
|
+
const updatedTaskData: TaskDataProps = {
|
|
279
|
+
...taskData,
|
|
280
|
+
participantId,
|
|
281
|
+
};
|
|
282
|
+
|
|
283
|
+
const sendCurrentTask = createSendCurrentTaskNew({
|
|
284
|
+
common: updatedCommon,
|
|
285
|
+
taskData: updatedTaskData,
|
|
286
|
+
consentBkiDialog,
|
|
287
|
+
});
|
|
288
|
+
|
|
271
289
|
const lastTaskId = await getLastTaskStatus({ userId, programId });
|
|
272
290
|
|
|
273
291
|
if (lastTaskId) {
|
|
@@ -283,7 +301,8 @@ const createHandleSuccessVerifyNew =
|
|
|
283
301
|
} else {
|
|
284
302
|
await sendCurrentTask();
|
|
285
303
|
}
|
|
286
|
-
} catch {
|
|
304
|
+
} catch (error) {
|
|
305
|
+
console.error('Error in handleSuccessVerify:', error);
|
|
287
306
|
handleFailSendForm();
|
|
288
307
|
}
|
|
289
308
|
};
|
|
@@ -96,6 +96,13 @@ const renderQuickActionsDropdown = ({
|
|
|
96
96
|
},
|
|
97
97
|
text: 'Написать в чат',
|
|
98
98
|
},
|
|
99
|
+
phone: {
|
|
100
|
+
handler: (ev: PreventableEventWithTarget) => {
|
|
101
|
+
handlers?.phone(ev);
|
|
102
|
+
closeDropdown();
|
|
103
|
+
},
|
|
104
|
+
text: 'Позвонить в Банк',
|
|
105
|
+
},
|
|
99
106
|
};
|
|
100
107
|
|
|
101
108
|
return (
|
|
@@ -127,8 +134,13 @@ export const useHandlers = () => {
|
|
|
127
134
|
}
|
|
128
135
|
}, []);
|
|
129
136
|
|
|
137
|
+
const handlePhoneClick = useCallback(() => {
|
|
138
|
+
globalThis.location.href = 'tel:88001007870';
|
|
139
|
+
}, []);
|
|
140
|
+
|
|
130
141
|
return {
|
|
131
142
|
call: handleCallClick,
|
|
132
143
|
chat: handleChatClick,
|
|
144
|
+
phone: handlePhoneClick,
|
|
133
145
|
};
|
|
134
146
|
};
|
|
@@ -12,7 +12,7 @@ interface CreateParticipantResponseType {
|
|
|
12
12
|
|
|
13
13
|
export const createParticipant = (body: CreateParticipantType) =>
|
|
14
14
|
fetchRetailJSON<CreateParticipantResponseType>(
|
|
15
|
-
'/
|
|
15
|
+
'/internal/entities/createParticipant',
|
|
16
16
|
'POST',
|
|
17
17
|
body,
|
|
18
18
|
).then((res) => res || null);
|