@tap-payments/auth-jsconnect 2.1.41-test → 2.1.43-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.
|
@@ -833,12 +833,14 @@ export var connectSlice = createSlice({
|
|
|
833
833
|
}
|
|
834
834
|
var firstBrand = (_b = (_a = state.data.brandData) === null || _a === void 0 ? void 0 : _a.responseBody) === null || _b === void 0 ? void 0 : _b.brand_list[0];
|
|
835
835
|
state.data.brandData.segment = rest.segments_list.find(function (_a) {
|
|
836
|
+
var _b;
|
|
836
837
|
var id = _a.id;
|
|
837
|
-
return firstBrand.segment.type === id;
|
|
838
|
+
return ((_b = firstBrand === null || firstBrand === void 0 ? void 0 : firstBrand.segment) === null || _b === void 0 ? void 0 : _b.type) === id;
|
|
838
839
|
});
|
|
839
840
|
state.data.brandData.teamSize = rest.team_size_list.find(function (_a) {
|
|
841
|
+
var _b;
|
|
840
842
|
var id = _a.id;
|
|
841
|
-
return firstBrand.segment.team === id;
|
|
843
|
+
return ((_b = firstBrand === null || firstBrand === void 0 ? void 0 : firstBrand.segment) === null || _b === void 0 ? void 0 : _b.team) === id;
|
|
842
844
|
});
|
|
843
845
|
state.data.individualData = formData;
|
|
844
846
|
state.data.individualData.responseBody = rest;
|
|
@@ -66,8 +66,8 @@ var Merchant = function (_a) {
|
|
|
66
66
|
dispatch(handlePrevScreenStep('CONNECT_INDIVIDUAL_STEP'));
|
|
67
67
|
};
|
|
68
68
|
React.useEffect(function () {
|
|
69
|
-
methods.setValue('segment', segment
|
|
70
|
-
methods.setValue('teamSize', teamSize
|
|
69
|
+
methods.setValue('segment', segment);
|
|
70
|
+
methods.setValue('teamSize', teamSize);
|
|
71
71
|
}, [segment, teamSize]);
|
|
72
72
|
React.useEffect(function () {
|
|
73
73
|
if (error)
|
|
@@ -81,7 +81,7 @@ var Merchant = function (_a) {
|
|
|
81
81
|
if (termAndConditionChecked === true)
|
|
82
82
|
methods.setValue('termAndConditionChecked', termAndConditionChecked);
|
|
83
83
|
}, [termAndConditionChecked]);
|
|
84
|
-
var brandErrChecks = !!Object.entries(methods.formState.errors).length || !!error;
|
|
84
|
+
var brandErrChecks = !!Object.entries(methods.formState.errors).length || !methods.formState.isValid || !!error;
|
|
85
85
|
var disabled = brandErrChecks || brandNameChecking || ((_b = data.brandData.responseBody) === null || _b === void 0 ? void 0 : _b.response_code) === '5';
|
|
86
86
|
var hasBrandList = (brandList === null || brandList === void 0 ? void 0 : brandList.length) > 0;
|
|
87
87
|
var isOtherBrand = (brandListItem === null || brandListItem === void 0 ? void 0 : brandListItem.id) === 'other' && hasBrandList;
|
|
@@ -18,7 +18,6 @@ import { useAppSelector, useLanguage } from '../../../../hooks';
|
|
|
18
18
|
import React from 'react';
|
|
19
19
|
import { useTranslation } from 'react-i18next';
|
|
20
20
|
import { useController, useFormContext } from 'react-hook-form';
|
|
21
|
-
import Search from '../../../../features/shared/Search';
|
|
22
21
|
import SimpleList from '../../../../components/SimpleList';
|
|
23
22
|
import ExpandIcon from '../../../../components/ExpandIcon';
|
|
24
23
|
import Container from '@mui/material/Container';
|
|
@@ -67,13 +66,9 @@ var Segments = function (_a) {
|
|
|
67
66
|
onCloseList();
|
|
68
67
|
segmentControl.field.onChange(segment);
|
|
69
68
|
};
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
return (_jsx(Collapse, __assign({ in: show }, { children: _jsxs(ScreenContainer, __assign({ sx: { mt: 2.5, mb: 0 } }, { children: [_jsx(Input, { required: true, label: t('segment_title'), readOnly: true, onClick: !!anchorEl ? function () { return onCloseList(); } : onOpenList, endAdornment: _jsx(ExpandIcon, { anchorEl: !!anchorEl }), placeholder: t('choose_any_segment'), value: (isAr ? (_d = segment === null || segment === void 0 ? void 0 : segment.name) === null || _d === void 0 ? void 0 : _d.ar : (_e = segment === null || segment === void 0 ? void 0 : segment.name) === null || _e === void 0 ? void 0 : _e.en) || '', warningMessage: error && t(error) }), _jsxs(Collapse, __assign({ in: !!anchorEl }, { children: [_jsx(Search, { onSearchValue: handleSearch }), _jsx(SimpleList, { searchKeyPath: 'name.en', searchValuePath: ['name.en', 'name.ar'], list: segmentList, onSelectItem: onSelectItem, renderItem: function (item) {
|
|
75
|
-
var _a, _b;
|
|
76
|
-
return (_jsxs(_Fragment, { children: [_jsx(Container, { children: _jsx(IncomeText, __assign({ isSelected: item.id === (segment === null || segment === void 0 ? void 0 : segment.id) }, { children: isAr ? (_a = item === null || item === void 0 ? void 0 : item.name) === null || _a === void 0 ? void 0 : _a.ar : (_b = item === null || item === void 0 ? void 0 : item.name) === null || _b === void 0 ? void 0 : _b.en })) }), item.id === (segment === null || segment === void 0 ? void 0 : segment.id) && _jsx(CheckIconStyled, {})] }));
|
|
77
|
-
} })] }))] })) })));
|
|
69
|
+
return (_jsx(Collapse, __assign({ in: show }, { children: _jsxs(ScreenContainer, __assign({ sx: { mt: 2.5, mb: 0 } }, { children: [_jsx(Input, { required: true, label: t('segment_title'), readOnly: true, onClick: !!anchorEl ? function () { return onCloseList(); } : onOpenList, endAdornment: _jsx(ExpandIcon, { anchorEl: !!anchorEl }), placeholder: t('choose_any_segment'), value: (isAr ? (_d = segment === null || segment === void 0 ? void 0 : segment.name) === null || _d === void 0 ? void 0 : _d.ar : (_e = segment === null || segment === void 0 ? void 0 : segment.name) === null || _e === void 0 ? void 0 : _e.en) || '', warningMessage: error && t(error) }), _jsx(Collapse, __assign({ in: !!anchorEl }, { children: _jsx(SimpleList, { searchKeyPath: 'name.en', searchValuePath: ['name.en', 'name.ar'], list: segmentList, onSelectItem: onSelectItem, renderItem: function (item) {
|
|
70
|
+
var _a, _b;
|
|
71
|
+
return (_jsxs(_Fragment, { children: [_jsx(Container, { children: _jsx(IncomeText, __assign({ isSelected: item.id === (segment === null || segment === void 0 ? void 0 : segment.id) }, { children: isAr ? (_a = item === null || item === void 0 ? void 0 : item.name) === null || _a === void 0 ? void 0 : _a.ar : (_b = item === null || item === void 0 ? void 0 : item.name) === null || _b === void 0 ? void 0 : _b.en })) }), item.id === (segment === null || segment === void 0 ? void 0 : segment.id) && _jsx(CheckIconStyled, {})] }));
|
|
72
|
+
} }) }))] })) })));
|
|
78
73
|
};
|
|
79
74
|
export default Segments;
|
|
@@ -18,7 +18,6 @@ import { useAppSelector, useLanguage } from '../../../../hooks';
|
|
|
18
18
|
import React from 'react';
|
|
19
19
|
import { useTranslation } from 'react-i18next';
|
|
20
20
|
import { useController, useFormContext } from 'react-hook-form';
|
|
21
|
-
import Search from '../../../../features/shared/Search';
|
|
22
21
|
import SimpleList from '../../../../components/SimpleList';
|
|
23
22
|
import ExpandIcon from '../../../../components/ExpandIcon';
|
|
24
23
|
import Container from '@mui/material/Container';
|
|
@@ -67,13 +66,9 @@ var TeamSize = function (_a) {
|
|
|
67
66
|
onCloseList();
|
|
68
67
|
teamSizeControl.field.onChange(teamSize);
|
|
69
68
|
};
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
return (_jsx(Collapse, __assign({ in: show }, { children: _jsxs(ScreenContainer, __assign({ sx: { mt: 2.5, mb: 0 } }, { children: [_jsx(Input, { required: true, label: t('team_size_title'), readOnly: true, onClick: !!anchorEl ? function () { return onCloseList(); } : onOpenList, endAdornment: _jsx(ExpandIcon, { anchorEl: !!anchorEl }), placeholder: t('choose_team_size'), value: (isAr ? (_d = teamSize === null || teamSize === void 0 ? void 0 : teamSize.name) === null || _d === void 0 ? void 0 : _d.ar : (_e = teamSize === null || teamSize === void 0 ? void 0 : teamSize.name) === null || _e === void 0 ? void 0 : _e.en) || '', warningMessage: error && t(error) }), _jsxs(Collapse, __assign({ in: !!anchorEl }, { children: [_jsx(Search, { onSearchValue: handleSearch }), _jsx(SimpleList, { searchKeyPath: 'name.en', searchValuePath: ['name.en', 'name.ar'], list: teamSizeList, onSelectItem: onSelectItem, renderItem: function (item) {
|
|
75
|
-
var _a, _b;
|
|
76
|
-
return (_jsxs(_Fragment, { children: [_jsx(Container, { children: _jsx(IncomeText, __assign({ isSelected: item.id === (teamSize === null || teamSize === void 0 ? void 0 : teamSize.id) }, { children: isAr ? (_a = item === null || item === void 0 ? void 0 : item.name) === null || _a === void 0 ? void 0 : _a.ar : (_b = item === null || item === void 0 ? void 0 : item.name) === null || _b === void 0 ? void 0 : _b.en })) }), item.id === (teamSize === null || teamSize === void 0 ? void 0 : teamSize.id) && _jsx(CheckIconStyled, {})] }));
|
|
77
|
-
} })] }))] })) })));
|
|
69
|
+
return (_jsx(Collapse, __assign({ in: show }, { children: _jsxs(ScreenContainer, __assign({ sx: { mt: 2.5, mb: 0 } }, { children: [_jsx(Input, { required: true, label: t('team_size_title'), readOnly: true, onClick: !!anchorEl ? function () { return onCloseList(); } : onOpenList, endAdornment: _jsx(ExpandIcon, { anchorEl: !!anchorEl }), placeholder: t('choose_team_size'), value: (isAr ? (_d = teamSize === null || teamSize === void 0 ? void 0 : teamSize.name) === null || _d === void 0 ? void 0 : _d.ar : (_e = teamSize === null || teamSize === void 0 ? void 0 : teamSize.name) === null || _e === void 0 ? void 0 : _e.en) || '', warningMessage: error && t(error) }), _jsx(Collapse, __assign({ in: !!anchorEl }, { children: _jsx(SimpleList, { searchKeyPath: 'name.en', searchValuePath: ['name.en', 'name.ar'], list: teamSizeList, onSelectItem: onSelectItem, renderItem: function (item) {
|
|
70
|
+
var _a, _b;
|
|
71
|
+
return (_jsxs(_Fragment, { children: [_jsx(Container, { children: _jsx(IncomeText, __assign({ isSelected: item.id === (teamSize === null || teamSize === void 0 ? void 0 : teamSize.id) }, { children: isAr ? (_a = item === null || item === void 0 ? void 0 : item.name) === null || _a === void 0 ? void 0 : _a.ar : (_b = item === null || item === void 0 ? void 0 : item.name) === null || _b === void 0 ? void 0 : _b.en })) }), item.id === (teamSize === null || teamSize === void 0 ? void 0 : teamSize.id) && _jsx(CheckIconStyled, {})] }));
|
|
72
|
+
} }) }))] })) })));
|
|
78
73
|
};
|
|
79
74
|
export default TeamSize;
|