@tap-payments/auth-jsconnect 2.0.52-test → 2.0.54-test
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/build/@types/app.d.ts +4 -15
- package/build/@types/app.js +0 -9
- package/build/@types/form.d.ts +0 -11
- package/build/api/auth.d.ts +1 -14
- package/build/api/auth.js +1 -24
- package/build/api/axios.js +2 -2
- package/build/api/data.d.ts +1 -4
- package/build/api/data.js +2 -6
- package/build/api/entity.d.ts +0 -2
- package/build/api/index.d.ts +1 -5
- package/build/app/rootReducer.d.ts +0 -3
- package/build/app/rootReducer.js +1 -7
- package/build/app/settings.js +2 -8
- package/build/app/store.d.ts +1 -7
- package/build/assets/locales/ar.json +4 -14
- package/build/assets/locales/en.json +4 -14
- package/build/components/AnimationFlow/AnimationFlow.d.ts +1 -4
- package/build/components/AnimationFlow/AnimationFlow.js +7 -5
- package/build/components/AnimationFlow/BottomSheet.js +1 -2
- package/build/components/AnimationFlow/Dialog.d.ts +1 -4
- package/build/components/AnimationFlow/Dialog.js +4 -9
- package/build/components/FileInput/DragAndDrop.d.ts +1 -9
- package/build/components/FileInput/DragAndDrop.js +8 -113
- package/build/components/ProgressBar/index.d.ts +0 -2
- package/build/components/ProgressBar/index.js +0 -2
- package/build/components/SocialMediaGroup/SocialMediaGroup.d.ts +1 -2
- package/build/components/SocialMediaGroup/SocialMediaGroup.js +34 -27
- package/build/constants/api.d.ts +0 -1
- package/build/constants/api.js +2 -5
- package/build/constants/app.d.ts +0 -15
- package/build/constants/app.js +3 -75
- package/build/constants/assets.d.ts +1 -17
- package/build/constants/assets.js +6 -22
- package/build/constants/validation.d.ts +0 -1
- package/build/constants/validation.js +0 -1
- package/build/features/app/bank/bankStore.d.ts +0 -4
- package/build/features/app/bank/bankStore.js +22 -42
- package/build/features/app/business/businessStore.js +12 -16
- package/build/features/app/connect/connectStore.d.ts +1 -13
- package/build/features/app/connect/connectStore.js +4 -164
- package/build/features/app/signIn/signInStore.js +2 -2
- package/build/features/bank/Bank.js +4 -10
- package/build/features/bank/screens/BankDetails/BankDetails.js +2 -2
- package/build/features/bank/screens/BankDetails/BankStatement.js +8 -33
- package/build/features/business/Business.d.ts +1 -1
- package/build/features/business/Business.js +5 -12
- package/build/features/business/screens/Activities/ActivitiesList.d.ts +1 -1
- package/build/features/business/screens/Activities/SalesChannels.js +1 -1
- package/build/features/business/screens/Customers/CustomerLocations.d.ts +2 -2
- package/build/features/connect/Connect.d.ts +1 -2
- package/build/features/connect/Connect.js +10 -40
- package/build/features/connect/screens/Individual/Individual.js +2 -6
- package/build/features/connect/screens/Merchant/Merchant.js +11 -35
- package/build/features/connect/screens/Merchant/SocialMedia.js +11 -56
- package/build/features/connect/screens/Merchant/validation.d.ts +0 -87
- package/build/features/connect/screens/Merchant/validation.js +2 -68
- package/build/features/connect/screens/Mobile/Mobile.js +4 -7
- package/build/features/featuresScreens.d.ts +0 -3
- package/build/features/featuresScreens.js +0 -48
- package/build/features/individual/Individual.d.ts +1 -1
- package/build/features/individual/Individual.js +5 -12
- package/build/features/password/Password.d.ts +1 -1
- package/build/features/password/Password.js +5 -12
- package/build/features/shared/Background/Background.d.ts +5 -7
- package/build/features/shared/Background/Background.js +5 -16
- package/build/features/shared/Input/Input.d.ts +1 -1
- package/build/features/shared/Input/Input.js +2 -2
- package/build/features/shared/UploadFile/UploadFile.d.ts +3 -8
- package/build/features/shared/UploadFile/UploadFile.js +8 -23
- package/build/features/signIn/SignIn.d.ts +1 -1
- package/build/features/signIn/SignIn.js +4 -12
- package/build/features/tax/Tax.d.ts +1 -1
- package/build/features/tax/Tax.js +4 -12
- package/build/hooks/index.d.ts +0 -1
- package/build/hooks/index.js +0 -1
- package/build/hooks/useAppConfig.js +0 -2
- package/build/hooks/useAppDispatch.d.ts +0 -3
- package/build/hooks/useErrorListener.js +2 -3
- package/build/index.d.ts +2 -5
- package/build/index.js +2 -11
- package/build/utils/device.d.ts +0 -1
- package/build/utils/device.js +0 -13
- package/build/utils/html.d.ts +0 -1
- package/build/utils/html.js +0 -6
- package/build/utils/locale.js +1 -1
- package/build/utils/rsa.d.ts +2 -2
- package/build/utils/rsa.js +1 -1
- package/build/utils/string.d.ts +20 -22
- package/build/utils/string.js +0 -9
- package/package.json +129 -129
- package/build/components/Lottie/Lottie.d.ts +0 -878
- package/build/components/Lottie/Lottie.js +0 -58
- package/build/components/Lottie/files/pulsating_circle_waves.json +0 -236
- package/build/components/Lottie/files/success.json +0 -425
- package/build/components/Lottie/index.d.ts +0 -3
- package/build/components/Lottie/index.js +0 -3
- package/build/components/ProgressBar/CircularProgressBar.d.ts +0 -14
- package/build/components/ProgressBar/CircularProgressBar.js +0 -48
- package/build/features/app/auth/authStore.d.ts +0 -35
- package/build/features/app/auth/authStore.js +0 -148
- package/build/features/app/entity/entityStore.d.ts +0 -53
- package/build/features/app/entity/entityStore.js +0 -461
- package/build/features/app/otp/otpStore.d.ts +0 -28
- package/build/features/app/otp/otpStore.js +0 -153
- package/build/features/auth/Auth.d.ts +0 -10
- package/build/features/auth/Auth.js +0 -87
- package/build/features/auth/index.d.ts +0 -1
- package/build/features/auth/index.js +0 -1
- package/build/features/auth/screens/OTP/OTP.d.ts +0 -5
- package/build/features/auth/screens/OTP/OTP.js +0 -72
- package/build/features/auth/screens/OTP/OTPInput.d.ts +0 -5
- package/build/features/auth/screens/OTP/OTPInput.js +0 -44
- package/build/features/auth/screens/OTP/index.d.ts +0 -3
- package/build/features/auth/screens/OTP/index.js +0 -2
- package/build/features/auth/screens/OTP/validation.d.ts +0 -8
- package/build/features/auth/screens/OTP/validation.js +0 -4
- package/build/features/connect/screens/CivilID/CivilID.d.ts +0 -5
- package/build/features/connect/screens/CivilID/CivilID.js +0 -85
- package/build/features/connect/screens/CivilID/IDNumber.d.ts +0 -7
- package/build/features/connect/screens/CivilID/IDNumber.js +0 -59
- package/build/features/connect/screens/CivilID/index.d.ts +0 -3
- package/build/features/connect/screens/CivilID/index.js +0 -2
- package/build/features/connect/screens/CivilID/validation.d.ts +0 -8
- package/build/features/connect/screens/CivilID/validation.js +0 -4
- package/build/features/connect/screens/Merchant/SalesChannels.d.ts +0 -5
- package/build/features/connect/screens/Merchant/SalesChannels.js +0 -114
- package/build/features/connect/screens/VerifyPACI/VerifyPACI.d.ts +0 -5
- package/build/features/connect/screens/VerifyPACI/VerifyPACI.js +0 -169
- package/build/features/connect/screens/VerifyPACI/VerifyPACILoading.d.ts +0 -5
- package/build/features/connect/screens/VerifyPACI/VerifyPACILoading.js +0 -22
- package/build/features/connect/screens/VerifyPACI/VerifyPACISuccess.d.ts +0 -5
- package/build/features/connect/screens/VerifyPACI/VerifyPACISuccess.js +0 -8
- package/build/features/connect/screens/VerifyPACI/index.d.ts +0 -3
- package/build/features/connect/screens/VerifyPACI/index.js +0 -2
- package/build/features/entity/Entity.d.ts +0 -7
- package/build/features/entity/Entity.js +0 -70
- package/build/features/entity/index.d.ts +0 -1
- package/build/features/entity/index.js +0 -1
- package/build/features/entity/screens/EntityInfoConfirm/ActivitiesList.d.ts +0 -54
- package/build/features/entity/screens/EntityInfoConfirm/ActivitiesList.js +0 -139
- package/build/features/entity/screens/EntityInfoConfirm/EntityInfo.d.ts +0 -5
- package/build/features/entity/screens/EntityInfoConfirm/EntityInfo.js +0 -56
- package/build/features/entity/screens/EntityInfoConfirm/LicenseName.d.ts +0 -5
- package/build/features/entity/screens/EntityInfoConfirm/LicenseName.js +0 -17
- package/build/features/entity/screens/EntityInfoConfirm/LicenseNumber.d.ts +0 -5
- package/build/features/entity/screens/EntityInfoConfirm/LicenseNumber.js +0 -28
- package/build/features/entity/screens/EntityInfoConfirm/OperationStartDate.d.ts +0 -6
- package/build/features/entity/screens/EntityInfoConfirm/OperationStartDate.js +0 -38
- package/build/features/entity/screens/EntityInfoConfirm/SalesChannels.d.ts +0 -5
- package/build/features/entity/screens/EntityInfoConfirm/SalesChannels.js +0 -112
- package/build/features/entity/screens/EntityInfoConfirm/index.d.ts +0 -2
- package/build/features/entity/screens/EntityInfoConfirm/index.js +0 -2
- package/build/features/entity/screens/EntityInfoConfirm/validation.d.ts +0 -107
- package/build/features/entity/screens/EntityInfoConfirm/validation.js +0 -17
- package/build/features/entity/screens/ResetPasswordSuccess/ResetPasswordSuccess.d.ts +0 -5
- package/build/features/entity/screens/ResetPasswordSuccess/ResetPasswordSuccess.js +0 -9
- package/build/features/entity/screens/ResetPasswordSuccess/index.d.ts +0 -3
- package/build/features/entity/screens/ResetPasswordSuccess/index.js +0 -2
- package/build/features/entity/screens/Success/Success.d.ts +0 -5
- package/build/features/entity/screens/Success/Success.js +0 -16
- package/build/features/entity/screens/Success/index.d.ts +0 -3
- package/build/features/entity/screens/Success/index.js +0 -2
- package/build/features/entity/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.d.ts +0 -3
- package/build/features/entity/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +0 -109
- package/build/features/entity/screens/SuccessWithFlowButtons/index.d.ts +0 -2
- package/build/features/entity/screens/SuccessWithFlowButtons/index.js +0 -2
- package/build/features/entity/screens/Verify/OTPInput.d.ts +0 -7
- package/build/features/entity/screens/Verify/OTPInput.js +0 -47
- package/build/features/entity/screens/Verify/Verify.d.ts +0 -5
- package/build/features/entity/screens/Verify/Verify.js +0 -78
- package/build/features/entity/screens/Verify/index.d.ts +0 -2
- package/build/features/entity/screens/Verify/index.js +0 -2
- package/build/features/entity/screens/Verify/validation.d.ts +0 -8
- package/build/features/entity/screens/Verify/validation.js +0 -4
- package/build/features/otp/OTP.d.ts +0 -7
- package/build/features/otp/OTP.js +0 -58
- package/build/features/otp/index.d.ts +0 -0
- package/build/features/otp/index.js +0 -1
- package/build/features/otp/screens/OTPVerify/OTPInput.d.ts +0 -6
- package/build/features/otp/screens/OTPVerify/OTPInput.js +0 -47
- package/build/features/otp/screens/OTPVerify/Verify.d.ts +0 -5
- package/build/features/otp/screens/OTPVerify/Verify.js +0 -49
- package/build/features/otp/screens/OTPVerify/index.d.ts +0 -2
- package/build/features/otp/screens/OTPVerify/index.js +0 -2
- package/build/features/otp/screens/OTPVerify/validation.d.ts +0 -8
- package/build/features/otp/screens/OTPVerify/validation.js +0 -4
- package/build/features/shared/Dialog/CloseDialog.d.ts +0 -11
- package/build/features/shared/Dialog/CloseDialog.js +0 -62
- package/build/features/shared/Dialog/DialogContainer.d.ts +0 -8
- package/build/features/shared/Dialog/DialogContainer.js +0 -56
- package/build/features/shared/Dialog/index.d.ts +0 -4
- package/build/features/shared/Dialog/index.js +0 -4
- package/build/hooks/useScreen.d.ts +0 -3
- package/build/hooks/useScreen.js +0 -14
|
@@ -157,33 +157,46 @@ export var retrieveBoardDetails = createAsyncThunk('retrieveBankEntityInfo', fun
|
|
|
157
157
|
});
|
|
158
158
|
}); });
|
|
159
159
|
export var createBankAccount = createAsyncThunk('createBankAccount', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
160
|
-
var _a, settings, bank, iban, beneficiaryName, bank_name, requestBody, data;
|
|
161
|
-
var _b, _c, _d, _e, _f, _g, _h;
|
|
162
|
-
return __generator(this, function (
|
|
163
|
-
switch (
|
|
160
|
+
var _a, settings, bank, iban, beneficiaryName, bank_name, fileResponse, uploadPayload, requestBody, data;
|
|
161
|
+
var _b, _c, _d, _e, _f, _g, _h, _j;
|
|
162
|
+
return __generator(this, function (_k) {
|
|
163
|
+
switch (_k.label) {
|
|
164
164
|
case 0:
|
|
165
165
|
_a = thunkApi.getState(), settings = _a.settings, bank = _a.bank;
|
|
166
166
|
iban = params.iban;
|
|
167
167
|
beneficiaryName = params.beneficiaryName;
|
|
168
168
|
bank_name = params.bankName;
|
|
169
|
+
fileResponse = undefined;
|
|
170
|
+
uploadPayload = {
|
|
171
|
+
file_link_create: true,
|
|
172
|
+
title: (_b = params.bankStatementFile) === null || _b === void 0 ? void 0 : _b.name,
|
|
173
|
+
purpose: 'identity_document',
|
|
174
|
+
file: params.bankStatementFile
|
|
175
|
+
};
|
|
176
|
+
if (!params.bankStatementFile) return [3, 2];
|
|
177
|
+
return [4, API.entityService.uploadFileInfo(uploadPayload)];
|
|
178
|
+
case 1:
|
|
179
|
+
fileResponse = _k.sent();
|
|
180
|
+
_k.label = 2;
|
|
181
|
+
case 2:
|
|
169
182
|
requestBody = {
|
|
170
|
-
wallet_id: (_f = (_e = (_d = (_c =
|
|
183
|
+
wallet_id: (_g = (_f = (_e = (_d = (_c = bank.data.verify.responseBody) === null || _c === void 0 ? void 0 : _c.business) === null || _d === void 0 ? void 0 : _d.entity) === null || _e === void 0 ? void 0 : _e.merchant) === null || _f === void 0 ? void 0 : _f.wallet) === null || _g === void 0 ? void 0 : _g.id,
|
|
171
184
|
bank_account: {
|
|
172
185
|
iban: iban,
|
|
173
186
|
beneficiary_name: beneficiaryName,
|
|
174
187
|
bank_name: bank_name,
|
|
175
|
-
bank_statement_file_id:
|
|
188
|
+
bank_statement_file_id: fileResponse === null || fileResponse === void 0 ? void 0 : fileResponse.id,
|
|
176
189
|
is_acknowledged: params.confirmPolicy
|
|
177
190
|
},
|
|
178
191
|
step_name: BANK_STEP_NAMES.BANK_INFO,
|
|
179
192
|
encryption_contract: ['bank_account.iban', 'bank_account.beneficiary_name', 'bank_account.bank_name']
|
|
180
193
|
};
|
|
181
194
|
return [4, API.entityService.createBankAccount(requestBody)];
|
|
182
|
-
case
|
|
183
|
-
data = (
|
|
195
|
+
case 3:
|
|
196
|
+
data = (_k.sent()).data;
|
|
184
197
|
if (!data.errors) {
|
|
185
198
|
thunkApi.dispatch(handleNextScreenStep());
|
|
186
|
-
(
|
|
199
|
+
(_j = (_h = settings.data.appConfig).onStepCompleted) === null || _j === void 0 ? void 0 : _j.call(_h, settings.data.activeScreen.name, requestBody);
|
|
187
200
|
}
|
|
188
201
|
return [2, { data: data, formData: params }];
|
|
189
202
|
}
|
|
@@ -209,24 +222,6 @@ export var checkIbanBank = createAsyncThunk('checkIbanBank', function (_a) {
|
|
|
209
222
|
});
|
|
210
223
|
});
|
|
211
224
|
});
|
|
212
|
-
export var uploadBankStatement = createAsyncThunk('uploadBankStatement', function (file) { return __awaiter(void 0, void 0, void 0, function () {
|
|
213
|
-
var uploadPayload, data;
|
|
214
|
-
return __generator(this, function (_a) {
|
|
215
|
-
switch (_a.label) {
|
|
216
|
-
case 0:
|
|
217
|
-
uploadPayload = {
|
|
218
|
-
file_link_create: true,
|
|
219
|
-
title: file === null || file === void 0 ? void 0 : file.name,
|
|
220
|
-
purpose: 'identity_document',
|
|
221
|
-
file: file
|
|
222
|
-
};
|
|
223
|
-
return [4, API.entityService.uploadFileInfo(uploadPayload)];
|
|
224
|
-
case 1:
|
|
225
|
-
data = _a.sent();
|
|
226
|
-
return [2, { data: data }];
|
|
227
|
-
}
|
|
228
|
-
});
|
|
229
|
-
}); });
|
|
230
225
|
export var updateBoardSuccess = createAsyncThunk('updateBoardBankSuccess', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
231
226
|
var _a, settings, bank, _b, id, infoId, payload, data;
|
|
232
227
|
var _c, _d, _e, _f;
|
|
@@ -259,7 +254,6 @@ var initialState = {
|
|
|
259
254
|
error: null,
|
|
260
255
|
loading: false,
|
|
261
256
|
customLoading: false,
|
|
262
|
-
uploading: false,
|
|
263
257
|
data: {
|
|
264
258
|
flowName: FlowsTypes.BANK,
|
|
265
259
|
verify: {
|
|
@@ -420,20 +414,6 @@ export var bankSlice = createSlice({
|
|
|
420
414
|
if (action.error.message === 'Aborted')
|
|
421
415
|
return;
|
|
422
416
|
state.error = action.error.message;
|
|
423
|
-
})
|
|
424
|
-
.addCase(uploadBankStatement.pending, function (state) {
|
|
425
|
-
state.error = null;
|
|
426
|
-
state.uploading = true;
|
|
427
|
-
})
|
|
428
|
-
.addCase(uploadBankStatement.fulfilled, function (state, action) {
|
|
429
|
-
state.error = null;
|
|
430
|
-
state.uploading = false;
|
|
431
|
-
var data = action.payload.data;
|
|
432
|
-
state.data.bankData.bankStatementId = data === null || data === void 0 ? void 0 : data.id;
|
|
433
|
-
})
|
|
434
|
-
.addCase(uploadBankStatement.rejected, function (state, action) {
|
|
435
|
-
state.uploading = false;
|
|
436
|
-
state.error = 'file_upload_error';
|
|
437
417
|
});
|
|
438
418
|
}
|
|
439
419
|
});
|
|
@@ -302,16 +302,12 @@ export var resendOTPLeadIdentity = createAsyncThunk('resendOTPLeadIdentity', fun
|
|
|
302
302
|
});
|
|
303
303
|
}); });
|
|
304
304
|
export var retrieveChannels = createAsyncThunk('retrieveChannels', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
305
|
-
var
|
|
305
|
+
var data;
|
|
306
306
|
return __generator(this, function (_a) {
|
|
307
307
|
switch (_a.label) {
|
|
308
|
-
case 0:
|
|
309
|
-
body = {
|
|
310
|
-
page: 0
|
|
311
|
-
};
|
|
312
|
-
return [4, API.dataService.getChannelsOfServices(body)];
|
|
308
|
+
case 0: return [4, API.dataService.getChannelsOfServices()];
|
|
313
309
|
case 1:
|
|
314
|
-
data = _a.sent();
|
|
310
|
+
data = (_a.sent()).data;
|
|
315
311
|
return [2, data];
|
|
316
312
|
}
|
|
317
313
|
});
|
|
@@ -613,8 +609,8 @@ export var businessSlice = createSlice({
|
|
|
613
609
|
var isHasWebsite = (website === null || website === void 0 ? void 0 : website.length) > 0;
|
|
614
610
|
var isHasTwitter = social === null || social === void 0 ? void 0 : social.find(function (s) { return s.includes('twitter.com'); });
|
|
615
611
|
var isHasInstagram = social === null || social === void 0 ? void 0 : social.find(function (s) { return s.includes('instagram.com'); });
|
|
616
|
-
var websiteData = channels === null || channels === void 0 ? void 0 : channels.find(function (c) { return c.
|
|
617
|
-
var socialData = channels === null || channels === void 0 ? void 0 : channels.find(function (c) { return c.
|
|
612
|
+
var websiteData = channels === null || channels === void 0 ? void 0 : channels.find(function (c) { return c.name_en.toLocaleLowerCase() === 'website'; });
|
|
613
|
+
var socialData = channels === null || channels === void 0 ? void 0 : channels.find(function (c) { return c.name_en.toLocaleLowerCase() === 'social'; });
|
|
618
614
|
if (isHasWebsite && (isHasTwitter || isHasInstagram))
|
|
619
615
|
selectedChannels = [websiteData, socialData];
|
|
620
616
|
else if (isHasTwitter || isHasInstagram)
|
|
@@ -624,7 +620,7 @@ export var businessSlice = createSlice({
|
|
|
624
620
|
if (((_d = brandInfo === null || brandInfo === void 0 ? void 0 : brandInfo.channel_services) === null || _d === void 0 ? void 0 : _d.length) > 0) {
|
|
625
621
|
selectedChannels = channels === null || channels === void 0 ? void 0 : channels.filter(function (channel) {
|
|
626
622
|
var _a;
|
|
627
|
-
return (_a = brandInfo === null || brandInfo === void 0 ? void 0 : brandInfo.channel_services) === null || _a === void 0 ? void 0 : _a.find(function (storedChannel) { return channel.
|
|
623
|
+
return (_a = brandInfo === null || brandInfo === void 0 ? void 0 : brandInfo.channel_services) === null || _a === void 0 ? void 0 : _a.find(function (storedChannel) { return channel.name_en.toLowerCase() === storedChannel.toLowerCase(); });
|
|
628
624
|
});
|
|
629
625
|
}
|
|
630
626
|
state.data.activitiesData.salesChannels = selectedChannels;
|
|
@@ -704,8 +700,8 @@ export var businessSlice = createSlice({
|
|
|
704
700
|
var isHasWebsite = (website === null || website === void 0 ? void 0 : website.length) > 0;
|
|
705
701
|
var isHasTwitter = social === null || social === void 0 ? void 0 : social.find(function (s) { return s.includes('twitter.com'); });
|
|
706
702
|
var isHasInstagram = social === null || social === void 0 ? void 0 : social.find(function (s) { return s.includes('instagram.com'); });
|
|
707
|
-
var websiteData = channels === null || channels === void 0 ? void 0 : channels.find(function (c) { return c.
|
|
708
|
-
var socialData = channels === null || channels === void 0 ? void 0 : channels.find(function (c) { return c.
|
|
703
|
+
var websiteData = channels === null || channels === void 0 ? void 0 : channels.find(function (c) { return c.name_en.toLocaleLowerCase() === 'website'; });
|
|
704
|
+
var socialData = channels === null || channels === void 0 ? void 0 : channels.find(function (c) { return c.name_en.toLocaleLowerCase() === 'social'; });
|
|
709
705
|
if (isHasWebsite && (isHasTwitter || isHasInstagram))
|
|
710
706
|
selectedChannels = [websiteData, socialData];
|
|
711
707
|
else if (isHasTwitter || isHasInstagram)
|
|
@@ -715,7 +711,7 @@ export var businessSlice = createSlice({
|
|
|
715
711
|
if (((_d = brandInfo === null || brandInfo === void 0 ? void 0 : brandInfo.channel_services) === null || _d === void 0 ? void 0 : _d.length) > 0) {
|
|
716
712
|
selectedChannels = channels === null || channels === void 0 ? void 0 : channels.filter(function (channel) {
|
|
717
713
|
var _a;
|
|
718
|
-
return (_a = brandInfo === null || brandInfo === void 0 ? void 0 : brandInfo.channel_services) === null || _a === void 0 ? void 0 : _a.find(function (storedChannel) { return channel.
|
|
714
|
+
return (_a = brandInfo === null || brandInfo === void 0 ? void 0 : brandInfo.channel_services) === null || _a === void 0 ? void 0 : _a.find(function (storedChannel) { return channel.name_en.toLowerCase() === storedChannel.toLowerCase(); });
|
|
719
715
|
});
|
|
720
716
|
}
|
|
721
717
|
state.data.activitiesData.salesChannels = selectedChannels;
|
|
@@ -855,7 +851,7 @@ export var businessSlice = createSlice({
|
|
|
855
851
|
state.error = description;
|
|
856
852
|
return;
|
|
857
853
|
}
|
|
858
|
-
var channels = data
|
|
854
|
+
var channels = data || [];
|
|
859
855
|
state.data.businessTypeData.responseBody = __assign(__assign({}, state.data.businessTypeData.responseBody), { channelList: channels });
|
|
860
856
|
var brand = (state.data.verify.responseBody || {}).brand;
|
|
861
857
|
var selectedChannels = (!!(channels === null || channels === void 0 ? void 0 : channels[0]) && [channels === null || channels === void 0 ? void 0 : channels[0]]) || [];
|
|
@@ -863,8 +859,8 @@ export var businessSlice = createSlice({
|
|
|
863
859
|
var isHasWebsite = (website === null || website === void 0 ? void 0 : website.length) > 0;
|
|
864
860
|
var isHasTwitter = social === null || social === void 0 ? void 0 : social.find(function (s) { return s.includes('twitter.com'); });
|
|
865
861
|
var isHasInstagram = social === null || social === void 0 ? void 0 : social.find(function (s) { return s.includes('instagram.com'); });
|
|
866
|
-
var websiteData = channels === null || channels === void 0 ? void 0 : channels.find(function (c) { return c.
|
|
867
|
-
var socialData = channels === null || channels === void 0 ? void 0 : channels.find(function (c) { return c.
|
|
862
|
+
var websiteData = channels === null || channels === void 0 ? void 0 : channels.find(function (c) { return c.name_en.toLocaleLowerCase() === 'website'; });
|
|
863
|
+
var socialData = channels === null || channels === void 0 ? void 0 : channels.find(function (c) { return c.name_en.toLocaleLowerCase() === 'social'; });
|
|
868
864
|
if (isHasWebsite && (isHasTwitter || isHasInstagram))
|
|
869
865
|
selectedChannels = [websiteData, socialData];
|
|
870
866
|
else if (isHasTwitter || isHasInstagram)
|
|
@@ -1,14 +1,10 @@
|
|
|
1
1
|
import { RootState } from '../../../app/store';
|
|
2
|
-
import { ResponseData, MobileFormValues, NIDFormValues,
|
|
2
|
+
import { ResponseData, MobileFormValues, NIDFormValues, OTPFormValues, IndividualFormValues, SharedState, BrandFormValues, FlowsTypes } from '../../../@types';
|
|
3
3
|
import { CancelToken } from 'axios';
|
|
4
4
|
export declare const createMobileAuth: import("@reduxjs/toolkit").AsyncThunk<{
|
|
5
5
|
response: any;
|
|
6
6
|
formData: MobileFormValues;
|
|
7
7
|
}, MobileFormValues, {}>;
|
|
8
|
-
export declare const createCivilIdAuth: import("@reduxjs/toolkit").AsyncThunk<{
|
|
9
|
-
response: any;
|
|
10
|
-
formData: CivilFormValues;
|
|
11
|
-
}, CivilFormValues, {}>;
|
|
12
8
|
export declare const resendOTPMobile: import("@reduxjs/toolkit").AsyncThunk<any, void, {}>;
|
|
13
9
|
export declare const createNIDAuth: import("@reduxjs/toolkit").AsyncThunk<{
|
|
14
10
|
response: any;
|
|
@@ -23,12 +19,6 @@ export declare const verifyAuth: import("@reduxjs/toolkit").AsyncThunk<{
|
|
|
23
19
|
response: any;
|
|
24
20
|
formData: OTPFormValues;
|
|
25
21
|
}, OTPFormValues, {}>;
|
|
26
|
-
interface verifyPACIParams {
|
|
27
|
-
onSuccess?: () => void | Promise<void>;
|
|
28
|
-
}
|
|
29
|
-
export declare const verifyPACI: import("@reduxjs/toolkit").AsyncThunk<{
|
|
30
|
-
response: any;
|
|
31
|
-
}, verifyPACIParams, {}>;
|
|
32
22
|
export declare const retrieveLead: import("@reduxjs/toolkit").AsyncThunk<{
|
|
33
23
|
response: any;
|
|
34
24
|
formData: {
|
|
@@ -50,7 +40,6 @@ export declare const createLead: import("@reduxjs/toolkit").AsyncThunk<{
|
|
|
50
40
|
stepName: string;
|
|
51
41
|
}, {}>;
|
|
52
42
|
export declare const retrieveBrandList: import("@reduxjs/toolkit").AsyncThunk<any, string, {}>;
|
|
53
|
-
export declare const retrieveChannels: import("@reduxjs/toolkit").AsyncThunk<any, void, {}>;
|
|
54
43
|
export declare const updateLeadIndividual: import("@reduxjs/toolkit").AsyncThunk<{
|
|
55
44
|
response: any;
|
|
56
45
|
formData: IndividualFormValues;
|
|
@@ -86,7 +75,6 @@ export interface ConnectData {
|
|
|
86
75
|
nidData: NIDFormValues & ResponseData & {
|
|
87
76
|
type: string;
|
|
88
77
|
};
|
|
89
|
-
civilIdData: CivilFormValues & ResponseData;
|
|
90
78
|
otpData: OTPFormValues & ResponseData & {
|
|
91
79
|
isAbsher: boolean;
|
|
92
80
|
};
|
|
@@ -90,34 +90,6 @@ export var createMobileAuth = createAsyncThunk('createMobileAuth', function (par
|
|
|
90
90
|
}
|
|
91
91
|
});
|
|
92
92
|
}); });
|
|
93
|
-
export var createCivilIdAuth = createAsyncThunk('createCivilIdAuth', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
94
|
-
var settings, requestBody, data;
|
|
95
|
-
var _a, _b;
|
|
96
|
-
return __generator(this, function (_c) {
|
|
97
|
-
switch (_c.label) {
|
|
98
|
-
case 0:
|
|
99
|
-
settings = thunkApi.getState().settings;
|
|
100
|
-
requestBody = {
|
|
101
|
-
lang: settings.data.language,
|
|
102
|
-
user_credentail: {
|
|
103
|
-
identification_id: params.civilId,
|
|
104
|
-
country_code: 'KW'
|
|
105
|
-
},
|
|
106
|
-
sign_in: false,
|
|
107
|
-
step_name: CONNECT_STEP_NAMES.CREATE_AUTH_CIVIL_ID,
|
|
108
|
-
encryption_contract: ['user_credentail.civil_id']
|
|
109
|
-
};
|
|
110
|
-
return [4, API.authService.createAuth(requestBody)];
|
|
111
|
-
case 1:
|
|
112
|
-
data = (_c.sent()).data;
|
|
113
|
-
if (!data.errors) {
|
|
114
|
-
thunkApi.dispatch(handleNextScreenStep());
|
|
115
|
-
(_b = (_a = settings.data.appConfig).onStepCompleted) === null || _b === void 0 ? void 0 : _b.call(_a, settings.data.activeScreen.name, requestBody.user_credentail);
|
|
116
|
-
}
|
|
117
|
-
return [2, { response: data, formData: params }];
|
|
118
|
-
}
|
|
119
|
-
});
|
|
120
|
-
}); });
|
|
121
93
|
export var resendOTPMobile = createAsyncThunk('resendOTPMobile', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
122
94
|
var _a, settings, connect, _b, mobile, countryCode, requestBody, data;
|
|
123
95
|
return __generator(this, function (_c) {
|
|
@@ -235,7 +207,7 @@ export var verifyAuth = createAsyncThunk('verifyAuth', function (params, thunkAp
|
|
|
235
207
|
return [4, API.authService.verifyAuth(payload)];
|
|
236
208
|
case 1:
|
|
237
209
|
data = (_e.sent()).data;
|
|
238
|
-
if (!!data.errors) return [3,
|
|
210
|
+
if (!!data.errors) return [3, 4];
|
|
239
211
|
(_d = (_c = settings.data.appConfig).onStepCompleted) === null || _d === void 0 ? void 0 : _d.call(_c, settings.data.activeScreen.name, { otp: params.otp });
|
|
240
212
|
if (!(responseBody === null || responseBody === void 0 ? void 0 : responseBody.new_user)) return [3, 2];
|
|
241
213
|
params_1 = {
|
|
@@ -243,12 +215,9 @@ export var verifyAuth = createAsyncThunk('verifyAuth', function (params, thunkAp
|
|
|
243
215
|
stepName: 'CONNECT_INDIVIDUAL_STEP'
|
|
244
216
|
};
|
|
245
217
|
thunkApi.dispatch(retrieveLead(params_1));
|
|
246
|
-
return [3,
|
|
218
|
+
return [3, 4];
|
|
247
219
|
case 2: return [4, thunkApi.dispatch(retrieveBrandList(data === null || data === void 0 ? void 0 : data.individual_id))];
|
|
248
220
|
case 3:
|
|
249
|
-
_e.sent();
|
|
250
|
-
return [4, thunkApi.dispatch(retrieveChannels())];
|
|
251
|
-
case 4:
|
|
252
221
|
_e.sent();
|
|
253
222
|
if (!(data === null || data === void 0 ? void 0 : data.lead_id)) {
|
|
254
223
|
params_2 = {
|
|
@@ -260,52 +229,8 @@ export var verifyAuth = createAsyncThunk('verifyAuth', function (params, thunkAp
|
|
|
260
229
|
else {
|
|
261
230
|
thunkApi.dispatch(handleNextScreenStep('CONNECT_MERCHANT_INFO_STEP'));
|
|
262
231
|
}
|
|
263
|
-
_e.label =
|
|
264
|
-
case
|
|
265
|
-
}
|
|
266
|
-
});
|
|
267
|
-
}); });
|
|
268
|
-
export var verifyPACI = createAsyncThunk('verifyPACI', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
269
|
-
var _a, settings, connect, responseBody, data, params_3, params_4;
|
|
270
|
-
var _b, _c, _d, _e;
|
|
271
|
-
return __generator(this, function (_f) {
|
|
272
|
-
switch (_f.label) {
|
|
273
|
-
case 0:
|
|
274
|
-
_a = thunkApi.getState(), settings = _a.settings, connect = _a.connect;
|
|
275
|
-
responseBody = connect.data.civilIdData.responseBody;
|
|
276
|
-
return [4, API.authService.getVerifyAuth(responseBody === null || responseBody === void 0 ? void 0 : responseBody.auth_token)];
|
|
277
|
-
case 1:
|
|
278
|
-
data = _f.sent();
|
|
279
|
-
if (!(((_b = data.status) === null || _b === void 0 ? void 0 : _b.toLowerCase()) === 'success')) return [3, 6];
|
|
280
|
-
return [4, ((_c = params === null || params === void 0 ? void 0 : params.onSuccess) === null || _c === void 0 ? void 0 : _c.call(params))];
|
|
281
|
-
case 2:
|
|
282
|
-
_f.sent();
|
|
283
|
-
(_e = (_d = settings.data.appConfig).onStepCompleted) === null || _e === void 0 ? void 0 : _e.call(_d, settings.data.activeScreen.name, {});
|
|
284
|
-
if (!(responseBody === null || responseBody === void 0 ? void 0 : responseBody.new_user)) return [3, 3];
|
|
285
|
-
params_3 = {
|
|
286
|
-
leadId: data === null || data === void 0 ? void 0 : data.lead_id,
|
|
287
|
-
stepName: 'CONNECT_INDIVIDUAL_STEP'
|
|
288
|
-
};
|
|
289
|
-
thunkApi.dispatch(retrieveLead(params_3));
|
|
290
|
-
return [3, 6];
|
|
291
|
-
case 3: return [4, thunkApi.dispatch(retrieveBrandList(data === null || data === void 0 ? void 0 : data.individual_id))];
|
|
292
|
-
case 4:
|
|
293
|
-
_f.sent();
|
|
294
|
-
return [4, thunkApi.dispatch(retrieveChannels())];
|
|
295
|
-
case 5:
|
|
296
|
-
_f.sent();
|
|
297
|
-
if (!(data === null || data === void 0 ? void 0 : data.lead_id)) {
|
|
298
|
-
params_4 = {
|
|
299
|
-
individualId: data === null || data === void 0 ? void 0 : data.individual_id,
|
|
300
|
-
stepName: 'CONNECT_MERCHANT_INFO_STEP'
|
|
301
|
-
};
|
|
302
|
-
thunkApi.dispatch(createLead(params_4));
|
|
303
|
-
}
|
|
304
|
-
else {
|
|
305
|
-
thunkApi.dispatch(handleNextScreenStep('CONNECT_MERCHANT_INFO_STEP'));
|
|
306
|
-
}
|
|
307
|
-
_f.label = 6;
|
|
308
|
-
case 6: return [2, { response: data }];
|
|
232
|
+
_e.label = 4;
|
|
233
|
+
case 4: return [2, { response: data, formData: params }];
|
|
309
234
|
}
|
|
310
235
|
});
|
|
311
236
|
}); });
|
|
@@ -357,21 +282,6 @@ export var retrieveBrandList = createAsyncThunk('retrieveBrandList', function (i
|
|
|
357
282
|
}
|
|
358
283
|
});
|
|
359
284
|
}); });
|
|
360
|
-
export var retrieveChannels = createAsyncThunk('retrieveChannels', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
361
|
-
var body, data;
|
|
362
|
-
return __generator(this, function (_a) {
|
|
363
|
-
switch (_a.label) {
|
|
364
|
-
case 0:
|
|
365
|
-
body = {
|
|
366
|
-
page: 0
|
|
367
|
-
};
|
|
368
|
-
return [4, API.dataService.getChannelsOfServices(body)];
|
|
369
|
-
case 1:
|
|
370
|
-
data = _a.sent();
|
|
371
|
-
return [2, data];
|
|
372
|
-
}
|
|
373
|
-
});
|
|
374
|
-
}); });
|
|
375
285
|
export var updateLeadIndividual = createAsyncThunk('updateLeadIndividual', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
376
286
|
var _a, settings, connect, isAbsher, payload, data;
|
|
377
287
|
var _b, _c, _d, _e, _f, _g;
|
|
@@ -406,9 +316,6 @@ export var updateLeadIndividual = createAsyncThunk('updateLeadIndividual', funct
|
|
|
406
316
|
return [4, API.leadService.updateLead(payload)];
|
|
407
317
|
case 1:
|
|
408
318
|
data = _h.sent();
|
|
409
|
-
return [4, thunkApi.dispatch(retrieveChannels())];
|
|
410
|
-
case 2:
|
|
411
|
-
_h.sent();
|
|
412
319
|
thunkApi.dispatch(handleNextScreenStep());
|
|
413
320
|
(_g = (_f = settings.data.appConfig).onStepCompleted) === null || _g === void 0 ? void 0 : _g.call(_f, settings.data.activeScreen.name, params);
|
|
414
321
|
return [2, { response: data, formData: params }];
|
|
@@ -551,9 +458,6 @@ var initialState = {
|
|
|
551
458
|
dob: getEighteenYearsAgo(),
|
|
552
459
|
type: ''
|
|
553
460
|
},
|
|
554
|
-
civilIdData: {
|
|
555
|
-
civilId: '284121505934'
|
|
556
|
-
},
|
|
557
461
|
otpData: {
|
|
558
462
|
otp: '',
|
|
559
463
|
isAbsher: false
|
|
@@ -566,7 +470,6 @@ var initialState = {
|
|
|
566
470
|
},
|
|
567
471
|
brandData: {
|
|
568
472
|
brandName: '',
|
|
569
|
-
salesChannels: [],
|
|
570
473
|
termAndConditionChecked: false,
|
|
571
474
|
links: {
|
|
572
475
|
website: '',
|
|
@@ -644,39 +547,6 @@ export var connectSlice = createSlice({
|
|
|
644
547
|
})
|
|
645
548
|
.addCase(resendOTPMobile.rejected, function (state, action) {
|
|
646
549
|
state.error = action.error.message;
|
|
647
|
-
})
|
|
648
|
-
.addCase(createCivilIdAuth.pending, function (state, action) {
|
|
649
|
-
state.loading = true;
|
|
650
|
-
state.error = null;
|
|
651
|
-
})
|
|
652
|
-
.addCase(createCivilIdAuth.fulfilled, function (state, action) {
|
|
653
|
-
var _a;
|
|
654
|
-
state.loading = false;
|
|
655
|
-
state.error = null;
|
|
656
|
-
var _b = action.payload, formData = _b.formData, response = _b.response;
|
|
657
|
-
var description = (((_a = response === null || response === void 0 ? void 0 : response.errors) === null || _a === void 0 ? void 0 : _a[0]) || {}).description;
|
|
658
|
-
if (description) {
|
|
659
|
-
state.error = description;
|
|
660
|
-
return;
|
|
661
|
-
}
|
|
662
|
-
state.data.civilIdData = __assign(__assign({}, formData), { responseBody: response });
|
|
663
|
-
})
|
|
664
|
-
.addCase(createCivilIdAuth.rejected, function (state, action) {
|
|
665
|
-
state.loading = false;
|
|
666
|
-
state.error = action.error.message;
|
|
667
|
-
})
|
|
668
|
-
.addCase(verifyPACI.pending, function (state) {
|
|
669
|
-
state.loading = true;
|
|
670
|
-
state.error = null;
|
|
671
|
-
})
|
|
672
|
-
.addCase(verifyPACI.fulfilled, function (state, action) {
|
|
673
|
-
state.loading = false;
|
|
674
|
-
state.error = null;
|
|
675
|
-
state.data.otpData.responseBody = action.payload.response;
|
|
676
|
-
})
|
|
677
|
-
.addCase(verifyPACI.rejected, function (state, action) {
|
|
678
|
-
state.loading = false;
|
|
679
|
-
state.error = action.error.message;
|
|
680
550
|
})
|
|
681
551
|
.addCase(createNIDAuth.fulfilled, function (state, action) {
|
|
682
552
|
var _a;
|
|
@@ -898,36 +768,6 @@ export var connectSlice = createSlice({
|
|
|
898
768
|
.addCase(updateLeadSuccess.rejected, function (state, action) {
|
|
899
769
|
state.loading = false;
|
|
900
770
|
state.error = action.error.message;
|
|
901
|
-
})
|
|
902
|
-
.addCase(retrieveChannels.pending, function (state) {
|
|
903
|
-
state.error = null;
|
|
904
|
-
state.loading = true;
|
|
905
|
-
})
|
|
906
|
-
.addCase(retrieveChannels.fulfilled, function (state, action) {
|
|
907
|
-
state.error = null;
|
|
908
|
-
state.loading = false;
|
|
909
|
-
var data = action.payload || {};
|
|
910
|
-
var channels = data.list || [];
|
|
911
|
-
state.data.brandData.responseBody = __assign(__assign({}, state.data.brandData.responseBody), { channelList: channels });
|
|
912
|
-
var selectedChannels = [];
|
|
913
|
-
var selectedBrandItem = (state.data.brandData || {}).selectedBrandItem;
|
|
914
|
-
var _a = selectedBrandItem || {}, website = _a.website, social = _a.social;
|
|
915
|
-
var isHasWebsite = (website === null || website === void 0 ? void 0 : website.length) > 0;
|
|
916
|
-
var isHasTwitter = social === null || social === void 0 ? void 0 : social.find(function (s) { return s.includes('twitter.com'); });
|
|
917
|
-
var isHasInstagram = social === null || social === void 0 ? void 0 : social.find(function (s) { return s.includes('instagram.com'); });
|
|
918
|
-
var websiteData = channels === null || channels === void 0 ? void 0 : channels.find(function (c) { return c.id.toLocaleLowerCase() === 'website'; });
|
|
919
|
-
var socialData = channels === null || channels === void 0 ? void 0 : channels.find(function (c) { var _a; return ((_a = c.name) === null || _a === void 0 ? void 0 : _a.en.toLocaleLowerCase()) === 'social'; });
|
|
920
|
-
if (isHasWebsite && (isHasTwitter || isHasInstagram))
|
|
921
|
-
selectedChannels = [websiteData, socialData];
|
|
922
|
-
else if (isHasTwitter || isHasInstagram)
|
|
923
|
-
selectedChannels = [socialData];
|
|
924
|
-
else if (isHasWebsite)
|
|
925
|
-
selectedChannels = [websiteData];
|
|
926
|
-
state.data.brandData.salesChannels = selectedChannels;
|
|
927
|
-
})
|
|
928
|
-
.addCase(retrieveChannels.rejected, function (state, action) {
|
|
929
|
-
state.error = action.error.message;
|
|
930
|
-
state.loading = false;
|
|
931
771
|
});
|
|
932
772
|
}
|
|
933
773
|
});
|
|
@@ -177,7 +177,7 @@ export var verifyAuthOTP = createAsyncThunk('signIn/verifyAuthOTP', function (pa
|
|
|
177
177
|
new_user: responseBody === null || responseBody === void 0 ? void 0 : responseBody.new_user,
|
|
178
178
|
sign_in: responseBody === null || responseBody === void 0 ? void 0 : responseBody.sign_in,
|
|
179
179
|
remember_me: responseBody === null || responseBody === void 0 ? void 0 : responseBody.remember_me,
|
|
180
|
-
scopes: responseBody === null || responseBody === void 0 ? void 0 : responseBody.scopes,
|
|
180
|
+
scopes: (responseBody === null || responseBody === void 0 ? void 0 : responseBody.scopes) || settings.data.appConfig.scope,
|
|
181
181
|
step_name: mobile ? SignIn_STEP_NAMES.VERIFY_AUTH_MOBILE_OTP : SignIn_STEP_NAMES.VERIFY_AUTH_EMAIL_OTP,
|
|
182
182
|
encryption_contract: ['data']
|
|
183
183
|
};
|
|
@@ -210,7 +210,7 @@ export var verifyAuthPassword = createAsyncThunk('signIn/verifyAuthPassword', fu
|
|
|
210
210
|
new_user: responseBody === null || responseBody === void 0 ? void 0 : responseBody.new_user,
|
|
211
211
|
sign_in: responseBody === null || responseBody === void 0 ? void 0 : responseBody.sign_in,
|
|
212
212
|
remember_me: responseBody === null || responseBody === void 0 ? void 0 : responseBody.remember_me,
|
|
213
|
-
scopes: responseBody === null || responseBody === void 0 ? void 0 : responseBody.scopes,
|
|
213
|
+
scopes: (responseBody === null || responseBody === void 0 ? void 0 : responseBody.scopes) || settings.data.appConfig.scope,
|
|
214
214
|
step_name: mobile ? SignIn_STEP_NAMES.VERIFY_AUTH_MOBILE : SignIn_STEP_NAMES.VERIFY_AUTH_EMAIL,
|
|
215
215
|
encryption_contract: ['data']
|
|
216
216
|
};
|
|
@@ -17,9 +17,9 @@ import AnimationFlow from '../../components/AnimationFlow';
|
|
|
17
17
|
import { store } from '../../app/store';
|
|
18
18
|
import { ReduxProvider, ThemeProvider } from '../../components/Providers';
|
|
19
19
|
import Collapse from '../../components/Collapse';
|
|
20
|
-
import { getParameterByName, reactElement
|
|
20
|
+
import { getParameterByName, reactElement } from '../../utils';
|
|
21
21
|
import { FeatureContainer } from '../shared/Containers';
|
|
22
|
-
import { BANK_SCREENS_NAVIGATION
|
|
22
|
+
import { BANK_SCREENS_NAVIGATION } from '../../constants';
|
|
23
23
|
import { bankFeatureScreens } from '../featuresScreens';
|
|
24
24
|
import CustomFooter from '../shared/Footer';
|
|
25
25
|
import { bankSelector, verifyLeadToken } from '../app/bank/bankStore';
|
|
@@ -46,7 +46,7 @@ var Bank = memo(function (props) {
|
|
|
46
46
|
if (!settingLoading)
|
|
47
47
|
verifyToken();
|
|
48
48
|
}, [settingLoading]);
|
|
49
|
-
return (_jsx(ThemeProvider, __assign({ theme: theme }, { children: _jsx(Background, __assign({
|
|
49
|
+
return (_jsx(ThemeProvider, __assign({ theme: theme }, { children: _jsx(Background, __assign({ isTapOrigin: isTapOrigin, loading: settingLoading || customLoading }, { children: _jsx(AnimationFlow, __assign({ isTapOrigin: isTapOrigin, loading: settingLoading || customLoading, error: error, open: open, breakpoint: 'sm', footer: _jsx(CustomFooter, {}), screenId: activeScreen.name }, { children: _jsx(FeatureContainer, { children: bankFeatureScreens.map(function (_a, index) {
|
|
50
50
|
var Element = _a.element, name = _a.name;
|
|
51
51
|
var isActive = activeScreen.name === name;
|
|
52
52
|
return (_jsx(Collapse, __assign({ in: isActive, timeout: { enter: 1000, exit: 800 } }, { children: _jsx(Element, {}) }), index));
|
|
@@ -59,11 +59,5 @@ export function renderBankLib(config, elementId) {
|
|
|
59
59
|
reactElement(elementId).render(_jsx(BankLib, __assign({}, config)));
|
|
60
60
|
}
|
|
61
61
|
export function unmountBankLib(elementId) {
|
|
62
|
-
|
|
63
|
-
setTimeout(function () {
|
|
64
|
-
var _a;
|
|
65
|
-
((_a = element === null || element === void 0 ? void 0 : element.children) === null || _a === void 0 ? void 0 : _a.length) && element.removeChild(element.children[0]);
|
|
66
|
-
removeElement(DIALOG_ID);
|
|
67
|
-
reactElement(elementId).unmount();
|
|
68
|
-
}, 1000);
|
|
62
|
+
reactElement(elementId).unmount();
|
|
69
63
|
}
|
|
@@ -42,7 +42,7 @@ var ButtonStyled = styled(Button)(function (_a) {
|
|
|
42
42
|
var BankDetails = function () {
|
|
43
43
|
var _a = React.useState(false), ibanChecking = _a[0], setIbanChecking = _a[1];
|
|
44
44
|
var dispatch = useAppDispatch();
|
|
45
|
-
var _b = useAppSelector(bankSelector), data = _b.data, loading = _b.loading, error = _b.error
|
|
45
|
+
var _b = useAppSelector(bankSelector), data = _b.data, loading = _b.loading, error = _b.error;
|
|
46
46
|
var methods = useForm({
|
|
47
47
|
resolver: yupResolver(BankValidation),
|
|
48
48
|
defaultValues: data.bankData,
|
|
@@ -56,7 +56,7 @@ var BankDetails = function () {
|
|
|
56
56
|
var onBack = function () {
|
|
57
57
|
dispatch(handleCurrentActiveScreen('BANK_SUCCESS_FOUR_FLOWS_BUTTONS_STEP'));
|
|
58
58
|
};
|
|
59
|
-
var disabled = ibanChecking || !methods.formState.isValid || !!error
|
|
59
|
+
var disabled = ibanChecking || !methods.formState.isValid || !!error;
|
|
60
60
|
React.useEffect(function () {
|
|
61
61
|
if (error)
|
|
62
62
|
dispatch(clearError());
|
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import React from 'react';
|
|
3
2
|
import { styled } from '@mui/material/styles';
|
|
4
3
|
import { ScreenContainer } from '../../../shared/Containers';
|
|
5
4
|
import { useTranslation } from 'react-i18next';
|
|
6
5
|
import { useController, useFormContext } from 'react-hook-form';
|
|
7
|
-
import {
|
|
8
|
-
import { bankSelector
|
|
6
|
+
import { useAppSelector } from '../../../../hooks';
|
|
7
|
+
import { bankSelector } from '../../../app/bank/bankStore';
|
|
9
8
|
import UploadFile from '../../../shared/UploadFile';
|
|
10
|
-
import { MAX_FILE_SIZE, VALID_FILE_FORMATS } from '../../../../constants';
|
|
11
9
|
var FeatureStyled = styled(ScreenContainer)(function (_a) {
|
|
12
10
|
var theme = _a.theme;
|
|
13
11
|
return ({
|
|
@@ -15,41 +13,18 @@ var FeatureStyled = styled(ScreenContainer)(function (_a) {
|
|
|
15
13
|
});
|
|
16
14
|
});
|
|
17
15
|
var BankStatement = function () {
|
|
18
|
-
var _a
|
|
16
|
+
var _a;
|
|
19
17
|
var t = useTranslation().t;
|
|
20
|
-
var
|
|
18
|
+
var control = useFormContext().control;
|
|
21
19
|
var bankStatementFileControl = useController({ name: 'bankStatementFile', control: control });
|
|
22
|
-
var
|
|
23
|
-
var
|
|
24
|
-
var dispatch = useAppDispatch();
|
|
25
|
-
var bankStatementValue = bankStatementFileControl.field.value;
|
|
26
|
-
var error = ((_a = bankStatementFileControl.fieldState.error) === null || _a === void 0 ? void 0 : _a.message) || ((_b = bankStatementIdControl.fieldState.error) === null || _b === void 0 ? void 0 : _b.message);
|
|
20
|
+
var loading = useAppSelector(bankSelector).loading;
|
|
21
|
+
var error = (_a = bankStatementFileControl.fieldState.error) === null || _a === void 0 ? void 0 : _a.message;
|
|
27
22
|
var handleBankStatementChange = function (file) {
|
|
28
|
-
|
|
29
|
-
setError('bankStatementFile', { message: 'file_not_supported_alert' });
|
|
30
|
-
}
|
|
31
|
-
else if ((file === null || file === void 0 ? void 0 : file.size) > MAX_FILE_SIZE) {
|
|
32
|
-
setError('bankStatementFile', { message: 'file_size_alert' });
|
|
33
|
-
}
|
|
34
|
-
else {
|
|
35
|
-
bankStatementFileControl.field.onChange(file);
|
|
36
|
-
dispatch(uploadBankStatement(file));
|
|
37
|
-
}
|
|
23
|
+
bankStatementFileControl.field.onChange(file);
|
|
38
24
|
};
|
|
39
25
|
var handleReset = function () {
|
|
40
26
|
bankStatementFileControl.field.onChange(null);
|
|
41
|
-
bankStatementIdControl.field.onChange('');
|
|
42
27
|
};
|
|
43
|
-
|
|
44
|
-
if (sysError === 'file_upload_error') {
|
|
45
|
-
setError('bankStatementId', { message: sysError });
|
|
46
|
-
bankStatementFileControl.field.onChange(null);
|
|
47
|
-
}
|
|
48
|
-
}, [sysError]);
|
|
49
|
-
React.useEffect(function () {
|
|
50
|
-
if ((bankStatementFileControl.formState.isValid || !!bankStatementValue) && error != 'file_upload_error')
|
|
51
|
-
clearErrors();
|
|
52
|
-
}, [bankStatementFileControl.formState.isValid, bankStatementValue]);
|
|
53
|
-
return (_jsx(FeatureStyled, { children: _jsx(UploadFile, { label: t('title_bank_statement'), title: t('drag_and_drop'), subTitle: t('subtitle_drop'), dragDescription: t('desc_drag_and_drop'), uploadingTitle: t('file_uploading_title'), successTitle: t('success_upload_bank_statement'), onFileUploaded: handleBankStatementChange, isFileUploaded: !uploading && !!bankStatementValue, isSubmitting: loading, isUploading: uploading, onReset: handleReset, error: error && t(error) }) }));
|
|
28
|
+
return (_jsx(FeatureStyled, { children: _jsx(UploadFile, { label: t('title_bank_statement'), dragTitle: t('drag_and_drop'), uploadTitle: t('title_upload_file'), onFileUploaded: handleBankStatementChange, isSubmitting: loading, onReset: handleReset, error: error && t(error) }) }));
|
|
54
29
|
};
|
|
55
30
|
export default BankStatement;
|
|
@@ -4,4 +4,4 @@ export interface BusinessLibProps extends LibConfig {
|
|
|
4
4
|
}
|
|
5
5
|
export declare function BusinessLib(props: BusinessLibProps): JSX.Element;
|
|
6
6
|
export declare function renderBusinessLib(config: BusinessLibProps, elementId: string): void;
|
|
7
|
-
export declare function unmountBusinessLib(elementId: string
|
|
7
|
+
export declare function unmountBusinessLib(elementId: string): void;
|