@tap-payments/auth-jsconnect 2.0.71-test → 2.0.75-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/@types/app.d.ts +5 -2
- package/build/@types/form.d.ts +4 -1
- package/build/api/brand.d.ts +2 -1
- package/build/api/brand.js +10 -1
- package/build/api/data.d.ts +2 -0
- package/build/api/data.js +16 -1
- package/build/api/entity.d.ts +3 -1
- package/build/api/index.d.ts +2 -0
- package/build/api/individual.d.ts +48 -19
- package/build/constants/api.d.ts +2 -0
- package/build/constants/api.js +5 -1
- package/build/features/app/business/businessStore.d.ts +1 -3
- package/build/features/app/business/businessStore.js +68 -164
- package/build/features/app/connect/connectStore.d.ts +1 -0
- package/build/features/app/connect/connectStore.js +66 -37
- package/build/features/app/entity/entityStore.js +3 -3
- package/build/features/business/screens/Activities/Activities.js +1 -6
- package/build/features/business/screens/Activities/ActivitiesList.js +7 -6
- package/build/features/business/screens/Activities/SalesChannels.d.ts +0 -3
- package/build/features/business/screens/Activities/SalesChannels.js +0 -96
- package/build/features/business/screens/Activities/validation.d.ts +0 -51
- package/build/features/business/screens/Activities/validation.js +0 -9
- package/build/features/connect/screens/Merchant/Merchant.js +9 -1
- package/build/features/connect/screens/Mobile/Mobile.js +4 -1
- package/build/features/entity/screens/EntityInfoConfirm/ActivitiesList.js +6 -5
- package/package.json +1 -1
|
@@ -172,8 +172,8 @@ export var updateEntityInfo = createAsyncThunk('updateEntityInfo', function (par
|
|
|
172
172
|
requestBody = {
|
|
173
173
|
id: (_c = (_b = entity.data.verify.responseBody) === null || _b === void 0 ? void 0 : _b.entity) === null || _c === void 0 ? void 0 : _c.id,
|
|
174
174
|
activities: (_d = (params.activities || [])) === null || _d === void 0 ? void 0 : _d.map(function (_a) {
|
|
175
|
-
var
|
|
176
|
-
return
|
|
175
|
+
var id = _a.id;
|
|
176
|
+
return ({ id: id });
|
|
177
177
|
}),
|
|
178
178
|
license_name: params.licenseName,
|
|
179
179
|
license_number: params.licenseNumber,
|
|
@@ -313,7 +313,7 @@ export var entitySlice = createSlice({
|
|
|
313
313
|
var activities = (entity === null || entity === void 0 ? void 0 : entity.activities) || [];
|
|
314
314
|
var selectedActivity = activities === null || activities === void 0 ? void 0 : activities.filter(function (activity) {
|
|
315
315
|
var _a;
|
|
316
|
-
return (_a = brand === null || brand === void 0 ? void 0 : brand.activities) === null || _a === void 0 ? void 0 : _a.find(function (value) {
|
|
316
|
+
return (_a = brand === null || brand === void 0 ? void 0 : brand.activities) === null || _a === void 0 ? void 0 : _a.find(function (value) { return value.id === activity.id; });
|
|
317
317
|
});
|
|
318
318
|
state.data.entityData.activities = (selectedActivity === null || selectedActivity === void 0 ? void 0 : selectedActivity.length) > 0 ? selectedActivity : [activities === null || activities === void 0 ? void 0 : activities[0]];
|
|
319
319
|
state.data.entityData.responseBody = __assign(__assign({}, state.data.entityData.responseBody), { entity_id: entity === null || entity === void 0 ? void 0 : entity.id, activities: activities, selectedActivities: (selectedActivity === null || selectedActivity === void 0 ? void 0 : selectedActivity.length) > 0 ? selectedActivity : [activities === null || activities === void 0 ? void 0 : activities[0]] });
|
|
@@ -20,7 +20,6 @@ import { yupResolver } from '@hookform/resolvers/yup';
|
|
|
20
20
|
import { useTranslation } from 'react-i18next';
|
|
21
21
|
import { handlePrevScreenStep } from '../../../../app/settings';
|
|
22
22
|
import Button from '../../../shared/Button';
|
|
23
|
-
import SalesChannels from './SalesChannels';
|
|
24
23
|
import { ScreenContainer } from '../../../shared/Containers';
|
|
25
24
|
import Collapse from '../../../../components/Collapse';
|
|
26
25
|
import OperationStartDate from './OperationStartDate';
|
|
@@ -53,10 +52,6 @@ var Activities = function () {
|
|
|
53
52
|
var onBack = function () {
|
|
54
53
|
dispatch(handlePrevScreenStep());
|
|
55
54
|
};
|
|
56
|
-
React.useEffect(function () {
|
|
57
|
-
var salesChannels = activitiesData.salesChannels;
|
|
58
|
-
methods.setValue('salesChannels', salesChannels);
|
|
59
|
-
}, [activitiesData.salesChannels]);
|
|
60
55
|
React.useEffect(function () {
|
|
61
56
|
var activities = activitiesData.activities;
|
|
62
57
|
methods.setValue('activities', activities);
|
|
@@ -73,6 +68,6 @@ var Activities = function () {
|
|
|
73
68
|
anchorEl ? setAnchorEl(false) : setAnchorEl(true);
|
|
74
69
|
};
|
|
75
70
|
var disabled = !methods.formState.isValid || !!error;
|
|
76
|
-
return (_jsx(ScreenContainer, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(FormStyled, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsx(Collapse, __assign({ in: !collapse && !anchorEl }, { children: _jsx(LicenseName, {}) })),
|
|
71
|
+
return (_jsx(ScreenContainer, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(FormStyled, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsx(Collapse, __assign({ in: !collapse && !anchorEl }, { children: _jsx(LicenseName, {}) })), _jsx(Collapse, __assign({ in: !collapse }, { children: _jsx(ActivitiesList, { onListOpen: function () { return handleMenuClick(); }, onListClose: function () { return handleMenuClick(); } }) })), _jsx(Collapse, __assign({ in: !anchorEl }, { children: _jsx(OperationStartDate, { onDateClicked: handleCollapseOpenClose }) })), _jsx(Collapse, __assign({ in: !collapse && !anchorEl }, { children: _jsx(Button, __assign({ disableBack: true, onBackClicked: function () { return onBack(); }, isAr: isAr, disabled: disabled, loading: loading, error: t(error || '') }, { children: t('next') })) }))] })) })) }));
|
|
77
72
|
};
|
|
78
73
|
export default Activities;
|
|
@@ -105,9 +105,9 @@ var ActivitiesList = function (_a) {
|
|
|
105
105
|
(_a = rest.onListClose) === null || _a === void 0 ? void 0 : _a.call(rest);
|
|
106
106
|
};
|
|
107
107
|
var onSelectItem = function (item) {
|
|
108
|
-
var isActivityExists = controlValue === null || controlValue === void 0 ? void 0 : controlValue.find(function (activity) { return activity.
|
|
108
|
+
var isActivityExists = controlValue === null || controlValue === void 0 ? void 0 : controlValue.find(function (activity) { return activity.id === item.id; });
|
|
109
109
|
if (isActivityExists) {
|
|
110
|
-
var updatedIdList = controlValue === null || controlValue === void 0 ? void 0 : controlValue.filter(function (activity) { return activity.
|
|
110
|
+
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); });
|
|
111
111
|
if (updatedIdList.length >= 1)
|
|
112
112
|
activitiesControl.field.onChange(updatedIdList);
|
|
113
113
|
return;
|
|
@@ -115,17 +115,18 @@ var ActivitiesList = function (_a) {
|
|
|
115
115
|
activitiesControl.field.onChange(__spreadArray(__spreadArray([], controlValue, true), [item], false));
|
|
116
116
|
};
|
|
117
117
|
var getSelectedActivities = function () {
|
|
118
|
-
var _a, _b;
|
|
119
118
|
if ((controlValue === null || controlValue === void 0 ? void 0 : controlValue.length) > 1) {
|
|
120
119
|
return (controlValue === null || controlValue === void 0 ? void 0 : controlValue.length) + ' ' + t('activities_selected');
|
|
121
120
|
}
|
|
122
|
-
|
|
121
|
+
var item = controlValue[0];
|
|
122
|
+
return isAr ? item === null || item === void 0 ? void 0 : item.name.ar : item === null || item === void 0 ? void 0 : item.name.en;
|
|
123
123
|
};
|
|
124
124
|
var getSelectedActivityFlag = function (item) {
|
|
125
|
-
return controlValue === null || controlValue === void 0 ? void 0 : controlValue.find(function (activity) { return activity.
|
|
125
|
+
return controlValue === null || controlValue === void 0 ? void 0 : controlValue.find(function (activity) { return activity.id === item.id; });
|
|
126
126
|
};
|
|
127
127
|
return (_jsx(Collapse, __assign({ in: (activitiesMenuList === null || activitiesMenuList === void 0 ? void 0 : activitiesMenuList.length) > 0 }, { children: _jsxs(ScreenContainer, { children: [_jsxs(InputLabelStyled, { children: [t(isCR ? 'activities' : 'category'), " ", _jsx(MandatoryStyled, { children: "*" })] }), _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) {
|
|
128
|
-
|
|
128
|
+
var _a, _b, _c;
|
|
129
|
+
return (_jsxs(_Fragment, { children: [_jsx(Box, __assign({ display: 'flex' }, { children: _jsx(NameContainer, __assign({ isSelected: item.id === ((_a = getSelectedActivityFlag(item)) === null || _a === void 0 ? void 0 : _a.id) }, { children: isAr ? (_b = item === null || item === void 0 ? void 0 : item.name) === null || _b === void 0 ? void 0 : _b.ar : (_c = item === null || item === void 0 ? void 0 : item.name) === null || _c === void 0 ? void 0 : _c.en })) })), getSelectedActivityFlag(item) && _jsx(CheckIconStyled, {})] }));
|
|
129
130
|
} }) }))] })] }) })));
|
|
130
131
|
};
|
|
131
132
|
export default ActivitiesList;
|
|
@@ -1,5 +1,2 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
export declare const MandatoryStyled: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, React.DetailedHTMLProps<React.HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {}>;
|
|
3
|
-
export declare const CollapseStyled: import("@emotion/styled").StyledComponent<import("../../../../components/Collapse").CollapseProps & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, {}, {}>;
|
|
4
|
-
declare const SalesChannels: () => JSX.Element;
|
|
5
|
-
export default SalesChannels;
|
|
@@ -9,104 +9,8 @@ var __assign = (this && this.__assign) || function () {
|
|
|
9
9
|
};
|
|
10
10
|
return __assign.apply(this, arguments);
|
|
11
11
|
};
|
|
12
|
-
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
13
|
-
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
14
|
-
if (ar || !(i in from)) {
|
|
15
|
-
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
16
|
-
ar[i] = from[i];
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
return to.concat(ar || Array.prototype.slice.call(from));
|
|
20
|
-
};
|
|
21
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
22
|
-
import * as React from 'react';
|
|
23
|
-
import Box from '@mui/material/Box';
|
|
24
12
|
import { alpha, styled } from '@mui/material/styles';
|
|
25
|
-
import { useTranslation } from 'react-i18next';
|
|
26
|
-
import { useController, useFormContext } from 'react-hook-form';
|
|
27
|
-
import { useLanguage, useAppSelector, useAppDispatch } from '../../../../hooks';
|
|
28
|
-
import Text from '../../../../components/Text';
|
|
29
|
-
import { businessSelector, clearError } from '../../../app/business/businessStore';
|
|
30
|
-
import CheckBox from '../../../../components/CheckBox';
|
|
31
|
-
import Warning from '../../../../components/Warning';
|
|
32
|
-
import Collapse from '../../../../components/Collapse';
|
|
33
|
-
import { ScreenContainer } from '../../../shared/Containers';
|
|
34
|
-
var InputLabelStyled = styled(Text)(function (_a) {
|
|
35
|
-
var theme = _a.theme;
|
|
36
|
-
return (__assign({ margin: theme.spacing(2.5, 2.5, 0.5, 2.5), color: alpha(theme.palette.text.primary, 0.4) }, theme.typography.caption));
|
|
37
|
-
});
|
|
38
|
-
var ContainerStyled = styled(Box)(function (_a) {
|
|
39
|
-
var theme = _a.theme;
|
|
40
|
-
return ({
|
|
41
|
-
display: 'flex',
|
|
42
|
-
flexDirection: 'row',
|
|
43
|
-
alignItems: 'center',
|
|
44
|
-
padding: theme.spacing(0, 0.5, 0, 0.5),
|
|
45
|
-
height: theme.spacing(3.625),
|
|
46
|
-
marginBlockEnd: theme.spacing(0.2)
|
|
47
|
-
});
|
|
48
|
-
});
|
|
49
|
-
var TextStyled = styled(Text)(function (_a) {
|
|
50
|
-
var theme = _a.theme;
|
|
51
|
-
return (__assign(__assign({ color: alpha(theme.palette.text.primary, 0.4), fontWeight: theme.typography.fontWeightLight, whiteSpace: 'pre' }, theme.typography.body2), { marginBlockStart: theme.spacing(1.75) }));
|
|
52
|
-
});
|
|
53
|
-
var CheckBoxStyled = styled(CheckBox)(function (_a) {
|
|
54
|
-
var theme = _a.theme;
|
|
55
|
-
return ({
|
|
56
|
-
marginInlineEnd: theme.spacing(-1),
|
|
57
|
-
'& .MuiSvgIcon-root': {
|
|
58
|
-
fontSize: 30
|
|
59
|
-
},
|
|
60
|
-
'&.Mui-checked': {
|
|
61
|
-
color: theme.palette.text.primary,
|
|
62
|
-
borderRadius: theme.spacing(2.5)
|
|
63
|
-
}
|
|
64
|
-
});
|
|
65
|
-
});
|
|
66
13
|
export var MandatoryStyled = styled('span')(function (_a) {
|
|
67
14
|
var theme = _a.theme;
|
|
68
15
|
return (__assign(__assign({ color: alpha(theme.palette.error.light, 0.4) }, theme.typography.h6), { fontWeight: theme.typography.fontWeightLight, verticalAlign: 'sub' }));
|
|
69
16
|
});
|
|
70
|
-
export var CollapseStyled = styled(Collapse)(function (_a) {
|
|
71
|
-
var theme = _a.theme;
|
|
72
|
-
return ({
|
|
73
|
-
marginBlockStart: theme.spacing(2)
|
|
74
|
-
});
|
|
75
|
-
});
|
|
76
|
-
var SalesChannels = function () {
|
|
77
|
-
var _a;
|
|
78
|
-
var _b = React.useState([]), channelsMenuList = _b[0], setChannelsMenuList = _b[1];
|
|
79
|
-
var t = useTranslation().t;
|
|
80
|
-
var isAr = useLanguage().isAr;
|
|
81
|
-
var control = useFormContext().control;
|
|
82
|
-
var dispatch = useAppDispatch();
|
|
83
|
-
var channelsControl = useController({ name: 'salesChannels', control: control });
|
|
84
|
-
var channelsChecked = channelsControl.field.value;
|
|
85
|
-
var warningMessage = (_a = channelsControl.fieldState.error) === null || _a === void 0 ? void 0 : _a.message;
|
|
86
|
-
var _c = useAppSelector(businessSelector), data = _c.data, error = _c.error;
|
|
87
|
-
var channelList = (data.businessTypeData.responseBody || {}).channelList;
|
|
88
|
-
var salesChannels = (data.activitiesData || {}).salesChannels;
|
|
89
|
-
React.useEffect(function () {
|
|
90
|
-
if ((channelList === null || channelList === void 0 ? void 0 : channelList.length) > 0) {
|
|
91
|
-
setChannelsMenuList(channelList);
|
|
92
|
-
}
|
|
93
|
-
}, [channelList]);
|
|
94
|
-
var handleSalesChannelChange = function (event, checked) {
|
|
95
|
-
var selected = channelsMenuList.find(function (channel) { return channel.id === event.target.id; });
|
|
96
|
-
var isExists = channelsChecked === null || channelsChecked === void 0 ? void 0 : channelsChecked.find(function (channel) { return channel.id === (selected === null || selected === void 0 ? void 0 : selected.id); });
|
|
97
|
-
if (isExists) {
|
|
98
|
-
var updatedIdList = channelsChecked === null || channelsChecked === void 0 ? void 0 : channelsChecked.filter(function (channel) { return channel.id !== (selected === null || selected === void 0 ? void 0 : selected.id); });
|
|
99
|
-
channelsControl.field.onChange(updatedIdList);
|
|
100
|
-
return;
|
|
101
|
-
}
|
|
102
|
-
channelsControl.field.onChange(__spreadArray(__spreadArray([], channelsChecked, true), [selected], false));
|
|
103
|
-
if (error)
|
|
104
|
-
dispatch(clearError());
|
|
105
|
-
};
|
|
106
|
-
var getSelectedChannelsFlag = function (item) {
|
|
107
|
-
if (channelsChecked)
|
|
108
|
-
return !!(channelsChecked === null || channelsChecked === void 0 ? void 0 : channelsChecked.find(function (channel) { return channel.id === (item === null || item === void 0 ? void 0 : item.id); }));
|
|
109
|
-
};
|
|
110
|
-
return (_jsxs(ScreenContainer, { children: [_jsxs(InputLabelStyled, { children: [t('channel_of_service'), " ", _jsx(MandatoryStyled, { children: "*" })] }), channelsMenuList.map(function (channel) { return (_jsxs(ContainerStyled, { children: [_jsx(CheckBoxStyled, { id: channel.id, disableRipple: true, disableFocusRipple: true, focusRipple: false, disabled: (salesChannels === null || salesChannels === void 0 ? void 0 : salesChannels.find(function (c) { return c.id === (channel === null || channel === void 0 ? void 0 : channel.id); })) ? true : false, checked: getSelectedChannelsFlag(channel), onChange: handleSalesChannelChange }), _jsxs(TextStyled, { children: [isAr ? channel.name.ar : channel.name.en, " "] })] }, channel.id)); }), _jsx(CollapseStyled, __assign({ in: !!warningMessage }, { children: _jsx(Warning, __assign({ warningType: 'alert' }, { children: t(warningMessage) })) }))] }));
|
|
111
|
-
};
|
|
112
|
-
export default SalesChannels;
|
|
@@ -16,23 +16,6 @@ export declare const ActivitiesValidationSchema: yup.ObjectSchema<import("yup/li
|
|
|
16
16
|
ar: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
17
17
|
en: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
18
18
|
}>>[] | undefined>;
|
|
19
|
-
salesChannels: import("yup/lib/array").RequiredArraySchema<yup.ObjectSchema<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
20
|
-
id: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
21
|
-
name_en: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
22
|
-
name_ar: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
23
|
-
}>, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
24
|
-
id: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
25
|
-
name_en: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
26
|
-
name_ar: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
27
|
-
}>>, import("yup/lib/object").AssertsShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
28
|
-
id: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
29
|
-
name_en: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
30
|
-
name_ar: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
31
|
-
}>>>, import("yup/lib/types").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
32
|
-
id: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
33
|
-
name_en: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
34
|
-
name_ar: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
35
|
-
}>>[] | undefined>;
|
|
36
19
|
operationStartDate: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
|
|
37
20
|
}>, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
38
21
|
activities: yup.ArraySchema<yup.ObjectSchema<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
@@ -51,23 +34,6 @@ export declare const ActivitiesValidationSchema: yup.ObjectSchema<import("yup/li
|
|
|
51
34
|
ar: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
52
35
|
en: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
53
36
|
}>>[] | undefined>;
|
|
54
|
-
salesChannels: import("yup/lib/array").RequiredArraySchema<yup.ObjectSchema<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
55
|
-
id: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
56
|
-
name_en: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
57
|
-
name_ar: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
58
|
-
}>, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
59
|
-
id: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
60
|
-
name_en: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
61
|
-
name_ar: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
62
|
-
}>>, import("yup/lib/object").AssertsShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
63
|
-
id: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
64
|
-
name_en: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
65
|
-
name_ar: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
66
|
-
}>>>, import("yup/lib/types").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
67
|
-
id: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
68
|
-
name_en: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
69
|
-
name_ar: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
70
|
-
}>>[] | undefined>;
|
|
71
37
|
operationStartDate: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
|
|
72
38
|
}>>, import("yup/lib/object").AssertsShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
73
39
|
activities: yup.ArraySchema<yup.ObjectSchema<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
@@ -86,22 +52,5 @@ export declare const ActivitiesValidationSchema: yup.ObjectSchema<import("yup/li
|
|
|
86
52
|
ar: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
87
53
|
en: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
88
54
|
}>>[] | undefined>;
|
|
89
|
-
salesChannels: import("yup/lib/array").RequiredArraySchema<yup.ObjectSchema<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
90
|
-
id: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
91
|
-
name_en: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
92
|
-
name_ar: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
93
|
-
}>, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
94
|
-
id: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
95
|
-
name_en: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
96
|
-
name_ar: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
97
|
-
}>>, import("yup/lib/object").AssertsShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
98
|
-
id: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
99
|
-
name_en: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
100
|
-
name_ar: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
101
|
-
}>>>, import("yup/lib/types").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
102
|
-
id: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
103
|
-
name_en: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
104
|
-
name_ar: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
105
|
-
}>>[] | undefined>;
|
|
106
55
|
operationStartDate: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
|
|
107
56
|
}>>>;
|
|
@@ -4,14 +4,5 @@ export var ActivitiesValidationSchema = yup.object().shape({
|
|
|
4
4
|
ar: yup.string(),
|
|
5
5
|
en: yup.string()
|
|
6
6
|
})),
|
|
7
|
-
salesChannels: yup
|
|
8
|
-
.array()
|
|
9
|
-
.min(1, 'choose_atleast_one_channel')
|
|
10
|
-
.of(yup.object().shape({
|
|
11
|
-
id: yup.string(),
|
|
12
|
-
name_en: yup.string(),
|
|
13
|
-
name_ar: yup.string()
|
|
14
|
-
}))
|
|
15
|
-
.required('choose_atleast_one_channel'),
|
|
16
7
|
operationStartDate: yup.string().required('choose_any_business_date')
|
|
17
8
|
});
|
|
@@ -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 = {
|
|
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.
|
|
115
|
-
var storedActivity = storedActivities === null || storedActivities === void 0 ? void 0 : storedActivities.find(function (activity) { return activity.
|
|
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.
|
|
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.
|
|
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
|
-
|
|
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;
|