@tap-payments/auth-jsconnect 2.8.0-test → 2.8.2-test

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -240,7 +240,7 @@ export var AUTH_SCREENS_NAVIGATION = [
240
240
  },
241
241
  {
242
242
  name: 'AUTH_EMAIL_STEP',
243
- next: 'AUTH_PASSWORD_STEP',
243
+ next: ['AUTH_PASSWORD_STEP', 'AUTH_RESET_PASSWORD_MESSAGE_STEP'],
244
244
  prev: 'AUTH_SWITCH_STEP',
245
245
  order: 1
246
246
  },
@@ -262,6 +262,12 @@ export var AUTH_SCREENS_NAVIGATION = [
262
262
  prev: 'AUTH_EMAIL_STEP',
263
263
  order: 2
264
264
  },
265
+ {
266
+ name: 'AUTH_RESET_PASSWORD_MESSAGE_STEP',
267
+ next: '',
268
+ prev: 'AUTH_EMAIL_STEP',
269
+ order: 2
270
+ },
265
271
  {
266
272
  name: 'AUTH_VERIFY_PACI_STEP',
267
273
  next: 'AUTH_PREPARING_DATA_STEP',
@@ -209,7 +209,7 @@ export var verifyMobileOtp = createAsyncThunk('auth/verifyMobileOtp', function (
209
209
  });
210
210
  }); });
