@tap-payments/auth-jsconnect 2.0.70-test → 2.0.72-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.
Files changed (29) hide show
  1. package/build/@types/app.d.ts +5 -2
  2. package/build/@types/form.d.ts +4 -1
  3. package/build/api/brand.d.ts +2 -1
  4. package/build/api/brand.js +10 -1
  5. package/build/api/data.d.ts +2 -0
  6. package/build/api/data.js +16 -1
  7. package/build/api/entity.d.ts +3 -1
  8. package/build/api/index.d.ts +2 -0
  9. package/build/api/individual.d.ts +48 -19
  10. package/build/constants/api.d.ts +2 -0
  11. package/build/constants/api.js +5 -1
  12. package/build/features/app/business/businessStore.d.ts +1 -2
  13. package/build/features/app/business/businessStore.js +72 -118
  14. package/build/features/app/connect/connectStore.d.ts +1 -0
  15. package/build/features/app/connect/connectStore.js +106 -60
  16. package/build/features/app/entity/entityStore.js +3 -3
  17. package/build/features/business/screens/Activities/Activities.js +1 -6
  18. package/build/features/business/screens/Activities/ActivitiesList.js +7 -6
  19. package/build/features/business/screens/Activities/SalesChannels.d.ts +0 -3
  20. package/build/features/business/screens/Activities/SalesChannels.js +0 -96
  21. package/build/features/business/screens/Activities/validation.d.ts +0 -51
  22. package/build/features/business/screens/Activities/validation.js +0 -9
  23. package/build/features/business/screens/CivilID/CivilID.js +2 -3
  24. package/build/features/business/screens/Customers/CustomerLocations.js +0 -1
  25. package/build/features/business/screens/Customers/ExpectedSalesRange.js +6 -6
  26. package/build/features/connect/screens/Merchant/Merchant.js +9 -1
  27. package/build/features/connect/screens/Mobile/Mobile.js +4 -1
  28. package/build/features/entity/screens/EntityInfoConfirm/ActivitiesList.js +6 -5
  29. package/package.json +129 -129
@@ -130,7 +130,6 @@ var customerLocations = function (_a) {
130
130
  };
131
131
  var customerLocationsValue = customerLocationsControl.field.value;
132
132
  var customerLocationSelected = customerLocationsValue === null || customerLocationsValue === void 0 ? void 0 : customerLocationsValue[0];
133
- console.log(customerLocationSelected, 'sele');
134
133
  return (_jsx(Collapse, __assign({ in: rest.show }, { children: _jsxs(ScreenContainer, { children: [_jsx(InputLabelStyled, { children: t('select_customer_base') }), _jsx(InputStyled, { readOnly: true, value: isAr ? customerLocationSelected === null || customerLocationSelected === void 0 ? void 0 : customerLocationSelected.name.ar : customerLocationSelected === null || customerLocationSelected === void 0 ? void 0 : customerLocationSelected.name.en, onClick: !!anchorEl ? function () { return onCloseList(); } : onOpenList, endAdornment: _jsx(ExpandIcon, { anchorEl: !!anchorEl }) }), _jsxs(Collapse, __assign({ in: !!anchorEl, timeout: 300 }, { children: [_jsx(Search, { onSearchValue: handleSearch }), _jsx(SimpleListStyled, { searchKeyPath: 'name.en', list: customerLocationsList, placeholder: 'choose_customer_base', onSelectItem: onSelectItem, renderItem: function (item) {
135
134
  return (_jsxs(_Fragment, { children: [_jsx(Box, __assign({ display: 'flex' }, { children: _jsx(NameContainer, __assign({ isSelected: (item === null || item === void 0 ? void 0 : item.id) === (customerLocationsValue === null || customerLocationsValue === void 0 ? void 0 : customerLocationsValue.id) }, { children: isAr ? item.name.ar : item.name.en })) })), item.id === (customerLocationSelected === null || customerLocationSelected === void 0 ? void 0 : customerLocationSelected.id) && _jsx(CheckIconStyled, {}), checkRemainingCondition(item) && item.id != (customerLocationSelected === null || customerLocationSelected === void 0 ? void 0 : customerLocationSelected.id) && _jsx(RemainingCheck, {})] }));
136
135
  } })] }))] }) })));
