ordering-ui-admin-external 1.30.0 → 1.30.2
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.046d3a07ef07287d2ee0.js → ordering-ui-admin.6be018fe653b04c6fa85.js} +2 -2
- package/_modules/components/Delivery/DriversGroupAutoassign/index.js +11 -2
- package/_modules/components/Delivery/DriversGroupAutoassign/styles.js +28 -25
- package/_modules/components/Orders/CompanySelector/styles.js +1 -1
- package/_modules/components/Orders/DriverMultiSelector/index.js +149 -0
- package/_modules/components/Orders/DriverMultiSelector/styles.js +83 -0
- package/_modules/components/Orders/DriverSelector/index.js +116 -147
- package/_modules/components/Orders/DriverSelector/styles.js +25 -36
- package/_modules/components/Orders/OrderContactInformation/index.js +1 -1
- package/_modules/components/Orders/OrderContactInformation/styles.js +26 -18
- package/_modules/components/Orders/OrdersContentHeader/index.js +1 -1
- package/_modules/components/Orders/OrdersFilterGroup/index.js +44 -5
- package/_modules/components/Orders/OrdersFilterGroup/styles.js +13 -3
- package/_modules/components/Users/UsersList/index.js +7 -3
- package/_modules/components/Users/UsersList/styles.js +1 -1
- package/package.json +2 -2
- package/src/components/Delivery/DriversGroupAutoassign/index.js +7 -0
- package/src/components/Delivery/DriversGroupAutoassign/styles.js +4 -0
- package/src/components/Orders/CompanySelector/styles.js +1 -0
- package/src/components/Orders/DriverMultiSelector/index.js +124 -0
- package/src/components/Orders/DriverMultiSelector/styles.js +150 -0
- package/src/components/Orders/DriverSelector/index.js +120 -149
- package/src/components/Orders/DriverSelector/styles.js +23 -25
- package/src/components/Orders/OrderContactInformation/index.js +3 -2
- package/src/components/Orders/OrderContactInformation/styles.js +24 -4
- package/src/components/Orders/OrdersContentHeader/index.js +1 -1
- package/src/components/Orders/OrdersFilterGroup/index.js +26 -5
- package/src/components/Orders/OrdersFilterGroup/styles.js +41 -0
- package/src/components/Users/UsersList/index.js +16 -1
- package/src/components/Users/UsersList/styles.js +6 -3
- /package/_bundles/{ordering-ui-admin.046d3a07ef07287d2ee0.js.LICENSE.txt → ordering-ui-admin.6be018fe653b04c6fa85.js.LICENSE.txt} +0 -0
|
@@ -3,7 +3,6 @@ import { useLanguage, DriversList as DriversController } from 'ordering-componen
|
|
|
3
3
|
import { useTheme } from 'styled-components'
|
|
4
4
|
import { Select } from '../../../styles/Select'
|
|
5
5
|
import { Select as FirstSelect } from '../../../styles/Select/FirstSelect'
|
|
6
|
-
import { MultiSelect } from '../../../styles/MultiSelect'
|
|
7
6
|
|
|
8
7
|
import {
|
|
9
8
|
Option,
|
|
@@ -12,24 +11,22 @@ import {
|
|
|
12
11
|
WrapperDriverImage,
|
|
13
12
|
DriverImage,
|
|
14
13
|
DriverName,
|
|
15
|
-
|
|
16
|
-
|
|
14
|
+
OptionInnerContainer,
|
|
15
|
+
SelectWrapper
|
|
17
16
|
} from './styles'
|
|
18
17
|
|
|
19
18
|
const DriverSelectorUI = (props) => {
|
|
20
19
|
const {
|
|
20
|
+
driverActionStatus,
|
|
21
|
+
companyActionStatus,
|
|
21
22
|
isFirstSelect,
|
|
22
23
|
order,
|
|
23
24
|
driversList,
|
|
24
25
|
defaultValue,
|
|
25
26
|
isPhoneView,
|
|
26
|
-
isFilterView,
|
|
27
27
|
small,
|
|
28
28
|
padding,
|
|
29
|
-
orderView,
|
|
30
29
|
handleAssignDriver,
|
|
31
|
-
handleChangeDriver,
|
|
32
|
-
filterValues,
|
|
33
30
|
isTourOpen,
|
|
34
31
|
setCurrentTourStep,
|
|
35
32
|
handleOpenMessages
|
|
@@ -39,47 +36,48 @@ const DriverSelectorUI = (props) => {
|
|
|
39
36
|
const theme = useTheme()
|
|
40
37
|
const [defaultOption, setDefaultOption] = useState(null)
|
|
41
38
|
const [driversOptionList, setDriversOptionList] = useState([])
|
|
42
|
-
const [driversMultiOptionList, setDriversMultiOptionList] = useState([])
|
|
43
39
|
const [searchValue, setSearchValue] = useState(null)
|
|
44
|
-
const driversLoading = [{ value: 'default', content: <Option small={small}>{t('LOADING', 'loading')}...</Option> }]
|
|
40
|
+
const driversLoading = [{ value: 'default', content: <Option small={small}><span>{t('LOADING', 'loading')}...</span></Option> }]
|
|
41
|
+
|
|
42
|
+
const getOption = (driver) => {
|
|
43
|
+
return {
|
|
44
|
+
value: driver.id,
|
|
45
|
+
disabled: !(driver?.enabled && driver?.available && !driver?.busy),
|
|
46
|
+
content: (
|
|
47
|
+
<Option small={small} isPhoneView={isPhoneView} padding={padding}>
|
|
48
|
+
<OptionInnerContainer>
|
|
49
|
+
<WrapperDriverImage small={small} className='driver-photo'>
|
|
50
|
+
<DriverImage bgimage={driver.photo || theme.images.icons?.noDriver} small={small} />
|
|
51
|
+
</WrapperDriverImage>
|
|
52
|
+
<OptionContent>
|
|
53
|
+
<DriverNameContainer className='driver-info'>
|
|
54
|
+
<DriverName small={small}>{driver.name} {driver.lastname} <span className='assigned-orders'>({driver?.assigned_orders_count} {t('ASSIGNED_ORDERS', 'Assigned orders')})</span></DriverName>
|
|
55
|
+
</DriverNameContainer>
|
|
56
|
+
</OptionContent>
|
|
57
|
+
</OptionInnerContainer>
|
|
58
|
+
</Option>
|
|
59
|
+
)
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
|
|
45
63
|
useEffect(() => {
|
|
46
64
|
const _driversOptionList = [
|
|
47
65
|
{
|
|
48
66
|
value: 'default',
|
|
49
|
-
content: (
|
|
50
|
-
<Option
|
|
51
|
-
padding={orderView ? padding : '0px'}
|
|
52
|
-
>
|
|
53
|
-
{orderView ? (
|
|
54
|
-
<>
|
|
55
|
-
<WrapperDriverImage small={small} className='driver-photo'>
|
|
56
|
-
<DriverImage bgimage={theme?.images?.icons?.noDriver} small={small} />
|
|
57
|
-
</WrapperDriverImage>
|
|
58
|
-
<OptionContent>
|
|
59
|
-
<DriverNameContainer className='driver-info'>
|
|
60
|
-
<DriverName small={small}>{t('NO_DRIVER', 'No Driver')}</DriverName>
|
|
61
|
-
</DriverNameContainer>
|
|
62
|
-
</OptionContent>
|
|
63
|
-
</>
|
|
64
|
-
) : (
|
|
65
|
-
<span>{t('SELECT_DRIVER', 'Select driver')}</span>
|
|
66
|
-
)}
|
|
67
|
-
</Option>
|
|
68
|
-
),
|
|
67
|
+
content: <Option padding='0px'><span>{t('SELECT_DRIVER', 'Select driver')}</span></Option>,
|
|
69
68
|
color: 'primary',
|
|
70
|
-
disabled:
|
|
69
|
+
disabled: true,
|
|
71
70
|
showDisable: true
|
|
72
71
|
}
|
|
73
72
|
]
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
}
|
|
73
|
+
_driversOptionList.push({
|
|
74
|
+
value: 'remove',
|
|
75
|
+
content: (
|
|
76
|
+
<Option isRemove><span>{t('REMOVE_DRIVER', 'Remove assigned driver')}</span></Option>
|
|
77
|
+
),
|
|
78
|
+
disabled: defaultValue === 'default'
|
|
79
|
+
})
|
|
80
|
+
|
|
83
81
|
if (!driversList.loading) {
|
|
84
82
|
let _driverList
|
|
85
83
|
if (searchValue) {
|
|
@@ -87,44 +85,54 @@ const DriverSelectorUI = (props) => {
|
|
|
87
85
|
} else {
|
|
88
86
|
_driverList = driversList.drivers
|
|
89
87
|
}
|
|
90
|
-
const
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
content: (
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
<DriverName small={small}>{driver.name} {driver.lastname}</DriverName>
|
|
102
|
-
<DriverText small={small}>{t('DRIVER', 'Driver')}</DriverText>
|
|
103
|
-
</DriverNameContainer>
|
|
104
|
-
</OptionContent>
|
|
105
|
-
</Option>
|
|
106
|
-
)
|
|
107
|
-
}
|
|
108
|
-
})
|
|
88
|
+
const availableDrivers = _driverList.filter(driver => driver?.enabled && driver?.available && !driver?.busy)
|
|
89
|
+
if (availableDrivers.length) {
|
|
90
|
+
_driversOptionList.push({
|
|
91
|
+
value: 'available',
|
|
92
|
+
content: <Option><span>{t('AVAILABLE', 'Available')}</span></Option>,
|
|
93
|
+
disabled: true
|
|
94
|
+
})
|
|
95
|
+
availableDrivers.forEach(driver => {
|
|
96
|
+
_driversOptionList.push(getOption(driver))
|
|
97
|
+
})
|
|
98
|
+
}
|
|
109
99
|
|
|
110
|
-
|
|
100
|
+
const busyDrivers = _driverList.filter(driver => driver?.enabled && driver?.available && driver?.busy)
|
|
101
|
+
if (busyDrivers.length) {
|
|
102
|
+
_driversOptionList.push({
|
|
103
|
+
value: 'busy',
|
|
104
|
+
content: <Option><span>{t('BUSY', 'Busy')}</span></Option>,
|
|
105
|
+
disabled: true
|
|
106
|
+
})
|
|
107
|
+
busyDrivers.forEach(driver => {
|
|
108
|
+
_driversOptionList.push(getOption(driver))
|
|
109
|
+
})
|
|
110
|
+
}
|
|
111
111
|
|
|
112
|
-
|
|
113
|
-
|
|
112
|
+
const notAvailableDrivers = _driverList.filter(driver => driver?.enabled && !driver?.available)
|
|
113
|
+
if (notAvailableDrivers.length) {
|
|
114
|
+
_driversOptionList.push({
|
|
115
|
+
value: 'not_available',
|
|
116
|
+
content: <Option><span>{t('NOT_AVAILABLE', 'Not available')}</span></Option>,
|
|
117
|
+
disabled: true
|
|
118
|
+
})
|
|
119
|
+
notAvailableDrivers.forEach(driver => {
|
|
120
|
+
_driversOptionList.push(getOption(driver))
|
|
121
|
+
})
|
|
114
122
|
}
|
|
115
123
|
}
|
|
116
124
|
setDriversOptionList(_driversOptionList)
|
|
117
125
|
}, [driversList, defaultValue, searchValue])
|
|
118
126
|
|
|
127
|
+
useEffect(() => {
|
|
128
|
+
if (!companyActionStatus?.error && !driverActionStatus?.error) return
|
|
129
|
+
setAlertState({
|
|
130
|
+
open: true,
|
|
131
|
+
content: companyActionStatus?.error || driverActionStatus?.error
|
|
132
|
+
})
|
|
133
|
+
}, [companyActionStatus?.error, driverActionStatus?.error])
|
|
134
|
+
|
|
119
135
|
const changeDriver = (driverId) => {
|
|
120
|
-
if (isFilterView) {
|
|
121
|
-
if (driverId === 'default') {
|
|
122
|
-
handleChangeDriver(null)
|
|
123
|
-
} else {
|
|
124
|
-
handleChangeDriver(driverId)
|
|
125
|
-
}
|
|
126
|
-
return
|
|
127
|
-
}
|
|
128
136
|
if (driverId === 'default') return
|
|
129
137
|
if (driverId === 'remove') {
|
|
130
138
|
driverId = null
|
|
@@ -142,95 +150,58 @@ const DriverSelectorUI = (props) => {
|
|
|
142
150
|
setDefaultOption(defaultValue)
|
|
143
151
|
}, [defaultValue])
|
|
144
152
|
|
|
145
|
-
const Placeholder = <PlaceholderTitle>{t('SELECT_DRIVER', 'Select driver')}</PlaceholderTitle>
|
|
146
|
-
|
|
147
153
|
const handleSearch = (val) => {
|
|
148
154
|
setSearchValue(val)
|
|
149
155
|
}
|
|
150
156
|
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
157
|
+
return (
|
|
158
|
+
<SelectWrapper>
|
|
159
|
+
{!driversList.loading ? (
|
|
160
|
+
<>
|
|
161
|
+
{isFirstSelect ? (
|
|
162
|
+
<FirstSelect
|
|
163
|
+
defaultValue={defaultOption || 'default'}
|
|
164
|
+
options={driversOptionList}
|
|
165
|
+
optionInnerMaxHeight='200px'
|
|
166
|
+
onChange={(driverId) => changeDriver(driverId)}
|
|
167
|
+
isShowSearchBar
|
|
168
|
+
searchBarPlaceholder={t('SEARCH', 'Search')}
|
|
169
|
+
searchBarIsCustomLayout
|
|
170
|
+
searchBarIsNotLazyLoad
|
|
171
|
+
searchValue={searchValue}
|
|
172
|
+
handleChangeSearch={handleSearch}
|
|
173
|
+
className='driver-select'
|
|
174
|
+
/>
|
|
175
|
+
) : (
|
|
176
|
+
<Select
|
|
177
|
+
defaultValue={defaultOption || 'default'}
|
|
178
|
+
options={driversOptionList}
|
|
179
|
+
optionInnerMaxHeight='200px'
|
|
180
|
+
onChange={(driverId) => changeDriver(driverId)}
|
|
181
|
+
isShowSearchBar
|
|
182
|
+
searchBarIsNotLazyLoad
|
|
183
|
+
searchBarPlaceholder={t('SEARCH', 'Search')}
|
|
184
|
+
searchBarIsCustomLayout
|
|
185
|
+
searchValue={searchValue}
|
|
186
|
+
handleChangeSearch={handleSearch}
|
|
187
|
+
className='driver-select'
|
|
188
|
+
/>
|
|
189
|
+
)}
|
|
190
|
+
</>
|
|
191
|
+
) : (
|
|
192
|
+
<>
|
|
193
|
+
<Select
|
|
194
|
+
placeholder={t('SELECT_DRIVER', 'Select driver')}
|
|
170
195
|
defaultValue='default'
|
|
171
196
|
options={driversLoading}
|
|
172
197
|
optionInnerMargin='10px'
|
|
173
|
-
optionInnerMaxHeight='
|
|
198
|
+
optionInnerMaxHeight='200px'
|
|
174
199
|
className='driver-select'
|
|
175
|
-
isShowSearchBar
|
|
176
|
-
searchBarIsCustomLayout
|
|
177
|
-
searchBarIsNotLazyLoad
|
|
178
|
-
searchValue={searchValue}
|
|
179
|
-
handleChangeSearch={(val) => setSearchValue(val)}
|
|
180
200
|
/>
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
return (
|
|
186
|
-
<>
|
|
187
|
-
{!driversList.loading ? (
|
|
188
|
-
<>
|
|
189
|
-
{isFirstSelect ? (
|
|
190
|
-
<FirstSelect
|
|
191
|
-
defaultValue={defaultOption || 'default'}
|
|
192
|
-
options={driversOptionList}
|
|
193
|
-
optionInnerMaxHeight='200px'
|
|
194
|
-
onChange={(driverId) => changeDriver(driverId)}
|
|
195
|
-
isShowSearchBar
|
|
196
|
-
searchBarPlaceholder={t('SEARCH', 'Search')}
|
|
197
|
-
searchBarIsCustomLayout
|
|
198
|
-
searchBarIsNotLazyLoad
|
|
199
|
-
searchValue={searchValue}
|
|
200
|
-
handleChangeSearch={handleSearch}
|
|
201
|
-
className='driver-select'
|
|
202
|
-
/>
|
|
203
|
-
) : (
|
|
204
|
-
<Select
|
|
205
|
-
defaultValue={defaultOption || 'default'}
|
|
206
|
-
options={driversOptionList}
|
|
207
|
-
optionInnerMaxHeight='200px'
|
|
208
|
-
onChange={(driverId) => changeDriver(driverId)}
|
|
209
|
-
isShowSearchBar
|
|
210
|
-
searchBarIsNotLazyLoad
|
|
211
|
-
searchBarPlaceholder={t('SEARCH', 'Search')}
|
|
212
|
-
searchBarIsCustomLayout
|
|
213
|
-
searchValue={searchValue}
|
|
214
|
-
handleChangeSearch={handleSearch}
|
|
215
|
-
className='driver-select'
|
|
216
|
-
/>
|
|
217
|
-
)}
|
|
218
|
-
</>
|
|
219
|
-
) : (
|
|
220
|
-
<>
|
|
221
|
-
<Select
|
|
222
|
-
placeholder={t('SELECT_DRIVER', 'Select driver')}
|
|
223
|
-
defaultValue='default'
|
|
224
|
-
options={driversLoading}
|
|
225
|
-
optionInnerMargin='10px'
|
|
226
|
-
optionInnerMaxHeight='200px'
|
|
227
|
-
className='driver-select'
|
|
228
|
-
/>
|
|
229
|
-
</>
|
|
230
|
-
)}
|
|
231
|
-
</>
|
|
232
|
-
)
|
|
233
|
-
}
|
|
201
|
+
</>
|
|
202
|
+
)}
|
|
203
|
+
</SelectWrapper>
|
|
204
|
+
)
|
|
234
205
|
}
|
|
235
206
|
|
|
236
207
|
export const DriverSelector = (props) => {
|
|
@@ -1,6 +1,16 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
2
|
import styled, { css } from 'styled-components'
|
|
3
3
|
|
|
4
|
+
export const SelectWrapper = styled.div`
|
|
5
|
+
.header {
|
|
6
|
+
> div {
|
|
7
|
+
> div {
|
|
8
|
+
padding: 0;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
`
|
|
13
|
+
|
|
4
14
|
export const Option = styled.div`
|
|
5
15
|
display: flex;
|
|
6
16
|
align-items: center;
|
|
@@ -29,6 +39,7 @@ export const Option = styled.div`
|
|
|
29
39
|
`}
|
|
30
40
|
|
|
31
41
|
span {
|
|
42
|
+
font-size: 14px;
|
|
32
43
|
overflow: hidden;
|
|
33
44
|
white-space: nowrap;
|
|
34
45
|
text-overflow: ellipsis;
|
|
@@ -37,19 +48,22 @@ export const Option = styled.div`
|
|
|
37
48
|
|
|
38
49
|
@media (max-width: 576px) {
|
|
39
50
|
padding: ${({ padding }) => padding || '5px 0px'};
|
|
40
|
-
${({ isFilterView }) => isFilterView && css`
|
|
41
|
-
${props => props.theme?.rtl ? css`
|
|
42
|
-
margin-right: 10px;
|
|
43
|
-
` : css`
|
|
44
|
-
margin-left: 10px;
|
|
45
|
-
`}
|
|
46
|
-
`}
|
|
47
51
|
span {
|
|
48
52
|
max-width: 280px;
|
|
49
53
|
}
|
|
50
54
|
}
|
|
51
55
|
`
|
|
52
56
|
|
|
57
|
+
export const OptionInnerContainer = styled.div`
|
|
58
|
+
display: flex;
|
|
59
|
+
align-items: center;
|
|
60
|
+
${props => props.theme?.rtl ? css`
|
|
61
|
+
padding-right: 20px;
|
|
62
|
+
` : css`
|
|
63
|
+
padding-left: 20px;
|
|
64
|
+
`}
|
|
65
|
+
`
|
|
66
|
+
|
|
53
67
|
export const OptionContent = styled.div`
|
|
54
68
|
flex: 1;
|
|
55
69
|
display: flex;
|
|
@@ -70,7 +84,7 @@ export const DriverName = styled.p`
|
|
|
70
84
|
overflow: hidden;
|
|
71
85
|
white-space: nowrap;
|
|
72
86
|
text-overflow: ellipsis;
|
|
73
|
-
max-width:
|
|
87
|
+
max-width: 350px;
|
|
74
88
|
margin: 0px;
|
|
75
89
|
|
|
76
90
|
${({ small }) => small && css`
|
|
@@ -78,16 +92,9 @@ export const DriverName = styled.p`
|
|
|
78
92
|
`}
|
|
79
93
|
|
|
80
94
|
@media (max-width: 576px) {
|
|
81
|
-
max-width:
|
|
95
|
+
max-width: 150px;
|
|
82
96
|
}
|
|
83
97
|
`
|
|
84
|
-
export const DriverText = styled.span`
|
|
85
|
-
font-size: 12px;
|
|
86
|
-
color: ${props => props.theme.colors.lightGray};
|
|
87
|
-
${({ small }) => small && css`
|
|
88
|
-
display: none;
|
|
89
|
-
`}
|
|
90
|
-
`
|
|
91
98
|
|
|
92
99
|
export const WrapperDriverImage = styled.div`
|
|
93
100
|
width: 45px;
|
|
@@ -141,12 +148,3 @@ export const DriverImage = (props) => {
|
|
|
141
148
|
</DriverImageStyled>
|
|
142
149
|
)
|
|
143
150
|
}
|
|
144
|
-
|
|
145
|
-
export const PlaceholderTitle = styled(Option)`
|
|
146
|
-
padding: 10px;
|
|
147
|
-
|
|
148
|
-
${({ isSingle }) => isSingle && css`
|
|
149
|
-
padding: 0px;
|
|
150
|
-
font-size: 14px;
|
|
151
|
-
`}
|
|
152
|
-
`
|
|
@@ -19,6 +19,7 @@ import {
|
|
|
19
19
|
DriverInfoContainer,
|
|
20
20
|
DriverInfo,
|
|
21
21
|
DriverSelectorContainer,
|
|
22
|
+
CompanySelectorContainer,
|
|
22
23
|
CutsomerDetail,
|
|
23
24
|
CustomerInfoTable,
|
|
24
25
|
ToggleItemWrapper,
|
|
@@ -217,7 +218,7 @@ export const OrderContactInformation = (props) => {
|
|
|
217
218
|
{order?.delivery_type === 1 && !isServiceOrder && (
|
|
218
219
|
<>
|
|
219
220
|
{!order?.driver_id && (
|
|
220
|
-
<
|
|
221
|
+
<CompanySelectorContainer>
|
|
221
222
|
<p>{t('DRIVER_COMPANY', 'Driver company')}</p>
|
|
222
223
|
<CompanySelector
|
|
223
224
|
small
|
|
@@ -230,7 +231,7 @@ export const OrderContactInformation = (props) => {
|
|
|
230
231
|
isOrderDrivers
|
|
231
232
|
orderId={order?.id}
|
|
232
233
|
/>
|
|
233
|
-
</
|
|
234
|
+
</CompanySelectorContainer>
|
|
234
235
|
)}
|
|
235
236
|
{!order?.driver_company_id && (
|
|
236
237
|
<DriverSelectorContainer>
|
|
@@ -108,7 +108,7 @@ export const DriverInfoContainer = styled.div`
|
|
|
108
108
|
`
|
|
109
109
|
export const DriverInfo = styled(BusinessInfo)``
|
|
110
110
|
|
|
111
|
-
export const
|
|
111
|
+
export const CompanySelectorContainer = styled.div`
|
|
112
112
|
display: flex;
|
|
113
113
|
flex-direction: column;
|
|
114
114
|
margin-top: 23px;
|
|
@@ -133,11 +133,31 @@ export const DriverSelectorContainer = styled.div`
|
|
|
133
133
|
}
|
|
134
134
|
}
|
|
135
135
|
}
|
|
136
|
+
`
|
|
137
|
+
export const DriverSelectorContainer = styled.div`
|
|
138
|
+
display: flex;
|
|
139
|
+
flex-direction: column;
|
|
140
|
+
margin-top: 23px;
|
|
141
|
+
margin-bottom: 13px;
|
|
142
|
+
> p {
|
|
143
|
+
font-size: 14px;
|
|
144
|
+
margin-top: 0;
|
|
145
|
+
margin-bottom: 15px;
|
|
146
|
+
}
|
|
147
|
+
> div {
|
|
148
|
+
width: 100%;
|
|
149
|
+
border-radius: 8px;
|
|
150
|
+
background-color: ${props => props.theme.colors?.secundary};
|
|
136
151
|
|
|
137
|
-
@media (max-width: 576px) {
|
|
138
152
|
> div {
|
|
139
|
-
|
|
140
|
-
|
|
153
|
+
> div {
|
|
154
|
+
&:first-child {
|
|
155
|
+
border: none;
|
|
156
|
+
height: 50px;
|
|
157
|
+
}
|
|
158
|
+
> div:first-child {
|
|
159
|
+
color: ${props => props.theme.colors?.headingColor};
|
|
160
|
+
}
|
|
141
161
|
}
|
|
142
162
|
}
|
|
143
163
|
}
|
|
@@ -60,7 +60,7 @@ export const OrdersContentHeader = (props) => {
|
|
|
60
60
|
_filterApplied = filterValues?.groupTypes?.length || filterValues.businessIds.length > 0 || filterValues.cityIds.length > 0 ||
|
|
61
61
|
filterValues.deliveryEndDatetime !== null || filterValues.deliveryFromDatetime !== null || filterValues.deliveryTypes.length > 0 ||
|
|
62
62
|
filterValues.driverIds.length > 0 || filterValues.paymethodIds.length > 0 || filterValues.statuses.length > 0 || filterValues?.metafield?.length > 0 ||
|
|
63
|
-
filterValues?.externalId
|
|
63
|
+
filterValues?.externalId || filterValues?.logisticStatus !== null
|
|
64
64
|
}
|
|
65
65
|
setFilterApplied(_filterApplied)
|
|
66
66
|
}, [filterValues])
|
|
@@ -4,7 +4,7 @@ import { useLanguage, OrdersFilter as OrdersFilterController } from 'ordering-co
|
|
|
4
4
|
import { BusinessesSelector } from '../BusinessesSelector'
|
|
5
5
|
import { DriversGroupTypeSelector } from '../DriversGroupTypeSelector'
|
|
6
6
|
import { DateTypeSelector } from '../DateTypeSelector'
|
|
7
|
-
import {
|
|
7
|
+
import { DriverMultiSelector } from '../DriverMultiSelector'
|
|
8
8
|
import { CitySelector, Modal } from '../../Shared'
|
|
9
9
|
// import { OrderStatusTypeSelector } from '../OrderStatusTypeSelector'
|
|
10
10
|
import { DeliveryTypeSelector } from '../DeliveryTypeSelector'
|
|
@@ -13,6 +13,7 @@ import { CountryFilter } from '../CountryFilter'
|
|
|
13
13
|
import { Button, IconButton, Input } from '../../../styles'
|
|
14
14
|
import { CurrencyFilter } from '../CurrencyFilter'
|
|
15
15
|
import { getUniqueId } from '../../../utils'
|
|
16
|
+
import { Select } from '../../../styles/Select/FirstSelect'
|
|
16
17
|
|
|
17
18
|
import {
|
|
18
19
|
FilterGroupListContainer,
|
|
@@ -20,8 +21,11 @@ import {
|
|
|
20
21
|
// MultiSelectContainer,
|
|
21
22
|
ButtonGroup,
|
|
22
23
|
AddInputWrapper,
|
|
23
|
-
AddMetaFiled
|
|
24
|
+
AddMetaFiled,
|
|
25
|
+
SelectWrapper,
|
|
26
|
+
Option
|
|
24
27
|
} from './styles'
|
|
28
|
+
import { LogisticStatusDot } from '../OrdersTable/styles'
|
|
25
29
|
|
|
26
30
|
const OrdersFilterGroupUI = (props) => {
|
|
27
31
|
const {
|
|
@@ -51,7 +55,8 @@ const OrdersFilterGroupUI = (props) => {
|
|
|
51
55
|
handleChangeMetaFieldValue,
|
|
52
56
|
handleAddMetaField,
|
|
53
57
|
handleDeleteMetafield,
|
|
54
|
-
handleChangeExternalId
|
|
58
|
+
handleChangeExternalId,
|
|
59
|
+
handleChangeChildFilterValue
|
|
55
60
|
} = props
|
|
56
61
|
|
|
57
62
|
const [, t] = useLanguage()
|
|
@@ -59,6 +64,14 @@ const OrdersFilterGroupUI = (props) => {
|
|
|
59
64
|
const [isShow, setIsShow] = useState(false)
|
|
60
65
|
const metafieldRef = useRef()
|
|
61
66
|
|
|
67
|
+
const logisticStatusList = [
|
|
68
|
+
{ value: 0, content: <Option>{t('PENDING', 'Pending')}<LogisticStatusDot status={0} /></Option> },
|
|
69
|
+
{ value: 1, content: <Option>{t('IN_PROGRESS', 'In progress')}<LogisticStatusDot status={1} /></Option> },
|
|
70
|
+
{ value: 2, content: <Option>{t('IN_QUEUE', 'In queue')}<LogisticStatusDot status={2} /></Option> },
|
|
71
|
+
{ value: 3, content: <Option>{t('EXPIRED', 'Expired')}<LogisticStatusDot status={3} /></Option> },
|
|
72
|
+
{ value: 4, content: <Option>{t('RESOLVED', 'Resolved')}<LogisticStatusDot status={4} /></Option> }
|
|
73
|
+
]
|
|
74
|
+
|
|
62
75
|
const handleAcceptFilter = () => {
|
|
63
76
|
handleChangeFilterValues(filterValues)
|
|
64
77
|
handleCloseFilterModal()
|
|
@@ -140,8 +153,7 @@ const OrdersFilterGroupUI = (props) => {
|
|
|
140
153
|
businessesList={businessesList}
|
|
141
154
|
handleChangeBusinesses={handleChangeBusinesses}
|
|
142
155
|
/>
|
|
143
|
-
<
|
|
144
|
-
isFilterView
|
|
156
|
+
<DriverMultiSelector
|
|
145
157
|
drivers={driversList.drivers}
|
|
146
158
|
filterValues={filterValues}
|
|
147
159
|
handleChangeDriver={handleChangeDriver}
|
|
@@ -181,6 +193,15 @@ const OrdersFilterGroupUI = (props) => {
|
|
|
181
193
|
filterValues={filterValues}
|
|
182
194
|
handleChangeCurrency={handleChangeCurrency}
|
|
183
195
|
/>
|
|
196
|
+
<SelectWrapper>
|
|
197
|
+
<Select
|
|
198
|
+
options={logisticStatusList}
|
|
199
|
+
className='select'
|
|
200
|
+
defaultValue={filterValues?.logisticStatus ?? ''}
|
|
201
|
+
placeholder={t('SELECT_LOGISTIC_STATUS', 'Select a logistic status')}
|
|
202
|
+
onChange={(value) => handleChangeChildFilterValue({ logisticStatus: value })}
|
|
203
|
+
/>
|
|
204
|
+
</SelectWrapper>
|
|
184
205
|
</WrapperRow>
|
|
185
206
|
{filterValues?.metafield.map(item => (
|
|
186
207
|
<WrapperRow key={item.id}>
|
|
@@ -149,3 +149,44 @@ export const AddMetaFiled = styled.span`
|
|
|
149
149
|
cursor: pointer;
|
|
150
150
|
width: 100%;
|
|
151
151
|
`
|
|
152
|
+
|
|
153
|
+
export const SelectWrapper = styled.div`
|
|
154
|
+
> div {
|
|
155
|
+
width: 100%;
|
|
156
|
+
border: none;
|
|
157
|
+
height: 100%;
|
|
158
|
+
|
|
159
|
+
> div:first-child {
|
|
160
|
+
height: 100%;
|
|
161
|
+
background-color: ${props => props.theme.colors.secundary};
|
|
162
|
+
border: none;
|
|
163
|
+
border-radius: 7.6px;
|
|
164
|
+
font-weight: 400;
|
|
165
|
+
font-size: 14px;
|
|
166
|
+
line-height: 24px;
|
|
167
|
+
padding-left: 20px;
|
|
168
|
+
}
|
|
169
|
+
.list {
|
|
170
|
+
background-color: ${props => props.theme.colors.secundary};
|
|
171
|
+
border: none;
|
|
172
|
+
|
|
173
|
+
.list-wrapper {
|
|
174
|
+
> div {
|
|
175
|
+
padding: 6px 10px;
|
|
176
|
+
&:hover {
|
|
177
|
+
background-color: #f2f5f7;
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
`
|
|
184
|
+
|
|
185
|
+
export const Option = styled.div`
|
|
186
|
+
font-weight: 400;
|
|
187
|
+
font-size: 14px;
|
|
188
|
+
line-height: 24px;
|
|
189
|
+
color: ${props => props.theme.colors.secundaryContrast};
|
|
190
|
+
display: flex;
|
|
191
|
+
align-items: center;
|
|
192
|
+
`
|
|
@@ -138,9 +138,10 @@ export const UsersList = (props) => {
|
|
|
138
138
|
<Square />
|
|
139
139
|
)}
|
|
140
140
|
</CheckBoxWrapper>
|
|
141
|
-
{t('
|
|
141
|
+
{t('ID', 'Id')}
|
|
142
142
|
</AllCheckWrapper>
|
|
143
143
|
</th>
|
|
144
|
+
<th>{t('USER', 'User')}</th>
|
|
144
145
|
<th>{t('PHONE', 'Phone')}</th>
|
|
145
146
|
<th>{t('TYPE', 'Type')}</th>
|
|
146
147
|
<th className='amout-orders '>{t('AMOUNT_OF_ORDERS', 'Amount of orders')}</th>
|
|
@@ -156,6 +157,13 @@ export const UsersList = (props) => {
|
|
|
156
157
|
<CheckBoxWrapper>
|
|
157
158
|
<Skeleton width={20} height={20} />
|
|
158
159
|
</CheckBoxWrapper>
|
|
160
|
+
<InfoBlock>
|
|
161
|
+
<p><Skeleton width={70} /></p>
|
|
162
|
+
</InfoBlock>
|
|
163
|
+
</UserMainInfo>
|
|
164
|
+
</td>
|
|
165
|
+
<td>
|
|
166
|
+
<UserMainInfo>
|
|
159
167
|
<WrapperImage isSkeleton>
|
|
160
168
|
<Skeleton width={45} height={45} />
|
|
161
169
|
</WrapperImage>
|
|
@@ -201,6 +209,13 @@ export const UsersList = (props) => {
|
|
|
201
209
|
<Square />
|
|
202
210
|
)}
|
|
203
211
|
</CheckBoxWrapper>
|
|
212
|
+
<InfoBlock>
|
|
213
|
+
<p className='bold'>{user?.id}</p>
|
|
214
|
+
</InfoBlock>
|
|
215
|
+
</UserMainInfo>
|
|
216
|
+
</td>
|
|
217
|
+
<td>
|
|
218
|
+
<UserMainInfo>
|
|
204
219
|
<WrapperImage>
|
|
205
220
|
{user?.photo ? (
|
|
206
221
|
<Image bgimage={optimizeImage(user?.photo, 'h_50,c_limit')} />
|