211
211
  export var createEmailAuth = createAsyncThunk('auth/createEmailAuth', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
212
- var _a, settings, auth, requestBody, data;
212
+ var _a, settings, auth, requestBody, data, screen;
213
213
  var _b, _c;
214
214
  return __generator(this, function (_d) {
215
215
  switch (_d.label) {
@@ -231,7 +231,10 @@ export var createEmailAuth = createAsyncThunk('auth/createEmailAuth', function (
231
231
  return [4, API.authService.createAuth(requestBody)];
232
232
  case 1:
233
233
  data = _d.sent();
234
- thunkApi.dispatch(handleNextScreenStep());
234
+ screen = 'AUTH_PASSWORD_STEP';
235
+ if ((data === null || data === void 0 ? void 0 : data.auth_type) === 7)
236
+ screen = 'AUTH_RESET_PASSWORD_MESSAGE_STEP';
237
+ thunkApi.dispatch(handleNextScreenStep(screen));
235
238
  (_c = (_b = settings.data.appConfig).onStepCompleted) === null || _c === void 0 ? void 0 : _c.call(_b, settings.data.activeScreen.name, requestBody.user_credentail);
236
239
  return [2, { response: data, formData: params }];
237
240
  }
@@ -0,0 +1,5 @@
1
+ import * as React from 'react';
2
+ export interface ResetPasswordMessageProps {
3
+ }
4
+ declare const _default: React.MemoExoticComponent<({}: ResetPasswordMessageProps) => import("react/jsx-runtime").JSX.Element>;
5
+ export default _default;
@@ -0,0 +1,21 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import * as React from 'react';
3
+ import { Trans, useTranslation } from 'react-i18next';
4
+ import { useAppDispatch, useAppSelector } from '../../../../hooks';
5
+ import SuccessScreen from '../../../shared/SuccessScreen';
6
+ import { handleOpen, settingsSelector } from '../../../../app/settings';
7
+ import { authSelector } from '../../../app/auth/authStore';
8
+ var ResetPasswordMessage = function (_a) {
9
+ var t = useTranslation().t;
10
+ var dispatch = useAppDispatch();
11
+ var data = useAppSelector(authSelector).data;
12
+ var settingsData = useAppSelector(settingsSelector).data;
13
+ var email = data.emailData.email;
14
+ var onSuccess = function () {
15
+ var _a, _b, _c;
16
+ dispatch(handleOpen(false));
17
+ (_b = (_a = settingsData.appConfig).onFlowCompleted) === null || _b === void 0 ? void 0 : _b.call(_a, (_c = data.responseData) === null || _c === void 0 ? void 0 : _c.authResponse);
18
+ };
19
+ return (_jsx(SuccessScreen, { title: t('reset_password_success_title'), description: _jsx(Trans, { i18nKey: 'reset_password_success_description_dev', values: { email: email } }), onSuccess: onSuccess, successTitle: t('express_account_already_created_close_button') }));
20
+ };
21
+ export default React.memo(ResetPasswordMessage);
@@ -0,0 +1,3 @@
1
+ import ResetPasswordMessage, { ResetPasswordMessageProps } from './ResetPasswordMessage';
2
+ export type { ResetPasswordMessageProps };
3
+ export default ResetPasswordMessage;
@@ -0,0 +1,2 @@
1
+ import ResetPasswordMessage from './ResetPasswordMessage';
2
+ export default ResetPasswordMessage;
@@ -36,6 +36,7 @@ import AuthCivilIDScreen from './auth/screens/CivilID';
36
36
  import AuthVerifyPACIScreen from './auth/screens/VerifyPACI';
37
37
  import AuthOTPScreen from './auth/screens/OTP';
38
38
  import AuthPasswordScreen from './auth/screens/Password';
39
+ import AuthResetPasswordMessageScreen from './auth/screens/ResetPasswordMessage';
39
40
  import PreparingDataScreen from './auth/screens/PreparingData';
40
41
  import AccountNotFoundScreen from './auth/screens/AccountNotFound';
41
42
  import AuthAuthenticationListScreen from './auth/screens/AuthenticationList';
@@ -255,6 +256,10 @@ export var authFeatureScreens = [
255
256
  name: 'AUTH_PASSWORD_STEP',
256
257
  element: AuthPasswordScreen
257
258
  },
259
+ {
260
+ name: 'AUTH_RESET_PASSWORD_MESSAGE_STEP',
261
+ element: AuthResetPasswordMessageScreen
262
+ },
258
263
  {
259
264
  name: 'AUTH_VERIFY_PACI_STEP',
260
265
  element: AuthVerifyPACIScreen
@@ -151,7 +151,7 @@ var AdditionalIndividualInfo = function (_a) {
151
151
  var isMonthlyIncomeListActive = listActive === ListType.MonthlyIncomeList;
152
152
  var isOccupationListActive = listActive === ListType.OccupationList;
153
153
  var disabled = !methods.formState.isValid || civilIDUploading || signatureFileUploading;
154
- return (_jsxs(ScreenContainer, { children: [_jsx(Collapse, __assign({ in: !listActive && !!is_authorized, timeout: 500 }, { children: _jsx(TextBoxStyled, { children: getUserName() || '' }) })), _jsx(FormProvider, __assign({}, methods, { children: _jsxs(Form, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsxs(Box, { children: [_jsx(Occupation, { isVerified: isOccupationVerified, readOnly: readOnly['occupation'] || noneEditable['occupation'], onListOpen: function () { return handleMenuClick(ListType.OccupationList); }, onListClose: function () { return handleMenuClick(); }, show: showOccupationFile && !isMonthlyIncomeListActive && !isSourceOfIncomeListActive }), _jsx(SourceOfIncome, { readOnly: readOnly['sourceIncome'] || noneEditable['source_of_income'], onListOpen: function () { return handleMenuClick(ListType.SourceOfIncomeList); }, onListClose: function () { return handleMenuClick(); }, show: showSourceOfIncome && !isMonthlyIncomeListActive && !isOccupationListActive }), _jsx(MonthlyIncome, { readOnly: readOnly['monthlyIncome'] || noneEditable['monthly_income'], show: showSourceOfIncome && !isSourceOfIncomeListActive && !isOccupationListActive, onListOpen: function () { return handleMenuClick(ListType.MonthlyIncomeList); }, onListClose: function () { return handleMenuClick(); } }), _jsx(ShareCount, { show: !listActive && showShares, readOnly: readOnly['shareCount'] }), _jsx(ShareValue, { show: !listActive && showShares, readOnly: readOnly['shareValue'] }), _jsx(IsAuthorizedSwitch, { show: !listActive && showIsAuthorized, readOnly: readOnly['isAuthorized'] || noneEditable['is_authorized'], isVerified: isAuthorizedSwitchVerified }), _jsxs(Collapse, __assign({ in: !listActive, timeout: 500 }, { children: [_jsx(CivilIDFile, { show: isKWCountry, readOnly: readOnly['civilID'], defaultFiles: defaultCivilIdFiles }), _jsx(SignatureFile, { show: isAuthorizedValue && showSignatureFile, readOnly: readOnly['signatureFileId'], defaultFiles: defaultSignatureFiles })] })), _jsx(PEPSwitch, { show: showIsPEP && !listActive, readOnly: readOnly['isPEP'] || noneEditable['is_relative_PEP'], isVerified: isPEPSwitchVerified }), _jsx(InfluencerSwitch, { show: showIsInfluencer && isKWCountry && !listActive, readOnly: readOnly['isInfluencer'] || noneEditable['is_influencer'], isVerified: isInfluencerSwitchVerified })] }), _jsx(Collapse, __assign({ in: !listActive, timeout: 500 }, { children: _jsx(Button, __assign({ onBackClicked: function () { return onBack(); }, isAr: isAr, disabled: disabled, loading: loading, error: t(error || '') }, { children: t('next') })) }))] })) }))] }));
154
+ return (_jsxs(ScreenContainer, { children: [_jsx(Collapse, __assign({ in: !listActive && !!is_authorized, timeout: 500 }, { children: _jsxs(TextBoxStyled, { children: [getUserName() || '', _jsx(RoleTextStyled, { children: getUserRole() || '' })] }) })), _jsx(FormProvider, __assign({}, methods, { children: _jsxs(Form, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsxs(Box, { children: [_jsx(Occupation, { isVerified: isOccupationVerified, readOnly: readOnly['occupation'] || noneEditable['occupation'], onListOpen: function () { return handleMenuClick(ListType.OccupationList); }, onListClose: function () { return handleMenuClick(); }, show: showOccupationFile && !isMonthlyIncomeListActive && !isSourceOfIncomeListActive }), _jsx(SourceOfIncome, { readOnly: readOnly['sourceIncome'] || noneEditable['source_of_income'], onListOpen: function () { return handleMenuClick(ListType.SourceOfIncomeList); }, onListClose: function () { return handleMenuClick(); }, show: showSourceOfIncome && !isMonthlyIncomeListActive && !isOccupationListActive }), _jsx(MonthlyIncome, { readOnly: readOnly['monthlyIncome'] || noneEditable['monthly_income'], show: showSourceOfIncome && !isSourceOfIncomeListActive && !isOccupationListActive, onListOpen: function () { return handleMenuClick(ListType.MonthlyIncomeList); }, onListClose: function () { return handleMenuClick(); } }), _jsx(ShareCount, { show: !listActive && showShares, readOnly: readOnly['shareCount'] }), _jsx(ShareValue, { show: !listActive && showShares, readOnly: readOnly['shareValue'] }), _jsx(IsAuthorizedSwitch, { show: !listActive && showIsAuthorized, readOnly: readOnly['isAuthorized'] || noneEditable['is_authorized'], isVerified: isAuthorizedSwitchVerified }), _jsxs(Collapse, __assign({ in: !listActive, timeout: 500 }, { children: [_jsx(CivilIDFile, { show: isKWCountry, readOnly: readOnly['civilID'], defaultFiles: defaultCivilIdFiles }), _jsx(SignatureFile, { show: isAuthorizedValue && showSignatureFile, readOnly: readOnly['signatureFileId'], defaultFiles: defaultSignatureFiles })] })), _jsx(PEPSwitch, { show: showIsPEP && !listActive, readOnly: readOnly['isPEP'] || noneEditable['is_relative_PEP'], isVerified: isPEPSwitchVerified }), _jsx(InfluencerSwitch, { show: showIsInfluencer && isKWCountry && !listActive, readOnly: readOnly['isInfluencer'] || noneEditable['is_influencer'], isVerified: isInfluencerSwitchVerified })] }), _jsx(Collapse, __assign({ in: !listActive, timeout: 500 }, { children: _jsx(Button, __assign({ onBackClicked: function () { return onBack(); }, isAr: isAr, disabled: disabled, loading: loading, error: t(error || '') }, { children: t('next') })) }))] })) }))] }));
155
155
  };