@@ -91,16 +91,16 @@ var ExpectedSalesRange = function (_a) {
91
91
  expectedSaleControl.field.onChange(expectedSalesRange);
92
92
  };
93
93
  var handleSearch = function (value) {
94
- var filteredSubList = expectedSales === null || expectedSales === void 0 ? void 0 : expectedSales.filter(function (salesRange) {
95
- var _a;
96
- return (_a = salesRange.sub) === null || _a === void 0 ? void 0 : _a.find(function (obj) { return obj.name.en.toLowerCase().startsWith(value.toLowerCase()); });
97
- });
98
94
  var filteredList = expectedSales === null || expectedSales === void 0 ? void 0 : expectedSales.filter(function (salesRange) {
99
- var _a, _b;
95
+ var _a, _b, _c;
100
96
  return salesRange.name.en.toLowerCase().includes(value.toLowerCase()) ||
97
+ salesRange.name.en.toLowerCase().replace(',', '').includes(value.toLowerCase()) ||
101
98
  salesRange.name.ar.toLowerCase().includes(value.toLowerCase()) ||
102
99
  ((_a = salesRange.sub) === null || _a === void 0 ? void 0 : _a.find(function (obj) { return obj.name.en.toLowerCase().includes(value.toLowerCase()); })) ||
103
- ((_b = salesRange.sub) === null || _b === void 0 ? void 0 : _b.find(function (obj) { return obj.name.ar.toLowerCase().includes(value.toLowerCase()); }));
100
+ ((_b = salesRange.sub) === null || _b === void 0 ? void 0 : _b.find(function (obj) {
101
+ return obj.name.en.toLowerCase().replace(',', '').includes(value.toLowerCase());
102
+ })) ||
103
+ ((_c = salesRange.sub) === null || _c === void 0 ? void 0 : _c.find(function (obj) { return obj.name.ar.toLowerCase().includes(value.toLowerCase()); }));
104
104
  });
105
105
  setExpectedSalesRangeList(filteredList);
106
106
  };
