@tap-payments/auth-jsconnect 2.0.90-test → 2.0.92-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.
- package/build/api/firebase.d.ts +1 -1
- package/build/api/firebase.js +3 -1
- package/build/api/index.d.ts +1 -1
- package/build/app/settings.d.ts +1 -0
- package/build/app/settings.js +7 -4
- package/build/assets/locales/ar.json +246 -194
- package/build/assets/locales/en.json +178 -119
- package/build/features/auth/Auth.js +1 -1
- package/build/features/connect/screens/Merchant/BrandList.js +1 -1
- package/build/features/connect/screens/Merchant/Merchant.js +6 -5
- package/build/features/connect/screens/Merchant/SalesChannels.js +10 -3
- package/build/features/connect/screens/Merchant/SocialMedia.js +9 -3
- package/build/features/connect/screens/Merchant/validation.js +38 -28
- package/build/features/shared/Dialog/CloseDialog.js +4 -3
- package/build/hooks/useAppConfig.d.ts +2 -1
- package/build/hooks/useAppConfig.js +2 -2
- package/build/hooks/useErrorListener.js +0 -6
- package/package.json +1 -1
|
@@ -11,11 +11,11 @@ export var MerchantValidationSchema = function (isNewBrand) {
|
|
|
11
11
|
if (length === 0)
|
|
12
12
|
return true;
|
|
13
13
|
if (length < 3 || !(value === null || value === void 0 ? void 0 : value.match(REGEX_BRAND_NAME)))
|
|
14
|
-
return this.createError({ message: '
|
|
14
|
+
return this.createError({ message: 'enter_brand_name_english_chars_numbers_space' });
|
|
15
15
|
return true;
|
|
16
16
|
}
|
|
17
17
|
})
|
|
18
|
-
.required('
|
|
18
|
+
.required('enter_brand_name_english_chars_numbers_space'),
|
|
19
19
|
termAndConditionChecked: yup.boolean().isTrue('check_terms_cond').required('check_terms_cond'),
|
|
20
20
|
salesChannels: yup
|
|
21
21
|
.array()
|
|
@@ -31,27 +31,32 @@ export var MerchantValidationSchema = function (isNewBrand) {
|
|
|
31
31
|
var channels = (value || []);
|
|
32
32
|
var dic = {};
|
|
33
33
|
channels.forEach(function (channel) {
|
|
34
|
-
var _a, _b;
|
|
34
|
+
var _a, _b, _c;
|
|
35
35
|
if ((_a = channel.sub) === null || _a === void 0 ? void 0 : _a.length) {
|
|
36
|
+
var key_1 = (_b = channel.id) === null || _b === void 0 ? void 0 : _b.toLowerCase();
|
|
37
|
+
if (key_1)
|
|
38
|
+
dic[key_1] = [];
|
|
36
39
|
channel.sub.forEach(function (sub) {
|
|
37
|
-
|
|
38
|
-
var key = (_a = sub.id) === null || _a === void 0 ? void 0 : _a.toLowerCase();
|
|
39
|
-
if (key)
|
|
40
|
-
dic[key] = sub.address || '';
|
|
40
|
+
dic[key_1].push(sub.address || '');
|
|
41
41
|
});
|
|
42
42
|
}
|
|
43
43
|
else {
|
|
44
|
-
var key = (
|
|
44
|
+
var key = (_c = channel.id) === null || _c === void 0 ? void 0 : _c.toLowerCase();
|
|
45
45
|
if (key)
|
|
46
|
-
dic[key] = channel.address || '';
|
|
46
|
+
dic[key] = [channel.address || ''];
|
|
47
47
|
}
|
|
48
48
|
});
|
|
49
|
-
var
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
49
|
+
for (var key in dic) {
|
|
50
|
+
var values = dic[key];
|
|
51
|
+
var atLestOne = values.every(function (item) { return item === ''; });
|
|
52
|
+
if (atLestOne)
|
|
53
|
+
return this.createError({ message: "enter_at_least_one_".concat(key) });
|
|
54
|
+
if (key === 'website') {
|
|
55
|
+
var isWebsite = values.every(function (item) { return item === '' || item.match(REGEX_WEBSITE); });
|
|
56
|
+
if (!isWebsite)
|
|
57
|
+
return this.createError({ message: 'invalid_url' });
|
|
58
|
+
}
|
|
59
|
+
}
|
|
55
60
|
return true;
|
|
56
61
|
}
|
|
57
62
|
})
|
|
@@ -72,27 +77,32 @@ export var MerchantValidationSchema = function (isNewBrand) {
|
|
|
72
77
|
var channels = (value || []);
|
|
73
78
|
var dic = {};
|
|
74
79
|
channels.forEach(function (channel) {
|
|
75
|
-
var _a, _b;
|
|
80
|
+
var _a, _b, _c;
|
|
76
81
|
if ((_a = channel.sub) === null || _a === void 0 ? void 0 : _a.length) {
|
|
82
|
+
var key_2 = (_b = channel.id) === null || _b === void 0 ? void 0 : _b.toLowerCase();
|
|
83
|
+
if (key_2)
|
|
84
|
+
dic[key_2] = [];
|
|
77
85
|
channel.sub.forEach(function (sub) {
|
|
78
|
-
|
|
79
|
-
var key = (_a = sub.id) === null || _a === void 0 ? void 0 : _a.toLowerCase();
|
|
80
|
-
if (key)
|
|
81
|
-
dic[key] = sub.address || '';
|
|
86
|
+
dic[key_2].push(sub.address || '');
|
|
82
87
|
});
|
|
83
88
|
}
|
|
84
89
|
else {
|
|
85
|
-
var key = (
|
|
90
|
+
var key = (_c = channel.id) === null || _c === void 0 ? void 0 : _c.toLowerCase();
|
|
86
91
|
if (key)
|
|
87
|
-
dic[key] = channel.address || '';
|
|
92
|
+
dic[key] = [channel.address || ''];
|
|
88
93
|
}
|
|
89
94
|
});
|
|
90
|
-
var
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
95
|
+
for (var key in dic) {
|
|
96
|
+
var values = dic[key];
|
|
97
|
+
var atLestOne = values.every(function (item) { return item === ''; });
|
|
98
|
+
if (atLestOne)
|
|
99
|
+
return this.createError({ message: "enter_at_least_one_".concat(key) });
|
|
100
|
+
if (key === 'website') {
|
|
101
|
+
var isWebsite = values.every(function (item) { return item === '' || item.match(REGEX_WEBSITE); });
|
|
102
|
+
if (!isWebsite)
|
|
103
|
+
return this.createError({ message: 'invalid_url' });
|
|
104
|
+
}
|
|
105
|
+
}
|
|
96
106
|
return true;
|
|
97
107
|
}
|
|
98
108
|
})
|
|
@@ -10,7 +10,7 @@ var __assign = (this && this.__assign) || function () {
|
|
|
10
10
|
return __assign.apply(this, arguments);
|
|
11
11
|
};
|
|
12
12
|
import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
|
|
13
|
-
import { alpha, styled } from '@mui/material/styles';
|
|
13
|
+
import { alpha, styled, useTheme } from '@mui/material/styles';
|
|
14
14
|
import Collapse from '../../../components/Collapse';
|
|
15
15
|
import Text from '../../../components/Text';
|
|
16
16
|
import Box from '@mui/material/Box';
|
|
@@ -52,11 +52,12 @@ var YesTextStyled = styled(Text)(function (_a) {
|
|
|
52
52
|
var NoTextStyled = styled(Text)(function (_a) {
|
|
53
53
|
var theme = _a.theme;
|
|
54
54
|
return ({
|
|
55
|
-
color: theme.palette.
|
|
55
|
+
color: theme.palette.text.secondary,
|
|
56
56
|
cursor: 'pointer'
|
|
57
57
|
});
|
|
58
58
|
});
|
|
59
59
|
export default function CloseDialog(_a) {
|
|
60
60
|
var message = _a.message, confirmTitle = _a.confirmTitle, closeTitle = _a.closeTitle, open = _a.open, onConfirm = _a.onConfirm, onCancel = _a.onCancel;
|
|
61
|
-
|
|
61
|
+
var theme = useTheme();
|
|
62
|
+
return (_jsxs(Collapse, __assign({ in: open }, { children: [_jsx(Box, __assign({ sx: { direction: theme.direction } }, { children: _jsxs(ConfirmCloseBox, { children: [_jsxs(Text, { children: [" ", message] }), _jsx(YesTextStyled, __assign({ onClick: onConfirm }, { children: confirmTitle })), _jsx(NoTextStyled, __assign({ onClick: onCancel }, { children: closeTitle }))] }) })), _jsx(DisableBoxStyled, { id: 'disable-container' })] })));
|
|
62
63
|
}
|
|
@@ -2,6 +2,7 @@ import { LibConfig, ScreenStepNavigation } from '../@types';
|
|
|
2
2
|
interface AppConfigProps extends LibConfig {
|
|
3
3
|
navigation: ScreenStepNavigation[];
|
|
4
4
|
disableCountries?: boolean;
|
|
5
|
+
disableLocale?: boolean;
|
|
5
6
|
}
|
|
6
|
-
export declare const useAppConfig: ({ appInfo, navigation, publicKey, disableCountries, ...rest }: AppConfigProps) => void;
|
|
7
|
+
export declare const useAppConfig: ({ appInfo, navigation, publicKey, disableCountries, disableLocale, ...rest }: AppConfigProps) => void;
|
|
7
8
|
export {};
|
|
@@ -27,7 +27,7 @@ import { axiosInstance } from '../api';
|
|
|
27
27
|
import { isTapDomain, removeRequestHeaders } from '../utils';
|
|
28
28
|
import { ENDPOINT_PATHS } from '../constants';
|
|
29
29
|
export var useAppConfig = function (_a) {
|
|
30
|
-
var appInfo = _a.appInfo, navigation = _a.navigation, publicKey = _a.publicKey, disableCountries = _a.disableCountries, rest = __rest(_a, ["appInfo", "navigation", "publicKey", "disableCountries"]);
|
|
30
|
+
var appInfo = _a.appInfo, navigation = _a.navigation, publicKey = _a.publicKey, disableCountries = _a.disableCountries, disableLocale = _a.disableLocale, rest = __rest(_a, ["appInfo", "navigation", "publicKey", "disableCountries", "disableLocale"]);
|
|
31
31
|
var dispatch = useAppDispatch();
|
|
32
32
|
var setBaseUrl = function () {
|
|
33
33
|
var isProd = publicKey.includes('pk_live');
|
|
@@ -56,6 +56,6 @@ export var useAppConfig = function (_a) {
|
|
|
56
56
|
setBaseUrl();
|
|
57
57
|
setAppConfig();
|
|
58
58
|
dispatch(handleLanguage(rest.language));
|
|
59
|
-
dispatch(fetchAppSettingsSync({ disableCountries: disableCountries }));
|
|
59
|
+
dispatch(fetchAppSettingsSync({ disableCountries: disableCountries, disableLocale: disableLocale }));
|
|
60
60
|
}, []);
|
|
61
61
|
};
|
|
@@ -9,10 +9,4 @@ export var useErrorListener = function (error) {
|
|
|
9
9
|
(_b = (_a = settings.data.appConfig) === null || _a === void 0 ? void 0 : _a.onError) === null || _b === void 0 ? void 0 : _b.call(_a, error);
|
|
10
10
|
}
|
|
11
11
|
}, [error]);
|
|
12
|
-
useEffect(function () {
|
|
13
|
-
var _a, _b;
|
|
14
|
-
if (!settings.error && !settings.loading) {
|
|
15
|
-
(_b = (_a = settings.data.appConfig).onReady) === null || _b === void 0 ? void 0 : _b.call(_a);
|
|
16
|
-
}
|
|
17
|
-
}, [settings.error, settings.loading]);
|
|
18
12
|
};
|