@tap-payments/auth-jsconnect 2.0.55 → 2.0.56
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/redux.d.ts +4 -0
- package/build/constants/app.js +9 -9
- package/build/features/app/bank/bankStore.d.ts +2 -2
- package/build/features/app/bank/bankStore.js +54 -51
- package/build/features/app/brand/brandStore.d.ts +3 -3
- package/build/features/app/brand/brandStore.js +133 -114
- package/build/features/app/business/businessStore.js +3 -4
- package/build/features/app/connect/connectStore.js +3 -2
- package/build/features/app/connectExpress/connectExpressStore.d.ts +3 -3
- package/build/features/app/connectExpress/connectExpressStore.js +80 -76
- package/build/features/app/entity/entityStore.d.ts +3 -3
- package/build/features/app/entity/entityStore.js +130 -120
- package/build/features/app/individual/individualStore.d.ts +4 -4
- package/build/features/app/individual/individualStore.js +227 -219
- package/build/features/app/password/passwordStore.d.ts +2 -0
- package/build/features/app/password/passwordStore.js +24 -12
- package/build/features/app/tax/taxStore.d.ts +2 -2
- package/build/features/app/tax/taxStore.js +59 -55
- package/build/features/bank/screens/BankDetails/BankDetails.js +7 -6
- package/build/features/bank/screens/ResetPasswordSuccess/ResetPasswordSuccess.js +8 -3
- package/build/features/brand/screens/BrandActivities/BrandActivities.js +3 -2
- package/build/features/brand/screens/BrandActivities/ExpectedCustomers.js +3 -11
- package/build/features/brand/screens/BrandInfo/BrandInfo.js +7 -6
- package/build/features/brand/screens/ResetPasswordSuccess/ResetPasswordSuccess.js +8 -3
- package/build/features/business/screens/ResetPasswordSuccess/ResetPasswordSuccess.js +7 -2
- package/build/features/connect/screens/Merchant/Merchant.js +2 -1
- package/build/features/connect/screens/Merchant/validation.d.ts +3 -0
- package/build/features/connect/screens/Merchant/validation.js +2 -1
- package/build/features/connectExpress/screens/CollectBusinessInfo/CollectBusinessInfo.js +5 -4
- package/build/features/connectExpress/screens/CollectIndividualInfo/CollectIndividualInfo.js +5 -4
- package/build/features/connectExpress/screens/CollectIndividualInfo/Email.js +3 -9
- package/build/features/entity/screens/EntityCapital/EntityCapital.js +3 -2
- package/build/features/entity/screens/EntityName/EntityName.js +3 -2
- package/build/features/entity/screens/ResetPasswordSuccess/ResetPasswordSuccess.js +8 -3
- package/build/features/individual/screens/AdditionalIndividualInfo/AdditionalIndividualInfo.js +19 -18
- package/build/features/individual/screens/IndividualPersonalInfo/IndividualPersonalInfo.js +3 -2
- package/build/features/individual/screens/IndividualPhoneInfo/PhoneInfo.js +3 -2
- package/build/features/individual/screens/ResetPasswordSuccess/ResetPasswordSuccess.js +7 -2
- package/build/features/password/screens/CreatePassword/CreatePassword.js +9 -16
- package/build/features/password/screens/ResetPasswordSuccess/ResetPasswordSuccess.js +7 -2
- package/build/features/password/screens/Verify/Verify.js +7 -20
- package/build/features/shared/Button/IndividualActionButtons.js +2 -2
- package/build/features/shared/SuccessScreen/SuccessScreen.d.ts +3 -1
- package/build/features/shared/SuccessScreen/SuccessScreen.js +3 -2
- package/build/features/tax/screens/ResetPasswordSuccess/ResetPasswordSuccess.js +8 -3
- package/build/features/tax/screens/TaxDetails/TaxDetails.js +4 -3
- package/build/hooks/index.d.ts +1 -0
- package/build/hooks/index.js +1 -0
- package/build/hooks/useExcludeReadOnlyFelids.d.ts +11 -0
- package/build/hooks/useExcludeReadOnlyFelids.js +33 -0
- package/build/utils/string.d.ts +1 -1
- package/build/utils/string.js +3 -1
- package/package.json +1 -1
|
@@ -165,62 +165,66 @@ export var verifyTaxLeadOTP = createAsyncThunk('verifyTaxLeadOTP', function (par
|
|
|
165
165
|
}
|
|
166
166
|
});
|
|
167
167
|
}); });
|
|
168
|
-
export var updateTaxInfo = createAsyncThunk('updateTaxInfo', function (
|
|
169
|
-
var
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
168
|
+
export var updateTaxInfo = createAsyncThunk('updateTaxInfo', function (_a, thunkApi) {
|
|
169
|
+
var formData = _a.formData, originalFormData = _a.originalFormData;
|
|
170
|
+
return __awaiter(void 0, void 0, void 0, function () {
|
|
171
|
+
var _b, settings, tax, _c, id, data_status, documents, isTaxNumberNonEditable, isConfirmPolicyNonEditable, isDocumentsNonEditable, document, vatId, confirmPolicy, documentId, requestBody, data, documentBody, _d, documentBody, _e;
|
|
172
|
+
var _f, _g, _h, _j;
|
|
173
|
+
return __generator(this, function (_k) {
|
|
174
|
+
switch (_k.label) {
|
|
175
|
+
case 0:
|
|
176
|
+
_b = thunkApi.getState(), settings = _b.settings, tax = _b.tax;
|
|
177
|
+
_c = ((_f = tax.data.verify.responseBody) === null || _f === void 0 ? void 0 : _f.entity) || {}, id = _c.id, data_status = _c.data_status, documents = _c.documents;
|
|
178
|
+
isTaxNumberNonEditable = hasNoneEditableValue(data_status, 'tax_number');
|
|
179
|
+
isConfirmPolicyNonEditable = hasNoneEditableValue(data_status, 'is_vat_acknowledged');
|
|
180
|
+
isDocumentsNonEditable = hasNoneEditableValue(data_status, 'documents');
|
|
181
|
+
document = getRecentDocumentBasedOnPurpose(documents, DocumentPurpose.TAX_DOCUMENT);
|
|
182
|
+
vatId = formData.vatId, confirmPolicy = formData.confirmPolicy, documentId = formData.documentId;
|
|
183
|
+
requestBody = {
|
|
184
|
+
id: id,
|
|
185
|
+
vat_id: isTaxNumberNonEditable ? undefined : vatId,
|
|
186
|
+
step_name: TAX_STEP_NAMES.TAX_INFO,
|
|
187
|
+
is_vat_acknowledged: isConfirmPolicyNonEditable ? undefined : confirmPolicy
|
|
188
|
+
};
|
|
189
|
+
return [4, API.entityService.updateEntityInfo(requestBody)];
|
|
190
|
+
case 1:
|
|
191
|
+
data = (_k.sent()).data;
|
|
192
|
+
if ((_g = data.errors) === null || _g === void 0 ? void 0 : _g.length)
|
|
193
|
+
throw new Error(data.errors[0].description);
|
|
194
|
+
if (!(!isDocumentsNonEditable && (documentId || []).length > 0)) return [3, 5];
|
|
195
|
+
if (!(document === null || document === void 0 ? void 0 : document.id)) return [3, 3];
|
|
196
|
+
documentBody = {
|
|
197
|
+
id: document === null || document === void 0 ? void 0 : document.id,
|
|
198
|
+
images: documentId
|
|
199
|
+
};
|
|
200
|
+
_d = data;
|
|
201
|
+
return [4, API.documentService.addFilesToExistingDocument(documentBody)];
|
|
202
|
+
case 2:
|
|
203
|
+
_d.documentData = _k.sent();
|
|
204
|
+
return [3, 5];
|
|
205
|
+
case 3:
|
|
206
|
+
documentBody = {
|
|
207
|
+
entity_id: id || '',
|
|
208
|
+
documents: [
|
|
209
|
+
{
|
|
210
|
+
type: DocumentPurpose.TAX_DOCUMENT,
|
|
211
|
+
images: documentId
|
|
212
|
+
}
|
|
213
|
+
]
|
|
214
|
+
};
|
|
215
|
+
_e = data;
|
|
216
|
+
return [4, API.documentService.updateDocumentInfo(documentBody)];
|
|
217
|
+
case 4:
|
|
218
|
+
_e.documentData = _k.sent();
|
|
219
|
+
_k.label = 5;
|
|
220
|
+
case 5:
|
|
221
|
+
thunkApi.dispatch(handleNextScreenStep());
|
|
222
|
+
(_j = (_h = settings.data.appConfig).onStepCompleted) === null || _j === void 0 ? void 0 : _j.call(_h, settings.data.activeScreen.name, requestBody);
|
|
223
|
+
return [2, { data: data, formData: originalFormData }];
|
|
224
|
+
}
|
|
225
|
+
});
|
|
222
226
|
});
|
|
223
|
-
});
|
|
227
|
+
});
|
|
224
228
|
export var updateLeadSuccess = createAsyncThunk('taxUpdateLeadSuccess', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
225
229
|
var _a, settings, tax, _b, id, infoId, payload, data, boardInfoData, boardData;
|
|
226
230
|
var _c, _d, _e, _f, _g;
|
|
@@ -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 } from '../../../../hooks';
|
|
19
|
+
import { useAppDispatch, useAppSelector, useFormReadOnly, useSetFromDefaultValues, useDataNoneEditable, useFormErrorAndUpdateReadOnly, useExcludeReadOnlyFelids } 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 { getFileDetailsFromDocument, isKW,
|
|
32
|
+
import { getFileDetailsFromDocument, isKW, isStringHasOneAsterisk } from '../../../../utils';
|
|
33
33
|
var FormStyled = styled(Form)(function () { return ({
|
|
34
34
|
display: 'flex',
|
|
35
35
|
flexDirection: 'column',
|
|
@@ -53,7 +53,7 @@ var BankDetails = function () {
|
|
|
53
53
|
var isKWCountry = React.useMemo(function () { return isKW(settingsData.businessCountry.iso2); }, [settingsData.businessCountry.iso2]);
|
|
54
54
|
var isFL = ((_a = entity === null || entity === void 0 ? void 0 : entity.type) === null || _a === void 0 ? void 0 : _a.toLowerCase()) === BusinessType.FL ? true : false;
|
|
55
55
|
var bankHasDocument = ((_c = (_b = bank_account === null || bank_account === void 0 ? void 0 : bank_account.document) === null || _b === void 0 ? void 0 : _b.file_details) === null || _c === void 0 ? void 0 : _c.length) > 0;
|
|
56
|
-
var isIBANMasked =
|
|
56
|
+
var isIBANMasked = isStringHasOneAsterisk(iban);
|
|
57
57
|
var methods = useForm({
|
|
58
58
|
resolver: yupResolver(isKWCountry && isFL && !bankHasDocument ? BankKWFLValidation(isIBANMasked) : BankValidation(isIBANMasked)),
|
|
59
59
|
defaultValues: {
|
|
@@ -67,9 +67,6 @@ var BankDetails = function () {
|
|
|
67
67
|
mode: 'onChange'
|
|
68
68
|
});
|
|
69
69
|
useSetFromDefaultValues(methods, data.bankData);
|
|
70
|
-
var onSubmit = function (data) {
|
|
71
|
-
dispatch(createBankAccount(data));
|
|
72
|
-
};
|
|
73
70
|
var t = useTranslation().t;
|
|
74
71
|
var isAr = useLanguage().isAr;
|
|
75
72
|
var onBack = function () {
|
|
@@ -99,6 +96,10 @@ var BankDetails = function () {
|
|
|
99
96
|
'is_acknowledged'
|
|
100
97
|
]);
|
|
101
98
|
var readOnly = useFormErrorAndUpdateReadOnly(methods, originalReadOnly, noneEditable);
|
|
99
|
+
var getFelids = useExcludeReadOnlyFelids(methods, readOnly).getFelids;
|
|
100
|
+
var onSubmit = function (data) {
|
|
101
|
+
dispatch(createBankAccount(getFelids(data)));
|
|
102
|
+
};
|
|
102
103
|
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'] }), _jsx(IBAN, { fetchingIban: function (value) { return setIbanChecking(value); }, ibanChecking: ibanChecking, readOnly: readOnly['iban'] || noneEditable['iban'] }), _jsx(BankName, { readOnly: readOnly['bankName'] || noneEditable['bank_name'] }), _jsx(BankStatement, { 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({ onBackClicked: function () { return onBack(); }, disabled: disabled, isAr: isAr, loading: loading, error: t(error || '') }, { children: t('confirm') }))] })) })) }));
|
|
103
104
|
};
|
|
104
105
|
export default BankDetails;
|
|
@@ -1,16 +1,21 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import { Trans, useTranslation } from 'react-i18next';
|
|
4
|
+
import { handlePrevScreenStep } from '../../../../app/settings';
|
|
4
5
|
import SuccessScreen from '../../../shared/SuccessScreen';
|
|
5
|
-
import { bankSelector } from '
|
|
6
|
+
import { bankSelector } from '../../../app/bank/bankStore';
|
|
6
7
|
import { maskEmail } from '../../../../utils';
|
|
7
|
-
import { useAppSelector } from '../../../../hooks';
|
|
8
|
+
import { useAppDispatch, useAppSelector } from '../../../../hooks';
|
|
8
9
|
var ResetPasswordSuccess = function (_a) {
|
|
9
10
|
var _b, _c;
|
|
10
11
|
var t = useTranslation().t;
|
|
12
|
+
var dispatch = useAppDispatch();
|
|
11
13
|
var data = useAppSelector(bankSelector).data;
|
|
12
14
|
var email = (((_c = (_b = data.verify.responseBody) === null || _b === void 0 ? void 0 : _b.business) === null || _c === void 0 ? void 0 : _c.primary_contact) || {}).email;
|
|
13
15
|
var maskedEmail = maskEmail(email);
|
|
14
|
-
|
|
16
|
+
var onBack = function () {
|
|
17
|
+
dispatch(handlePrevScreenStep());
|
|
18
|
+
};
|
|
19
|
+
return (_jsx(SuccessScreen, { title: t("reset_password_success_title"), description: _jsx(Trans, { i18nKey: 'reset_password_success_description_dev', values: { email: maskedEmail } }), showEmailProviders: true, enableBack: true, onBack: function () { return onBack(); } }));
|
|
15
20
|
};
|
|
16
21
|
export default React.memo(ResetPasswordSuccess);
|
|
@@ -15,7 +15,7 @@ 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 } from '../../../../hooks';
|
|
18
|
+
import { useAppDispatch, useAppSelector, useDataNoneEditable, useFormReadOnly, useLanguage, useSetFromDefaultValues, useFormErrorAndUpdateReadOnly, useExcludeReadOnlyFelids } from '../../../../hooks';
|
|
19
19
|
import { yupResolver } from '@hookform/resolvers/yup';
|
|
20
20
|
import { BrandActivitiesValidationSchema } from './validation';
|
|
21
21
|
import Button from '../../../shared/Button';
|
|
@@ -70,8 +70,9 @@ var BrandActivities = function (_a) {
|
|
|
70
70
|
'terms'
|
|
71
71
|
]);
|
|
72
72
|
var readOnly = useFormErrorAndUpdateReadOnly(methods, originalReadOnly, noneEditable);
|
|
73
|
+
var getFelids = useExcludeReadOnlyFelids(methods, readOnly).getFelids;
|
|
73
74
|
var onSubmit = function (data) {
|
|
74
|
-
dispatch(updateBrandActivities(data));
|
|
75
|
+
dispatch(updateBrandActivities(getFelids(data)));
|
|
75
76
|
};
|
|
76
77
|
var onBack = function () {
|
|
77
78
|
dispatch(handlePrevScreenStep());
|
|
@@ -33,7 +33,6 @@ import ExpandIcon from '../../../../components/ExpandIcon';
|
|
|
33
33
|
import { ScreenContainer } from '../../../shared/Containers';
|
|
34
34
|
import { CheckIconStyled, InputLabelStyled, NameContainer } from './CustomerBase';
|
|
35
35
|
import { brandSelector, clearError } from '../../../app/brand/brandStore';
|
|
36
|
-
import Search from '../../../shared/Search';
|
|
37
36
|
import Input from '../../../shared/Input';
|
|
38
37
|
var InputStyled = styled(Input)(function (_a) {
|
|
39
38
|
var theme = _a.theme, readOnly = _a.readOnly;
|
|
@@ -94,17 +93,10 @@ var ExpectedCustomers = function (_a) {
|
|
|
94
93
|
dispatch(clearError());
|
|
95
94
|
onCloseList();
|
|
96
95
|
};
|
|
97
|
-
var handleSearch = function (value) {
|
|
98
|
-
var _a;
|
|
99
|
-
var filteredList = (_a = response === null || response === void 0 ? void 0 : response.expectedCustomerSales) === null || _a === void 0 ? void 0 : _a.filter(function (customer) {
|
|
100
|
-
return customer.name.en.toLowerCase().startsWith(value.toLowerCase()) || customer.name.ar.toLowerCase().startsWith(value.toLowerCase());
|
|
101
|
-
});
|
|
102
|
-
setExpectedCustomersList(filteredList);
|
|
103
|
-
};
|
|
104
96
|
var expectedCustomersValue = expectedCustomerControl.field.value;
|
|
105
97
|
var expectedCustomersSelected = expectedCustomersValue;
|
|
106
|
-
return (_jsx(Collapse, __assign({ in: props.show }, { children: _jsxs(ScreenContainer, { children: [_jsx(InputLabelStyled, { children: t('expected_customers_to_serve') }), _jsx(InputStyled, { readOnly: readOnly, placeholder: t('choose_expected_sales'), value: isAr ? (_c = (_b = expectedCustomersSelected === null || expectedCustomersSelected === void 0 ? void 0 : expectedCustomersSelected.name) === null || _b === void 0 ? void 0 : _b.ar) !== null && _c !== void 0 ? _c : '' : (_e = (_d = expectedCustomersSelected === null || expectedCustomersSelected === void 0 ? void 0 : expectedCustomersSelected.name) === null || _d === void 0 ? void 0 : _d.en) !== null && _e !== void 0 ? _e : '', onClick: !!anchorEl ? function () { return onCloseList(); } : onOpenList, endAdornment: _jsx(ExpandIcon, { anchorEl: !!anchorEl }) }),
|
|
107
|
-
|
|
108
|
-
|
|
98
|
+
return (_jsx(Collapse, __assign({ in: props.show }, { children: _jsxs(ScreenContainer, { children: [_jsx(InputLabelStyled, { children: t('expected_customers_to_serve') }), _jsx(InputStyled, { readOnly: readOnly, placeholder: t('choose_expected_sales'), value: isAr ? (_c = (_b = expectedCustomersSelected === null || expectedCustomersSelected === void 0 ? void 0 : expectedCustomersSelected.name) === null || _b === void 0 ? void 0 : _b.ar) !== null && _c !== void 0 ? _c : '' : (_e = (_d = expectedCustomersSelected === null || expectedCustomersSelected === void 0 ? void 0 : expectedCustomersSelected.name) === null || _d === void 0 ? void 0 : _d.en) !== null && _e !== void 0 ? _e : '', onClick: !!anchorEl ? function () { return onCloseList(); } : onOpenList, endAdornment: _jsx(ExpandIcon, { anchorEl: !!anchorEl }) }), _jsx(Collapse, __assign({ in: !!anchorEl, timeout: 300 }, { children: _jsx(SimpleListStyled, { searchKeyPath: 'name.en', searchValuePath: ['name.ar', 'name.en'], list: expectedCustomersList, onSelectItem: onSelectItem, renderItem: function (item) {
|
|
99
|
+
return (_jsxs(_Fragment, { children: [_jsx(ListItemContainer, { children: _jsx(NameContainer, __assign({ isSelected: (item === null || item === void 0 ? void 0 : item.id) === (expectedCustomersValue === null || expectedCustomersValue === void 0 ? void 0 : expectedCustomersValue.id) }, { children: isAr ? item.name.ar : item.name.en })) }), item.id === (expectedCustomersSelected === null || expectedCustomersSelected === void 0 ? void 0 : expectedCustomersSelected.id) && _jsx(CheckIconStyled, {})] }));
|
|
100
|
+
} }) }))] }) })));
|
|
109
101
|
};
|
|
110
102
|
export default ExpectedCustomers;
|
|
@@ -15,7 +15,7 @@ import React from 'react';
|
|
|
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 } from '../../../../hooks';
|
|
18
|
+
import { useAppDispatch, useAppSelector, useDataNoneEditable, useFormReadOnly, useLanguage, useSetFromDefaultValues, useFormErrorAndUpdateReadOnly, useExcludeReadOnlyFelids } from '../../../../hooks';
|
|
19
19
|
import { yupResolver } from '@hookform/resolvers/yup';
|
|
20
20
|
import { BrandValidationSchema } from './validation';
|
|
21
21
|
import Button from '../../../shared/Button';
|
|
@@ -60,8 +60,13 @@ var BrandInfo = function (_a) {
|
|
|
60
60
|
mode: 'onChange'
|
|
61
61
|
});
|
|
62
62
|
useSetFromDefaultValues(methods, data.brandData, true);
|
|
63
|
+
var defaultBrandLogoFile = React.useMemo(function () { return logo_details && __assign(__assign({}, logo_details), { docId: '' }); }, [logo_details]);
|
|
64
|
+
var originalReadOnly = useFormReadOnly(methods, { brandLogoId: defaultBrandLogoFile });
|
|
65
|
+
var noneEditable = useDataNoneEditable(data_status, ['name', 'segment.type', 'segment.teams', 'channel_services']);
|
|
66
|
+
var readOnly = useFormErrorAndUpdateReadOnly(methods, originalReadOnly, noneEditable);
|
|
67
|
+
var getFelids = useExcludeReadOnlyFelids(methods, readOnly).getFelids;
|
|
63
68
|
var onSubmit = function (data) {
|
|
64
|
-
dispatch(updateBrand(data));
|
|
69
|
+
dispatch(updateBrand(getFelids(data)));
|
|
65
70
|
};
|
|
66
71
|
var onBack = function () {
|
|
67
72
|
if ((flows === null || flows === void 0 ? void 0 : flows.length) > 0) {
|
|
@@ -87,10 +92,6 @@ var BrandInfo = function (_a) {
|
|
|
87
92
|
var handleMenuClick = function (flag) {
|
|
88
93
|
setListActive(flag);
|
|
89
94
|
};
|
|
90
|
-
var defaultBrandLogoFile = React.useMemo(function () { return logo_details && __assign(__assign({}, logo_details), { docId: '' }); }, [logo_details]);
|
|
91
|
-
var originalReadOnly = useFormReadOnly(methods, { brandLogoId: defaultBrandLogoFile });
|
|
92
|
-
var noneEditable = useDataNoneEditable(data_status, ['name', 'segment.type', 'segment.teams', 'channel_services']);
|
|
93
|
-
var readOnly = useFormErrorAndUpdateReadOnly(methods, originalReadOnly, noneEditable);
|
|
94
95
|
var isSegmentsListActive = listActive === ListType.SegmentsList;
|
|
95
96
|
var isTeamSizeListActive = listActive === ListType.TeamSizeList;
|
|
96
97
|
return (_jsx(ScreenContainer, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(FormStyled, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsx(BrandName, { readOnly: readOnly['brandName'] || noneEditable['name'], show: !listActive, brandNameChecking: brandNameChecking, fetchingBrandName: setBrandNameChecking }), _jsx(BrandLogo, { defaultFile: defaultBrandLogoFile, readOnly: readOnly['brandLogoId'], show: !listActive }), _jsx(Segments, { readOnly: readOnly['segment'] || noneEditable['segment.type'], show: !isTeamSizeListActive, onListOpen: function () { return handleMenuClick(ListType.SegmentsList); }, onListClose: function () { return handleMenuClick(); } }), _jsx(TeamSize, { readOnly: readOnly['teamSize'] || noneEditable['segment.teams'], show: !isSegmentsListActive, onListOpen: function () { return handleMenuClick(ListType.TeamSizeList); }, onListClose: function () { return handleMenuClick(); } }), _jsxs(Collapse, __assign({ in: !listActive }, { children: [_jsx(SalesChannels, { readOnly: readOnly['salesChannels'] || noneEditable['channel_services'] }), _jsx(Button, __assign({ onBackClicked: function () { return onBack(); }, disabled: disabled, isAr: isAr, error: t(error || ''), loading: loading }, { children: t('next') }))] }))] })) })) }));
|
|
@@ -1,16 +1,21 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import { Trans, useTranslation } from 'react-i18next';
|
|
4
|
+
import { handlePrevScreenStep } from '../../../../app/settings';
|
|
4
5
|
import SuccessScreen from '../../../shared/SuccessScreen';
|
|
5
|
-
import { useAppSelector } from '../../../../hooks';
|
|
6
|
+
import { useAppSelector, useAppDispatch } from '../../../../hooks';
|
|
6
7
|
import { maskEmail } from '../../../../utils';
|
|
7
|
-
import { brandSelector } from '
|
|
8
|
+
import { brandSelector } from '../../../app/brand/brandStore';
|
|
8
9
|
var ResetPasswordSuccess = function (_a) {
|
|
9
10
|
var _b, _c;
|
|
10
11
|
var t = useTranslation().t;
|
|
12
|
+
var dispatch = useAppDispatch();
|
|
11
13
|
var data = useAppSelector(brandSelector).data;
|
|
12
14
|
var email = (((_c = (_b = data.verify.responseBody) === null || _b === void 0 ? void 0 : _b.business) === null || _c === void 0 ? void 0 : _c.primary_contact) || {}).email;
|
|
13
15
|
var maskedEmail = maskEmail(email);
|
|
14
|
-
|
|
16
|
+
var onBack = function () {
|
|
17
|
+
dispatch(handlePrevScreenStep());
|
|
18
|
+
};
|
|
19
|
+
return (_jsx(SuccessScreen, { title: t("reset_password_success_title"), description: _jsx(Trans, { i18nKey: 'reset_password_success_description_dev', values: { email: maskedEmail } }), showEmailProviders: true, enableBack: true, onBack: function () { return onBack(); } }));
|
|
15
20
|
};
|
|
16
21
|
export default React.memo(ResetPasswordSuccess);
|
|
@@ -1,16 +1,21 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import { useTranslation, Trans } from 'react-i18next';
|
|
4
|
+
import { handlePrevScreenStep } from '../../../../app/settings';
|
|
4
5
|
import SuccessScreen from '../../../shared/SuccessScreen';
|
|
5
6
|
import { businessSelector } from '../../../app/business/businessStore';
|
|
6
|
-
import { useAppSelector } from '../../../../hooks';
|
|
7
|
+
import { useAppSelector, useAppDispatch } from '../../../../hooks';
|
|
7
8
|
import { maskEmail } from '../../../../utils';
|
|
8
9
|
var ResetPasswordSuccess = function (_a) {
|
|
9
10
|
var _b, _c;
|
|
10
11
|
var t = useTranslation().t;
|
|
12
|
+
var dispatch = useAppDispatch();
|
|
11
13
|
var data = useAppSelector(businessSelector).data;
|
|
12
14
|
var email = (((_c = (_b = data.verify.responseBody) === null || _b === void 0 ? void 0 : _b.business) === null || _c === void 0 ? void 0 : _c.primary_contact) || {}).email;
|
|
13
15
|
var maskedEmail = maskEmail(email);
|
|
14
|
-
|
|
16
|
+
var onBack = function () {
|
|
17
|
+
dispatch(handlePrevScreenStep());
|
|
18
|
+
};
|
|
19
|
+
return (_jsx(SuccessScreen, { title: t("reset_password_success_title"), description: _jsx(Trans, { i18nKey: 'reset_password_success_description_dev', values: { email: maskedEmail } }), showEmailProviders: true, enableBack: true, onBack: function () { return onBack(); } }));
|
|
15
20
|
};
|
|
16
21
|
export default React.memo(ResetPasswordSuccess);
|
|
@@ -34,6 +34,7 @@ var ListType;
|
|
|
34
34
|
ListType["SegmentsList"] = "SegmentsList";
|
|
35
35
|
ListType["TeamSizeList"] = "TeamSizeList";
|
|
36
36
|
ListType["BrandList"] = "BrandList";
|
|
37
|
+
ListType["BusinessList"] = "BusinessList";
|
|
37
38
|
})(ListType || (ListType = {}));
|
|
38
39
|
var Merchant = function (_a) {
|
|
39
40
|
var _b, _c;
|
|
@@ -97,6 +98,6 @@ var Merchant = function (_a) {
|
|
|
97
98
|
var isSegmentsListActive = listActive === ListType.SegmentsList;
|
|
98
99
|
var isTeamSizeListActive = listActive === ListType.TeamSizeList;
|
|
99
100
|
var isBrandListActive = listActive === ListType.BrandList;
|
|
100
|
-
return (_jsx(ScreenContainer, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(Form, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsx(BrandList, { show:
|
|
101
|
+
return (_jsx(ScreenContainer, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(Form, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsx(BrandList, { show: hasBrandList && !isTeamSizeListActive && !isSegmentsListActive, list: brandList, onListOpen: function () { return handleMenuClick(ListType.BrandList); }, onListClose: function () { return handleMenuClick(); } }), _jsx(BrandName, { show: (isNewBrand || isOtherBrand) && !listActive, brandNameChecking: brandNameChecking, fetchingBrandName: setBrandNameChecking }), _jsx(Segments, { show: !isTeamSizeListActive && !isBrandListActive, onListOpen: function () { return handleMenuClick(ListType.SegmentsList); }, onListClose: function () { return handleMenuClick(); } }), _jsx(TeamSize, { show: !isSegmentsListActive && !isBrandListActive, onListOpen: function () { return handleMenuClick(ListType.TeamSizeList); }, onListClose: function () { return handleMenuClick(); } }), _jsx(Collapse, __assign({ in: !listActive }, { children: _jsx(SalesChannels, {}) })), _jsx(TAC, { show: (isNewBrand || isOtherBrand) && !listActive }), _jsx(Collapse, __assign({ in: !listActive, timeout: 500 }, { children: _jsx(Button, __assign({ onBackClicked: function () { return onBack(); }, disabled: disabled, isAr: isAr, error: t(error || ''), loading: loading }, { children: t('next') })) }))] })) })) }));
|
|
101
102
|
};
|
|
102
103
|
export default React.memo(Merchant);
|
|
@@ -11,6 +11,7 @@ export declare const MerchantValidationSchema: (isNewBrand?: boolean) => yup.Obj
|
|
|
11
11
|
}>>[] | undefined>;
|
|
12
12
|
segment: import("yup/lib/object").RequiredObjectSchema<import("yup/lib/object").ObjectShape, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").ObjectShape>>;
|
|
13
13
|
teamSize: import("yup/lib/object").RequiredObjectSchema<import("yup/lib/object").ObjectShape, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").ObjectShape>>;
|
|
14
|
+
brandName: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
14
15
|
}>, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
15
16
|
salesChannels: import("yup/lib/array").RequiredArraySchema<yup.ObjectSchema<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
16
17
|
id: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
|
|
@@ -23,6 +24,7 @@ export declare const MerchantValidationSchema: (isNewBrand?: boolean) => yup.Obj
|
|
|
23
24
|
}>>[] | undefined>;
|
|
24
25
|
segment: import("yup/lib/object").RequiredObjectSchema<import("yup/lib/object").ObjectShape, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").ObjectShape>>;
|
|
25
26
|
teamSize: import("yup/lib/object").RequiredObjectSchema<import("yup/lib/object").ObjectShape, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").ObjectShape>>;
|
|
27
|
+
brandName: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
26
28
|
}>>, import("yup/lib/object").AssertsShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
27
29
|
salesChannels: import("yup/lib/array").RequiredArraySchema<yup.ObjectSchema<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
28
30
|
id: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
|
|
@@ -35,4 +37,5 @@ export declare const MerchantValidationSchema: (isNewBrand?: boolean) => yup.Obj
|
|
|
35
37
|
}>>[] | undefined>;
|
|
36
38
|
segment: import("yup/lib/object").RequiredObjectSchema<import("yup/lib/object").ObjectShape, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").ObjectShape>>;
|
|
37
39
|
teamSize: import("yup/lib/object").RequiredObjectSchema<import("yup/lib/object").ObjectShape, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").ObjectShape>>;
|
|
40
|
+
brandName: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
38
41
|
}>>>;
|
|
@@ -129,6 +129,7 @@ export var MerchantValidationSchema = function (isNewBrand) {
|
|
|
129
129
|
})
|
|
130
130
|
.required('choose_atleast_one_channel'),
|
|
131
131
|
segment: yup.object().required('alert_choose_segment'),
|
|
132
|
-
teamSize: yup.object().required('alert_choose_teamSize')
|
|
132
|
+
teamSize: yup.object().required('alert_choose_teamSize'),
|
|
133
|
+
brandName: yup.string().optional()
|
|
133
134
|
});
|
|
134
135
|
};
|
|
@@ -14,7 +14,7 @@ import * as React from 'react';
|
|
|
14
14
|
import { useForm, FormProvider } from 'react-hook-form';
|
|
15
15
|
import { useTranslation } from 'react-i18next';
|
|
16
16
|
import { yupResolver } from '@hookform/resolvers/yup';
|
|
17
|
-
import { useAppDispatch, useAppSelector, useSetFromDefaultValues, useLanguage, useFormReadOnly, useFormErrorAndUpdateReadOnly } from '../../../../hooks';
|
|
17
|
+
import { useAppDispatch, useAppSelector, useSetFromDefaultValues, useLanguage, useFormReadOnly, useFormErrorAndUpdateReadOnly, useExcludeReadOnlyFelids } from '../../../../hooks';
|
|
18
18
|
import { isSA } from '../../../../utils';
|
|
19
19
|
import { handlePrevScreenStep, settingsSelector } from '../../../../app/settings';
|
|
20
20
|
import Form from '../../../../components/Form';
|
|
@@ -49,6 +49,9 @@ var CollectBusinessInfo = function (_a) {
|
|
|
49
49
|
mode: 'onChange'
|
|
50
50
|
});
|
|
51
51
|
useSetFromDefaultValues(methods, data.businessData);
|
|
52
|
+
var originalReadOnly = useFormReadOnly(methods);
|
|
53
|
+
var readOnly = useFormErrorAndUpdateReadOnly(methods, originalReadOnly);
|
|
54
|
+
var getFelids = useExcludeReadOnlyFelids(methods, readOnly).getFelids;
|
|
52
55
|
React.useEffect(function () {
|
|
53
56
|
if (error)
|
|
54
57
|
dispatch(clearError());
|
|
@@ -64,13 +67,11 @@ var CollectBusinessInfo = function (_a) {
|
|
|
64
67
|
licenseNumber: data.licenseNumber,
|
|
65
68
|
termAndConditionChecked: data.termAndConditionChecked
|
|
66
69
|
};
|
|
67
|
-
dispatch(updateLeadBusinessDataAsync(dataValues));
|
|
70
|
+
dispatch(updateLeadBusinessDataAsync(getFelids(dataValues)));
|
|
68
71
|
};
|
|
69
72
|
var onBack = function () {
|
|
70
73
|
dispatch(handlePrevScreenStep());
|
|
71
74
|
};
|
|
72
|
-
var originalReadOnly = useFormReadOnly(methods);
|
|
73
|
-
var readOnly = useFormErrorAndUpdateReadOnly(methods, originalReadOnly);
|
|
74
75
|
var brandErrChecks = !methods.formState.isValid || !!methods.formState.errors.brandName || !!error;
|
|
75
76
|
var disabled = brandErrChecks || brandNameChecking || isBrandNameAvailable == false;
|
|
76
77
|
return (_jsx(ScreenContainer, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(Form, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsx(BrandName, { readOnly: readOnly['brandName'], show: true, brandNameChecking: brandNameChecking, fetchingBrandName: setBrandNameChecking }), _jsx(LicenseList, { readOnly: readOnly['selectedLicense'], onListOpen: function () {
|
package/build/features/connectExpress/screens/CollectIndividualInfo/CollectIndividualInfo.js
CHANGED
|
@@ -15,7 +15,7 @@ import { useTranslation } from 'react-i18next';
|
|
|
15
15
|
import { useForm, FormProvider } from 'react-hook-form';
|
|
16
16
|
import { yupResolver } from '@hookform/resolvers/yup';
|
|
17
17
|
import { styled } from '@mui/material/styles';
|
|
18
|
-
import { useAppDispatch, useAppSelector, useFormErrorAndUpdateReadOnly, useFormReadOnly, useSetFromDefaultValues } from '../../../../hooks';
|
|
18
|
+
import { useAppDispatch, useAppSelector, useExcludeReadOnlyFelids, useFormErrorAndUpdateReadOnly, useFormReadOnly, useSetFromDefaultValues } from '../../../../hooks';
|
|
19
19
|
import { AuthForType } from '../../../../@types';
|
|
20
20
|
import { useLanguage } from '../../../../hooks';
|
|
21
21
|
import { isKW } from '../../../../utils';
|
|
@@ -56,12 +56,15 @@ var CollectIndividualInfo = function (_a) {
|
|
|
56
56
|
mode: 'onChange'
|
|
57
57
|
});
|
|
58
58
|
useSetFromDefaultValues(methods, individualData, true);
|
|
59
|
+
var originalReadOnly = useFormReadOnly(methods);
|
|
60
|
+
var readOnly = useFormErrorAndUpdateReadOnly(methods, originalReadOnly);
|
|
61
|
+
var getFelids = useExcludeReadOnlyFelids(methods, readOnly).getFelids;
|
|
59
62
|
React.useEffect(function () {
|
|
60
63
|
if (countryCode.iso2 !== methods.getValues('countryCode.iso2'))
|
|
61
64
|
methods.setValue('countryCode', countryCode);
|
|
62
65
|
}, [countryCode]);
|
|
63
66
|
var onSubmit = function (formData) {
|
|
64
|
-
dispatch(updateLeadIndividualAsync(formData));
|
|
67
|
+
dispatch(updateLeadIndividualAsync(getFelids(formData)));
|
|
65
68
|
};
|
|
66
69
|
var onBack = function () {
|
|
67
70
|
var _a;
|
|
@@ -81,8 +84,6 @@ var CollectIndividualInfo = function (_a) {
|
|
|
81
84
|
if (isEmailAvailable === false)
|
|
82
85
|
methods.setError('email', { message: 'tap_js_email_already_exist' });
|
|
83
86
|
}, [responseData]);
|
|
84
|
-
var originalReadOnly = useFormReadOnly(methods);
|
|
85
|
-
var readOnly = useFormErrorAndUpdateReadOnly(methods, originalReadOnly);
|
|
86
87
|
var isLeadEmailAvailable = (contact === null || contact === void 0 ? void 0 : contact.email) === methods.watch('email');
|
|
87
88
|
var isEmailValid = typeof isEmailAvailable === 'undefined' ? isLeadEmailAvailable : isEmailAvailable;
|
|
88
89
|
var emailErrChecks = !methods.formState.isValid || !!methods.formState.errors.email || !!error;
|
|
@@ -67,9 +67,8 @@ var InputStyled = styled(Input)(function () { return ({
|
|
|
67
67
|
}); });
|
|
68
68
|
var cancelToken = null;
|
|
69
69
|
var Email = function (_a) {
|
|
70
|
-
var _b;
|
|
70
|
+
var _b, _c, _d, _e;
|
|
71
71
|
var show = _a.show, fetchingEmail = _a.fetchingEmail, emailChecking = _a.emailChecking, readOnly = _a.readOnly;
|
|
72
|
-
var _c = React.useState(''), storedEmail = _c[0], setStoredEmail = _c[1];
|
|
73
72
|
var dispatch = useAppDispatch();
|
|
74
73
|
var data = useAppSelector(connectExpressSelector).data;
|
|
75
74
|
var t = useTranslation().t;
|
|
@@ -77,6 +76,7 @@ var Email = function (_a) {
|
|
|
77
76
|
var emailControl = useController({ name: 'email', control: control });
|
|
78
77
|
var emailValue = emailControl.field.value;
|
|
79
78
|
var error = (_b = emailControl.fieldState.error) === null || _b === void 0 ? void 0 : _b.message;
|
|
79
|
+
var email = (_e = (_d = (_c = data.responseData) === null || _c === void 0 ? void 0 : _c.leadData) === null || _d === void 0 ? void 0 : _d.contact) === null || _e === void 0 ? void 0 : _e.email;
|
|
80
80
|
var checkEmail = debounce(function (value) { return __awaiter(void 0, void 0, void 0, function () {
|
|
81
81
|
var onSuccess;
|
|
82
82
|
return __generator(this, function (_a) {
|
|
@@ -92,15 +92,9 @@ var Email = function (_a) {
|
|
|
92
92
|
var handleEmailChange = function (event) {
|
|
93
93
|
emailControl.field.onChange(event.target.value);
|
|
94
94
|
};
|
|
95
|
-
React.useEffect(function () {
|
|
96
|
-
var _a, _b, _c;
|
|
97
|
-
var email = (_c = (_b = (_a = data.responseData) === null || _a === void 0 ? void 0 : _a.leadData) === null || _b === void 0 ? void 0 : _b.contact) === null || _c === void 0 ? void 0 : _c.email;
|
|
98
|
-
if (!!email)
|
|
99
|
-
setStoredEmail(email);
|
|
100
|
-
}, [data.responseData]);
|
|
101
95
|
React.useEffect(function () {
|
|
102
96
|
var isValid = emailValue && !error && emailValue.length > 3;
|
|
103
|
-
if (isValid && emailValue !=
|
|
97
|
+
if (isValid && emailValue != email) {
|
|
104
98
|
fetchingEmail(true);
|
|
105
99
|
checkEmail(emailValue);
|
|
106
100
|
}
|
|
@@ -15,7 +15,7 @@ import { FormProvider, useForm } from 'react-hook-form';
|
|
|
15
15
|
import { useTranslation } from 'react-i18next';
|
|
16
16
|
import { styled } from '@mui/material/styles';
|
|
17
17
|
import Collapse from '@mui/material/Collapse';
|
|
18
|
-
import { useAppDispatch, useAppSelector, useDataNoneEditable, useFormReadOnly, useLanguage, useSetFromDefaultValues, useFormErrorAndUpdateReadOnly } from '../../../../hooks';
|
|
18
|
+
import { useAppDispatch, useAppSelector, useDataNoneEditable, useFormReadOnly, useLanguage, useSetFromDefaultValues, useFormErrorAndUpdateReadOnly, useExcludeReadOnlyFelids } from '../../../../hooks';
|
|
19
19
|
import { clearError, entitySelector, updateEntityCapital } from '../../../app/entity/entityStore';
|
|
20
20
|
import { yupResolver } from '@hookform/resolvers/yup';
|
|
21
21
|
import { handlePrevScreenStep } from '../../../../app/settings';
|
|
@@ -58,8 +58,9 @@ var EntityCapital = function (_a) {
|
|
|
58
58
|
'capital.shares.value'
|
|
59
59
|
]);
|
|
60
60
|
var readOnly = useFormErrorAndUpdateReadOnly(methods, originalReadOnly, noneEditable);
|
|
61
|
+
var getFelids = useExcludeReadOnlyFelids(methods, readOnly).getFelids;
|
|
61
62
|
var onSubmit = function (data) {
|
|
62
|
-
dispatch(updateEntityCapital(data));
|
|
63
|
+
dispatch(updateEntityCapital(getFelids(data)));
|
|
63
64
|
};
|
|
64
65
|
var onBack = function () {
|
|
65
66
|
dispatch(handlePrevScreenStep());
|
|
@@ -15,7 +15,7 @@ import { FormProvider, useForm } from 'react-hook-form';
|
|
|
15
15
|
import { useTranslation } from 'react-i18next';
|
|
16
16
|
import { yupResolver } from '@hookform/resolvers/yup';
|
|
17
17
|
import { styled } from '@mui/material/styles';
|
|
18
|
-
import { useAppDispatch, useAppSelector, useDataNoneEditable, useFormReadOnly, useLanguage, useSetFromDefaultValues, useFormErrorAndUpdateReadOnly } from '../../../../hooks';
|
|
18
|
+
import { useAppDispatch, useAppSelector, useDataNoneEditable, useFormReadOnly, useLanguage, useSetFromDefaultValues, useFormErrorAndUpdateReadOnly, useExcludeReadOnlyFelids } from '../../../../hooks';
|
|
19
19
|
import { handlePrevScreenStep, settingsSelector } from '../../../../app/settings';
|
|
20
20
|
import { getFileDetailsFromDocument, isKW, isSA } from '../../../../utils';
|
|
21
21
|
import { BusinessType, DocumentPurpose } from '../../../../@types';
|
|
@@ -83,8 +83,9 @@ var EntityName = function (_a) {
|
|
|
83
83
|
'AOA_file_id'
|
|
84
84
|
]);
|
|
85
85
|
var readOnly = useFormErrorAndUpdateReadOnly(methods, originalReadOnly, noneEditable);
|
|
86
|
+
var getFelids = useExcludeReadOnlyFelids(methods, readOnly).getFelids;
|
|
86
87
|
var onSubmit = function (data) {
|
|
87
|
-
dispatch(updateEntityName(data));
|
|
88
|
+
dispatch(updateEntityName(getFelids(data)));
|
|
88
89
|
};
|
|
89
90
|
var handleIssueDateOpenClose = function (flag) {
|
|
90
91
|
setIssueAnchorEl(flag);
|
|
@@ -1,16 +1,21 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import { Trans, useTranslation } from 'react-i18next';
|
|
4
|
+
import { handlePrevScreenStep } from '../../../../app/settings';
|
|
4
5
|
import SuccessScreen from '../../../shared/SuccessScreen';
|
|
5
6
|
import { maskEmail } from '../../../../utils';
|
|
6
|
-
import { entitySelector } from '
|
|
7
|
-
import { useAppSelector } from '../../../../hooks';
|
|
7
|
+
import { entitySelector } from '../../../app/entity/entityStore';
|
|
8
|
+
import { useAppSelector, useAppDispatch } from '../../../../hooks';
|
|
8
9
|
var ResetPasswordSuccess = function (_a) {
|
|
9
10
|
var _b, _c;
|
|
10
11
|
var t = useTranslation().t;
|
|
12
|
+
var dispatch = useAppDispatch();
|
|
11
13
|
var data = useAppSelector(entitySelector).data;
|
|
12
14
|
var email = (((_c = (_b = data.verify.responseBody) === null || _b === void 0 ? void 0 : _b.business) === null || _c === void 0 ? void 0 : _c.primary_contact) || {}).email;
|
|
13
15
|
var maskedEmail = maskEmail(email);
|
|
14
|
-
|
|
16
|
+
var onBack = function () {
|
|
17
|
+
dispatch(handlePrevScreenStep());
|
|
18
|
+
};
|
|
19
|
+
return (_jsx(SuccessScreen, { title: t("reset_password_success_title"), description: _jsx(Trans, { i18nKey: 'reset_password_success_description_dev', values: { email: maskedEmail } }), showEmailProviders: true, enableBack: true, onBack: function () { return onBack(); } }));
|
|
15
20
|
};
|
|
16
21
|
export default React.memo(ResetPasswordSuccess);
|