@@ -85,7 +85,15 @@ var Merchant = function (_a) {
85
85
  setUserType(ValidationOptions.EXISTING_USER_WITH_OTHER_BRAND);
86
86
  methods.clearErrors();
87
87
  setTimeout(function () {
88
- var sites = { website: '', twitter: '', instagram: '' };
88
+ var sites = {
89
+ website: '',
90
+ twitter: '',
91
+ instagram: '',
92
+ apple_store: '',
93
+ play_store: '',
94
+ call_center: '',
95
+ physical_store: ''
96
+ };
89
97
  methods.setValue('brandName', '', { shouldValidate: true });
90
98
  methods.setValue('links', sites);
91
99
  methods.setValue('salesChannels', []);
@@ -22,7 +22,7 @@ import Button, { AbsherButton, MobileButton } from '../../../shared/Button';
22
22
  import { useAppDispatch, useAppSelector } from '../../../../hooks';
23
23
  import { handlePrevScreenStep, settingsSelector } from '../../../../app/settings';
24
24
  import ScreenContainer from '../../../shared/Containers/ScreenContainer';
25
- import { clearError, connectSelector, createMobileAuth, resetNIDScreen, resetCivilScreen } from '../../../app/connect/connectStore';
25
+ import { clearError, connectSelector, createMobileAuth, resetNIDScreen, resetCivilScreen, resetOTPScreen } from '../../../app/connect/connectStore';
26
26
  import { useLanguage } from '../../../../hooks';
27
27
  import Divider from '@mui/material/Divider';
28
28
  import { isKW } from '../../../../utils';
@@ -94,6 +94,9 @@ var Mobile = function (_a) {
94
94
  methods.setValue('countryCode', data.mobileData.countryCode);
95
95
  }
96
96
  }, [data.mobileData]);
97
+ React.useEffect(function () {
98
+ dispatch(resetOTPScreen());
99
+ }, []);
97
100
  React.useEffect(function () {
98
101
  if (error)
99
102
  dispatch(clearError());
@@ -111,10 +111,10 @@ var ActivitiesList = function (_a) {
111
111
  (_a = rest.onListClose) === null || _a === void 0 ? void 0 : _a.call(rest);
112
112
  };
113
113
  var onSelectItem = function (item) {
114
- var isActivityExists = controlValue === null || controlValue === void 0 ? void 0 : controlValue.find(function (activity) { return activity.en === (item === null || item === void 0 ? void 0 : item.en); });
115
- var storedActivity = storedActivities === null || storedActivities === void 0 ? void 0 : storedActivities.find(function (activity) { return activity.en === (item === null || item === void 0 ? void 0 : item.en); });
114
+ var isActivityExists = controlValue === null || controlValue === void 0 ? void 0 : controlValue.find(function (activity) { return activity.id === (item === null || item === void 0 ? void 0 : item.id); });
115
+ var storedActivity = storedActivities === null || storedActivities === void 0 ? void 0 : storedActivities.find(function (activity) { return activity.id === (item === null || item === void 0 ? void 0 : item.id); });
116
116
  if (isActivityExists && !storedActivity) {
117
- var updatedIdList = controlValue === null || controlValue === void 0 ? void 0 : controlValue.filter(function (activity) { return activity.en !== (item === null || item === void 0 ? void 0 : item.en); });
117
+ var updatedIdList = controlValue === null || controlValue === void 0 ? void 0 : controlValue.filter(function (activity) { return activity.id !== (item === null || item === void 0 ? void 0 : item.id); });
118
118
  if (updatedIdList.length >= 1)
119
119
  activitiesControl.field.onChange(updatedIdList);
120
120
  return;
@@ -130,10 +130,11 @@ var ActivitiesList = function (_a) {
130
130
  return isAr ? (_a = controlValue[0]) === null || _a === void 0 ? void 0 : _a.ar : (_b = controlValue[0]) === null || _b === void 0 ? void 0 : _b.en;
131
131
  };
132
132
  var getSelectedActivityFlag = function (item) {
133
- return controlValue === null || controlValue === void 0 ? void 0 : controlValue.find(function (activity) { return activity.en === (item === null || item === void 0 ? void 0 : item.en); });
133
+ return controlValue === null || controlValue === void 0 ? void 0 : controlValue.find(function (activity) { return activity.id === (item === null || item === void 0 ? void 0 : item.id); });
134
134
  };
135
135
  return (_jsx(Collapse, __assign({ in: (activitiesMenuList === null || activitiesMenuList === void 0 ? void 0 : activitiesMenuList.length) > 0 }, { children: _jsxs(ScreenContainer, { children: [_jsx(InputLabelStyled, { children: t(isCR ? 'activities' : 'category') }), _jsxs(Box, { children: [_jsx(InputStyled, { readOnly: true, value: getSelectedActivities(), placeholder: isCR ? t('choose_activities') : t('category_name'), onClick: !!anchorEl ? function () { return onCloseList(); } : onOpenList, endAdornment: _jsx(ExpandIcon, { anchorEl: !!anchorEl }) }), _jsx(Collapse, __assign({ in: !!anchorEl, timeout: 300 }, { children: _jsx(SimpleListStyled, { searchKeyPath: 'name', list: activitiesMenuList, onSelectItem: onSelectItem, renderItem: function (item) {
136
- return (_jsxs(_Fragment, { children: [_jsx(Box, __assign({ display: 'flex' }, { children: _jsx(NameContainer, __assign({ isSelected: (item === null || item === void 0 ? void 0 : item.en) === getSelectedActivityFlag(item) }, { children: isAr ? item === null || item === void 0 ? void 0 : item.ar : item === null || item === void 0 ? void 0 : item.en })) })), getSelectedActivityFlag(item) && _jsx(CheckIconStyled, {})] }));
136
+ var _a;
137
+ return (_jsxs(_Fragment, { children: [_jsx(Box, __assign({ display: 'flex' }, { children: _jsx(NameContainer, __assign({ isSelected: (item === null || item === void 0 ? void 0 : item.id) === ((_a = getSelectedActivityFlag(item)) === null || _a === void 0 ? void 0 : _a.id) }, { children: isAr ? item === null || item === void 0 ? void 0 : item.name.ar : item === null || item === void 0 ? void 0 : item.name.en })) })), getSelectedActivityFlag(item) && _jsx(CheckIconStyled, {})] }));
137
138
  } }) }))] })] }) })));
138
139
  };
139
140
  export default ActivitiesList;
package/package.json CHANGED
@@ -1,129 +1,129 @@
1
- {
2
- "name": "@tap-payments/auth-jsconnect",
3
- "version": "2.0.70-test",
4
- "description": "connect library, auth",
5
- "private": false,
6
- "main": "build/index.js",
7
- "module": "build/index.js",
8
- "types": "build/index.d.ts",
9
- "files": [
10
- "build",
11
- "README.md"
12
- ],
13
- "scripts": {
14
- "husky:setup": "npx husky install",
15
- "prettier": "prettier --list-different \"src/**/*.{md,mdx,ts,js,tsx,jsx,json}\" *.json *.js",
16
- "prettier:fix": "prettier --write \"src/**/*.{ts,tsx,js,jsx,json,md,css,json}\" *.json *.js",
17
- "lint": "eslint src --color --ext .js,.jsx,.ts,.tsx,.json",
18
- "lint:fix": "eslint src --ext .js,.jsx,.ts,.tsx --fix",
19
- "start": "cross-env NODE_ENV=development webpack serve",
20
- "build": "rm -rf build && cross-env NODE_ENV=production webpack",
21
- "copy:files": "copyfiles -u 1 src/**/*.css build/",
22
- "tsc:alias": "tsc-alias -p tsconfig.json",
23
- "ts:build": "rm -rf build && tsc -p tsconfig.json && tsc-alias -p tsconfig.json && yarn copy:files",
24
- "push": "npm publish --access public"
25
- },
26
- "keywords": [],
27
- "author": {
28
- "name": "Ahmed Elsharkawy",
29
- "email": "a.elsharkawy@tap.company"
30
- },
31
- "license": "ISC",
32
- "devDependencies": {
33
- "@babel/core": "^7.18.6",
34
- "@babel/preset-env": "^7.18.6",
35
- "@babel/preset-react": "^7.18.6",
36
- "@babel/preset-typescript": "^7.18.6",
37
- "@types/lodash-es": "^4.17.6",
38
- "@types/moment-hijri": "^2.1.0",
39
- "@types/react": "^18.0.15",
40
- "@types/react-calendar": "~3.5.1",
41
- "@types/react-dom": "^18.0.6",
42
- "@typescript-eslint/eslint-plugin": "^5.30.5",
43
- "@typescript-eslint/parser": "^5.30.5",
44
- "babel-loader": "^8.2.5",
45
- "copyfiles": "^2.4.1",
46
- "cross-env": "^7.0.3",
47
- "css-loader": "^6.7.1",
48
- "css-minimizer-webpack-plugin": "^4.0.0",
49
- "eslint": "^8.19.0",
50
- "eslint-config-airbnb": "^19.0.4",
51
- "eslint-config-prettier": "^8.5.0",
52
- "eslint-plugin-import": "^2.26.0",
53
- "eslint-plugin-jsx-a11y": "^6.6.0",
54
- "eslint-plugin-node": "^11.1.0",
55
- "eslint-plugin-prettier": "^4.2.1",
56
- "eslint-plugin-react": "^7.30.1",
57
- "eslint-plugin-react-hooks": "^4.6.0",
58
- "file-loader": "^6.2.0",
59
- "fork-ts-checker-webpack-plugin": "^7.2.12",
60
- "html-loader": "^3.1.2",
61
- "html-webpack-plugin": "^5.5.0",
62
- "husky": "^8.0.1",
63
- "lint-staged": "^13.0.3",
64
- "mini-css-extract-plugin": "^2.6.1",
65
- "prettier": "^2.7.1",
66
- "sass": "^1.53.0",
67
- "sass-loader": "^13.0.2",
68
- "style-loader": "^3.3.1",
69
- "terser-webpack-plugin": "^5.3.3",
70
- "tsc-alias": "^1.6.11",
71
- "typescript": "^4.7.4",
72
- "webpack": "^5.73.0",
73
- "webpack-cli": "^4.10.0",
74
- "webpack-dev-server": "^4.9.3",
75
- "webpack-merge": "^5.8.0"
76
- },
77
- "dependencies": {
78
- "@emotion/react": "^11.9.3",
79
- "@emotion/styled": "^11.9.3",
80
- "@fingerprintjs/fingerprintjs": "~3.3.4",
81
- "@hookform/resolvers": "^2.9.6",
82
- "@mui/icons-material": "^5.8.4",
83
- "@mui/material": "^5.8.7",
84
- "@reduxjs/toolkit": "^1.8.3",
85
- "axios": "^0.27.2",
86
- "device-detector-js": "^3.0.3",
87
- "i18next": "^21.8.14",
88
- "i18next-browser-languagedetector": "^6.1.4",
89
- "i18next-http-backend": "^1.4.1",
90
- "jsencrypt": "^2.3.1",
91
- "lodash-es": "^4.17.21",
92
- "lottie-web": "^5.9.6",
93
- "moment-hijri": "~2.1.2",
94
- "react": "^18.2.0",
95
- "react-calendar": "~3.7.0",
96
- "react-device-detect": "^2.2.2",
97
- "react-dom": "^18.2.0",
98
- "react-dropzone": "^14.2.2",
99
- "react-hook-form": "^7.33.1",
100
- "react-i18next": "^11.18.1",
101
- "react-otp-input": "^2.4.0",
102
- "react-redux": "^8.0.2",
103
- "react-spring-bottom-sheet": "^3.4.1",
104
- "yup": "^0.32.11"
105
- },
106
- "peerDependencies": {
107
- "react": "^18.2.0",
108
- "react-dom": "^18.2.0"
109
- },
110
- "lint-staged": {
111
- "src/**/*.{ts,tsx,json,js,jsx}": [
112
- "yarn run prettier:fix",
113
- "yarn run lint",
114
- "git add ."
115
- ]
116
- },
117
- "browserslist": {
118
- "production": [
119
- ">0.2%",
120
- "not dead",
121
- "not op_mini all"
122
- ],
123
- "development": [
124
- "last 1 chrome version",
125
- "last 1 firefox version",
126
- "last 1 safari version"
127
- ]
128
- }
129
- }
1
+ {
2
+ "name": "@tap-payments/auth-jsconnect",
3
+ "version": "2.0.72-test",
4
+ "description": "connect library, auth",
5
+ "private": false,
6
+ "main": "build/index.js",
7
+ "module": "build/index.js",
8
+ "types": "build/index.d.ts",
9
+ "files": [
10
+ "build",
11
+ "README.md"
12
+ ],
13
+ "scripts": {
14
+ "husky:setup": "npx husky install",
15
+ "prettier": "prettier --list-different \"src/**/*.{md,mdx,ts,js,tsx,jsx,json}\" *.json *.js",
16
+ "prettier:fix": "prettier --write \"src/**/*.{ts,tsx,js,jsx,json,md,css,json}\" *.json *.js",
17
+ "lint": "eslint src --color --ext .js,.jsx,.ts,.tsx,.json",
18
+ "lint:fix": "eslint src --ext .js,.jsx,.ts,.tsx --fix",
19
+ "start": "cross-env NODE_ENV=development webpack serve",
20
+ "build": "rm -rf build && cross-env NODE_ENV=production webpack",
21
+ "copy:files": "copyfiles -u 1 src/**/*.css build/",
22
+ "tsc:alias": "tsc-alias -p tsconfig.json",
23
+ "ts:build": "rm -rf build && tsc -p tsconfig.json && tsc-alias -p tsconfig.json && yarn copy:files",
24
+ "push": "npm publish --access public"
25
+ },
26
+ "keywords": [],
27
+ "author": {
28
+ "name": "Ahmed Elsharkawy",
29
+ "email": "a.elsharkawy@tap.company"
30
+ },
31
+ "license": "ISC",
32
+ "devDependencies": {
33
+ "@babel/core": "^7.18.6",
34
+ "@babel/preset-env": "^7.18.6",
35
+ "@babel/preset-react": "^7.18.6",
36
+ "@babel/preset-typescript": "^7.18.6",
37
+ "@types/lodash-es": "^4.17.6",
38
+ "@types/moment-hijri": "^2.1.0",
39
+ "@types/react": "^18.0.15",
40
+ "@types/react-calendar": "~3.5.1",
41
+ "@types/react-dom": "^18.0.6",
42
+ "@typescript-eslint/eslint-plugin": "^5.30.5",
43
+ "@typescript-eslint/parser": "^5.30.5",
44
+ "babel-loader": "^8.2.5",
45
+ "copyfiles": "^2.4.1",
46
+ "cross-env": "^7.0.3",
47
+ "css-loader": "^6.7.1",
48
+ "css-minimizer-webpack-plugin": "^4.0.0",
49
+ "eslint": "^8.19.0",
50
+ "eslint-config-airbnb": "^19.0.4",
51
+ "eslint-config-prettier": "^8.5.0",
52
+ "eslint-plugin-import": "^2.26.0",
53
+ "eslint-plugin-jsx-a11y": "^6.6.0",
54
+ "eslint-plugin-node": "^11.1.0",
55
+ "eslint-plugin-prettier": "^4.2.1",
56
+ "eslint-plugin-react": "^7.30.1",
57
+ "eslint-plugin-react-hooks": "^4.6.0",
58
+ "file-loader": "^6.2.0",
59
+ "fork-ts-checker-webpack-plugin": "^7.2.12",
60
+ "html-loader": "^3.1.2",
61
+ "html-webpack-plugin": "^5.5.0",
62
+ "husky": "^8.0.1",
63
+ "lint-staged": "^13.0.3",
64
+ "mini-css-extract-plugin": "^2.6.1",
65
+ "prettier": "^2.7.1",
66
+ "sass": "^1.53.0",
67
+ "sass-loader": "^13.0.2",
68
+ "style-loader": "^3.3.1",
69
+ "terser-webpack-plugin": "^5.3.3",
70
+ "tsc-alias": "^1.6.11",
71
+ "typescript": "^4.7.4",
72
+ "webpack": "^5.73.0",
73
+ "webpack-cli": "^4.10.0",
74
+ "webpack-dev-server": "^4.9.3",
75
+ "webpack-merge": "^5.8.0"
76
+ },
77
+ "dependencies": {
78
+ "@emotion/react": "^11.9.3",
79
+ "@emotion/styled": "^11.9.3",
80
+ "@fingerprintjs/fingerprintjs": "~3.3.4",
81
+ "@hookform/resolvers": "^2.9.6",
82
+ "@mui/icons-material": "^5.8.4",
83
+ "@mui/material": "^5.8.7",
84
+ "@reduxjs/toolkit": "^1.8.3",
85
+ "axios": "^0.27.2",
86
+ "device-detector-js": "^3.0.3",
87
+ "i18next": "^21.8.14",
88
+ "i18next-browser-languagedetector": "^6.1.4",
89
+ "i18next-http-backend": "^1.4.1",
90
+ "jsencrypt": "^2.3.1",
91
+ "lodash-es": "^4.17.21",
92
+ "lottie-web": "^5.9.6",
93
+ "moment-hijri": "~2.1.2",
94
+ "react": "^18.2.0",
95
+ "react-calendar": "~3.7.0",
96
+ "react-device-detect": "^2.2.2",
97
+ "react-dom": "^18.2.0",
98
+ "react-dropzone": "^14.2.2",
99
+ "react-hook-form": "^7.33.1",
100
+ "react-i18next": "^11.18.1",
101
+ "react-otp-input": "^2.4.0",
102
+ "react-redux": "^8.0.2",
103
+ "react-spring-bottom-sheet": "^3.4.1",
104
+ "yup": "^0.32.11"
105
+ },
106
+ "peerDependencies": {
107
+ "react": "^18.2.0",
108
+ "react-dom": "^18.2.0"
109
+ },
110
+ "lint-staged": {
111
+ "src/**/*.{ts,tsx,json,js,jsx}": [
112
+ "yarn run prettier:fix",
113
+ "yarn run lint",
114
+ "git add ."
115
+ ]
116
+ },
117
+ "browserslist": {
118
+ "production": [
119
+ ">0.2%",
120
+ "not dead",
121
+ "not op_mini all"
122
+ ],
123
+ "development": [
124
+ "last 1 chrome version",
125
+ "last 1 firefox version",
126
+ "last 1 safari version"
127
+ ]
128
+ }
129
+ }