ordering-ui-admin-external 1.20.0 → 1.20.1
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/_bundles/{ordering-ui-admin.9e032c80734b4e623988.js → ordering-ui-admin.a9bd3b8526ba44f15714.js} +2 -2
- package/_modules/components/Orders/BusinessesSelector/index.js +23 -3
- package/_modules/components/Orders/CountryFilter/index.js +20 -7
- package/_modules/components/Orders/CurrencyFilter/index.js +20 -7
- package/_modules/components/Orders/DeliveryTypeSelector/index.js +36 -8
- package/_modules/components/Orders/DriverSelector/index.js +15 -1
- package/_modules/components/Orders/DriversGroupTypeSelector/index.js +27 -7
- package/_modules/components/Orders/OrdersContentHeader/index.js +1 -1
- package/_modules/components/Orders/OrdersFilterGroup/index.js +11 -4
- package/_modules/components/Orders/OrdersTable/index.js +60 -13
- package/_modules/components/Orders/OrdersTable/styles.js +13 -1
- package/_modules/components/Orders/PaymethodTypeSelector/index.js +20 -2
- package/_modules/components/Shared/CitySelector/index.js +18 -5
- package/_modules/styles/MultiSelect/index.js +23 -4
- package/package.json +2 -2
- package/src/components/Orders/BusinessesSelector/index.js +37 -24
- package/src/components/Orders/CountryFilter/index.js +19 -11
- package/src/components/Orders/CurrencyFilter/index.js +17 -9
- package/src/components/Orders/DeliveryTypeSelector/index.js +30 -7
- package/src/components/Orders/DriverSelector/index.js +10 -0
- package/src/components/Orders/DriversGroupTypeSelector/index.js +23 -9
- package/src/components/Orders/OrdersContentHeader/index.js +2 -1
- package/src/components/Orders/OrdersFilterGroup/index.js +14 -4
- package/src/components/Orders/OrdersTable/index.js +45 -0
- package/src/components/Orders/OrdersTable/styles.js +14 -0
- package/src/components/Orders/PaymethodTypeSelector/index.js +12 -1
- package/src/components/Shared/CitySelector/index.js +18 -9
- package/src/styles/MultiSelect/index.js +36 -4
- package/template/theme.json +3 -1
- /package/_bundles/{ordering-ui-admin.9e032c80734b4e623988.js.LICENSE.txt → ordering-ui-admin.a9bd3b8526ba44f15714.js.LICENSE.txt} +0 -0
|
@@ -34,19 +34,25 @@ var CitySelectorUI = function CitySelectorUI(props) {
|
|
|
34
34
|
handleChangeCity = props.handleChangeCity,
|
|
35
35
|
position = props.position,
|
|
36
36
|
optionInnerMaxHeight = props.optionInnerMaxHeight;
|
|
37
|
+
var _useLanguage = (0, _orderingComponentsAdminExternal.useLanguage)(),
|
|
38
|
+
_useLanguage2 = _slicedToArray(_useLanguage, 2),
|
|
39
|
+
t = _useLanguage2[1];
|
|
37
40
|
var _useState = (0, _react.useState)([]),
|
|
38
41
|
_useState2 = _slicedToArray(_useState, 2),
|
|
39
42
|
cityOptions = _useState2[0],
|
|
40
43
|
setCityOptions = _useState2[1];
|
|
41
|
-
var
|
|
42
|
-
|
|
43
|
-
|
|
44
|
+
var _useState3 = (0, _react.useState)(''),
|
|
45
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
46
|
+
searchValue = _useState4[0],
|
|
47
|
+
setSearchValue = _useState4[1];
|
|
44
48
|
var placeholder = /*#__PURE__*/_react.default.createElement(_styles.PlaceholderTitle, {
|
|
45
49
|
isDefault: isDefault
|
|
46
50
|
}, t('SELECT_CITY', 'Select City'));
|
|
47
51
|
(0, _react.useEffect)(function () {
|
|
48
52
|
if (citiesList !== null && citiesList !== void 0 && citiesList.loading) return;
|
|
49
|
-
var _cityOptions = citiesList === null || citiesList === void 0 ? void 0 : citiesList.cities.
|
|
53
|
+
var _cityOptions = citiesList === null || citiesList === void 0 ? void 0 : citiesList.cities.filter(function (option) {
|
|
54
|
+
return option === null || option === void 0 ? void 0 : option.name.toLocaleLowerCase().includes(searchValue.toLocaleLowerCase());
|
|
55
|
+
}).map(function (city) {
|
|
50
56
|
return {
|
|
51
57
|
value: city.id,
|
|
52
58
|
content: /*#__PURE__*/_react.default.createElement(_styles.Option, {
|
|
@@ -59,7 +65,7 @@ var CitySelectorUI = function CitySelectorUI(props) {
|
|
|
59
65
|
};
|
|
60
66
|
});
|
|
61
67
|
setCityOptions(_cityOptions);
|
|
62
|
-
}, [citiesList, isDefault]);
|
|
68
|
+
}, [citiesList, isDefault, searchValue]);
|
|
63
69
|
(0, _react.useEffect)(function () {
|
|
64
70
|
if (!isAddMode) return;
|
|
65
71
|
if (cityOptions.length === 1) {
|
|
@@ -87,6 +93,13 @@ var CitySelectorUI = function CitySelectorUI(props) {
|
|
|
87
93
|
options: cityOptions,
|
|
88
94
|
onChange: function onChange(city) {
|
|
89
95
|
return handleChangeCity(city);
|
|
96
|
+
},
|
|
97
|
+
isShowSearchBar: true,
|
|
98
|
+
searchBarIsCustomLayout: true,
|
|
99
|
+
searchBarIsNotLazyLoad: true,
|
|
100
|
+
searchValue: searchValue,
|
|
101
|
+
handleChangeSearch: function handleChangeSearch(val) {
|
|
102
|
+
return setSearchValue(val);
|
|
90
103
|
}
|
|
91
104
|
})));
|
|
92
105
|
};
|
|
@@ -10,6 +10,7 @@ var _EnChevronDown = _interopRequireDefault(require("@meronex/icons/en/EnChevron
|
|
|
10
10
|
var _reactBootstrapIcons = require("react-bootstrap-icons");
|
|
11
11
|
var _MdClose = _interopRequireDefault(require("@meronex/icons/md/MdClose"));
|
|
12
12
|
var _Buttons = require("../Buttons");
|
|
13
|
+
var _Shared = require("../../components/Shared");
|
|
13
14
|
var _Selects = require("../Selects");
|
|
14
15
|
var _styles = require("./styles");
|
|
15
16
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
@@ -30,7 +31,13 @@ var MultiSelect = function MultiSelect(props) {
|
|
|
30
31
|
options = props.options,
|
|
31
32
|
onChange = props.onChange,
|
|
32
33
|
defaultValue = props.defaultValue,
|
|
33
|
-
className = props.className
|
|
34
|
+
className = props.className,
|
|
35
|
+
isShowSearchBar = props.isShowSearchBar,
|
|
36
|
+
searchBarIsNotLazyLoad = props.searchBarIsNotLazyLoad,
|
|
37
|
+
searchBarPlaceholder = props.searchBarPlaceholder,
|
|
38
|
+
searchBarIsCustomLayout = props.searchBarIsCustomLayout,
|
|
39
|
+
searchValue = props.searchValue,
|
|
40
|
+
handleChangeSearch = props.handleChangeSearch;
|
|
34
41
|
var _useState = (0, _react.useState)(false),
|
|
35
42
|
_useState2 = _slicedToArray(_useState, 2),
|
|
36
43
|
open = _useState2[0],
|
|
@@ -59,14 +66,18 @@ var MultiSelect = function MultiSelect(props) {
|
|
|
59
66
|
}
|
|
60
67
|
};
|
|
61
68
|
(0, _react.useEffect)(function () {
|
|
69
|
+
if (isShowSearchBar && searchValue) return;
|
|
62
70
|
var _defaultOption = options === null || options === void 0 ? void 0 : options.filter(function (option) {
|
|
63
71
|
return defaultValue.includes(option.value);
|
|
64
72
|
});
|
|
65
73
|
setSelectedOptions(_defaultOption);
|
|
66
74
|
setValues(defaultValue);
|
|
67
|
-
}, [defaultValue, options]);
|
|
75
|
+
}, [defaultValue, options, searchValue]);
|
|
68
76
|
(0, _react.useEffect)(function () {
|
|
69
|
-
if (!open)
|
|
77
|
+
if (!open) {
|
|
78
|
+
handleChangeSearch && handleChangeSearch('');
|
|
79
|
+
return;
|
|
80
|
+
}
|
|
70
81
|
document.addEventListener('click', closeSelect);
|
|
71
82
|
return function () {
|
|
72
83
|
return document.removeEventListener('click', closeSelect);
|
|
@@ -119,7 +130,15 @@ var MultiSelect = function MultiSelect(props) {
|
|
|
119
130
|
isAbsolute: true,
|
|
120
131
|
position: "right",
|
|
121
132
|
ref: dropdownReference
|
|
122
|
-
}, /*#__PURE__*/_react.default.createElement(_Selects.
|
|
133
|
+
}, isShowSearchBar && /*#__PURE__*/_react.default.createElement(_Selects.SearchBarWrapper, {
|
|
134
|
+
className: "search-bar-container"
|
|
135
|
+
}, /*#__PURE__*/_react.default.createElement(_Shared.SearchBar, {
|
|
136
|
+
lazyLoad: !searchBarIsNotLazyLoad,
|
|
137
|
+
isCustomLayout: searchBarIsCustomLayout,
|
|
138
|
+
search: searchValue,
|
|
139
|
+
onSearch: handleChangeSearch,
|
|
140
|
+
placeholder: searchBarPlaceholder || ''
|
|
141
|
+
})), /*#__PURE__*/_react.default.createElement(_Selects.OptionsInner, {
|
|
123
142
|
optionInnerMargin: props.optionInnerMargin,
|
|
124
143
|
optionInnerMaxHeight: props.optionInnerMaxHeight
|
|
125
144
|
}, options.map(function (option, i) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ordering-ui-admin-external",
|
|
3
|
-
"version": "1.20.
|
|
3
|
+
"version": "1.20.1",
|
|
4
4
|
"description": "Ordering UI Admin Components",
|
|
5
5
|
"main": "./_modules/index.js",
|
|
6
6
|
"exports": {
|
|
@@ -83,7 +83,7 @@
|
|
|
83
83
|
"lodash": "^4.17.20",
|
|
84
84
|
"moment": "^2.29.1",
|
|
85
85
|
"moment-range": "^4.0.2",
|
|
86
|
-
"ordering-components-admin-external": "1.20.
|
|
86
|
+
"ordering-components-admin-external": "1.20.2",
|
|
87
87
|
"polished": "^3.6.7",
|
|
88
88
|
"prop-types": "^15.7.2",
|
|
89
89
|
"react-big-calendar": "^1.4.2",
|
|
@@ -22,6 +22,7 @@ export const BusinessesSelector = (props) => {
|
|
|
22
22
|
|
|
23
23
|
const [, t] = useLanguage()
|
|
24
24
|
const [businessTypes, setBusinessTypes] = useState([])
|
|
25
|
+
const [searchValue, setSearchValue] = useState('')
|
|
25
26
|
|
|
26
27
|
const Placeholder = <PlaceholderTitle>{t('SELECT_BUSINESS', 'Select business')}</PlaceholderTitle>
|
|
27
28
|
const businessesLoading = [{ value: 'default', content: <Option>{t('BUSINESSES_LOADING', 'Businesses loading')}...</Option> }]
|
|
@@ -29,29 +30,31 @@ export const BusinessesSelector = (props) => {
|
|
|
29
30
|
useEffect(() => {
|
|
30
31
|
const _businessesOptionList = []
|
|
31
32
|
if (!businessesList.loading) {
|
|
32
|
-
const _businessesOption = businessesList.businesses
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
33
|
+
const _businessesOption = businessesList.businesses
|
|
34
|
+
.filter(option => option?.name.toLocaleLowerCase().includes(searchValue.toLocaleLowerCase()))
|
|
35
|
+
.map((business) => {
|
|
36
|
+
return {
|
|
37
|
+
value: business.id,
|
|
38
|
+
content: (
|
|
39
|
+
<Option>
|
|
40
|
+
<WrapperBusinessImage>
|
|
41
|
+
{business.logo && <BusinessImage bgimage={business.logo} />}
|
|
42
|
+
</WrapperBusinessImage>
|
|
43
|
+
<OptionContent>
|
|
44
|
+
<OptionName>
|
|
45
|
+
{business.name}
|
|
46
|
+
</OptionName>
|
|
47
|
+
<OptionCategory>
|
|
48
|
+
{business?.alcohol && t('ALCOHOL', 'Alcohol')}
|
|
49
|
+
{business?.food && t('FOOD', 'Food')}
|
|
50
|
+
{business?.groceries && t('GROCERIES', 'Groceries')}
|
|
51
|
+
{business?.laundry && t('LAUNDRY', 'Laundry')}
|
|
52
|
+
</OptionCategory>
|
|
53
|
+
</OptionContent>
|
|
54
|
+
</Option>
|
|
55
|
+
)
|
|
56
|
+
}
|
|
57
|
+
})
|
|
55
58
|
|
|
56
59
|
for (const option of _businessesOption) {
|
|
57
60
|
_businessesOptionList.push(option)
|
|
@@ -59,7 +62,7 @@ export const BusinessesSelector = (props) => {
|
|
|
59
62
|
}
|
|
60
63
|
|
|
61
64
|
setBusinessTypes(_businessesOptionList)
|
|
62
|
-
}, [businessesList])
|
|
65
|
+
}, [businessesList, searchValue])
|
|
63
66
|
|
|
64
67
|
return (
|
|
65
68
|
<>
|
|
@@ -72,6 +75,11 @@ export const BusinessesSelector = (props) => {
|
|
|
72
75
|
optionInnerMaxHeight='150px'
|
|
73
76
|
optionBottomBorder
|
|
74
77
|
onChange={(business) => handleChangeBusinesses(business)}
|
|
78
|
+
isShowSearchBar
|
|
79
|
+
searchBarIsCustomLayout
|
|
80
|
+
searchBarIsNotLazyLoad
|
|
81
|
+
searchValue={searchValue}
|
|
82
|
+
handleChangeSearch={(val) => setSearchValue(val)}
|
|
75
83
|
/>
|
|
76
84
|
) : (
|
|
77
85
|
<MultiSelect
|
|
@@ -80,6 +88,11 @@ export const BusinessesSelector = (props) => {
|
|
|
80
88
|
optionInnerMargin='10px'
|
|
81
89
|
optionInnerMaxHeight='150px'
|
|
82
90
|
optionBottomBorder
|
|
91
|
+
isShowSearchBar
|
|
92
|
+
searchBarIsCustomLayout
|
|
93
|
+
searchBarIsNotLazyLoad
|
|
94
|
+
searchValue={searchValue}
|
|
95
|
+
handleChangeSearch={(val) => setSearchValue(val)}
|
|
83
96
|
/>
|
|
84
97
|
)}
|
|
85
98
|
</>
|
|
@@ -13,32 +13,35 @@ const CountryFilterUI = (props) => {
|
|
|
13
13
|
|
|
14
14
|
const [, t] = useLanguage()
|
|
15
15
|
|
|
16
|
+
const [searchValue, setSearchValue] = useState('')
|
|
17
|
+
const [countryTypes, setCountryTypes] = useState([])
|
|
18
|
+
|
|
16
19
|
const placeholder = (
|
|
17
20
|
<PlaceholderTitle>
|
|
18
21
|
{t('SELECT_A_COUNTRY', 'Select a country')}
|
|
19
22
|
</PlaceholderTitle>
|
|
20
23
|
)
|
|
21
24
|
|
|
22
|
-
const [countryTypes, setCountryTypes] = useState([])
|
|
23
|
-
|
|
24
25
|
useEffect(() => {
|
|
25
26
|
const _countryList = []
|
|
26
27
|
if (!countriesState.loading) {
|
|
27
|
-
const _groupsOption = countriesState.countries
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
28
|
+
const _groupsOption = countriesState.countries
|
|
29
|
+
.filter(option => option?.name.toLocaleLowerCase().includes(searchValue.toLocaleLowerCase()))
|
|
30
|
+
.map((country) => {
|
|
31
|
+
return {
|
|
32
|
+
value: country.code,
|
|
33
|
+
content: (
|
|
34
|
+
<Option>{country.name}</Option>
|
|
35
|
+
)
|
|
36
|
+
}
|
|
37
|
+
})
|
|
35
38
|
|
|
36
39
|
for (const option of _groupsOption) {
|
|
37
40
|
_countryList.push(option)
|
|
38
41
|
}
|
|
39
42
|
}
|
|
40
43
|
setCountryTypes(_countryList)
|
|
41
|
-
}, [countriesState])
|
|
44
|
+
}, [countriesState, searchValue])
|
|
42
45
|
|
|
43
46
|
return (
|
|
44
47
|
<>
|
|
@@ -49,6 +52,11 @@ const CountryFilterUI = (props) => {
|
|
|
49
52
|
options={countryTypes}
|
|
50
53
|
onChange={(code) => handleChangeCountryCode(code)}
|
|
51
54
|
optionInnerMaxHeight='200px'
|
|
55
|
+
isShowSearchBar
|
|
56
|
+
searchBarIsCustomLayout
|
|
57
|
+
searchBarIsNotLazyLoad
|
|
58
|
+
searchValue={searchValue}
|
|
59
|
+
handleChangeSearch={(val) => setSearchValue(val)}
|
|
52
60
|
/>
|
|
53
61
|
) : (
|
|
54
62
|
<SkeletonWrapper>
|
|
@@ -11,6 +11,7 @@ export const CurrencyFilter = (props) => {
|
|
|
11
11
|
} = props
|
|
12
12
|
|
|
13
13
|
const [, t] = useLanguage()
|
|
14
|
+
const [searchValue, setSearchValue] = useState('')
|
|
14
15
|
|
|
15
16
|
const placeholder = (
|
|
16
17
|
<PlaceholderTitle>
|
|
@@ -22,20 +23,22 @@ export const CurrencyFilter = (props) => {
|
|
|
22
23
|
|
|
23
24
|
useEffect(() => {
|
|
24
25
|
const _countryList = []
|
|
25
|
-
const _groupsOption = currencyList
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
26
|
+
const _groupsOption = currencyList
|
|
27
|
+
.filter(option => option?.text.toLocaleLowerCase().includes(searchValue.toLocaleLowerCase()))
|
|
28
|
+
.map((country) => {
|
|
29
|
+
return {
|
|
30
|
+
value: country.value,
|
|
31
|
+
content: (
|
|
32
|
+
<Option>{country.text}</Option>
|
|
33
|
+
)
|
|
34
|
+
}
|
|
35
|
+
})
|
|
33
36
|
|
|
34
37
|
for (const option of _groupsOption) {
|
|
35
38
|
_countryList.push(option)
|
|
36
39
|
}
|
|
37
40
|
setCountryTypes(_countryList)
|
|
38
|
-
}, [currencyList])
|
|
41
|
+
}, [currencyList, searchValue])
|
|
39
42
|
|
|
40
43
|
return (
|
|
41
44
|
<MultiSelect
|
|
@@ -44,6 +47,11 @@ export const CurrencyFilter = (props) => {
|
|
|
44
47
|
options={countryTypes}
|
|
45
48
|
onChange={(code) => handleChangeCurrency(code)}
|
|
46
49
|
optionInnerMaxHeight='200px'
|
|
50
|
+
isShowSearchBar
|
|
51
|
+
searchBarIsCustomLayout
|
|
52
|
+
searchBarIsNotLazyLoad
|
|
53
|
+
searchValue={searchValue}
|
|
54
|
+
handleChangeSearch={(val) => setSearchValue(val)}
|
|
47
55
|
/>
|
|
48
56
|
)
|
|
49
57
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React from 'react'
|
|
1
|
+
import React, { useEffect, useState } from 'react'
|
|
2
2
|
import { useLanguage } from 'ordering-components-admin-external'
|
|
3
3
|
import { MultiSelect } from '../../../styles/MultiSelect'
|
|
4
4
|
|
|
@@ -15,13 +15,31 @@ export const DeliveryTypeSelector = (props) => {
|
|
|
15
15
|
|
|
16
16
|
const [, t] = useLanguage()
|
|
17
17
|
|
|
18
|
-
const
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
{ value:
|
|
23
|
-
{ value:
|
|
18
|
+
const [searchValue, setSearchValue] = useState('')
|
|
19
|
+
const [deliveryTypes, setDeliveryTypes] = useState([])
|
|
20
|
+
|
|
21
|
+
const deliveryTypeList = [
|
|
22
|
+
{ value: 1, name: t('DELIVERY', 'Delivery') },
|
|
23
|
+
{ value: 2, name: t('PICKUP', 'Pickup') },
|
|
24
|
+
{ value: 3, name: t('EAT_IN', 'Eat in') },
|
|
25
|
+
{ value: 4, name: t('CURBSIDE', 'Curbside') },
|
|
26
|
+
{ value: 5, name: t('DRIVE_THRU', 'Drive thru') }
|
|
24
27
|
]
|
|
28
|
+
|
|
29
|
+
useEffect(() => {
|
|
30
|
+
const _deliveryTypes = deliveryTypeList
|
|
31
|
+
.filter(option => option?.name.toLocaleLowerCase().includes(searchValue.toLocaleLowerCase()))
|
|
32
|
+
.map((type) => {
|
|
33
|
+
return {
|
|
34
|
+
value: type.value,
|
|
35
|
+
content: (
|
|
36
|
+
<Option>{type.name}</Option>
|
|
37
|
+
)
|
|
38
|
+
}
|
|
39
|
+
})
|
|
40
|
+
setDeliveryTypes(_deliveryTypes)
|
|
41
|
+
}, [searchValue])
|
|
42
|
+
|
|
25
43
|
const placeholder = <PlaceholderTitle>{t('SELECT_DELIVERY_TYPE', 'Select delivery type')}</PlaceholderTitle>
|
|
26
44
|
|
|
27
45
|
return (
|
|
@@ -30,6 +48,11 @@ export const DeliveryTypeSelector = (props) => {
|
|
|
30
48
|
defaultValue={filterValues.deliveryTypes}
|
|
31
49
|
options={deliveryTypes}
|
|
32
50
|
onChange={(deliveryType) => handleChangeDeliveryType(deliveryType)}
|
|
51
|
+
isShowSearchBar
|
|
52
|
+
searchBarIsCustomLayout
|
|
53
|
+
searchBarIsNotLazyLoad
|
|
54
|
+
searchValue={searchValue}
|
|
55
|
+
handleChangeSearch={(val) => setSearchValue(val)}
|
|
33
56
|
/>
|
|
34
57
|
)
|
|
35
58
|
}
|
|
@@ -159,6 +159,11 @@ const DriverSelectorUI = (props) => {
|
|
|
159
159
|
optionInnerMargin='10px'
|
|
160
160
|
optionInnerMaxHeight='150px'
|
|
161
161
|
onChange={(driver) => handleChangeDriver(driver)}
|
|
162
|
+
isShowSearchBar
|
|
163
|
+
searchBarIsCustomLayout
|
|
164
|
+
searchBarIsNotLazyLoad
|
|
165
|
+
searchValue={searchValue}
|
|
166
|
+
handleChangeSearch={(val) => setSearchValue(val)}
|
|
162
167
|
/>
|
|
163
168
|
) : (
|
|
164
169
|
<MultiSelect
|
|
@@ -167,6 +172,11 @@ const DriverSelectorUI = (props) => {
|
|
|
167
172
|
optionInnerMargin='10px'
|
|
168
173
|
optionInnerMaxHeight='150px'
|
|
169
174
|
className='driver-select'
|
|
175
|
+
isShowSearchBar
|
|
176
|
+
searchBarIsCustomLayout
|
|
177
|
+
searchBarIsNotLazyLoad
|
|
178
|
+
searchValue={searchValue}
|
|
179
|
+
handleChangeSearch={(val) => setSearchValue(val)}
|
|
170
180
|
/>
|
|
171
181
|
)}
|
|
172
182
|
</>
|
|
@@ -13,6 +13,8 @@ export const DriversGroupTypeSelector = (props) => {
|
|
|
13
13
|
|
|
14
14
|
const [, t] = useLanguage()
|
|
15
15
|
|
|
16
|
+
const [searchValue, setSearchValue] = useState('')
|
|
17
|
+
|
|
16
18
|
const placeholder = (
|
|
17
19
|
<PlaceholderTitle>
|
|
18
20
|
{t('DRIVER_GROUP', 'Driver group')}
|
|
@@ -24,21 +26,23 @@ export const DriversGroupTypeSelector = (props) => {
|
|
|
24
26
|
useEffect(() => {
|
|
25
27
|
const _groupList = []
|
|
26
28
|
if (!driverGroupList.loading) {
|
|
27
|
-
const _groupsOption = driverGroupList.groups
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
29
|
+
const _groupsOption = driverGroupList.groups
|
|
30
|
+
.filter(option => option?.name.toLocaleLowerCase().includes(searchValue.toLocaleLowerCase()))
|
|
31
|
+
.map((group) => {
|
|
32
|
+
return {
|
|
33
|
+
value: group.id,
|
|
34
|
+
content: (
|
|
35
|
+
<Option>{group.id}. {group.name}</Option>
|
|
36
|
+
)
|
|
37
|
+
}
|
|
38
|
+
})
|
|
35
39
|
|
|
36
40
|
for (const option of _groupsOption) {
|
|
37
41
|
_groupList.push(option)
|
|
38
42
|
}
|
|
39
43
|
}
|
|
40
44
|
setGroupTypes(_groupList)
|
|
41
|
-
}, [driverGroupList])
|
|
45
|
+
}, [driverGroupList, searchValue])
|
|
42
46
|
|
|
43
47
|
return (
|
|
44
48
|
<>
|
|
@@ -48,12 +52,22 @@ export const DriversGroupTypeSelector = (props) => {
|
|
|
48
52
|
defaultValue={filterValues.groupTypes}
|
|
49
53
|
options={groupTypes}
|
|
50
54
|
onChange={(groupType) => handleChangeGroup(groupType)}
|
|
55
|
+
isShowSearchBar
|
|
56
|
+
searchBarIsCustomLayout
|
|
57
|
+
searchBarIsNotLazyLoad
|
|
58
|
+
searchValue={searchValue}
|
|
59
|
+
handleChangeSearch={(val) => setSearchValue(val)}
|
|
51
60
|
/>
|
|
52
61
|
) : (
|
|
53
62
|
<MultiSelect
|
|
54
63
|
defaultValue='default'
|
|
55
64
|
options={groupTypesLoading}
|
|
56
65
|
optionBottomBorder
|
|
66
|
+
isShowSearchBar
|
|
67
|
+
searchBarIsCustomLayout
|
|
68
|
+
searchBarIsNotLazyLoad
|
|
69
|
+
searchValue={searchValue}
|
|
70
|
+
handleChangeSearch={(val) => setSearchValue(val)}
|
|
57
71
|
/>
|
|
58
72
|
)}
|
|
59
73
|
</>
|
|
@@ -58,7 +58,8 @@ export const OrdersContentHeader = (props) => {
|
|
|
58
58
|
} else {
|
|
59
59
|
_filterApplied = filterValues?.groupTypes?.length || filterValues.businessIds.length > 0 || filterValues.cityIds.length > 0 ||
|
|
60
60
|
filterValues.deliveryEndDatetime !== null || filterValues.deliveryFromDatetime !== null || filterValues.deliveryTypes.length > 0 ||
|
|
61
|
-
filterValues.driverIds.length > 0 || filterValues.paymethodIds.length > 0 || filterValues.statuses.length > 0 || filterValues?.metafield?.length > 0
|
|
61
|
+
filterValues.driverIds.length > 0 || filterValues.paymethodIds.length > 0 || filterValues.statuses.length > 0 || filterValues?.metafield?.length > 0 ||
|
|
62
|
+
filterValues?.externalId
|
|
62
63
|
}
|
|
63
64
|
setFilterApplied(_filterApplied)
|
|
64
65
|
}, [filterValues])
|
|
@@ -50,7 +50,8 @@ const OrdersFilterGroupUI = (props) => {
|
|
|
50
50
|
handleChangeCurrency,
|
|
51
51
|
handleChangeMetaFieldValue,
|
|
52
52
|
handleAddMetaField,
|
|
53
|
-
handleDeleteMetafield
|
|
53
|
+
handleDeleteMetafield,
|
|
54
|
+
handleChangeExternalId
|
|
54
55
|
} = props
|
|
55
56
|
|
|
56
57
|
const [, t] = useLanguage()
|
|
@@ -112,9 +113,12 @@ const OrdersFilterGroupUI = (props) => {
|
|
|
112
113
|
value={filterValues?.orderId || ''}
|
|
113
114
|
onChange={(e) => handleChangeOrderId(e)}
|
|
114
115
|
/>
|
|
115
|
-
<
|
|
116
|
-
|
|
117
|
-
|
|
116
|
+
<Input
|
|
117
|
+
type='text'
|
|
118
|
+
placeholder={t('EXTERNAL_ID', 'External Id')}
|
|
119
|
+
autoComplete='off'
|
|
120
|
+
value={filterValues?.externalId || ''}
|
|
121
|
+
onChange={handleChangeExternalId}
|
|
118
122
|
/>
|
|
119
123
|
</WrapperRow>
|
|
120
124
|
<WrapperRow>
|
|
@@ -172,6 +176,12 @@ const OrdersFilterGroupUI = (props) => {
|
|
|
172
176
|
handleChangePaymethodType={handleChangePaymethodType}
|
|
173
177
|
/>
|
|
174
178
|
</WrapperRow>
|
|
179
|
+
<WrapperRow>
|
|
180
|
+
<CurrencyFilter
|
|
181
|
+
filterValues={filterValues}
|
|
182
|
+
handleChangeCurrency={handleChangeCurrency}
|
|
183
|
+
/>
|
|
184
|
+
</WrapperRow>
|
|
175
185
|
{filterValues?.metafield.map(item => (
|
|
176
186
|
<WrapperRow key={item.id}>
|
|
177
187
|
<Input
|
|
@@ -114,6 +114,10 @@ export const OrdersTable = (props) => {
|
|
|
114
114
|
{
|
|
115
115
|
value: 'total',
|
|
116
116
|
content: t('EXPORT_TOTAL', 'Total')
|
|
117
|
+
},
|
|
118
|
+
{
|
|
119
|
+
value: 'externalId',
|
|
120
|
+
content: t('EXTERNAL_ID', 'External id')
|
|
117
121
|
}
|
|
118
122
|
]
|
|
119
123
|
|
|
@@ -228,6 +232,7 @@ export const OrdersTable = (props) => {
|
|
|
228
232
|
}
|
|
229
233
|
|
|
230
234
|
const handleChangeAllowColumns = (type) => {
|
|
235
|
+
console.log(type, 'type', allowColumns)
|
|
231
236
|
const _column = allowColumns[type]
|
|
232
237
|
setAllowColumns({
|
|
233
238
|
...allowColumns,
|
|
@@ -368,6 +373,27 @@ export const OrdersTable = (props) => {
|
|
|
368
373
|
</React.Fragment>
|
|
369
374
|
)
|
|
370
375
|
}
|
|
376
|
+
if (column === 'externalId') {
|
|
377
|
+
return (
|
|
378
|
+
<DragTh
|
|
379
|
+
key={`dragTh-${i}`}
|
|
380
|
+
onDragOver={e => handleDragOver?.(e, column)}
|
|
381
|
+
onDrop={e => handleDrop(e, column)}
|
|
382
|
+
onDragEnd={e => handleDragEnd(e)}
|
|
383
|
+
colSpan={allowColumns[column]?.colSpan ?? 1}
|
|
384
|
+
className={allowColumns[column]?.className}
|
|
385
|
+
selectedDragOver={column === dragOverd}
|
|
386
|
+
>
|
|
387
|
+
<div draggable onDragStart={e => handleDragStart?.(e, column)}>
|
|
388
|
+
<img
|
|
389
|
+
src={theme.images.icons?.sixDots}
|
|
390
|
+
alt='six dots'
|
|
391
|
+
/>
|
|
392
|
+
<span>{allowColumns[column]?.title}</span>
|
|
393
|
+
</div>
|
|
394
|
+
</DragTh>
|
|
395
|
+
)
|
|
396
|
+
}
|
|
371
397
|
if (column === 'total' || (column !== 'total' && column === [...array].pop())) {
|
|
372
398
|
return (
|
|
373
399
|
<React.Fragment key={i}>
|
|
@@ -450,6 +476,15 @@ export const OrdersTable = (props) => {
|
|
|
450
476
|
</div>
|
|
451
477
|
</OrderNumberContainer>
|
|
452
478
|
</td>
|
|
479
|
+
{allowColumns?.externalId?.visable && (
|
|
480
|
+
<td className='externalId'>
|
|
481
|
+
<StatusInfo>
|
|
482
|
+
<div className='info'>
|
|
483
|
+
<p className='bold'><Skeleton width={100} /></p>
|
|
484
|
+
</div>
|
|
485
|
+
</StatusInfo>
|
|
486
|
+
</td>
|
|
487
|
+
)}
|
|
453
488
|
{allowColumns?.cartGroupId?.visable && (
|
|
454
489
|
<td className='statusInfo'>
|
|
455
490
|
<StatusInfo>
|
|
@@ -558,6 +593,7 @@ export const OrdersTable = (props) => {
|
|
|
558
593
|
className={parseInt(orderDetailId) === order.id ? 'active' : ''}
|
|
559
594
|
onClick={(e) => handleClickOrder(order, e)}
|
|
560
595
|
data-tour={i === 0 ? 'tour_start' : ''}
|
|
596
|
+
data-status={getStatusClassName(getDelayMinutes(order))}
|
|
561
597
|
>
|
|
562
598
|
<tr>
|
|
563
599
|
{Object.keys(allowColumns).filter(col => allowColumns[col]?.visable)
|
|
@@ -572,6 +608,15 @@ export const OrdersTable = (props) => {
|
|
|
572
608
|
</td>
|
|
573
609
|
)
|
|
574
610
|
}
|
|
611
|
+
if (column === 'externalId' && !isSelectedOrders) {
|
|
612
|
+
return (
|
|
613
|
+
<td className='externalId' key={`externalId${i}-${index}`}>
|
|
614
|
+
<StatusInfo>
|
|
615
|
+
<p className='bold'>{order?.external_id}</p>
|
|
616
|
+
</StatusInfo>
|
|
617
|
+
</td>
|
|
618
|
+
)
|
|
619
|
+
}
|
|
575
620
|
if (column === 'orderNumber') {
|
|
576
621
|
return (
|
|
577
622
|
<td
|
|
@@ -102,6 +102,20 @@ export const OrderTbody = styled.tbody`
|
|
|
102
102
|
border-bottom: 1px solid ${props => props.theme.colors.borderColor};
|
|
103
103
|
cursor: pointer;
|
|
104
104
|
|
|
105
|
+
/* &[data-status="delayed"] {
|
|
106
|
+
background-color: ${props => props.theme.colors.danger100};
|
|
107
|
+
td {
|
|
108
|
+
border-top: 1px solid ${props => props.theme.colors.danger} !important;
|
|
109
|
+
border-bottom: 1px solid ${props => props.theme.colors.danger} !important;
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
&[data-status="at_risk"] {
|
|
113
|
+
background-color: ${props => props.theme.colors.warning100};
|
|
114
|
+
td {
|
|
115
|
+
border-top: 1px solid ${props => props.theme.colors.warning} !important;
|
|
116
|
+
border-bottom: 1px solid ${props => props.theme.colors.warning} !important;
|
|
117
|
+
}
|
|
118
|
+
} */
|
|
105
119
|
&:hover {
|
|
106
120
|
background-color: ${props => props.theme.colors.lightPrimary};
|
|
107
121
|
}
|