@tap-payments/auth-jsconnect 2.8.57-development → 2.8.59-beta
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 +0 -1
- package/build/@types/form.d.ts +0 -1
- package/build/@types/redux.d.ts +0 -1
- package/build/api/entity.d.ts +2 -2
- package/build/api/entity.js +4 -12
- package/build/api/index.d.ts +2 -2
- package/build/constants/api.d.ts +1 -0
- package/build/constants/api.js +2 -0
- package/build/constants/app.d.ts +2 -0
- package/build/constants/app.js +2 -0
- package/build/features/app/bank/bankStore.d.ts +18 -13
- package/build/features/app/bank/bankStore.js +165 -184
- package/build/features/app/board/boardStore.js +30 -52
- package/build/features/app/brand/brandStore.d.ts +33 -16
- package/build/features/app/brand/brandStore.js +242 -239
- package/build/features/app/business/businessStore.d.ts +5 -0
- package/build/features/app/business/businessStore.js +88 -77
- package/build/features/app/connectExpress/connectExpressStore.d.ts +6 -15
- package/build/features/app/connectExpress/connectExpressStore.js +52 -110
- package/build/features/app/entity/entityStore.d.ts +36 -20
- package/build/features/app/entity/entityStore.js +246 -196
- package/build/features/app/individual/individualStore.d.ts +38 -22
- package/build/features/app/individual/individualStore.js +266 -263
- package/build/features/app/password/passwordStore.d.ts +23 -40
- package/build/features/app/password/passwordStore.js +233 -226
- package/build/features/app/tax/taxStore.d.ts +7 -13
- package/build/features/app/tax/taxStore.js +147 -168
- package/build/features/auth/screens/AuthSwitch/AuthSwitch.js +1 -13
- package/build/features/auth/screens/BusinessCountry/BusinessCountry.js +1 -7
- package/build/features/bank/Bank.d.ts +0 -1
- package/build/features/bank/Bank.js +4 -7
- package/build/features/bank/screens/BankDetails/BankDetails.js +5 -18
- package/build/features/bank/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +2 -2
- package/build/features/bank/screens/Verify/Verify.js +5 -5
- package/build/features/board/Board.js +4 -8
- package/build/features/board/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +4 -3
- package/build/features/brand/Brand.d.ts +0 -1
- package/build/features/brand/Brand.js +4 -7
- package/build/features/brand/screens/BrandActivities/BrandActivities.js +12 -49
- package/build/features/brand/screens/BrandActivities/ExpectedSalesRange.js +3 -6
- package/build/features/brand/screens/BrandActivities/RefundPolicy.js +1 -1
- package/build/features/brand/screens/BrandActivities/TAC.js +1 -1
- package/build/features/brand/screens/BrandActivities/TransactionPolicy.js +1 -1
- package/build/features/brand/screens/BrandInfo/BrandInfo.js +5 -23
- package/build/features/brand/screens/BrandSegmentInfo/BrandSegmentInfo.js +7 -23
- package/build/features/brand/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +2 -2
- package/build/features/brand/screens/Verify/Verify.js +1 -1
- package/build/features/business/Business.js +4 -9
- package/build/features/business/screens/Activities/Activities.js +3 -12
- package/build/features/business/screens/BusinessType/BusinessType.js +2 -10
- package/build/features/business/screens/CivilID/CivilID.js +1 -1
- package/build/features/business/screens/Customers/Customers.js +3 -12
- package/build/features/business/screens/Customers/ExpectedSalesRange.js +3 -6
- package/build/features/business/screens/IDBOD/IDBOD.js +2 -10
- package/build/features/business/screens/OTP/OTP.js +1 -1
- package/build/features/business/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +3 -14
- package/build/features/business/screens/Verify/Verify.js +3 -13
- package/build/features/connect/Connect.js +2 -3
- package/build/features/connect/screens/BrandSegment/BrandSegment.js +1 -1
- package/build/features/connect/screens/BusinessCountry/BusinessCountry.js +2 -9
- package/build/features/connect/screens/CivilID/CivilID.js +1 -1
- package/build/features/connect/screens/Individual/Email.js +1 -3
- package/build/features/connect/screens/Individual/Individual.js +1 -1
- package/build/features/connect/screens/Merchant/BrandList.js +3 -3
- package/build/features/connect/screens/Merchant/Merchant.js +1 -1
- package/build/features/connect/screens/Merchant/SalesChannels.js +1 -1
- package/build/features/connect/screens/Mobile/Mobile.js +8 -11
- package/build/features/connect/screens/NID/NID.js +1 -1
- package/build/features/connect/screens/OperatorError/OperatorError.js +1 -1
- package/build/features/connectExpress/ConnectExpress.js +1 -2
- package/build/features/connectExpress/screens/AuthenticationList/AuthenticationList.js +2 -5
- package/build/features/connectExpress/screens/AuthenticationList/EntityList.js +1 -6
- package/build/features/connectExpress/screens/AuthenticationList/validation.d.ts +0 -3
- package/build/features/connectExpress/screens/AuthenticationList/validation.js +0 -10
- package/build/features/connectExpress/screens/BusinessCountry/BusinessCountry.js +1 -7
- package/build/features/connectExpress/screens/CivilID/CivilID.js +1 -1
- package/build/features/connectExpress/screens/CivilIDMissed/CivilID.js +1 -1
- package/build/features/connectExpress/screens/CollectBusinessInfo/CollectBusinessInfo.js +1 -1
- package/build/features/connectExpress/screens/CollectIndividualInfo/CollectIndividualInfo.js +1 -1
- package/build/features/connectExpress/screens/CollectIndividualInfo/Email.js +1 -3
- package/build/features/connectExpress/screens/CreateAccountLoader/CreateAccountLoader.js +24 -14
- package/build/features/connectExpress/screens/Mobile/Mobile.js +2 -9
- package/build/features/connectExpress/screens/NID/NID.js +1 -1
- package/build/features/connectExpress/screens/NIDMissed/NID.js +1 -1
- package/build/features/connectExpress/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +2 -2
- package/build/features/entity/Entity.d.ts +0 -1
- package/build/features/entity/Entity.js +4 -7
- package/build/features/entity/screens/EntityCapital/CapitalPaid.js +4 -8
- package/build/features/entity/screens/EntityCapital/CapitalShareValue.js +4 -8
- package/build/features/entity/screens/EntityCapital/EntityCapital.js +10 -34
- package/build/features/entity/screens/EntityName/EntityName.js +15 -32
- package/build/features/entity/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +2 -2
- package/build/features/entity/screens/Verify/Verify.js +1 -1
- package/build/features/featuresScreens.js +7 -67
- package/build/features/individual/Individual.d.ts +0 -1
- package/build/features/individual/Individual.js +4 -7
- package/build/features/individual/screens/AdditionalIndividualInfo/AdditionalIndividualInfo.js +14 -54
- package/build/features/individual/screens/AdditionalIndividualInfo/MonthlyIncome.js +2 -5
- package/build/features/individual/screens/AdditionalIndividualInfo/ShareValue.js +3 -8
- package/build/features/individual/screens/AdditionalIndividualInfo/validation.d.ts +1 -4
- package/build/features/individual/screens/AdditionalIndividualInfo/validation.js +2 -3
- package/build/features/individual/screens/IndividualList/Email.js +2 -3
- package/build/features/individual/screens/IndividualList/IndividualList.js +5 -18
- package/build/features/individual/screens/IndividualList/UserList.js +9 -13
- package/build/features/individual/screens/IndividualPersonalInfo/Email.js +2 -4
- package/build/features/individual/screens/IndividualPersonalInfo/IndividualPersonalInfo.js +20 -76
- package/build/features/individual/screens/IndividualPhoneInfo/PhoneInfo.js +1 -1
- package/build/features/individual/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +2 -2
- package/build/features/individual/screens/Verify/Verify.js +1 -1
- package/build/features/password/Password.d.ts +0 -1
- package/build/features/password/Password.js +28 -75
- package/build/features/password/screens/CreatePassword/CreatePassword.js +4 -8
- package/build/features/password/screens/OTP/OTP.js +1 -1
- package/build/features/password/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +2 -2
- package/build/features/password/screens/Verify/Verify.js +5 -5
- package/build/features/shared/Button/FlowsButtons.js +3 -13
- package/build/features/shared/Containers/FeatureContainer.d.ts +0 -1
- package/build/features/shared/Containers/FeatureContainer.js +3 -3
- package/build/features/shared/SuccessFlowButtons/SuccessFlowButtons.d.ts +2 -5
- package/build/features/shared/SuccessFlowButtons/SuccessFlowButtons.js +11 -14
- package/build/features/signIn/SignIn.js +3 -12
- package/build/features/tax/Tax.d.ts +0 -1
- package/build/features/tax/Tax.js +4 -7
- package/build/features/tax/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +2 -2
- package/build/features/tax/screens/TaxDetails/TaxDetails.js +2 -7
- package/build/features/tax/screens/Verify/Verify.js +5 -5
- package/build/hooks/index.d.ts +0 -1
- package/build/hooks/index.js +0 -1
- package/build/hooks/useVerifyToken.d.ts +2 -5
- package/build/hooks/useVerifyToken.js +5 -10
- package/build/utils/common.js +4 -4
- package/build/utils/locale.js +1 -2
- package/build/utils/string.d.ts +2 -5
- package/build/utils/string.js +5 -34
- package/package.json +2 -2
- package/build/features/bank/screens/OperatorError/OperatorError.d.ts +0 -5
- package/build/features/bank/screens/OperatorError/OperatorError.js +0 -9
- package/build/features/bank/screens/OperatorError/index.d.ts +0 -3
- package/build/features/bank/screens/OperatorError/index.js +0 -2
- package/build/features/board/screens/OperatorError/OperatorError.d.ts +0 -5
- package/build/features/board/screens/OperatorError/OperatorError.js +0 -9
- package/build/features/board/screens/OperatorError/index.d.ts +0 -3
- package/build/features/board/screens/OperatorError/index.js +0 -2
- package/build/features/brand/screens/OperatorError/OperatorError.d.ts +0 -5
- package/build/features/brand/screens/OperatorError/OperatorError.js +0 -9
- package/build/features/brand/screens/OperatorError/index.d.ts +0 -3
- package/build/features/brand/screens/OperatorError/index.js +0 -2
- package/build/features/business/screens/OperatorError/OperatorError.d.ts +0 -5
- package/build/features/business/screens/OperatorError/OperatorError.js +0 -9
- package/build/features/business/screens/OperatorError/index.d.ts +0 -3
- package/build/features/business/screens/OperatorError/index.js +0 -2
- package/build/features/connectExpress/screens/AuthenticationList/EntityLicenseType.d.ts +0 -31
- package/build/features/connectExpress/screens/AuthenticationList/EntityLicenseType.js +0 -90
- package/build/features/connectExpress/screens/OperatorError/OperatorError.d.ts +0 -5
- package/build/features/connectExpress/screens/OperatorError/OperatorError.js +0 -9
- package/build/features/connectExpress/screens/OperatorError/index.d.ts +0 -3
- package/build/features/connectExpress/screens/OperatorError/index.js +0 -2
- package/build/features/connectExpress/screens/PrepareDataLoading/PrepareDataLoading.d.ts +0 -5
- package/build/features/connectExpress/screens/PrepareDataLoading/PrepareDataLoading.js +0 -34
- package/build/features/connectExpress/screens/PrepareDataLoading/index.d.ts +0 -2
- package/build/features/connectExpress/screens/PrepareDataLoading/index.js +0 -2
- package/build/features/entity/screens/OperatorError/OperatorError.d.ts +0 -5
- package/build/features/entity/screens/OperatorError/OperatorError.js +0 -9
- package/build/features/entity/screens/OperatorError/index.d.ts +0 -3
- package/build/features/entity/screens/OperatorError/index.js +0 -2
- package/build/features/individual/screens/AdditionalIndividualInfo/IsAuthorizedSwitch.d.ts +0 -36
- package/build/features/individual/screens/AdditionalIndividualInfo/IsAuthorizedSwitch.js +0 -76
- package/build/features/individual/screens/OperatorError/OperatorError.d.ts +0 -5
- package/build/features/individual/screens/OperatorError/OperatorError.js +0 -9
- package/build/features/individual/screens/OperatorError/index.d.ts +0 -3
- package/build/features/individual/screens/OperatorError/index.js +0 -2
- package/build/features/password/screens/OperatorError/OperatorError.d.ts +0 -5
- package/build/features/password/screens/OperatorError/OperatorError.js +0 -9
- package/build/features/password/screens/OperatorError/index.d.ts +0 -3
- package/build/features/password/screens/OperatorError/index.js +0 -2
- package/build/features/password/screens/PrepareDataLoading/PrepareDataLoading.d.ts +0 -4
- package/build/features/password/screens/PrepareDataLoading/PrepareDataLoading.js +0 -10
- package/build/features/password/screens/PrepareDataLoading/index.d.ts +0 -2
- package/build/features/password/screens/PrepareDataLoading/index.js +0 -2
- package/build/features/signIn/screens/OperatorError/OperatorError.d.ts +0 -5
- package/build/features/signIn/screens/OperatorError/OperatorError.js +0 -9
- package/build/features/signIn/screens/OperatorError/index.d.ts +0 -3
- package/build/features/signIn/screens/OperatorError/index.js +0 -2
- package/build/features/tax/screens/OperatorError/OperatorError.d.ts +0 -5
- package/build/features/tax/screens/OperatorError/OperatorError.js +0 -9
- package/build/features/tax/screens/OperatorError/index.d.ts +0 -3
- package/build/features/tax/screens/OperatorError/index.js +0 -2
- package/build/hooks/useFormDirtyCheck.d.ts +0 -10
- package/build/hooks/useFormDirtyCheck.js +0 -66
|
@@ -16,7 +16,7 @@ import Beneficiary from './Beneficiary';
|
|
|
16
16
|
import IBAN from './IBAN';
|
|
17
17
|
import BankName from './BankName';
|
|
18
18
|
import Button from '../../../shared/Button';
|
|
19
|
-
import { useAppDispatch, useAppSelector, useFormReadOnly, useSetFromDefaultValues, useDataNoneEditable, useFormErrorAndUpdateReadOnly, useExcludeReadOnlyFelids, useDataVerified
|
|
19
|
+
import { useAppDispatch, useAppSelector, useFormReadOnly, useSetFromDefaultValues, useDataNoneEditable, useFormErrorAndUpdateReadOnly, useExcludeReadOnlyFelids, useDataVerified } from '../../../../hooks';
|
|
20
20
|
import { BankKWFLValidation, BankValidation } from './validation';
|
|
21
21
|
import { useTranslation } from 'react-i18next';
|
|
22
22
|
import { useForm, FormProvider } from 'react-hook-form';
|
|
@@ -29,7 +29,7 @@ import Form from '../../../../components/Form';
|
|
|
29
29
|
import { handlePrevScreenStep, settingsSelector } from '../../../../app/settings';
|
|
30
30
|
import ConfirmPolicy from './ConfirmPolicy';
|
|
31
31
|
import BankStatement from './BankStatement';
|
|
32
|
-
import { deepCopy, getFileDetailsFromDocument, isKW, isStringHasOneAsterisk
|
|
32
|
+
import { deepCopy, getFileDetailsFromDocument, isKW, isStringHasOneAsterisk } from '../../../../utils';
|
|
33
33
|
var FormStyled = styled(Form)(function () { return ({
|
|
34
34
|
display: 'flex',
|
|
35
35
|
flexDirection: 'column',
|
|
@@ -50,7 +50,7 @@ var BankDetails = function () {
|
|
|
50
50
|
var _e = data.bankData, iban = _e.iban, beneficiaryName = _e.beneficiaryName, bankName = _e.bankName, bankStatementId = _e.bankStatementId, bankStatementUploading = _e.uploading, confirmPolicy = _e.confirmPolicy;
|
|
51
51
|
var verify = data.verify;
|
|
52
52
|
var _f = verify.responseBody || {}, bank_account = _f.bank_account, entity = _f.entity, flows = _f.flows;
|
|
53
|
-
var _g = bank_account || {}, document = _g.document, data_status = _g.data_status, data_verification = _g.data_verification, beneficiary_name = _g.beneficiary_name, resIban = _g.iban, bank_name = _g.bank_name
|
|
53
|
+
var _g = bank_account || {}, document = _g.document, data_status = _g.data_status, data_verification = _g.data_verification, beneficiary_name = _g.beneficiary_name, resIban = _g.iban, bank_name = _g.bank_name;
|
|
54
54
|
var isKWCountry = React.useMemo(function () { return isKW(settingsData.businessCountry.iso2); }, [settingsData.businessCountry.iso2]);
|
|
55
55
|
var isFL = ((_a = entity === null || entity === void 0 ? void 0 : entity.type) === null || _a === void 0 ? void 0 : _a.toLowerCase()) === BusinessType.FL ? true : false;
|
|
56
56
|
var bankHasDocument = ((_b = document === null || document === void 0 ? void 0 : document.file_details) === null || _b === void 0 ? void 0 : _b.length) > 0;
|
|
@@ -71,19 +71,13 @@ var BankDetails = function () {
|
|
|
71
71
|
var t = useTranslation().t;
|
|
72
72
|
var isAr = useLanguage().isAr;
|
|
73
73
|
var onBack = function () {
|
|
74
|
-
sendCustomEventToGTM({
|
|
75
|
-
event: 'Send Event',
|
|
76
|
-
event_category: 'Board Flows - Wallet',
|
|
77
|
-
event_action: 'Wallet Details Back button',
|
|
78
|
-
event_label: settingsData.businessCountry.iso2
|
|
79
|
-
});
|
|
80
74
|
if ((flows === null || flows === void 0 ? void 0 : flows.length) > 0) {
|
|
81
75
|
dispatch(handlePrevScreenStep());
|
|
82
76
|
return;
|
|
83
77
|
}
|
|
84
78
|
dispatch(retrieveBoardStatus());
|
|
85
79
|
};
|
|
86
|
-
var disabled = ibanChecking || !methods.formState.isValid || bankStatementUploading;
|
|
80
|
+
var disabled = ibanChecking || !methods.formState.isValid || !!error || bankStatementUploading;
|
|
87
81
|
React.useEffect(function () {
|
|
88
82
|
if (error)
|
|
89
83
|
dispatch(clearError());
|
|
@@ -107,16 +101,9 @@ var BankDetails = function () {
|
|
|
107
101
|
var isBeneficiaryNameVerified = dataVerified['beneficiary_name'] && beneficiary_name === methods.watch('beneficiaryName');
|
|
108
102
|
var isIBANVerified = dataVerified['iban'] && resIban === methods.watch('iban');
|
|
109
103
|
var isBankNameVerified = dataVerified['bank_name'] && bank_name === methods.watch('bankName');
|
|
110
|
-
var isDirty = useFormDirtyCheck(methods, {
|
|
111
|
-
iban: resIban,
|
|
112
|
-
beneficiaryName: beneficiary_name,
|
|
113
|
-
bankName: bank_name,
|
|
114
|
-
confirmPolicy: is_acknowledged
|
|
115
|
-
}).isDirty;
|
|
116
104
|
var getFelids = useExcludeReadOnlyFelids(methods, readOnly).getFelids;
|
|
117
105
|
var onSubmit = function (data) {
|
|
118
|
-
|
|
119
|
-
dispatch(createBankAccount(formData));
|
|
106
|
+
dispatch(createBankAccount(deepCopy(getFelids(data))));
|
|
120
107
|
};
|
|
121
108
|
var disableBack = settingsData.appConfig.mode === 'content';
|
|
122
109
|
return (_jsx(ScreenContainer, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(FormStyled, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsx(Beneficiary, { readOnly: readOnly['beneficiaryName'] || noneEditable['beneficiary_name'], isVerified: isBeneficiaryNameVerified }), _jsx(IBAN, { fetchingIban: function (value) { return setIbanChecking(value); }, ibanChecking: ibanChecking, readOnly: readOnly['iban'] || noneEditable['iban'], isVerified: isIBANVerified }), _jsx(BankName, { readOnly: readOnly['bankName'] || noneEditable['bank_name'], isVerified: isBankNameVerified }), _jsx(BankStatement, { isVerified: dataVerified['document'], required: isKWCountry && isFL && !bankHasDocument, defaultFiles: defaultBankFiles, readOnly: readOnly['bankStatementId'] || noneEditable['bank_statement_file_id'] }), _jsx(ConfirmPolicy, { readOnly: readOnly['confirmPolicy'] || noneEditable['is_acknowledged'] }), _jsx(ButtonStyled, __assign({ disableBack: disableBack, onBackClicked: function () { return onBack(); }, disabled: disabled, isAr: isAr, loading: loading, error: t(error || '') }, { children: t('confirm') }))] })) })) }));
|
|
@@ -21,10 +21,10 @@ var SuccessWithFlowButtons = function () {
|
|
|
21
21
|
var _a = useAppSelector(bankSelector), data = _a.data, loading = _a.loading;
|
|
22
22
|
var settingsData = useAppSelector(settingsSelector).data;
|
|
23
23
|
var isScopeAuthentication = settingsData.appConfig.scope === SCOPE_AUTH;
|
|
24
|
-
var _b = data.verify.responseBody || {}, flows = _b.flows, entity = _b.entity, brand = _b.brand, bank = _b.bank_account, merchant = _b.merchant, user = _b.user, business = _b.business, board_id = _b.board_id, board_info_id = _b.board_info_id, name = _b.name, individuals = _b.individuals, recipient = _b.recipient;
|
|
24
|
+
var _b = data.verify.responseBody || {}, flows = _b.flows, entity = _b.entity, brand = _b.brand, bank = _b.bank_account, merchant = _b.merchant, user = _b.user, business = _b.business, board_id = _b.board_id, board_info_id = _b.board_info_id, name = _b.name, individuals = _b.individuals, recipient = _b.recipient, board_status = _b.board_status;
|
|
25
25
|
var onClose = function () {
|
|
26
26
|
dispatch(onCloseCompleteBank());
|
|
27
27
|
};
|
|
28
|
-
return (_jsx(SuccessFlowButtons, { flowName: data.flowName, loading: loading, bank: bank, brand: brand, entity: entity, merchant: merchant, user: __assign({ names: { en: name } }, user), business: business, boardId: board_id, boardInfoId: board_info_id, individuals: individuals, flows: flows || [], onClose: isScopeAuthentication ? onClose : undefined,
|
|
28
|
+
return (_jsx(SuccessFlowButtons, { flowName: data.flowName, loading: loading, bank: bank, brand: brand, entity: entity, merchant: merchant, user: __assign({ names: { en: name } }, user), business: business, boardId: board_id, boardInfoId: board_info_id, individuals: individuals, flows: flows || [], onClose: isScopeAuthentication ? onClose : undefined, status: board_status }));
|
|
29
29
|
};
|
|
30
30
|
export default memo(SuccessWithFlowButtons);
|
|
@@ -46,9 +46,9 @@ var FormStyled = styled(Form)(function () { return ({
|
|
|
46
46
|
flexDirection: 'column'
|
|
47
47
|
}); });
|
|
48
48
|
var VerifyNumber = function (_a) {
|
|
49
|
-
var _b, _c;
|
|
49
|
+
var _b, _c, _d;
|
|
50
50
|
var dispatch = useAppDispatch();
|
|
51
|
-
var
|
|
51
|
+
var _e = useAppSelector(bankSelector), data = _e.data, loading = _e.loading, error = _e.error;
|
|
52
52
|
var methods = useForm({
|
|
53
53
|
resolver: yupResolver(OTPValidation),
|
|
54
54
|
defaultValues: data.otpData,
|
|
@@ -56,8 +56,8 @@ var VerifyNumber = function (_a) {
|
|
|
56
56
|
});
|
|
57
57
|
var t = useTranslation().t;
|
|
58
58
|
var isAr = useLanguage().isAr;
|
|
59
|
-
var
|
|
60
|
-
var phone = (_c = (_b = data.verify.responseBody) === null || _b === void 0 ? void 0 : _b.
|
|
59
|
+
var _f = React.useState(false), resendLoading = _f[0], setResendLoading = _f[1];
|
|
60
|
+
var phone = (_d = (_c = (_b = data.verify.responseBody) === null || _b === void 0 ? void 0 : _b.contact) === null || _c === void 0 ? void 0 : _c.phone) === null || _d === void 0 ? void 0 : _d.number;
|
|
61
61
|
React.useEffect(function () {
|
|
62
62
|
if (error && methods.formState.isValid && phone)
|
|
63
63
|
dispatch(clearError());
|
|
@@ -68,7 +68,7 @@ var VerifyNumber = function (_a) {
|
|
|
68
68
|
var onSubmit = function (formData) {
|
|
69
69
|
dispatch(verifyBankLeadOTP(deepCopy(formData)));
|
|
70
70
|
};
|
|
71
|
-
var disabled = !methods.formState.isValid || !phone || resendLoading;
|
|
71
|
+
var disabled = !methods.formState.isValid || !!error || !phone || resendLoading;
|
|
72
72
|
return (_jsx(ScreenContainer, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(FormStyled, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsx(OTPTitleContainerStyled, { children: _jsxs(OTPTitleStyled, { children: [loading ? t('ide_otp_waiting_title') : t('ide_opt_sent_title'), !loading && phone && _jsx("span", __assign({ dir: 'ltr' }, { children: "".concat(maskPhone(phone || '')) }))] }) }), _jsx(OTPInput, { loading: resendLoading, setLoading: setResendLoading }), _jsx(Button, __assign({ disableBack: true, disabled: disabled, isAr: isAr, loading: loading, error: t(error || '') }, { children: t('next') }))] })) })) }));
|
|
73
73
|
};
|
|
74
74
|
export default React.memo(VerifyNumber);
|
|
@@ -52,15 +52,11 @@ var Board = memo(function (_a) {
|
|
|
52
52
|
});
|
|
53
53
|
}, []);
|
|
54
54
|
React.useEffect(function () {
|
|
55
|
-
if (
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
return;
|
|
55
|
+
if (data.isValidOperator && props.open && !settingLoading) {
|
|
56
|
+
dispatch(createVerifyTokenBy(boardId));
|
|
57
|
+
if (props.mode === 'content')
|
|
58
|
+
dispatch(handleCurrentActiveScreen('BOARD_SUCCESS_FLOWS_BUTTONS_STEP'));
|
|
60
59
|
}
|
|
61
|
-
dispatch(createVerifyTokenBy(boardId));
|
|
62
|
-
if (props.mode === 'content')
|
|
63
|
-
dispatch(handleCurrentActiveScreen('BOARD_SUCCESS_FLOWS_BUTTONS_STEP'));
|
|
64
60
|
}, [data.isValidOperator, settingLoading]);
|
|
65
61
|
var initialLoading = settingLoading || customLoading;
|
|
66
62
|
return (_jsx(ThemeProvider, __assign({ theme: theme }, { children: _jsx(Background, __assign({ mode: props.mode, open: open, isTapOrigin: isTapOrigin, loading: initialLoading }, { children: _jsx(AnimationFlow, __assign({ pointerEvents: loading ? 'none' : 'auto', isTapOrigin: isTapOrigin, loading: initialLoading, error: error, open: open, breakpoint: 'sm', screenId: activeScreen.name, merchantInfo: merchant, isMaturityExpress: !isTapDomain(props.merchantDomain), loaderColor: loaderColor, type: props.mode === 'content' ? 'CONTENT' : undefined, dialogEdgeFormat: data.appConfig.dialogEdgeFormat, features: appConfig.features }, { children: _jsx(FeatureContainer, __assign({ isMaturityExpress: !isTapDomain(props.merchantDomain) }, { children: boardFeatureScreens.map(function (_a, index) {
|
|
@@ -12,15 +12,16 @@ var __assign = (this && this.__assign) || function () {
|
|
|
12
12
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
13
|
import { memo } from 'react';
|
|
14
14
|
import { settingsSelector } from '../../../../app/settings';
|
|
15
|
-
import { useAppSelector } from '../../../../hooks';
|
|
15
|
+
import { useAppSelector, useAppDispatch } from '../../../../hooks';
|
|
16
16
|
import { SCOPE_AUTH } from '../../../../constants';
|
|
17
17
|
import { boardSelector } from '../../../app/board/boardStore';
|
|
18
18
|
import SuccessFlowButtons from '../../../shared/SuccessFlowButtons';
|
|
19
19
|
var SuccessWithFlowButtons = function () {
|
|
20
|
+
var dispatch = useAppDispatch();
|
|
20
21
|
var _a = useAppSelector(boardSelector), data = _a.data, loading = _a.loading;
|
|
21
22
|
var settingsData = useAppSelector(settingsSelector).data;
|
|
22
23
|
var isScopeAuthentication = settingsData.appConfig.scope === SCOPE_AUTH;
|
|
23
|
-
var _b = data.verify.responseBody || {}, flows = _b.flows, entity = _b.entity, brand = _b.brand, bank = _b.bank_account, merchant = _b.merchant, user = _b.user, business = _b.business, board_id = _b.board_id, board_info_id = _b.board_info_id, name = _b.name, individuals = _b.individuals,
|
|
24
|
+
var _b = data.verify.responseBody || {}, flows = _b.flows, entity = _b.entity, brand = _b.brand, bank = _b.bank_account, merchant = _b.merchant, user = _b.user, business = _b.business, board_id = _b.board_id, board_info_id = _b.board_info_id, name = _b.name, individuals = _b.individuals, board_status = _b.board_status;
|
|
24
25
|
var onClose = function () {
|
|
25
26
|
var url = settingsData.appConfig.redirectUrl;
|
|
26
27
|
if (!url)
|
|
@@ -29,6 +30,6 @@ var SuccessWithFlowButtons = function () {
|
|
|
29
30
|
newUrl.searchParams.append('action', 'close');
|
|
30
31
|
window.open("".concat(newUrl), '_self', '_blank');
|
|
31
32
|
};
|
|
32
|
-
return (_jsx(SuccessFlowButtons, { flowName: data.flowName, loading: loading, bank: bank, brand: brand, entity: entity, merchant: merchant, user: __assign({ names: { en: name } }, user), business: business, boardId: board_id, boardInfoId: board_info_id, individuals: individuals, flows: flows || [], onClose: isScopeAuthentication ? onClose : undefined,
|
|
33
|
+
return (_jsx(SuccessFlowButtons, { flowName: data.flowName, loading: loading, bank: bank, brand: brand, entity: entity, merchant: merchant, user: __assign({ names: { en: name } }, user), business: business, boardId: board_id, boardInfoId: board_info_id, individuals: individuals, flows: flows || [], onClose: isScopeAuthentication ? onClose : undefined, status: board_status }));
|
|
33
34
|
};
|
|
34
35
|
export default memo(SuccessWithFlowButtons);
|
|
@@ -2,7 +2,6 @@ import { LibConfig } from '../../@types';
|
|
|
2
2
|
export interface BrandLibProps extends LibConfig {
|
|
3
3
|
verifyToken?: string;
|
|
4
4
|
configToken?: string;
|
|
5
|
-
loaderColor?: string;
|
|
6
5
|
}
|
|
7
6
|
export declare function BrandElement(props: BrandLibProps): import("react/jsx-runtime").JSX.Element;
|
|
8
7
|
export declare function renderBrandLib(config: BrandLibProps, elementId: string): {
|
|
@@ -36,7 +36,7 @@ import { brandFeatureScreens } from '../featuresScreens';
|
|
|
36
36
|
import { brandSelector, verifyLeadToken } from '../app/brand/brandStore';
|
|
37
37
|
import Background from '../shared/Background';
|
|
38
38
|
var Brand = memo(function (_a) {
|
|
39
|
-
var verifyToken = _a.verifyToken, configToken = _a.configToken,
|
|
39
|
+
var verifyToken = _a.verifyToken, configToken = _a.configToken, props = __rest(_a, ["verifyToken", "configToken"]);
|
|
40
40
|
var theme = useAppTheme().theme;
|
|
41
41
|
var _b = useAppSelector(settingsSelector), data = _b.data, error = _b.error, settingLoading = _b.loading;
|
|
42
42
|
var _c = useAppSelector(brandSelector), customLoading = _c.customLoading, loading = _c.loading, brandError = _c.error;
|
|
@@ -55,14 +55,11 @@ var Brand = memo(function (_a) {
|
|
|
55
55
|
loadingScreenName: 'BRAND_LOADING_DATA_STEP',
|
|
56
56
|
navigation: featureScreensNavigation,
|
|
57
57
|
open: open,
|
|
58
|
-
mode: props.mode,
|
|
59
58
|
internalToken: verifyToken,
|
|
60
|
-
settingLoading: settingLoading
|
|
61
|
-
operatorErrorScreenName: 'BRAND_OPERATOR_ERROR_STEP',
|
|
62
|
-
isValidOperator: data.isValidOperator
|
|
59
|
+
settingLoading: settingLoading
|
|
63
60
|
});
|
|
64
|
-
var initialLoading = verifyToken
|
|
65
|
-
return (_jsx(ThemeProvider, __assign({ theme: theme }, { children: _jsx(Background, __assign({
|
|
61
|
+
var initialLoading = verifyToken ? settingLoading : settingLoading || customLoading;
|
|
62
|
+
return (_jsx(ThemeProvider, __assign({ theme: theme }, { children: _jsx(Background, __assign({ open: open, isTapOrigin: isTapOrigin, loading: initialLoading }, { children: _jsx(AnimationFlow, __assign({ pointerEvents: loading ? 'none' : 'auto', isTapOrigin: isTapOrigin, loading: initialLoading, error: error, open: open, breakpoint: 'sm', screenId: activeScreen.name, merchantInfo: merchant, isMaturityExpress: isMaturityExpress, type: props.mode === 'content' ? 'CONTENT' : undefined, dialogEdgeFormat: data.appConfig.dialogEdgeFormat, features: appConfig.features }, { children: _jsx(FeatureContainer, __assign({ isMaturityExpress: isMaturityExpress }, { children: brandFeatureScreens.map(function (_a, index) {
|
|
66
63
|
var Element = _a.element, name = _a.name;
|
|
67
64
|
var isActive = activeScreen.name === name;
|
|
68
65
|
return (_jsx(Collapse, __assign({ in: isActive, timeout: { enter: 1000, exit: 800 } }, { children: _jsx(Element, {}) }), index));
|
|
@@ -15,13 +15,13 @@ import { ScreenContainer } from '../../../shared/Containers';
|
|
|
15
15
|
import { FormProvider, useForm } from 'react-hook-form';
|
|
16
16
|
import Form from '../../../../components/Form';
|
|
17
17
|
import { styled } from '@mui/material/styles';
|
|
18
|
-
import { useAppDispatch, useAppSelector, useDataNoneEditable, useFormReadOnly, useLanguage, useSetFromDefaultValues, useFormErrorAndUpdateReadOnly, useExcludeReadOnlyFelids, useDataVerified
|
|
18
|
+
import { useAppDispatch, useAppSelector, useDataNoneEditable, useFormReadOnly, useLanguage, useSetFromDefaultValues, useFormErrorAndUpdateReadOnly, useExcludeReadOnlyFelids, useDataVerified } from '../../../../hooks';
|
|
19
19
|
import { yupResolver } from '@hookform/resolvers/yup';
|
|
20
20
|
import { BrandActivitiesValidationSchema } from './validation';
|
|
21
21
|
import Button from '../../../shared/Button';
|
|
22
22
|
import { brandSelector, updateBrandActivities } from '../../../app/brand/brandStore';
|
|
23
|
-
import { handlePrevScreenStep
|
|
24
|
-
import { deepCopy
|
|
23
|
+
import { handlePrevScreenStep } from '../../../../app/settings';
|
|
24
|
+
import { deepCopy } from '../../../../utils';
|
|
25
25
|
import { useTranslation } from 'react-i18next';
|
|
26
26
|
import ActivitiesList from './ActivitiesList';
|
|
27
27
|
import CustomerBase from './CustomerBase';
|
|
@@ -36,12 +36,11 @@ var FormStyled = styled(Form)(function () { return ({
|
|
|
36
36
|
flexDirection: 'column'
|
|
37
37
|
}); });
|
|
38
38
|
var BrandActivities = function (_a) {
|
|
39
|
-
var _b, _c, _d, _e;
|
|
40
|
-
var
|
|
39
|
+
var _b, _c, _d, _e, _f;
|
|
40
|
+
var _g = React.useState(), listActive = _g[0], setListActive = _g[1];
|
|
41
41
|
var dispatch = useAppDispatch();
|
|
42
|
-
var
|
|
43
|
-
var
|
|
44
|
-
var _h = data.brandActivities, activities = _h.activities, customerLocations = _h.customerLocations, expectedCustomer = _h.expectedCustomer, expectedSale = _h.expectedSale, termAndConditionChecked = _h.termAndConditionChecked, refundPolicy = _h.refundPolicy, transactionPolicy = _h.transactionPolicy;
|
|
42
|
+
var _h = useAppSelector(brandSelector), data = _h.data, loading = _h.loading, error = _h.error;
|
|
43
|
+
var _j = data.brandActivities, activities = _j.activities, customerLocations = _j.customerLocations, expectedCustomer = _j.expectedCustomer, expectedSale = _j.expectedSale, termAndConditionChecked = _j.termAndConditionChecked, refundPolicy = _j.refundPolicy, transactionPolicy = _j.transactionPolicy;
|
|
45
44
|
var ListType;
|
|
46
45
|
(function (ListType) {
|
|
47
46
|
ListType["ActivitiesList"] = "ActivitiesList";
|
|
@@ -49,14 +48,6 @@ var BrandActivities = function (_a) {
|
|
|
49
48
|
ListType["ExpectedCustomerList"] = "ExpectedCustomerList";
|
|
50
49
|
ListType["ExpectedSalesList"] = "ExpectedSalesList";
|
|
51
50
|
})(ListType || (ListType = {}));
|
|
52
|
-
React.useEffect(function () {
|
|
53
|
-
sendCustomEventToGTM({
|
|
54
|
-
event: 'Send Event',
|
|
55
|
-
event_category: 'Board Flows - Brand',
|
|
56
|
-
event_action: 'Update Brand Activities Details Page',
|
|
57
|
-
event_label: settingsData.businessCountry.iso2
|
|
58
|
-
});
|
|
59
|
-
}, []);
|
|
60
51
|
var methods = useForm({
|
|
61
52
|
resolver: yupResolver(BrandActivitiesValidationSchema()),
|
|
62
53
|
defaultValues: {
|
|
@@ -71,8 +62,7 @@ var BrandActivities = function (_a) {
|
|
|
71
62
|
mode: 'onChange'
|
|
72
63
|
});
|
|
73
64
|
useSetFromDefaultValues(methods, data.brandActivities, true);
|
|
74
|
-
var
|
|
75
|
-
var _k = brand || {}, data_status = _k.data_status, data_verification = _k.data_verification, operations = _k.operations;
|
|
65
|
+
var _k = ((_b = data.verify.responseBody) === null || _b === void 0 ? void 0 : _b.brand) || {}, data_status = _k.data_status, data_verification = _k.data_verification, operations = _k.operations;
|
|
76
66
|
var originalReadOnly = useFormReadOnly(methods);
|
|
77
67
|
var noneEditable = useDataNoneEditable(data_status, [
|
|
78
68
|
'activities',
|
|
@@ -88,32 +78,6 @@ var BrandActivities = function (_a) {
|
|
|
88
78
|
'operations.sales_range'
|
|
89
79
|
]);
|
|
90
80
|
var getFelids = useExcludeReadOnlyFelids(methods, readOnly).getFelids;
|
|
91
|
-
var isDirty = useFormDirtyCheck(methods, {
|
|
92
|
-
activities: activitiesDefaultValues === null || activitiesDefaultValues === void 0 ? void 0 : activitiesDefaultValues.activities,
|
|
93
|
-
customerLocations: activitiesDefaultValues === null || activitiesDefaultValues === void 0 ? void 0 : activitiesDefaultValues.customerLocations,
|
|
94
|
-
expectedCustomer: activitiesDefaultValues === null || activitiesDefaultValues === void 0 ? void 0 : activitiesDefaultValues.expectedCustomer,
|
|
95
|
-
expectedSale: activitiesDefaultValues === null || activitiesDefaultValues === void 0 ? void 0 : activitiesDefaultValues.expectedSale,
|
|
96
|
-
termAndConditionChecked: activitiesDefaultValues === null || activitiesDefaultValues === void 0 ? void 0 : activitiesDefaultValues.termAndConditionChecked,
|
|
97
|
-
refundPolicy: activitiesDefaultValues === null || activitiesDefaultValues === void 0 ? void 0 : activitiesDefaultValues.transactionPolicy,
|
|
98
|
-
transactionPolicy: activitiesDefaultValues === null || activitiesDefaultValues === void 0 ? void 0 : activitiesDefaultValues.refundPolicy
|
|
99
|
-
}, [
|
|
100
|
-
{
|
|
101
|
-
name: 'activities',
|
|
102
|
-
keys: ['id']
|
|
103
|
-
},
|
|
104
|
-
{
|
|
105
|
-
name: 'customerLocations',
|
|
106
|
-
keys: ['id']
|
|
107
|
-
},
|
|
108
|
-
{
|
|
109
|
-
name: 'expectedCustomer',
|
|
110
|
-
keys: ['id']
|
|
111
|
-
},
|
|
112
|
-
{
|
|
113
|
-
name: 'expectedSale',
|
|
114
|
-
keys: ['id']
|
|
115
|
-
}
|
|
116
|
-
]).isDirty;
|
|
117
81
|
var locations = methods.watch('customerLocations');
|
|
118
82
|
var isCustomerLocationsHasVerifiedValue = React.useMemo(function () {
|
|
119
83
|
var _a, _b;
|
|
@@ -128,11 +92,10 @@ var BrandActivities = function (_a) {
|
|
|
128
92
|
return (locationIds === null || locationIds === void 0 ? void 0 : locationIds.length) === (Ids === null || Ids === void 0 ? void 0 : Ids.length) && locationIds.every(function (locationId) { return Ids.includes(locationId); });
|
|
129
93
|
}, [locations, operations]);
|
|
130
94
|
var isCustomerLocationsVerified = dataVerified['operations.customer_base_location'] && isCustomerLocationsHasVerifiedValue;
|
|
131
|
-
var isExpectedSalesRangeVerified = dataVerified['operations.sales_range'] && ((
|
|
132
|
-
var isExpectedCustomersVerified = dataVerified['operations.customer_base'] && ((
|
|
95
|
+
var isExpectedSalesRangeVerified = dataVerified['operations.sales_range'] && ((_c = operations === null || operations === void 0 ? void 0 : operations.sales) === null || _c === void 0 ? void 0 : _c.id) === ((_d = methods.watch('expectedSale')) === null || _d === void 0 ? void 0 : _d.id);
|
|
96
|
+
var isExpectedCustomersVerified = dataVerified['operations.customer_base'] && ((_e = operations === null || operations === void 0 ? void 0 : operations.customer_base) === null || _e === void 0 ? void 0 : _e.id) === ((_f = methods.watch('expectedCustomer')) === null || _f === void 0 ? void 0 : _f.id);
|
|
133
97
|
var onSubmit = function (data) {
|
|
134
|
-
|
|
135
|
-
dispatch(updateBrandActivities(formData));
|
|
98
|
+
dispatch(updateBrandActivities(deepCopy(getFelids(data))));
|
|
136
99
|
};
|
|
137
100
|
var onBack = function () {
|
|
138
101
|
dispatch(handlePrevScreenStep());
|
|
@@ -142,7 +105,7 @@ var BrandActivities = function (_a) {
|
|
|
142
105
|
};
|
|
143
106
|
var t = useTranslation().t;
|
|
144
107
|
var isAr = useLanguage().isAr;
|
|
145
|
-
var disabled = !methods.formState.isValid;
|
|
108
|
+
var disabled = !methods.formState.isValid || !!error;
|
|
146
109
|
var isActivitiesListActive = listActive === ListType.ActivitiesList;
|
|
147
110
|
var isCustomerBaseListActive = listActive === ListType.CustomerBaseList;
|
|
148
111
|
var isExpectedCustomerListActive = listActive === ListType.ExpectedCustomerList;
|
|
@@ -15,7 +15,7 @@ import { useTranslation } from 'react-i18next';
|
|
|
15
15
|
import { useController, useFormContext } from 'react-hook-form';
|
|
16
16
|
import Box from '@mui/material/Box';
|
|
17
17
|
import { styled } from '@mui/material/styles';
|
|
18
|
-
import {
|
|
18
|
+
import { isExist } from '../../../../utils';
|
|
19
19
|
import { useLanguage, useAppSelector, useAppDispatch } from '../../../../hooks';
|
|
20
20
|
import { settingsSelector } from '../../../../app/settings';
|
|
21
21
|
import SimpleList from '../../../../components/SimpleList';
|
|
@@ -68,7 +68,7 @@ var ExpectedSalesRange = function (_a) {
|
|
|
68
68
|
var expectedSaleControl = useController({ name: 'expectedSale', control: control });
|
|
69
69
|
var _g = useAppSelector(brandSelector), data = _g.data, error = _g.error;
|
|
70
70
|
var settingsData = useAppSelector(settingsSelector).data;
|
|
71
|
-
var brandActivities = data.brandActivities;
|
|
71
|
+
var brandActivities = data.brandActivities, currency = data.currency;
|
|
72
72
|
var expectedSales = (brandActivities.responseBody || {}).expectedSales;
|
|
73
73
|
var expectedSalesRangeValue = expectedSaleControl.field.value;
|
|
74
74
|
var countryCode = settingsData.businessCountry;
|
|
@@ -95,9 +95,6 @@ var ExpectedSalesRange = function (_a) {
|
|
|
95
95
|
var handleCloseSubMenu = function () {
|
|
96
96
|
setSubIndex('');
|
|
97
97
|
};
|
|
98
|
-
var getCurrency = React.useMemo(function () {
|
|
99
|
-
return t(getCurrencyByCountryIso2(countryCode.iso2));
|
|
100
|
-
}, [countryCode.iso2]);
|
|
101
98
|
React.useEffect(function () {
|
|
102
99
|
if ((expectedSales === null || expectedSales === void 0 ? void 0 : expectedSales.length) > 0) {
|
|
103
100
|
setExpectedSalesRangeList(expectedSales);
|
|
@@ -127,7 +124,7 @@ var ExpectedSalesRange = function (_a) {
|
|
|
127
124
|
setSubIndex(item.id);
|
|
128
125
|
}, [anchorEl, expectedSalesRangeValue]);
|
|
129
126
|
return (_jsx(Collapse, __assign({ in: show }, { children: _jsxs(ScreenContainer, { children: [_jsxs(InputLabelStyled, { children: [t('expected_sales_monthly', {
|
|
130
|
-
currency:
|
|
127
|
+
currency: t(currency)
|
|
131
128
|
}), _jsx(MandatoryStyled, { children: "*" })] }), _jsx(InputStyled, { readOnly: readOnly, value: isAr ? (_b = expectedSalesRangeValue === null || expectedSalesRangeValue === void 0 ? void 0 : expectedSalesRangeValue.name.ar) !== null && _b !== void 0 ? _b : '' : (_c = expectedSalesRangeValue === null || expectedSalesRangeValue === void 0 ? void 0 : expectedSalesRangeValue.name.en) !== null && _c !== void 0 ? _c : '', onClick: !!anchorEl ? handleCloseMainMenu : handleOpenMainMenu, placeholder: t('choose_expected_sales'), endAdornment: _jsx(EndAdornmentExpanded, { anchorEl: anchorEl, isVerified: isVerified }) }), _jsxs(Collapse, __assign({ in: !!anchorEl }, { children: [_jsx(Search, { onSearchValue: handleSearch }), _jsx(SimpleListStyled, { sx: { maxHeight: '350px', paddingTop: 0 }, list: expectedSalesRangeList, listItemProps: { sx: { padding: 0 } }, onSelectItem: function (item) {
|
|
132
129
|
var isOnlyOneItem = !item.sub || item.sub.length === 1;
|
|
133
130
|
if (isOnlyOneItem)
|
|
@@ -88,6 +88,6 @@ var RefundPolicy = function (_a) {
|
|
|
88
88
|
return;
|
|
89
89
|
refundControl.field.onChange(checked);
|
|
90
90
|
};
|
|
91
|
-
return (_jsxs(ScreenContainer, { children: [_jsxs(ContainerStyled, __assign({ readOnly: readOnly
|
|
91
|
+
return (_jsx(Collapse, __assign({ in: !isChecked }, { children: _jsxs(ScreenContainer, { children: [_jsxs(ContainerStyled, __assign({ readOnly: readOnly }, { children: [_jsx(CheckboxStyled, { disableRipple: true, disableFocusRipple: true, focusRipple: false, checked: refundChecked, onChange: handleRefundCheckedChange }), _jsxs(TextStyled, { children: [t('agree_on_refund_policy'), _jsx(LinkStyled, __assign({ href: isAr ? TAP_WEBSITE + countryCode + EXTERNAL_LINKS.REFUND_AR : TAP_WEBSITE + countryCode + EXTERNAL_LINKS.REFUND_EN, target: '_blank', underline: 'always' }, { children: t('refund_policy_compliance') }))] })] })), _jsx(CollapseStyled, __assign({ in: !!warningMessage }, { children: _jsx(Warning, __assign({ warningType: 'alert' }, { children: warningMessage && t(warningMessage) })) }))] }) })));
|
|
92
92
|
};
|
|
93
93
|
export default RefundPolicy;
|
|
@@ -88,6 +88,6 @@ var TAC = function (_a) {
|
|
|
88
88
|
return;
|
|
89
89
|
tacControl.field.onChange(checked);
|
|
90
90
|
};
|
|
91
|
-
return (_jsxs(ScreenContainer, __assign({ sx: { mt: 2.75 } }, { children: [_jsxs(TACContainerStyled, __assign({ readOnly: readOnly
|
|
91
|
+
return (_jsx(Collapse, __assign({ in: !isChecked }, { children: _jsxs(ScreenContainer, __assign({ sx: { mt: 2.75 } }, { children: [_jsxs(TACContainerStyled, __assign({ readOnly: readOnly }, { children: [_jsx(CheckboxStyled, { disableRipple: true, disableFocusRipple: true, focusRipple: false, checked: tacChecked, onChange: handleTACCheckedChange }), _jsxs(TextStyled, { children: [t('read_agree_terms_and_conditions_message'), _jsx(LinkStyled, __assign({ href: isAr ? TAP_WEBSITE + countryCode + EXTERNAL_LINKS.TOS_AR : TAP_WEBSITE + countryCode + EXTERNAL_LINKS.TOS_EN, target: '_blank', underline: 'always' }, { children: t('terms_and_conditions_link_title') }))] })] })), _jsx(CollapseStyled, __assign({ in: !!warningMessage }, { children: _jsx(Warning, __assign({ warningType: 'alert' }, { children: warningMessage && t(warningMessage) })) }))] })) })));
|
|
92
92
|
};
|
|
93
93
|
export default React.memo(TAC);
|
|
@@ -51,6 +51,6 @@ var TransactionPolicy = function (_a) {
|
|
|
51
51
|
return;
|
|
52
52
|
transactionControl.field.onChange(checked);
|
|
53
53
|
};
|
|
54
|
-
return (_jsxs(ScreenContainer, { children: [_jsxs(ContainerStyled, __assign({ readOnly: readOnly
|
|
54
|
+
return (_jsx(Collapse, __assign({ in: !isChecked }, { children: _jsxs(ScreenContainer, { children: [_jsxs(ContainerStyled, __assign({ readOnly: readOnly }, { children: [_jsx(CheckboxStyled, { disableRipple: true, disableFocusRipple: true, focusRipple: false, checked: transactionChecked, onChange: handleTransactionCheckedChange }), _jsxs(TextStyled, { children: [t('agree_on_chargeback_policy'), _jsx(LinkStyled, __assign({ href: isAr ? TAP_WEBSITE + countryCode + EXTERNAL_LINKS.TRANSACTION_AR : TAP_WEBSITE + countryCode + EXTERNAL_LINKS.TRANSACTION_EN, target: '_blank', underline: 'always' }, { children: t('chargeback_policy') }))] })] })), _jsx(CollapseStyled, __assign({ in: !!warningMessage }, { children: _jsx(Warning, __assign({ warningType: 'alert' }, { children: warningMessage && t(warningMessage) })) }))] }) })));
|
|
55
55
|
};
|
|
56
56
|
export default TransactionPolicy;
|
|
@@ -14,11 +14,11 @@ import React from 'react';
|
|
|
14
14
|
import { useTranslation } from 'react-i18next';
|
|
15
15
|
import { FormProvider, useForm } from 'react-hook-form';
|
|
16
16
|
import { styled } from '@mui/material/styles';
|
|
17
|
-
import { useAppDispatch, useAppSelector, useDataNoneEditable, useFormReadOnly, useLanguage, useSetFromDefaultValues, useFormErrorAndUpdateReadOnly, useExcludeReadOnlyFelids, useDataVerified
|
|
17
|
+
import { useAppDispatch, useAppSelector, useDataNoneEditable, useFormReadOnly, useLanguage, useSetFromDefaultValues, useFormErrorAndUpdateReadOnly, useExcludeReadOnlyFelids, useDataVerified } from '../../../../hooks';
|
|
18
18
|
import { handlePrevScreenStep, settingsSelector } from '../../../../app/settings';
|
|
19
19
|
import { yupResolver } from '@hookform/resolvers/yup';
|
|
20
20
|
import Form from '../../../../components/Form';
|
|
21
|
-
import { deepCopy, mapSalesChannel
|
|
21
|
+
import { deepCopy, mapSalesChannel } from '../../../../utils';
|
|
22
22
|
import Button from '../../../shared/Button';
|
|
23
23
|
import { clearError, brandSelector, updateBrand, retrieveBoardStatus } from '../../../app/brand/brandStore';
|
|
24
24
|
import { ScreenContainer } from '../../../shared/Containers';
|
|
@@ -39,7 +39,7 @@ var BrandInfo = function (_a) {
|
|
|
39
39
|
var settingsData = useAppSelector(settingsSelector).data;
|
|
40
40
|
var _d = data.brandData, brandName = _d.brandName, salesChannels = _d.salesChannels, brandLogoId = _d.brandLogoId, responseBody = _d.responseBody;
|
|
41
41
|
var _e = data.verify.responseBody || {}, brand = _e.brand, flows = _e.flows;
|
|
42
|
-
var _f = brand || {}, logo_details = _f.logo_details, data_status = _f.data_status, data_verification = _f.data_verification, name = _f.name
|
|
42
|
+
var _f = brand || {}, logo_details = _f.logo_details, data_status = _f.data_status, data_verification = _f.data_verification, name = _f.name;
|
|
43
43
|
var methods = useForm({
|
|
44
44
|
resolver: yupResolver(BrandValidationSchema()),
|
|
45
45
|
defaultValues: {
|
|
@@ -52,17 +52,6 @@ var BrandInfo = function (_a) {
|
|
|
52
52
|
var watch = methods.watch;
|
|
53
53
|
useSetFromDefaultValues(methods, data.brandData, true);
|
|
54
54
|
var defaultBrandLogoFile = React.useMemo(function () { return logo_details && __assign(__assign({}, logo_details), { docId: '' }); }, [logo_details]);
|
|
55
|
-
var initialSalesChannels = React.useMemo(function () { return mapSalesChannel(channel_services || []); }, [channel_services]);
|
|
56
|
-
var isDirty = useFormDirtyCheck(methods, {
|
|
57
|
-
brandName: ((name === null || name === void 0 ? void 0 : name.en) || '').trim(),
|
|
58
|
-
salesChannels: initialSalesChannels,
|
|
59
|
-
brandLogoId: defaultBrandLogoFile === null || defaultBrandLogoFile === void 0 ? void 0 : defaultBrandLogoFile.id
|
|
60
|
-
}, [
|
|
61
|
-
{
|
|
62
|
-
name: 'salesChannels',
|
|
63
|
-
keys: ['id', 'address', 'code', 'sub']
|
|
64
|
-
}
|
|
65
|
-
]).isDirty;
|
|
66
55
|
var originalReadOnly = useFormReadOnly(methods, { brandLogoId: defaultBrandLogoFile });
|
|
67
56
|
var noneEditable = useDataNoneEditable(data_status, ['name.en', 'name.ar', 'channel_services', 'logo']);
|
|
68
57
|
var readOnly = useFormErrorAndUpdateReadOnly(methods, originalReadOnly, noneEditable);
|
|
@@ -70,16 +59,9 @@ var BrandInfo = function (_a) {
|
|
|
70
59
|
var getFelids = useExcludeReadOnlyFelids(methods, readOnly).getFelids;
|
|
71
60
|
var isBrandNameVerified = dataVerified['name.en'] && dataVerified['name.ar'] && ((name === null || name === void 0 ? void 0 : name.en) === watch('brandName') || (name === null || name === void 0 ? void 0 : name.ar) === watch('brandName'));
|
|
72
61
|
var onSubmit = function (data) {
|
|
73
|
-
|
|
74
|
-
dispatch(updateBrand(formData));
|
|
62
|
+
dispatch(updateBrand(deepCopy(getFelids(data))));
|
|
75
63
|
};
|
|
76
64
|
var onBack = function () {
|
|
77
|
-
sendCustomEventToGTM({
|
|
78
|
-
event: 'Send Event',
|
|
79
|
-
event_category: 'Board Flows - Brand',
|
|
80
|
-
event_action: 'Brand Details Back button',
|
|
81
|
-
event_label: settingsData.businessCountry.iso2
|
|
82
|
-
});
|
|
83
65
|
if ((flows === null || flows === void 0 ? void 0 : flows.length) > 0) {
|
|
84
66
|
dispatch(handlePrevScreenStep());
|
|
85
67
|
return;
|
|
@@ -98,7 +80,7 @@ var BrandInfo = function (_a) {
|
|
|
98
80
|
if ((responseBody === null || responseBody === void 0 ? void 0 : responseBody.response_code) === '5')
|
|
99
81
|
methods.setError('brandName', { message: 'brand_name_already_exist' });
|
|
100
82
|
}, [responseBody]);
|
|
101
|
-
var brandErrChecks = !methods.formState.isValid || !!methods.formState.errors.brandName;
|
|
83
|
+
var brandErrChecks = !methods.formState.isValid || !!methods.formState.errors.brandName || !!error;
|
|
102
84
|
var disabled = brandErrChecks || brandNameChecking || uploadingBrandLogo;
|
|
103
85
|
var disableBack = settingsData.appConfig.mode === 'content';
|
|
104
86
|
return (_jsx(ScreenContainer, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(FormStyled, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsx(BrandName, { readOnly: readOnly['brandName'] || (noneEditable['name.en'] && noneEditable['name.ar']), brandNameChecking: brandNameChecking, fetchingBrandName: setBrandNameChecking, isVerified: isBrandNameVerified }), _jsx(BrandLogo, { defaultFile: defaultBrandLogoFile, readOnly: readOnly['brandLogoId'], isVerified: dataVerified['logo'] }), _jsx(SalesChannels, { readOnly: readOnly['salesChannels'] || noneEditable['channel_services'] }), _jsx(Button, __assign({ disableBack: disableBack, onBackClicked: function () { return onBack(); }, disabled: disabled, isAr: isAr, error: t(error || ''), loading: loading }, { children: t('next') }))] })) })) }));
|
|
@@ -14,12 +14,12 @@ import React from 'react';
|
|
|
14
14
|
import { useTranslation } from 'react-i18next';
|
|
15
15
|
import { FormProvider, useForm } from 'react-hook-form';
|
|
16
16
|
import { styled } from '@mui/material/styles';
|
|
17
|
-
import { useAppDispatch, useAppSelector, useDataNoneEditable, useFormReadOnly, useLanguage, useSetFromDefaultValues, useFormErrorAndUpdateReadOnly, useExcludeReadOnlyFelids, useDataVerified
|
|
18
|
-
import { handlePrevScreenStep
|
|
17
|
+
import { useAppDispatch, useAppSelector, useDataNoneEditable, useFormReadOnly, useLanguage, useSetFromDefaultValues, useFormErrorAndUpdateReadOnly, useExcludeReadOnlyFelids, useDataVerified } from '../../../../hooks';
|
|
18
|
+
import { handlePrevScreenStep } from '../../../../app/settings';
|
|
19
19
|
import { yupResolver } from '@hookform/resolvers/yup';
|
|
20
20
|
import Collapse from '../../../../components/Collapse';
|
|
21
21
|
import Form from '../../../../components/Form';
|
|
22
|
-
import { deepCopy
|
|
22
|
+
import { deepCopy } from '../../../../utils';
|
|
23
23
|
import { ScreenContainer } from '../../../shared/Containers';
|
|
24
24
|
import { clearError, brandSelector, updateSegmentBrand } from '../../../app/brand/brandStore';
|
|
25
25
|
import Button from '../../../shared/Button';
|
|
@@ -46,10 +46,9 @@ var BrandInfo = function (_a) {
|
|
|
46
46
|
var t = useTranslation().t;
|
|
47
47
|
var isAr = useLanguage().isAr;
|
|
48
48
|
var _l = useAppSelector(brandSelector), data = _l.data, loading = _l.loading, error = _l.error;
|
|
49
|
-
var settingsData = useAppSelector(settingsSelector).data;
|
|
50
49
|
var _m = data.brandSegmentData, segmentLocation = _m.segmentLocation, segmentProfit = _m.segmentProfit, segmentTech = _m.segmentTech, teamSize = _m.teamSize;
|
|
51
|
-
var
|
|
52
|
-
var
|
|
50
|
+
var brand = (data.verify.responseBody || {}).brand;
|
|
51
|
+
var _o = brand || {}, data_status = _o.data_status, data_verification = _o.data_verification, resSegment = _o.segment;
|
|
53
52
|
var methods = useForm({
|
|
54
53
|
resolver: yupResolver(BrandValidationSchema()),
|
|
55
54
|
defaultValues: {
|
|
@@ -62,12 +61,6 @@ var BrandInfo = function (_a) {
|
|
|
62
61
|
});
|
|
63
62
|
var watch = methods.watch;
|
|
64
63
|
useSetFromDefaultValues(methods, data.brandSegmentData, true);
|
|
65
|
-
var isDirty = useFormDirtyCheck(methods, {
|
|
66
|
-
segmentLocation: segmentDefaultValues === null || segmentDefaultValues === void 0 ? void 0 : segmentDefaultValues.segmentLocation,
|
|
67
|
-
segmentProfit: segmentDefaultValues === null || segmentDefaultValues === void 0 ? void 0 : segmentDefaultValues.segmentProfit,
|
|
68
|
-
segmentTech: segmentDefaultValues === null || segmentDefaultValues === void 0 ? void 0 : segmentDefaultValues.segmentTech,
|
|
69
|
-
teamSize: segmentDefaultValues === null || segmentDefaultValues === void 0 ? void 0 : segmentDefaultValues.teamSize
|
|
70
|
-
}).isDirty;
|
|
71
64
|
var originalReadOnly = useFormReadOnly(methods);
|
|
72
65
|
var noneEditable = useDataNoneEditable(data_status, [
|
|
73
66
|
'segment.location_type',
|
|
@@ -88,25 +81,16 @@ var BrandInfo = function (_a) {
|
|
|
88
81
|
var isSegmentTechVerified = dataVerified['segment.tech_type'] && ((_f = resSegment === null || resSegment === void 0 ? void 0 : resSegment.tech_type) === null || _f === void 0 ? void 0 : _f.id) === ((_g = watch('segmentTech')) === null || _g === void 0 ? void 0 : _g.id);
|
|
89
82
|
var isTeamSizeVerified = dataVerified['segment.teams'] && ((_h = resSegment === null || resSegment === void 0 ? void 0 : resSegment.team) === null || _h === void 0 ? void 0 : _h.id) === ((_j = watch('teamSize')) === null || _j === void 0 ? void 0 : _j.id);
|
|
90
83
|
var onSubmit = function (data) {
|
|
91
|
-
|
|
92
|
-
dispatch(updateSegmentBrand(formData));
|
|
84
|
+
dispatch(updateSegmentBrand(deepCopy(getFelids(data))));
|
|
93
85
|
};
|
|
94
86
|
var onBack = function () {
|
|
95
87
|
dispatch(handlePrevScreenStep());
|
|
96
88
|
};
|
|
97
|
-
React.useEffect(function () {
|
|
98
|
-
sendCustomEventToGTM({
|
|
99
|
-
event: 'Send Event',
|
|
100
|
-
event_category: 'Board Flows - Brand',
|
|
101
|
-
event_action: 'Update Business Market & Size',
|
|
102
|
-
event_label: settingsData.businessCountry.iso2
|
|
103
|
-
});
|
|
104
|
-
}, []);
|
|
105
89
|
React.useEffect(function () {
|
|
106
90
|
if (error)
|
|
107
91
|
dispatch(clearError());
|
|
108
92
|
}, [methods.formState.isValid]);
|
|
109
|
-
var disabled = !methods.formState.isValid;
|
|
93
|
+
var disabled = !methods.formState.isValid || !!error;
|
|
110
94
|
var handleMenuClick = function (flag) {
|
|
111
95
|
setListActive(flag);
|
|
112
96
|
};
|
|
@@ -21,10 +21,10 @@ var SuccessWithFlowButtons = function () {
|
|
|
21
21
|
var _a = useAppSelector(brandSelector), data = _a.data, loading = _a.loading;
|
|
22
22
|
var settingsData = useAppSelector(settingsSelector).data;
|
|
23
23
|
var isScopeAuthentication = settingsData.appConfig.scope === SCOPE_AUTH;
|
|
24
|
-
var _b = data.verify.responseBody || {}, flows = _b.flows, entity = _b.entity, brand = _b.brand, bank = _b.bank_account, merchant = _b.merchant, user = _b.user, business = _b.business, board_id = _b.board_id, board_info_id = _b.board_info_id, name = _b.name, individuals = _b.individuals, recipient = _b.recipient;
|
|
24
|
+
var _b = data.verify.responseBody || {}, flows = _b.flows, entity = _b.entity, brand = _b.brand, bank = _b.bank_account, merchant = _b.merchant, user = _b.user, business = _b.business, board_id = _b.board_id, board_info_id = _b.board_info_id, name = _b.name, individuals = _b.individuals, recipient = _b.recipient, board_status = _b.board_status;
|
|
25
25
|
var onClose = function () {
|
|
26
26
|
dispatch(onCloseCompleteBrand());
|
|
27
27
|
};
|
|
28
|
-
return (_jsx(SuccessFlowButtons, { flowName: data.flowName, loading: loading, bank: bank, brand: brand, entity: entity, merchant: merchant, user: __assign({ names: { en: name } }, user), business: business, boardId: board_id, boardInfoId: board_info_id, individuals: individuals, flows: flows || [], onClose: isScopeAuthentication ? onClose : undefined,
|
|
28
|
+
return (_jsx(SuccessFlowButtons, { flowName: data.flowName, loading: loading, bank: bank, brand: brand, entity: entity, merchant: merchant, user: __assign({ names: { en: name } }, user), business: business, boardId: board_id, boardInfoId: board_info_id, individuals: individuals, flows: flows || [], onClose: isScopeAuthentication ? onClose : undefined, status: board_status }));
|
|
29
29
|
};
|
|
30
30
|
export default memo(SuccessWithFlowButtons);
|
|
@@ -72,7 +72,7 @@ var VerifyNumber = function (_a) {
|
|
|
72
72
|
var onSubmit = function (formData) {
|
|
73
73
|
dispatch(verifyBrandLeadOTP(deepCopy(formData)));
|
|
74
74
|
};
|
|
75
|
-
var disabled = !methods.formState.isValid || !phone || resendLoading;
|
|
75
|
+
var disabled = !methods.formState.isValid || !!error || !phone || resendLoading;
|
|
76
76
|
return (_jsx(ScreenContainer, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(FormStyled, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsx(OTPTitleContainerStyled, { children: _jsxs(OTPTitleStyled, { children: [loading ? t('ide_otp_waiting_title') : t('ide_opt_sent_title'), !loading && phone && _jsx("span", __assign({ dir: 'ltr' }, { children: "".concat(maskPhone(phone || '')) }))] }) }), _jsx(OTPInput, { loading: resendLoading, setLoading: setResendLoading }), _jsx(Button, __assign({ disableBack: true, disabled: disabled, isAr: isAr, loading: loading, error: t(error || '') }, { children: t('next') }))] })) })) }));
|
|
77
77
|
};
|
|
78
78
|
export default React.memo(VerifyNumber);
|
|
@@ -13,7 +13,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
13
13
|
import { memo, useEffect } from 'react';
|
|
14
14
|
import { createRoot } from 'react-dom/client';
|
|
15
15
|
import { useAppTheme, useAppDispatch, useAppSelector, useAppConfig, useErrorListener, useStepStartedListener } from '../../hooks';
|
|
16
|
-
import {
|
|
16
|
+
import { handleLanguage, settingsSelector } from '../../app/settings';
|
|
17
17
|
import { FeatureContainer } from '../shared/Containers';
|
|
18
18
|
import { businessSelector, verifyLeadToken } from '../app/business/businessStore';
|
|
19
19
|
import AnimationFlow from '../../components/AnimationFlow';
|
|
@@ -47,14 +47,9 @@ var Business = memo(function (props) {
|
|
|
47
47
|
dispatch(verifyLeadToken(token));
|
|
48
48
|
};
|
|
49
49
|
useEffect(function () {
|
|
50
|
-
if (settingLoading
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
dispatch(handleCurrentActiveScreen('BUSINESS_OPERATOR_ERROR_STEP'));
|
|
54
|
-
return;
|
|
55
|
-
}
|
|
56
|
-
verifyToken();
|
|
57
|
-
}, [data.isValidOperator, settingLoading]);
|
|
50
|
+
if (!settingLoading && open)
|
|
51
|
+
verifyToken();
|
|
52
|
+
}, [settingLoading]);
|
|
58
53
|
return (_jsx(ThemeProvider, __assign({ theme: theme }, { children: _jsx(Background, __assign({ open: open, isTapOrigin: isTapOrigin, loading: settingLoading || customLoading }, { children: _jsx(AnimationFlow, __assign({ pointerEvents: loading ? 'none' : 'auto', isTapOrigin: isTapOrigin, loading: settingLoading || customLoading, error: error, open: open, breakpoint: 'sm', screenId: activeScreen.name, merchantInfo: merchant, isMaturityExpress: isMaturityExpress, dialogEdgeFormat: data.appConfig.dialogEdgeFormat, features: appConfig.features }, { children: _jsx(FeatureContainer, __assign({ isMaturityExpress: isMaturityExpress }, { children: businessFeatureScreens.map(function (_a, index) {
|
|
59
54
|
var Element = _a.element, name = _a.name;
|
|
60
55
|
var isActive = activeScreen.name === name;
|