@tap-payments/auth-jsconnect 2.0.114-test → 2.0.116-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.
@@ -16,7 +16,7 @@ export var REGEX_BENEFICIARY_NAME = /^([\u0600-\u065F\u066A-\u06EF\u06FA-\u06FFa
16
16
  export var REGEX_ALPHANUMERIC = /^[a-zA-Z0-9!@#$%^&*()_+\-=\[\]{};':"\\|,.<>\/? ]*$/g;
17
17
  export var REGEX_BRAND_NAME = /^(([a-zA-Z0-9])+\s)*[a-zA-Z0-9]+$/;
18
18
  export var EMAIL_MAX_LENGTH = 50;
19
- export var LINKEDIN_URL = /^((http|https):\/\/)(www.linkedin.com\/)in(\/)[a-zA-Z0-9-]+$/;
19
+ export var LINKEDIN_URL = /^((http|https):\/\/)(www.linkedin.com\/)in(\/)[a-zA-Z0-9-\/]+$/;
20
20
  export var SOCIAL_USERNAME = /^[A-Za-z-0-9\d._]{3,}$/;
21
21
  export var DIGITS_ONLY = /^\d+$/;
22
22
  export var REGEX_PHONE_APP_NAME = /^[a-zA-Z0-9[._-]*$/;
@@ -218,7 +218,7 @@ export var verifyLeadOTP = createAsyncThunk('verifyLeadOTP', function (params, t
218
218
  hasBusinessCRActivitiesCompleted = hasKey(steps, BUSINESS_STEP_NAMES.BUSINESS_CR_ACTIVITIES);
219
219
  hasBusinessCustomersCompleted = hasKey(steps, BUSINESS_STEP_NAMES.BUSINESS_CUSTOMERS);
220
220
  isIdentityAuthStep = data.step_name === BUSINESS_STEP_NAMES.IDENTITY_AUTH;
221
- if (!isSA(countryIso2)) return [3, 4];
221
+ if (!(isSA(countryIso2) && !isIdentityAuthStep)) return [3, 4];
222
222
  return [4, thunkApi.dispatch(retrieveEntityList({ leadId: data === null || data === void 0 ? void 0 : data.id }))];
223
223
  case 3:
224
224
  _j.sent();
@@ -711,7 +711,7 @@ export var connectSlice = createSlice({
711
711
  var _b = action.payload, authResponse = _b.authResponse, leadResponse = _b.leadResponse, isNewUser = _b.isNewUser, countryCode = _b.countryCode, userInfoMissed = _b.userInfoMissed;
712
712
  var name = leadResponse.name, contact = leadResponse.contact, brand = leadResponse.brand, brand_list = leadResponse.brand_list, channel_list = leadResponse.channel_list, is_new_individual = leadResponse.is_new_individual, id = leadResponse.id;
713
713
  var _c = contact || {}, email = _c.email, phone = _c.phone;
714
- var fullName = concatenateObjectValues(name, ['first', 'middle', 'third', 'last']);
714
+ var fullName = concatenateObjectValues(name, ['first', 'middle', 'last']);
715
715
  if (!!fullName) {
716
716
  var capitalizedName = capitalizeTheFirstLetterOfEachWord(fullName);
717
717
  state.data.individualData.name = capitalizedName;
@@ -747,7 +747,7 @@ export var connectSlice = createSlice({
747
747
  var _b = action.payload, authResponse = _b.authResponse, leadResponse = _b.leadResponse, isNewUser = _b.isNewUser, countryCode = _b.countryCode, userInfoMissed = _b.userInfoMissed;
748
748
  var name = leadResponse.name, contact = leadResponse.contact, brand = leadResponse.brand, brand_list = leadResponse.brand_list, channel_list = leadResponse.channel_list, is_new_individual = leadResponse.is_new_individual, id = leadResponse.id;
749
749
  var _c = contact || {}, email = _c.email, phone = _c.phone;
750
- var fullName = concatenateObjectValues(name, ['first', 'middle', 'third', 'last']);
750
+ var fullName = concatenateObjectValues(name, ['first', 'middle', 'last']);
751
751
  if (!!fullName) {
752
752
  var capitalizedName = capitalizeTheFirstLetterOfEachWord(fullName);
753
753
  state.data.individualData.name = capitalizedName;
@@ -47,7 +47,8 @@ var BankName = function () {
47
47
  React.useEffect(function () {
48
48
  var _a;
49
49
  var bankName = (_a = data.bankData.responseBody) === null || _a === void 0 ? void 0 : _a.bank_name;
50
- setValue('bankName', bankName);
50
+ if (bankName && !bankNameValue)
51
+ setValue('bankName', bankName);
51
52
  }, [(_b = data.bankData.responseBody) === null || _b === void 0 ? void 0 : _b.bank_name]);
52
53
  var handleBankChange = function (_a) {
53
54
  var target = _a.target;
@@ -95,6 +95,7 @@ var BackButton = styled('button')(function (_a) {
95
95
  height: 44,
96
96
  appearance: 'none',
97
97
  background: 'none',
98
+ pointerEvents: 'auto',
98
99
  border: 'none',
99
100
  color: theme.palette.primary.main,
100
101
  fontSize: theme.typography.body1.fontSize,
@@ -9,6 +9,17 @@ var __assign = (this && this.__assign) || function () {
9
9
  };
10
10
  return __assign.apply(this, arguments);
11
11
  };
12
+ var __rest = (this && this.__rest) || function (s, e) {
13
+ var t = {};
14
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
15
+ t[p] = s[p];
16
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
17
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
18
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
19
+ t[p[i]] = s[p[i]];
20
+ }
21
+ return t;
22
+ };
12
23
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
13
24
  import { styled } from '@mui/material/styles';
14
25
  import Email from './Email';
@@ -46,10 +57,11 @@ var Individual = function (_a) {
46
57
  var startWithNID = otpData.authFor === AuthForType.NATIONAL_ID;
47
58
  var isMobile = mobileData.mobile;
48
59
  var _e = otpData.responseBody || {}, contact = _e.contact, name = _e.name, userInfoMissed = _e.userInfoMissed, is_new_individual = _e.is_new_individual;
49
- var is_available = (individualData.responseBody || {}).is_available;
60
+ var responseBody = individualData.responseBody, individualDataForm = __rest(individualData, ["responseBody"]);
61
+ var is_available = (responseBody || {}).is_available;
50
62
  var methods = useForm({
51
63
  resolver: yupResolver(isMobile ? IndividualValidation : IndividualMobileValidation),
52
- defaultValues: data.individualData,
64
+ defaultValues: individualDataForm,
53
65
  mode: 'onChange'
54
66
  });
55
67
  var onSubmit = function (formData) {
@@ -81,10 +93,9 @@ var Individual = function (_a) {
81
93
  listActive ? setListActive(false) : setListActive(true);
82
94
  };
83
95
  React.useEffect(function () {
84
- var _a;
85
- if (((_a = individualData === null || individualData === void 0 ? void 0 : individualData.responseBody) === null || _a === void 0 ? void 0 : _a.is_available) === false)
96
+ if (is_available === false)
86
97
  methods.setError('email', { message: 'tap_js_email_already_exist' });
87
- }, [individualData === null || individualData === void 0 ? void 0 : individualData.responseBody]);
98
+ }, [responseBody]);
88
99
  var isLeadEmailAvailable = (contact === null || contact === void 0 ? void 0 : contact.email) === methods.watch('email');
89
100
  var isEmailValid = typeof is_available === 'undefined' ? isLeadEmailAvailable : is_available;
90
101
  var emailErrChecks = !methods.formState.isValid || !!methods.formState.errors.email || !!error;
@@ -94,6 +94,7 @@ var BackButton = styled('button')(function (_a) {
94
94
  var theme = _a.theme;
95
95
  return ({
96
96
  cursor: 'pointer',
97
+ pointerEvents: 'auto',
97
98
  height: 44,
98
99
  appearance: 'none',
99
100
  background: 'none',
@@ -28,7 +28,7 @@ export var concatenateObjectValues = function (data, keys) {
28
28
  for (var _i = 0, keys_1 = keys; _i < keys_1.length; _i++) {
29
29
  var key = keys_1[_i];
30
30
  if (data[key]) {
31
- result += data[key] + ' ';
31
+ result += data[key].trim() + ' ';
32
32
  }
33
33
  }
34
34
  return result.trim();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tap-payments/auth-jsconnect",
3
- "version": "2.0.114-test",
3
+ "version": "2.0.116-test",
4
4
  "description": "connect library, auth",
5
5
  "private": false,
6
6
  "main": "build/index.js",