156
156
  export default React.memo(AdditionalIndividualInfo);
157
157
  AdditionalIndividualInfo.defaultProps = {};
@@ -192,7 +192,7 @@ var UserList = function (_a) {
192
192
  return (_jsx(ScreenContainerStyled, { children: usersMenuList.map(function (user, index) {
193
193
  return (_jsxs(Box, __assign({ sx: index !== usersMenuList.length - 1 ? { borderBottom: "1px solid ".concat(alpha(theme.palette.divider, 0.8)) } : {} }, { children: [_jsxs(TextBoxStyled, __assign({ sx: {
194
194
  cursor: emailChecking ? 'default' : 'pointer'
195
- }, onClick: !!anchorEl && isActiveUser(user) ? function () { return onCloseUserAction(); } : function (e) { return onClickUser(user, e); } }, { children: [_jsx(TextStyled, { children: _jsx("span", { children: getName(user) || '' }) }), (user === null || user === void 0 ? void 0 : user.isRequestedEmail) ? _jsx(CheckIcon, {}) : _jsx(ExpandIcon, { anchorEl: !!anchorEl && isActiveUser(user) })] })), _jsx(Collapse, __assign({ in: !!anchorEl && isActiveUser(user), timeout: 300 }, { children: _jsx(IndividualActionButtons, { isAr: isAr, addDetails: {
195
+ }, onClick: !!anchorEl && isActiveUser(user) ? function () { return onCloseUserAction(); } : function (e) { return onClickUser(user, e); } }, { children: [_jsxs(TextStyled, { children: [_jsx("span", { children: getName(user) || '' }), _jsx(RoleTextStyled, { children: getUserRole(user) || '' })] }), (user === null || user === void 0 ? void 0 : user.isRequestedEmail) ? _jsx(CheckIcon, {}) : _jsx(ExpandIcon, { anchorEl: !!anchorEl && isActiveUser(user) })] })), _jsx(Collapse, __assign({ in: !!anchorEl && isActiveUser(user), timeout: 300 }, { children: _jsx(IndividualActionButtons, { isAr: isAr, addDetails: {
196
196
  status: getUserStatus(user),
197
197
  title: t('add_details'),
198
198
  onClick: onAddDetails,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tap-payments/auth-jsconnect",
3
- "version": "2.8.0-test",
3
+ "version": "2.8.2-test",
4
4
  "description": "connect library, auth",
5
5
  "private": false,
6
6
  "main": "build/index.js",