@tap-payments/auth-jsconnect 2.4.70-test → 2.4.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.
- package/build/@types/app.d.ts +1 -0
- package/build/@types/form.d.ts +5 -3
- package/build/assets/locales/ar.json +3 -3
- package/build/constants/app.d.ts +2 -0
- package/build/constants/app.js +23 -9
- package/build/features/app/brand/brandStore.d.ts +19 -9
- package/build/features/app/brand/brandStore.js +141 -126
- package/build/features/app/connect/connectStore.d.ts +15 -1
- package/build/features/app/connect/connectStore.js +146 -83
- package/build/features/brand/screens/BrandInfo/BrandInfo.js +14 -51
- package/build/features/brand/screens/BrandInfo/BrandLogo.d.ts +1 -2
- package/build/features/brand/screens/BrandInfo/BrandLogo.js +2 -14
- package/build/features/brand/screens/BrandInfo/BrandName.d.ts +1 -2
- package/build/features/brand/screens/BrandInfo/BrandName.js +2 -3
- package/build/features/brand/screens/BrandInfo/validation.d.ts +0 -12
- package/build/features/brand/screens/BrandInfo/validation.js +0 -4
- package/build/features/brand/screens/BrandSegmentInfo/BrandSegmentInfo.d.ts +5 -0
- package/build/features/brand/screens/BrandSegmentInfo/BrandSegmentInfo.js +102 -0
- package/build/features/brand/screens/BrandSegmentInfo/index.d.ts +2 -0
- package/build/features/brand/screens/BrandSegmentInfo/index.js +2 -0
- package/build/features/brand/screens/BrandSegmentInfo/validation.d.ts +17 -0
- package/build/features/brand/screens/BrandSegmentInfo/validation.js +9 -0
- package/build/features/connect/screens/BrandSegment/BrandSegment.d.ts +5 -0
- package/build/features/connect/screens/BrandSegment/BrandSegment.js +84 -0
- package/build/features/connect/screens/{Merchant → BrandSegment}/SegmentLocations.js +1 -1
- package/build/features/connect/screens/{Merchant → BrandSegment}/SegmentProfits.js +1 -1
- package/build/features/connect/screens/{Merchant → BrandSegment}/SegmentTechs.js +1 -1
- package/build/features/connect/screens/{Merchant → BrandSegment}/TeamSize.js +1 -1
- package/build/features/connect/screens/BrandSegment/index.d.ts +3 -0
- package/build/features/connect/screens/BrandSegment/index.js +2 -0
- package/build/features/connect/screens/BrandSegment/validation.d.ts +17 -0
- package/build/features/connect/screens/BrandSegment/validation.js +9 -0
- package/build/features/connect/screens/Merchant/BrandList.js +2 -25
- package/build/features/connect/screens/Merchant/Merchant.js +4 -25
- package/build/features/connect/screens/Merchant/validation.d.ts +0 -12
- package/build/features/connect/screens/Merchant/validation.js +0 -8
- package/build/features/featuresScreens.js +10 -0
- package/package.json +1 -1
- /package/build/features/brand/screens/{BrandInfo → BrandSegmentInfo}/SegmentLocations.d.ts +0 -0
- /package/build/features/brand/screens/{BrandInfo → BrandSegmentInfo}/SegmentLocations.js +0 -0
- /package/build/features/brand/screens/{BrandInfo → BrandSegmentInfo}/SegmentProfits.d.ts +0 -0
- /package/build/features/brand/screens/{BrandInfo → BrandSegmentInfo}/SegmentProfits.js +0 -0
- /package/build/features/brand/screens/{BrandInfo → BrandSegmentInfo}/SegmentTechs.d.ts +0 -0
- /package/build/features/brand/screens/{BrandInfo → BrandSegmentInfo}/SegmentTechs.js +0 -0
- /package/build/features/brand/screens/{BrandInfo → BrandSegmentInfo}/TeamSize.d.ts +0 -0
- /package/build/features/brand/screens/{BrandInfo → BrandSegmentInfo}/TeamSize.js +0 -0
- /package/build/features/connect/screens/{Merchant → BrandSegment}/SegmentLocations.d.ts +0 -0
- /package/build/features/connect/screens/{Merchant → BrandSegment}/SegmentProfits.d.ts +0 -0
- /package/build/features/connect/screens/{Merchant → BrandSegment}/SegmentTechs.d.ts +0 -0
- /package/build/features/connect/screens/{Merchant → BrandSegment}/TeamSize.d.ts +0 -0
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
12
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
|
+
import React from 'react';
|
|
14
|
+
import { useTranslation } from 'react-i18next';
|
|
15
|
+
import { FormProvider, useForm } from 'react-hook-form';
|
|
16
|
+
import { styled } from '@mui/material/styles';
|
|
17
|
+
import { useAppDispatch, useAppSelector, useDataNoneEditable, useFormReadOnly, useLanguage, useSetFromDefaultValues, useFormErrorAndUpdateReadOnly, useExcludeReadOnlyFelids, useDataVerified } from '../../../../hooks';
|
|
18
|
+
import { handlePrevScreenStep } from '../../../../app/settings';
|
|
19
|
+
import { yupResolver } from '@hookform/resolvers/yup';
|
|
20
|
+
import Collapse from '../../../../components/Collapse';
|
|
21
|
+
import Form from '../../../../components/Form';
|
|
22
|
+
import { ScreenContainer } from '../../../shared/Containers';
|
|
23
|
+
import { clearError, brandSelector, updateSegmentBrand } from '../../../app/brand/brandStore';
|
|
24
|
+
import Button from '../../../shared/Button';
|
|
25
|
+
import SegmentLocations from './SegmentLocations';
|
|
26
|
+
import SegmentProfits from './SegmentProfits';
|
|
27
|
+
import SegmentTechs from './SegmentTechs';
|
|
28
|
+
import { BrandValidationSchema } from './validation';
|
|
29
|
+
import TeamSize from './TeamSize';
|
|
30
|
+
var FormStyled = styled(Form)(function () { return ({
|
|
31
|
+
display: 'flex',
|
|
32
|
+
flexDirection: 'column'
|
|
33
|
+
}); });
|
|
34
|
+
var ListType;
|
|
35
|
+
(function (ListType) {
|
|
36
|
+
ListType["TeamSizeList"] = "TeamSizeList";
|
|
37
|
+
ListType["SegmentLocationList"] = "SegmentLocationList";
|
|
38
|
+
ListType["SegmentProfitList"] = "SegmentProfitList";
|
|
39
|
+
ListType["SegmentTechList"] = "SegmentTechList";
|
|
40
|
+
})(ListType || (ListType = {}));
|
|
41
|
+
var BrandInfo = function (_a) {
|
|
42
|
+
var _b, _c, _d, _e, _f, _g, _h, _j;
|
|
43
|
+
var _k = React.useState(), listActive = _k[0], setListActive = _k[1];
|
|
44
|
+
var dispatch = useAppDispatch();
|
|
45
|
+
var t = useTranslation().t;
|
|
46
|
+
var isAr = useLanguage().isAr;
|
|
47
|
+
var _l = useAppSelector(brandSelector), data = _l.data, loading = _l.loading, error = _l.error;
|
|
48
|
+
var _m = data.brandSegmentData, segmentLocation = _m.segmentLocation, segmentProfit = _m.segmentProfit, segmentTech = _m.segmentTech, teamSize = _m.teamSize;
|
|
49
|
+
var brand = (data.verify.responseBody || {}).brand;
|
|
50
|
+
var _o = brand || {}, data_status = _o.data_status, data_verification = _o.data_verification, resSegment = _o.segment;
|
|
51
|
+
var methods = useForm({
|
|
52
|
+
resolver: yupResolver(BrandValidationSchema()),
|
|
53
|
+
defaultValues: {
|
|
54
|
+
segmentLocation: segmentLocation,
|
|
55
|
+
segmentProfit: segmentProfit,
|
|
56
|
+
segmentTech: segmentTech,
|
|
57
|
+
teamSize: teamSize
|
|
58
|
+
},
|
|
59
|
+
mode: 'onChange'
|
|
60
|
+
});
|
|
61
|
+
var watch = methods.watch;
|
|
62
|
+
useSetFromDefaultValues(methods, data.brandSegmentData, true);
|
|
63
|
+
var originalReadOnly = useFormReadOnly(methods);
|
|
64
|
+
var noneEditable = useDataNoneEditable(data_status, [
|
|
65
|
+
'segment.location_type',
|
|
66
|
+
'segment.profit_type',
|
|
67
|
+
'segment.tech_type',
|
|
68
|
+
'segment.teams'
|
|
69
|
+
]);
|
|
70
|
+
var readOnly = useFormErrorAndUpdateReadOnly(methods, originalReadOnly, noneEditable);
|
|
71
|
+
var dataVerified = useDataVerified(data_verification, [
|
|
72
|
+
'segment.location_type',
|
|
73
|
+
'segment.profit_type',
|
|
74
|
+
'segment.tech_type',
|
|
75
|
+
'segment.teams'
|
|
76
|
+
]);
|
|
77
|
+
var getFelids = useExcludeReadOnlyFelids(methods, readOnly).getFelids;
|
|
78
|
+
var isSegmentLocationVerified = dataVerified['segment.location_type'] && ((_b = resSegment === null || resSegment === void 0 ? void 0 : resSegment.location_type) === null || _b === void 0 ? void 0 : _b.id) === ((_c = watch('segmentLocation')) === null || _c === void 0 ? void 0 : _c.id);
|
|
79
|
+
var isSegmentProfitVerified = dataVerified['segment.profit_type'] && ((_d = resSegment === null || resSegment === void 0 ? void 0 : resSegment.profit_type) === null || _d === void 0 ? void 0 : _d.id) === ((_e = watch('segmentProfit')) === null || _e === void 0 ? void 0 : _e.id);
|
|
80
|
+
var isSegmentTechVerified = dataVerified['segment.tech_type'] && ((_f = resSegment === null || resSegment === void 0 ? void 0 : resSegment.tech_type) === null || _f === void 0 ? void 0 : _f.id) === ((_g = watch('segmentTech')) === null || _g === void 0 ? void 0 : _g.id);
|
|
81
|
+
var isTeamSizeVerified = dataVerified['segment.teams'] && ((_h = resSegment === null || resSegment === void 0 ? void 0 : resSegment.team) === null || _h === void 0 ? void 0 : _h.id) === ((_j = watch('teamSize')) === null || _j === void 0 ? void 0 : _j.id);
|
|
82
|
+
var onSubmit = function (data) {
|
|
83
|
+
dispatch(updateSegmentBrand(getFelids(data)));
|
|
84
|
+
};
|
|
85
|
+
var onBack = function () {
|
|
86
|
+
dispatch(handlePrevScreenStep());
|
|
87
|
+
};
|
|
88
|
+
React.useEffect(function () {
|
|
89
|
+
if (error)
|
|
90
|
+
dispatch(clearError());
|
|
91
|
+
}, [methods.formState.isValid]);
|
|
92
|
+
var disabled = !methods.formState.isValid || !!error;
|
|
93
|
+
var handleMenuClick = function (flag) {
|
|
94
|
+
setListActive(flag);
|
|
95
|
+
};
|
|
96
|
+
var isSegmentLocationListActive = listActive === ListType.SegmentLocationList;
|
|
97
|
+
var isSegmentProfitListActive = listActive === ListType.SegmentProfitList;
|
|
98
|
+
var isSegmentTechListActive = listActive === ListType.SegmentTechList;
|
|
99
|
+
var isTeamSizeListActive = listActive === ListType.TeamSizeList;
|
|
100
|
+
return (_jsx(ScreenContainer, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(FormStyled, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsx(SegmentLocations, { readOnly: readOnly['segmentLocation'], show: !isTeamSizeListActive && !isSegmentProfitListActive && !isSegmentTechListActive, onListOpen: function () { return handleMenuClick(ListType.SegmentLocationList); }, onListClose: function () { return handleMenuClick(); }, isVerified: isSegmentLocationVerified }), _jsx(SegmentProfits, { readOnly: readOnly['segmentProfit'], show: !isTeamSizeListActive && !isSegmentLocationListActive && !isSegmentTechListActive, onListOpen: function () { return handleMenuClick(ListType.SegmentProfitList); }, onListClose: function () { return handleMenuClick(); }, isVerified: isSegmentProfitVerified }), _jsx(SegmentTechs, { readOnly: readOnly['segmentTech'], show: !isTeamSizeListActive && !isSegmentLocationListActive && !isSegmentProfitListActive, onListOpen: function () { return handleMenuClick(ListType.SegmentTechList); }, onListClose: function () { return handleMenuClick(); }, isVerified: isSegmentTechVerified }), _jsx(TeamSize, { readOnly: readOnly['teamSize'] || noneEditable['segment.teams'], show: !isSegmentLocationListActive && !isSegmentProfitListActive && !isSegmentTechListActive, onListOpen: function () { return handleMenuClick(ListType.TeamSizeList); }, onListClose: function () { return handleMenuClick(); }, isVerified: isTeamSizeVerified }), _jsx(Collapse, __assign({ in: !listActive }, { children: _jsx(Button, __assign({ onBackClicked: function () { return onBack(); }, disabled: disabled, isAr: isAr, error: t(error || ''), loading: loading }, { children: t('next') })) }))] })) })) }));
|
|
101
|
+
};
|
|
102
|
+
export default BrandInfo;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import * as yup from 'yup';
|
|
2
|
+
export declare const BrandValidationSchema: () => yup.ObjectSchema<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
3
|
+
segmentLocation: import("yup/lib/object").RequiredObjectSchema<import("yup/lib/object").ObjectShape, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").ObjectShape>>;
|
|
4
|
+
segmentTech: import("yup/lib/object").RequiredObjectSchema<import("yup/lib/object").ObjectShape, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").ObjectShape>>;
|
|
5
|
+
segmentProfit: import("yup/lib/object").RequiredObjectSchema<import("yup/lib/object").ObjectShape, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").ObjectShape>>;
|
|
6
|
+
teamSize: import("yup/lib/object").RequiredObjectSchema<import("yup/lib/object").ObjectShape, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").ObjectShape>>;
|
|
7
|
+
}>, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
8
|
+
segmentLocation: import("yup/lib/object").RequiredObjectSchema<import("yup/lib/object").ObjectShape, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").ObjectShape>>;
|
|
9
|
+
segmentTech: import("yup/lib/object").RequiredObjectSchema<import("yup/lib/object").ObjectShape, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").ObjectShape>>;
|
|
10
|
+
segmentProfit: import("yup/lib/object").RequiredObjectSchema<import("yup/lib/object").ObjectShape, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").ObjectShape>>;
|
|
11
|
+
teamSize: import("yup/lib/object").RequiredObjectSchema<import("yup/lib/object").ObjectShape, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").ObjectShape>>;
|
|
12
|
+
}>>, import("yup/lib/object").AssertsShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
13
|
+
segmentLocation: import("yup/lib/object").RequiredObjectSchema<import("yup/lib/object").ObjectShape, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").ObjectShape>>;
|
|
14
|
+
segmentTech: import("yup/lib/object").RequiredObjectSchema<import("yup/lib/object").ObjectShape, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").ObjectShape>>;
|
|
15
|
+
segmentProfit: import("yup/lib/object").RequiredObjectSchema<import("yup/lib/object").ObjectShape, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").ObjectShape>>;
|
|
16
|
+
teamSize: import("yup/lib/object").RequiredObjectSchema<import("yup/lib/object").ObjectShape, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").ObjectShape>>;
|
|
17
|
+
}>>>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import * as yup from 'yup';
|
|
2
|
+
export var BrandValidationSchema = function () {
|
|
3
|
+
return yup.object().shape({
|
|
4
|
+
segmentLocation: yup.object().required('alert_choose_segment_location'),
|
|
5
|
+
segmentTech: yup.object().required('alert_choose_segment_tech'),
|
|
6
|
+
segmentProfit: yup.object().required('alert_choose_segment_profit'),
|
|
7
|
+
teamSize: yup.object().required('alert_choose_teamSize')
|
|
8
|
+
});
|
|
9
|
+
};
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
12
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
|
+
import * as React from 'react';
|
|
14
|
+
import { useForm, FormProvider } from 'react-hook-form';
|
|
15
|
+
import { useTranslation } from 'react-i18next';
|
|
16
|
+
import Collapse from '@mui/material/Collapse';
|
|
17
|
+
import { yupResolver } from '@hookform/resolvers/yup';
|
|
18
|
+
import { useAppDispatch, useAppSelector } from '../../../../hooks';
|
|
19
|
+
import { handlePrevScreenStep } from '../../../../app/settings';
|
|
20
|
+
import { sendCustomEventToGTM } from '../../../../utils';
|
|
21
|
+
import Form from '../../../../components/Form';
|
|
22
|
+
import { ScreenContainer } from '../../../shared/Containers';
|
|
23
|
+
import Button from '../../../shared/Button';
|
|
24
|
+
import { clearError, connectSelector, updateLeadBrandSegment } from '../../../app/connect/connectStore';
|
|
25
|
+
import { useLanguage } from '../../../../hooks';
|
|
26
|
+
import { BrandSegmentValidationSchema } from './validation';
|
|
27
|
+
import SegmentLocations from './SegmentLocations';
|
|
28
|
+
import SegmentProfits from './SegmentProfits';
|
|
29
|
+
import SegmentTechs from './SegmentTechs';
|
|
30
|
+
import TeamSize from './TeamSize';
|
|
31
|
+
var ListType;
|
|
32
|
+
(function (ListType) {
|
|
33
|
+
ListType["SegmentLocationList"] = "SegmentLocationList";
|
|
34
|
+
ListType["SegmentProfitList"] = "SegmentProfitList";
|
|
35
|
+
ListType["SegmentTechList"] = "SegmentTechList";
|
|
36
|
+
ListType["TeamSizeList"] = "TeamSizeList";
|
|
37
|
+
ListType["BrandList"] = "BrandList";
|
|
38
|
+
ListType["BusinessList"] = "BusinessList";
|
|
39
|
+
})(ListType || (ListType = {}));
|
|
40
|
+
var BrandSegment = function (_a) {
|
|
41
|
+
var _b = useAppSelector(connectSelector), data = _b.data, loading = _b.loading, error = _b.error;
|
|
42
|
+
var _c = data.brandSegmentData, segmentLocation = _c.segmentLocation, segmentProfit = _c.segmentProfit, segmentTech = _c.segmentTech, teamSize = _c.teamSize;
|
|
43
|
+
var _d = React.useState(), listActive = _d[0], setListActive = _d[1];
|
|
44
|
+
React.useEffect(function () {
|
|
45
|
+
sendCustomEventToGTM({
|
|
46
|
+
event: 'Send Event',
|
|
47
|
+
event_category: 'User Registration Flow',
|
|
48
|
+
event_action: 'Brand Segment Details Step'
|
|
49
|
+
});
|
|
50
|
+
}, []);
|
|
51
|
+
var methods = useForm({
|
|
52
|
+
resolver: yupResolver(BrandSegmentValidationSchema()),
|
|
53
|
+
defaultValues: {
|
|
54
|
+
segmentLocation: segmentLocation,
|
|
55
|
+
segmentProfit: segmentProfit,
|
|
56
|
+
segmentTech: segmentTech,
|
|
57
|
+
teamSize: teamSize
|
|
58
|
+
},
|
|
59
|
+
mode: 'onChange'
|
|
60
|
+
});
|
|
61
|
+
var t = useTranslation().t;
|
|
62
|
+
var isAr = useLanguage().isAr;
|
|
63
|
+
var dispatch = useAppDispatch();
|
|
64
|
+
var onSubmit = function (formData) {
|
|
65
|
+
dispatch(updateLeadBrandSegment(formData));
|
|
66
|
+
};
|
|
67
|
+
var onBack = function () {
|
|
68
|
+
dispatch(handlePrevScreenStep());
|
|
69
|
+
};
|
|
70
|
+
React.useEffect(function () {
|
|
71
|
+
if (error)
|
|
72
|
+
dispatch(clearError());
|
|
73
|
+
}, [methods.formState.isValid]);
|
|
74
|
+
var disabled = !methods.formState.isValid || !!error;
|
|
75
|
+
var handleMenuClick = function (flag) {
|
|
76
|
+
setListActive(flag);
|
|
77
|
+
};
|
|
78
|
+
var isSegmentLocationListActive = listActive === ListType.SegmentLocationList;
|
|
79
|
+
var isSegmentProfitListActive = listActive === ListType.SegmentProfitList;
|
|
80
|
+
var isSegmentTechListActive = listActive === ListType.SegmentTechList;
|
|
81
|
+
var isTeamSizeListActive = listActive === ListType.TeamSizeList;
|
|
82
|
+
return (_jsx(ScreenContainer, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(Form, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsx(SegmentLocations, { show: !isTeamSizeListActive && !isSegmentProfitListActive && !isSegmentTechListActive, onListOpen: function () { return handleMenuClick(ListType.SegmentLocationList); }, onListClose: function () { return handleMenuClick(); } }), _jsx(SegmentProfits, { show: !isTeamSizeListActive && !isSegmentLocationListActive && !isSegmentTechListActive, onListOpen: function () { return handleMenuClick(ListType.SegmentProfitList); }, onListClose: function () { return handleMenuClick(); } }), _jsx(SegmentTechs, { show: !isTeamSizeListActive && !isSegmentLocationListActive && !isSegmentProfitListActive, onListOpen: function () { return handleMenuClick(ListType.SegmentTechList); }, onListClose: function () { return handleMenuClick(); } }), _jsx(TeamSize, { show: !isSegmentLocationListActive && !isSegmentProfitListActive && !isSegmentTechListActive, onListOpen: function () { return handleMenuClick(ListType.TeamSizeList); }, onListClose: function () { return handleMenuClick(); } }), _jsx(Collapse, __assign({ in: !listActive, timeout: 500 }, { children: _jsx(Button, __assign({ onBackClicked: function () { return onBack(); }, disabled: disabled, isAr: isAr, error: t(error || ''), loading: loading }, { children: t('next') })) }))] })) })) }));
|
|
83
|
+
};
|
|
84
|
+
export default React.memo(BrandSegment);
|
|
@@ -37,7 +37,7 @@ var SegmentLocations = function (_a) {
|
|
|
37
37
|
var isAr = useLanguage().isAr;
|
|
38
38
|
var data = useAppSelector(connectSelector).data;
|
|
39
39
|
var control = useFormContext().control;
|
|
40
|
-
var segmentLocationList = ((_b = data.
|
|
40
|
+
var segmentLocationList = ((_b = data.brandSegmentData.responseBody) === null || _b === void 0 ? void 0 : _b.segment_location_list) || [];
|
|
41
41
|
var segmentControl = useController({ control: control, name: 'segmentLocation' });
|
|
42
42
|
var segment = segmentControl.field.value;
|
|
43
43
|
var error = (_c = segmentControl.fieldState.error) === null || _c === void 0 ? void 0 : _c.message;
|
|
@@ -37,7 +37,7 @@ var SegmentProfits = function (_a) {
|
|
|
37
37
|
var isAr = useLanguage().isAr;
|
|
38
38
|
var data = useAppSelector(connectSelector).data;
|
|
39
39
|
var control = useFormContext().control;
|
|
40
|
-
var segmentProfitList = ((_b = data.
|
|
40
|
+
var segmentProfitList = ((_b = data.brandSegmentData.responseBody) === null || _b === void 0 ? void 0 : _b.segment_profit_list) || [];
|
|
41
41
|
var segmentControl = useController({ control: control, name: 'segmentProfit' });
|
|
42
42
|
var segment = segmentControl.field.value;
|
|
43
43
|
var error = (_c = segmentControl.fieldState.error) === null || _c === void 0 ? void 0 : _c.message;
|
|
@@ -37,7 +37,7 @@ var SegmentTechs = function (_a) {
|
|
|
37
37
|
var isAr = useLanguage().isAr;
|
|
38
38
|
var data = useAppSelector(connectSelector).data;
|
|
39
39
|
var control = useFormContext().control;
|
|
40
|
-
var segmentTechList = ((_b = data.
|
|
40
|
+
var segmentTechList = ((_b = data.brandSegmentData.responseBody) === null || _b === void 0 ? void 0 : _b.segment_tech_list) || [];
|
|
41
41
|
var segmentControl = useController({ control: control, name: 'segmentTech' });
|
|
42
42
|
var segment = segmentControl.field.value;
|
|
43
43
|
var error = (_c = segmentControl.fieldState.error) === null || _c === void 0 ? void 0 : _c.message;
|
|
@@ -37,7 +37,7 @@ var TeamSize = function (_a) {
|
|
|
37
37
|
var isAr = useLanguage().isAr;
|
|
38
38
|
var data = useAppSelector(connectSelector).data;
|
|
39
39
|
var control = useFormContext().control;
|
|
40
|
-
var teamSizesList = ((_b = data.
|
|
40
|
+
var teamSizesList = ((_b = data.brandSegmentData.responseBody) === null || _b === void 0 ? void 0 : _b.team_size_list) || [];
|
|
41
41
|
var teamSizeControl = useController({ control: control, name: 'teamSize' });
|
|
42
42
|
var teamSize = teamSizeControl.field.value;
|
|
43
43
|
var error = (_c = teamSizeControl.fieldState.error) === null || _c === void 0 ? void 0 : _c.message;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import * as yup from 'yup';
|
|
2
|
+
export declare const BrandSegmentValidationSchema: () => yup.ObjectSchema<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
3
|
+
segmentLocation: import("yup/lib/object").RequiredObjectSchema<import("yup/lib/object").ObjectShape, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").ObjectShape>>;
|
|
4
|
+
segmentProfit: import("yup/lib/object").RequiredObjectSchema<import("yup/lib/object").ObjectShape, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").ObjectShape>>;
|
|
5
|
+
segmentTech: import("yup/lib/object").RequiredObjectSchema<import("yup/lib/object").ObjectShape, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").ObjectShape>>;
|
|
6
|
+
teamSize: import("yup/lib/object").RequiredObjectSchema<import("yup/lib/object").ObjectShape, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").ObjectShape>>;
|
|
7
|
+
}>, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
8
|
+
segmentLocation: import("yup/lib/object").RequiredObjectSchema<import("yup/lib/object").ObjectShape, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").ObjectShape>>;
|
|
9
|
+
segmentProfit: import("yup/lib/object").RequiredObjectSchema<import("yup/lib/object").ObjectShape, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").ObjectShape>>;
|
|
10
|
+
segmentTech: import("yup/lib/object").RequiredObjectSchema<import("yup/lib/object").ObjectShape, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").ObjectShape>>;
|
|
11
|
+
teamSize: import("yup/lib/object").RequiredObjectSchema<import("yup/lib/object").ObjectShape, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").ObjectShape>>;
|
|
12
|
+
}>>, import("yup/lib/object").AssertsShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
13
|
+
segmentLocation: import("yup/lib/object").RequiredObjectSchema<import("yup/lib/object").ObjectShape, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").ObjectShape>>;
|
|
14
|
+
segmentProfit: import("yup/lib/object").RequiredObjectSchema<import("yup/lib/object").ObjectShape, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").ObjectShape>>;
|
|
15
|
+
segmentTech: import("yup/lib/object").RequiredObjectSchema<import("yup/lib/object").ObjectShape, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").ObjectShape>>;
|
|
16
|
+
teamSize: import("yup/lib/object").RequiredObjectSchema<import("yup/lib/object").ObjectShape, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").ObjectShape>>;
|
|
17
|
+
}>>>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import * as yup from 'yup';
|
|
2
|
+
export var BrandSegmentValidationSchema = function () {
|
|
3
|
+
return yup.object().shape({
|
|
4
|
+
segmentLocation: yup.object().required('alert_choose_segment_location'),
|
|
5
|
+
segmentProfit: yup.object().required('alert_choose_segment_profit'),
|
|
6
|
+
segmentTech: yup.object().required('alert_choose_segment_tech'),
|
|
7
|
+
teamSize: yup.object().required('alert_choose_teamSize')
|
|
8
|
+
});
|
|
9
|
+
};
|
|
@@ -21,13 +21,12 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
21
21
|
return t;
|
|
22
22
|
};
|
|
23
23
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
24
|
-
import { connectSelector } from '../../../app/connect/connectStore';
|
|
25
24
|
import * as React from 'react';
|
|
26
25
|
import { useTranslation } from 'react-i18next';
|
|
27
26
|
import { useFormContext, useController } from 'react-hook-form';
|
|
28
27
|
import Box from '@mui/material/Box';
|
|
29
28
|
import { styled } from '@mui/material/styles';
|
|
30
|
-
import {
|
|
29
|
+
import { useLanguage } from '../../../../hooks';
|
|
31
30
|
import ScreenContainer from '../../../shared/Containers/ScreenContainer';
|
|
32
31
|
import InputSelect from '../../../shared/InputSelect';
|
|
33
32
|
import CheckIcon from '../../../shared/CheckIcon';
|
|
@@ -48,9 +47,7 @@ var BrandList = function (_a) {
|
|
|
48
47
|
var _b = React.useState(null), anchorEl = _b[0], setAnchorEl = _b[1];
|
|
49
48
|
var t = useTranslation().t;
|
|
50
49
|
var isAr = useLanguage().isAr;
|
|
51
|
-
var
|
|
52
|
-
var _c = data.individualData.responseBody || {}, segment_location_list = _c.segment_location_list, segment_profit_list = _c.segment_profit_list, segment_tech_list = _c.segment_tech_list, team_size_list = _c.team_size_list;
|
|
53
|
-
var _d = useFormContext(), control = _d.control, setValue = _d.setValue;
|
|
50
|
+
var _c = useFormContext(), control = _c.control, setValue = _c.setValue;
|
|
54
51
|
var selectedBrandControl = useController({ control: control, name: 'selectedBrandItem' });
|
|
55
52
|
var selectedBrand = selectedBrandControl.field.value;
|
|
56
53
|
var onOpenBrandList = function (event) {
|
|
@@ -82,26 +79,6 @@ var BrandList = function (_a) {
|
|
|
82
79
|
setValue('salesChannels', [], { shouldValidate: true });
|
|
83
80
|
setValue('brandName', '');
|
|
84
81
|
}
|
|
85
|
-
setValue('segmentLocation', segment_location_list.find(function (_a) {
|
|
86
|
-
var _b, _c;
|
|
87
|
-
var id = _a.id;
|
|
88
|
-
return ((_c = (_b = brand === null || brand === void 0 ? void 0 : brand.segment) === null || _b === void 0 ? void 0 : _b.location_type) === null || _c === void 0 ? void 0 : _c.id) === id;
|
|
89
|
-
}), { shouldValidate: true });
|
|
90
|
-
setValue('segmentProfit', segment_profit_list.find(function (_a) {
|
|
91
|
-
var _b, _c;
|
|
92
|
-
var id = _a.id;
|
|
93
|
-
return ((_c = (_b = brand === null || brand === void 0 ? void 0 : brand.segment) === null || _b === void 0 ? void 0 : _b.profit_type) === null || _c === void 0 ? void 0 : _c.id) === id;
|
|
94
|
-
}), { shouldValidate: true });
|
|
95
|
-
setValue('segmentTech', segment_tech_list.find(function (_a) {
|
|
96
|
-
var _b, _c;
|
|
97
|
-
var id = _a.id;
|
|
98
|
-
return ((_c = (_b = brand === null || brand === void 0 ? void 0 : brand.segment) === null || _b === void 0 ? void 0 : _b.tech_type) === null || _c === void 0 ? void 0 : _c.id) === id;
|
|
99
|
-
}), { shouldValidate: true });
|
|
100
|
-
setValue('teamSize', team_size_list.find(function (_a) {
|
|
101
|
-
var _b, _c;
|
|
102
|
-
var id = _a.id;
|
|
103
|
-
return ((_c = (_b = brand === null || brand === void 0 ? void 0 : brand.segment) === null || _b === void 0 ? void 0 : _b.team) === null || _c === void 0 ? void 0 : _c.id) === id;
|
|
104
|
-
}), { shouldValidate: true });
|
|
105
82
|
onCloseBrandList();
|
|
106
83
|
};
|
|
107
84
|
return (_jsx(Collapse, __assign({ in: show }, { children: _jsxs(ScreenContainer, { children: [_jsx(InputSelect, { label: t('select_brand_label'), onClick: !!anchorEl ? onCloseBrandList : onOpenBrandList, endAdornment: _jsx(ExpandIcon, { anchorEl: !!anchorEl }), placeholder: t('choose_brand'), value: t(getBrandName(selectedBrand)) }), _jsx(Collapse, __assign({ in: !!anchorEl }, { children: _jsx(SimpleList, { searchKeyPath: 'id', space: 140, list: list, onSelectItem: onSelectItem, renderItem: function (item) {
|
|
@@ -10,7 +10,6 @@ var __assign = (this && this.__assign) || function () {
|
|
|
10
10
|
return __assign.apply(this, arguments);
|
|
11
11
|
};
|
|
12
12
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
|
-
import TeamSize from '../../../connect/screens/Merchant/TeamSize';
|
|
14
13
|
import * as React from 'react';
|
|
15
14
|
import { useForm, FormProvider } from 'react-hook-form';
|
|
16
15
|
import { useTranslation } from 'react-i18next';
|
|
@@ -29,15 +28,8 @@ import BrandName from './BrandName';
|
|
|
29
28
|
import TAC from './TAC';
|
|
30
29
|
import BrandList from './BrandList';
|
|
31
30
|
import SalesChannels from './SalesChannels';
|
|
32
|
-
import SegmentLocations from './SegmentLocations';
|
|
33
|
-
import SegmentProfits from './SegmentProfits';
|
|
34
|
-
import SegmentTechs from './SegmentTechs';
|
|
35
31
|
var ListType;
|
|
36
32
|
(function (ListType) {
|
|
37
|
-
ListType["SegmentLocationList"] = "SegmentLocationList";
|
|
38
|
-
ListType["SegmentProfitList"] = "SegmentProfitList";
|
|
39
|
-
ListType["SegmentTechList"] = "SegmentTechList";
|
|
40
|
-
ListType["TeamSizeList"] = "TeamSizeList";
|
|
41
33
|
ListType["BrandList"] = "BrandList";
|
|
42
34
|
ListType["BusinessList"] = "BusinessList";
|
|
43
35
|
})(ListType || (ListType = {}));
|
|
@@ -46,7 +38,7 @@ var Merchant = function (_a) {
|
|
|
46
38
|
var _d = React.useState(false), brandNameChecking = _d[0], setBrandNameChecking = _d[1];
|
|
47
39
|
var _e = React.useState(false), isRequiredNewBrand = _e[0], setIsRequiredNewBrand = _e[1];
|
|
48
40
|
var _f = useAppSelector(connectSelector), data = _f.data, loading = _f.loading, error = _f.error;
|
|
49
|
-
var _g = data.brandData, brandName = _g.brandName, selectedBrandItem = _g.selectedBrandItem, termAndConditionChecked = _g.termAndConditionChecked, responseBody = _g.responseBody, salesChannels = _g.salesChannels
|
|
41
|
+
var _g = data.brandData, brandName = _g.brandName, selectedBrandItem = _g.selectedBrandItem, termAndConditionChecked = _g.termAndConditionChecked, responseBody = _g.responseBody, salesChannels = _g.salesChannels;
|
|
50
42
|
var brandList = (responseBody || {}).brand_list;
|
|
51
43
|
var _h = React.useState(), listActive = _h[0], setListActive = _h[1];
|
|
52
44
|
React.useEffect(function () {
|
|
@@ -62,11 +54,7 @@ var Merchant = function (_a) {
|
|
|
62
54
|
brandName: brandName || ((_b = selectedBrandItem === null || selectedBrandItem === void 0 ? void 0 : selectedBrandItem.name) === null || _b === void 0 ? void 0 : _b.en),
|
|
63
55
|
selectedBrandItem: selectedBrandItem,
|
|
64
56
|
termAndConditionChecked: termAndConditionChecked,
|
|
65
|
-
salesChannels: salesChannels
|
|
66
|
-
segmentLocation: segmentLocation,
|
|
67
|
-
segmentProfit: segmentProfit,
|
|
68
|
-
segmentTech: segmentTech,
|
|
69
|
-
teamSize: teamSize
|
|
57
|
+
salesChannels: salesChannels
|
|
70
58
|
},
|
|
71
59
|
mode: 'onChange'
|
|
72
60
|
});
|
|
@@ -81,13 +69,9 @@ var Merchant = function (_a) {
|
|
|
81
69
|
dispatch(handlePrevScreenStep('CONNECT_INDIVIDUAL_STEP'));
|
|
82
70
|
};
|
|
83
71
|
React.useEffect(function () {
|
|
84
|
-
methods.setValue('segmentLocation', segmentLocation);
|
|
85
|
-
methods.setValue('segmentProfit', segmentProfit);
|
|
86
|
-
methods.setValue('segmentTech', segmentTech);
|
|
87
|
-
methods.setValue('teamSize', teamSize);
|
|
88
72
|
if (brandName)
|
|
89
73
|
methods.trigger('brandName');
|
|
90
|
-
}, [
|
|
74
|
+
}, [brandName]);
|
|
91
75
|
React.useEffect(function () {
|
|
92
76
|
if (error)
|
|
93
77
|
dispatch(clearError());
|
|
@@ -111,11 +95,6 @@ var Merchant = function (_a) {
|
|
|
111
95
|
var handleMenuClick = function (flag) {
|
|
112
96
|
setListActive(flag);
|
|
113
97
|
};
|
|
114
|
-
|
|
115
|
-
var isSegmentProfitListActive = listActive === ListType.SegmentProfitList;
|
|
116
|
-
var isSegmentTechListActive = listActive === ListType.SegmentTechList;
|
|
117
|
-
var isTeamSizeListActive = listActive === ListType.TeamSizeList;
|
|
118
|
-
var isBrandListActive = listActive === ListType.BrandList;
|
|
119
|
-
return (_jsx(ScreenContainer, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(Form, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsx(BrandList, { show: hasBrandList && !isTeamSizeListActive && !isSegmentLocationListActive && !isSegmentProfitListActive && !isSegmentTechListActive, list: brandList, onListOpen: function () { return handleMenuClick(ListType.BrandList); }, onListClose: function () { return handleMenuClick(); } }), _jsx(BrandName, { show: (isNewBrand || isOtherBrand) && !listActive, brandNameChecking: brandNameChecking, fetchingBrandName: setBrandNameChecking }), _jsx(SegmentLocations, { show: !isTeamSizeListActive && !isBrandListActive && !isSegmentProfitListActive && !isSegmentTechListActive, onListOpen: function () { return handleMenuClick(ListType.SegmentLocationList); }, onListClose: function () { return handleMenuClick(); } }), _jsx(SegmentProfits, { show: !isTeamSizeListActive && !isBrandListActive && !isSegmentLocationListActive && !isSegmentTechListActive, onListOpen: function () { return handleMenuClick(ListType.SegmentProfitList); }, onListClose: function () { return handleMenuClick(); } }), _jsx(SegmentTechs, { show: !isTeamSizeListActive && !isBrandListActive && !isSegmentLocationListActive && !isSegmentProfitListActive, onListOpen: function () { return handleMenuClick(ListType.SegmentTechList); }, onListClose: function () { return handleMenuClick(); } }), _jsx(TeamSize, { show: !isSegmentLocationListActive && !isSegmentProfitListActive && !isSegmentTechListActive && !isBrandListActive, onListOpen: function () { return handleMenuClick(ListType.TeamSizeList); }, onListClose: function () { return handleMenuClick(); } }), _jsx(Collapse, __assign({ in: !listActive }, { children: _jsx(SalesChannels, {}) })), _jsx(TAC, { show: (isNewBrand || isOtherBrand) && !listActive }), _jsx(Collapse, __assign({ in: !listActive, timeout: 500 }, { children: _jsx(Button, __assign({ onBackClicked: function () { return onBack(); }, disabled: disabled, isAr: isAr, error: t(error || ''), loading: loading }, { children: t('next') })) }))] })) })) }));
|
|
98
|
+
return (_jsx(ScreenContainer, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(Form, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsx(BrandList, { show: hasBrandList, list: brandList, onListOpen: function () { return handleMenuClick(ListType.BrandList); }, onListClose: function () { return handleMenuClick(); } }), _jsx(BrandName, { show: (isNewBrand || isOtherBrand) && !listActive, brandNameChecking: brandNameChecking, fetchingBrandName: setBrandNameChecking }), _jsx(Collapse, __assign({ in: !listActive }, { children: _jsx(SalesChannels, {}) })), _jsx(TAC, { show: (isNewBrand || isOtherBrand) && !listActive }), _jsx(Collapse, __assign({ in: !listActive, timeout: 500 }, { children: _jsx(Button, __assign({ onBackClicked: function () { return onBack(); }, disabled: disabled, isAr: isAr, error: t(error || ''), loading: loading }, { children: t('next') })) }))] })) })) }));
|
|
120
99
|
};
|
|
121
100
|
export default React.memo(Merchant);
|
|
@@ -9,10 +9,6 @@ export declare const MerchantValidationSchema: (isNewBrand?: boolean) => yup.Obj
|
|
|
9
9
|
}>>>, import("yup/lib/types").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
10
10
|
id: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
|
|
11
11
|
}>>[] | undefined>;
|
|
12
|
-
segmentLocation: import("yup/lib/object").RequiredObjectSchema<import("yup/lib/object").ObjectShape, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").ObjectShape>>;
|
|
13
|
-
segmentProfit: import("yup/lib/object").RequiredObjectSchema<import("yup/lib/object").ObjectShape, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").ObjectShape>>;
|
|
14
|
-
segmentTech: import("yup/lib/object").RequiredObjectSchema<import("yup/lib/object").ObjectShape, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").ObjectShape>>;
|
|
15
|
-
teamSize: import("yup/lib/object").RequiredObjectSchema<import("yup/lib/object").ObjectShape, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").ObjectShape>>;
|
|
16
12
|
brandName: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
17
13
|
}>, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
18
14
|
salesChannels: import("yup/lib/array").RequiredArraySchema<yup.ObjectSchema<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
@@ -24,10 +20,6 @@ export declare const MerchantValidationSchema: (isNewBrand?: boolean) => yup.Obj
|
|
|
24
20
|
}>>>, import("yup/lib/types").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
25
21
|
id: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
|
|
26
22
|
}>>[] | undefined>;
|
|
27
|
-
segmentLocation: import("yup/lib/object").RequiredObjectSchema<import("yup/lib/object").ObjectShape, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").ObjectShape>>;
|
|
28
|
-
segmentProfit: import("yup/lib/object").RequiredObjectSchema<import("yup/lib/object").ObjectShape, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").ObjectShape>>;
|
|
29
|
-
segmentTech: import("yup/lib/object").RequiredObjectSchema<import("yup/lib/object").ObjectShape, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").ObjectShape>>;
|
|
30
|
-
teamSize: import("yup/lib/object").RequiredObjectSchema<import("yup/lib/object").ObjectShape, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").ObjectShape>>;
|
|
31
23
|
brandName: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
32
24
|
}>>, import("yup/lib/object").AssertsShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
33
25
|
salesChannels: import("yup/lib/array").RequiredArraySchema<yup.ObjectSchema<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
@@ -39,9 +31,5 @@ export declare const MerchantValidationSchema: (isNewBrand?: boolean) => yup.Obj
|
|
|
39
31
|
}>>>, import("yup/lib/types").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
40
32
|
id: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
|
|
41
33
|
}>>[] | undefined>;
|
|
42
|
-
segmentLocation: import("yup/lib/object").RequiredObjectSchema<import("yup/lib/object").ObjectShape, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").ObjectShape>>;
|
|
43
|
-
segmentProfit: import("yup/lib/object").RequiredObjectSchema<import("yup/lib/object").ObjectShape, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").ObjectShape>>;
|
|
44
|
-
segmentTech: import("yup/lib/object").RequiredObjectSchema<import("yup/lib/object").ObjectShape, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").ObjectShape>>;
|
|
45
|
-
teamSize: import("yup/lib/object").RequiredObjectSchema<import("yup/lib/object").ObjectShape, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").ObjectShape>>;
|
|
46
34
|
brandName: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
47
35
|
}>>>;
|
|
@@ -86,10 +86,6 @@ export var MerchantValidationSchema = function (isNewBrand) {
|
|
|
86
86
|
})
|
|
87
87
|
.required('enter_brand_name_english_chars_numbers_space'),
|
|
88
88
|
termAndConditionChecked: yup.boolean().isTrue('check_terms_cond').required('check_terms_cond'),
|
|
89
|
-
segmentLocation: yup.object().required('alert_choose_segment_location'),
|
|
90
|
-
segmentProfit: yup.object().required('alert_choose_segment_profit'),
|
|
91
|
-
segmentTech: yup.object().required('alert_choose_segment_tech'),
|
|
92
|
-
teamSize: yup.object().required('alert_choose_teamSize'),
|
|
93
89
|
salesChannels: yup
|
|
94
90
|
.array()
|
|
95
91
|
.min(1, 'choose_atleast_one_channel')
|
|
@@ -130,10 +126,6 @@ export var MerchantValidationSchema = function (isNewBrand) {
|
|
|
130
126
|
}
|
|
131
127
|
})
|
|
132
128
|
.required('choose_atleast_one_channel'),
|
|
133
|
-
segmentLocation: yup.object().required('alert_choose_segment_location'),
|
|
134
|
-
segmentProfit: yup.object().required('alert_choose_segment_profit'),
|
|
135
|
-
segmentTech: yup.object().required('alert_choose_segment_tech'),
|
|
136
|
-
teamSize: yup.object().required('alert_choose_teamSize'),
|
|
137
129
|
brandName: yup.string().optional()
|
|
138
130
|
});
|
|
139
131
|
};
|
|
@@ -4,6 +4,7 @@ import ConnectCivilIDScreen from '../features/connect/screens/CivilID';
|
|
|
4
4
|
import ConnectVerifyPACIScreen from './connect/screens/VerifyPACI';
|
|
5
5
|
import IndividualScreen from './connect/screens/Individual';
|
|
6
6
|
import MerchantInfoScreen from './connect/screens/Merchant';
|
|
7
|
+
import BrandSegmentInfoScreen from './connect/screens/BrandSegment';
|
|
7
8
|
import ConnectOTPScreen from './connect/screens/OTP';
|
|
8
9
|
import ThankYouScreen from './connect/screens/ThankYou';
|
|
9
10
|
import ConnectExpressMobileScreen from './connectExpress/screens/Mobile';
|
|
@@ -72,6 +73,7 @@ import EntityResetPasswordSuccessPage from './entity/screens/ResetPasswordSucces
|
|
|
72
73
|
import EntityDataLoadingPage from './entity/screens/PrepareDataLoading';
|
|
73
74
|
import BrandVerifyPage from './brand/screens/Verify';
|
|
74
75
|
import BrandInfoPage from './brand/screens/BrandInfo';
|
|
76
|
+
import BrandSegmentPage from './brand/screens/BrandSegmentInfo';
|
|
75
77
|
import BrandActivitiesPage from './brand/screens/BrandActivities';
|
|
76
78
|
import BrandSuccessPage from './brand/screens/Success';
|
|
77
79
|
import BrandSuccessWithFlowPage from './brand/screens/SuccessWithFlowButtons';
|
|
@@ -106,6 +108,10 @@ export var connectFeatureScreens = [
|
|
|
106
108
|
name: 'CONNECT_MERCHANT_INFO_STEP',
|
|
107
109
|
element: MerchantInfoScreen
|
|
108
110
|
},
|
|
111
|
+
{
|
|
112
|
+
name: 'CONNECT_BRAND_SEGMENT_INFO_STEP',
|
|
113
|
+
element: BrandSegmentInfoScreen
|
|
114
|
+
},
|
|
109
115
|
{
|
|
110
116
|
name: 'CONNECT_THANK_YOU_STEP',
|
|
111
117
|
element: ThankYouScreen
|
|
@@ -369,6 +375,10 @@ export var brandFeatureScreens = [
|
|
|
369
375
|
name: 'BRAND_INFO_STEP',
|
|
370
376
|
element: BrandInfoPage
|
|
371
377
|
},
|
|
378
|
+
{
|
|
379
|
+
name: 'BRAND_SEGMENT_INFO_STEP',
|
|
380
|
+
element: BrandSegmentPage
|
|
381
|
+
},
|
|
372
382
|
{
|
|
373
383
|
name: 'BRAND_ACTIVITIES_STEP',
|
|
374
384
|
element: BrandActivitiesPage
|
package/package.json
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|