ordering-ui-admin-external 1.39.9 → 1.40.0
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.a195abab9ce10c18d568.js → ordering-ui-admin.27b7bb0f04b6581074ce.js} +2 -2
- package/_modules/components/BusinessIntelligence/InvoiceDriverPdf/index.js +2 -1
- package/_modules/components/BusinessIntelligence/Reports/ReportsSlaOrders/index.js +84 -8
- package/_modules/components/BusinessIntelligence/Reports/ReportsSlaOrders/styles.js +8 -4
- package/_modules/components/Delivery/DriversGroupAddForm/BusinessesForm/index.js +23 -4
- package/_modules/components/Delivery/DriversGroupAddForm/BusinessesForm/styles.js +7 -3
- package/_modules/components/Delivery/DriversGroupBusinesses/index.js +23 -4
- package/_modules/components/Delivery/DriversGroupBusinesses/styles.js +7 -3
- package/_modules/components/Delivery/DriversGroupsListing/index.js +2 -0
- package/_modules/components/Delivery/UsersListingHeader/index.js +9 -1
- package/_modules/components/Delivery/UsersListingHeader/styles.js +17 -2
- package/_modules/components/MyProducts/AdvancedSettings/index.js +20 -0
- package/_modules/components/MyProducts/AppLayout/index.js +56 -46
- package/_modules/components/MyProducts/CallCenterApp/index.js +2 -6
- package/_modules/components/MyProducts/CustomProject/index.js +1 -1
- package/_modules/components/MyProducts/CustomerApp/index.js +3 -1
- package/_modules/components/MyProducts/DriverApp/index.js +3 -1
- package/_modules/components/MyProducts/KioskApp/index.js +2 -4
- package/_modules/components/MyProducts/StoreApp/index.js +3 -1
- package/_modules/components/Orders/AllInOne/DriversManager/index.js +13 -5
- package/_modules/components/Orders/AllInOne/index.js +13 -4
- package/_modules/components/Orders/DeliveriesLocation/index.js +6 -2
- package/_modules/components/Orders/DriversBusyStatusFilter/index.js +5 -2
- package/_modules/components/Orders/DriversBusyStatusFilter/styles.js +5 -2
- package/_modules/components/Orders/DriversList/Driver.js +67 -0
- package/_modules/components/Orders/DriversList/index.js +21 -48
- package/_modules/components/Orders/DriversList/styles.js +35 -26
- package/_modules/components/Orders/DriversLocation/index.js +8 -13
- package/_modules/components/Orders/DriversManager/index.js +10 -1
- package/_modules/components/Orders/DriversManager/styles.js +18 -3
- package/_modules/components/Orders/DriversOnlineOfflineFilter/index.js +5 -2
- package/_modules/components/Orders/DriversOnlineOfflineFilter/styles.js +11 -8
- package/_modules/components/Orders/OrderContactInformation/index.js +39 -18
- package/_modules/components/Orders/OrderContactInformation/styles.js +4 -3
- package/_modules/components/Orders/OrderDetails/index.js +8 -3
- package/_modules/components/Orders/OrderDetailsHeader/styles.js +1 -1
- package/_modules/components/Orders/OrderStatusTypeSelector/index.js +19 -27
- package/_modules/components/Orders/OrdersDashboard/index.js +2 -2
- package/_modules/components/Orders/OrdersFilterGroup/index.js +5 -2
- package/_modules/components/Orders/OrdersFilterGroup/styles.js +9 -3
- package/_modules/components/Orders/OrdersLateralBar/index.js +1 -0
- package/_modules/components/Orders/OrdersListing/index.js +12 -3
- package/_modules/components/Orders/OrdersListing/styles.js +23 -2
- package/_modules/components/Orders/OrdersManager/index.js +4 -2
- package/_modules/components/Orders/OrdersManager/test.js +975 -0
- package/_modules/components/Orders/OrdersTable/Order.js +230 -0
- package/_modules/components/Orders/OrdersTable/index.js +30 -200
- package/_modules/components/Orders/ProductItemAccordion/styles.js +1 -1
- package/_modules/components/Settings/SettingsLogs/index.js +174 -0
- package/_modules/components/Settings/SettingsLogs/styles.js +80 -0
- package/_modules/components/Settings/index.js +7 -0
- package/_modules/components/SidebarMenu/index.js +6 -1
- package/_modules/components/Stores/BusinessAdd/BusinessDetails/index.js +8 -3
- package/_modules/index.js +6 -0
- package/index-template.js +1 -1
- package/package.json +2 -2
- package/src/components/BusinessIntelligence/InvoiceDriverPdf/index.js +1 -1
- package/src/components/BusinessIntelligence/Reports/ReportsSlaOrders/index.js +71 -2
- package/src/components/BusinessIntelligence/Reports/ReportsSlaOrders/styles.js +15 -1
- package/src/components/Delivery/DriversGroupAddForm/BusinessesForm/index.js +46 -18
- package/src/components/Delivery/DriversGroupAddForm/BusinessesForm/styles.js +12 -0
- package/src/components/Delivery/DriversGroupBusinesses/index.js +46 -18
- package/src/components/Delivery/DriversGroupBusinesses/styles.js +12 -0
- package/src/components/Delivery/DriversGroupsListing/index.js +2 -0
- package/src/components/Delivery/UsersListingHeader/index.js +14 -2
- package/src/components/Delivery/UsersListingHeader/styles.js +55 -0
- package/src/components/MyProducts/AdvancedSettings/index.js +6 -1
- package/src/components/MyProducts/AppLayout/index.js +82 -64
- package/src/components/MyProducts/CallCenterApp/index.js +2 -6
- package/src/components/MyProducts/CustomProject/index.js +1 -1
- package/src/components/MyProducts/CustomerApp/index.js +3 -1
- package/src/components/MyProducts/DriverApp/index.js +3 -1
- package/src/components/MyProducts/KioskApp/index.js +2 -4
- package/src/components/MyProducts/StoreApp/index.js +3 -1
- package/src/components/Orders/AllInOne/DriversManager/index.js +8 -2
- package/src/components/Orders/AllInOne/index.js +10 -2
- package/src/components/Orders/DeliveriesLocation/index.js +8 -2
- package/src/components/Orders/DriversBusyStatusFilter/index.js +3 -2
- package/src/components/Orders/DriversBusyStatusFilter/styles.js +5 -0
- package/src/components/Orders/DriversList/Driver.js +61 -0
- package/src/components/Orders/DriversList/index.js +14 -41
- package/src/components/Orders/DriversList/styles.js +25 -1
- package/src/components/Orders/DriversLocation/index.js +12 -25
- package/src/components/Orders/DriversManager/index.js +15 -2
- package/src/components/Orders/DriversManager/styles.js +55 -0
- package/src/components/Orders/DriversOnlineOfflineFilter/index.js +3 -2
- package/src/components/Orders/DriversOnlineOfflineFilter/styles.js +11 -0
- package/src/components/Orders/OrderContactInformation/index.js +26 -3
- package/src/components/Orders/OrderContactInformation/styles.js +16 -0
- package/src/components/Orders/OrderDetails/index.js +19 -2
- package/src/components/Orders/OrderDetailsHeader/styles.js +3 -1
- package/src/components/Orders/OrderStatusTypeSelector/index.js +19 -27
- package/src/components/Orders/OrdersDashboard/index.js +2 -2
- package/src/components/Orders/OrdersFilterGroup/index.js +2 -1
- package/src/components/Orders/OrdersFilterGroup/styles.js +14 -5
- package/src/components/Orders/OrdersLateralBar/index.js +1 -0
- package/src/components/Orders/OrdersListing/index.js +20 -4
- package/src/components/Orders/OrdersListing/styles.js +62 -0
- package/src/components/Orders/OrdersManager/index.js +2 -0
- package/src/components/Orders/OrdersManager/test.js +602 -0
- package/src/components/Orders/OrdersTable/Order.js +281 -0
- package/src/components/Orders/OrdersTable/index.js +35 -252
- package/src/components/Orders/ProductItemAccordion/styles.js +0 -4
- package/src/components/Settings/SettingsLogs/index.js +307 -0
- package/src/components/Settings/SettingsLogs/styles.js +268 -0
- package/src/components/Settings/index.js +2 -0
- package/src/components/SidebarMenu/index.js +8 -1
- package/src/components/Stores/BusinessAdd/BusinessDetails/index.js +9 -0
- package/src/index.js +2 -0
- package/template/app.js +4 -0
- package/template/components/ListenPageChanges/index.js +1 -0
- package/template/helmetdata.json +7 -0
- package/template/pages/SettingsLogs/index.js +12 -0
- /package/_bundles/{ordering-ui-admin.a195abab9ce10c18d568.js.LICENSE.txt → ordering-ui-admin.27b7bb0f04b6581074ce.js.LICENSE.txt} +0 -0
|
@@ -115,7 +115,7 @@ const OrdersManagerUI = (props) => {
|
|
|
115
115
|
}
|
|
116
116
|
setDetailsOrder(order)
|
|
117
117
|
setOrderDetailId(order.id)
|
|
118
|
-
setIsOpenOrderDetail(true)
|
|
118
|
+
// setIsOpenOrderDetail(true)
|
|
119
119
|
if (!isSelectedOrders) {
|
|
120
120
|
onOrderRedirect(order.id)
|
|
121
121
|
} else {
|
|
@@ -131,6 +131,10 @@ const OrdersManagerUI = (props) => {
|
|
|
131
131
|
}
|
|
132
132
|
}
|
|
133
133
|
|
|
134
|
+
const handleSetOpenOrderDetail = (state) => {
|
|
135
|
+
setIsOpenOrderDetail(state)
|
|
136
|
+
}
|
|
137
|
+
|
|
134
138
|
const handleOpenTour = () => {
|
|
135
139
|
const tourElement = document.querySelector('[data-tour="tour_start"]')
|
|
136
140
|
if (!tourElement) {
|
|
@@ -219,9 +223,12 @@ const OrdersManagerUI = (props) => {
|
|
|
219
223
|
setMapsData={setMapsData}
|
|
220
224
|
handleUpdateAssignedOrders={handleUpdateAssignedOrders}
|
|
221
225
|
disableSocketRoomDriver
|
|
226
|
+
drivers={driversList.drivers}
|
|
227
|
+
showCompressedInfo
|
|
228
|
+
handleEmtpyOrderSelected={handleBackRedirect}
|
|
222
229
|
/>
|
|
223
230
|
</DriversContainer>
|
|
224
|
-
<OrdersContainer>
|
|
231
|
+
<OrdersContainer showCompressedInfo>
|
|
225
232
|
<OrderStatusFilterBar
|
|
226
233
|
isUseQuery={isUseQuery}
|
|
227
234
|
selectedOrderStatus={ordersStatusGroup}
|
|
@@ -276,6 +283,7 @@ const OrdersManagerUI = (props) => {
|
|
|
276
283
|
setAllowColumns={setAllowColumns}
|
|
277
284
|
setOrdersAmountByStatus={setOrdersAmountByStatus}
|
|
278
285
|
isUseQuery={isUseQuery}
|
|
286
|
+
handleSetOpenOrderDetail={handleSetOpenOrderDetail}
|
|
279
287
|
/>
|
|
280
288
|
</WrapItemView>
|
|
281
289
|
</OrdersInnerContent>
|
|
@@ -16,7 +16,13 @@ import {
|
|
|
16
16
|
DriverInfo
|
|
17
17
|
} from './styles'
|
|
18
18
|
|
|
19
|
-
|
|
19
|
+
const DeliveriesLocationPropsAreEqual = (prevProps, nextProps) => {
|
|
20
|
+
return prevProps.interActionMapOrder?.id === nextProps.interActionMapOrder?.id &&
|
|
21
|
+
JSON.stringify(prevProps.interActionMapOrder?.driver) === JSON.stringify(nextProps.interActionMapOrder?.driver) &&
|
|
22
|
+
(JSON.stringify(prevProps.driversList) === JSON.stringify(nextProps.driversList) || !prevProps.interActionMapOrder?.id)
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export const DeliveriesLocation = React.memo((props) => {
|
|
20
26
|
const {
|
|
21
27
|
driversList,
|
|
22
28
|
interActionMapOrder
|
|
@@ -296,4 +302,4 @@ export const DeliveriesLocation = (props) => {
|
|
|
296
302
|
)}
|
|
297
303
|
</WrapperMap>
|
|
298
304
|
)
|
|
299
|
-
}
|
|
305
|
+
}, DeliveriesLocationPropsAreEqual)
|
|
@@ -12,11 +12,12 @@ export const DriversBusyStatusFilter = (props) => {
|
|
|
12
12
|
driversSubfilter,
|
|
13
13
|
handleChangeDriversSubFilter,
|
|
14
14
|
numberOfbusyDrivers,
|
|
15
|
-
numberOfnotBusyDrivers
|
|
15
|
+
numberOfnotBusyDrivers,
|
|
16
|
+
showCompressedInfo
|
|
16
17
|
} = props
|
|
17
18
|
const [, t] = useLanguage()
|
|
18
19
|
return (
|
|
19
|
-
<Container>
|
|
20
|
+
<Container showCompressedInfo={showCompressedInfo}>
|
|
20
21
|
<Button
|
|
21
22
|
color={driversSubfilter.busy ? 'primary' : 'secundary'}
|
|
22
23
|
onClick={() => handleChangeDriversSubFilter({ ...driversSubfilter, busy: !driversSubfilter.busy })}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import { DriverCard, DriverInfo, Image, WrapperImage, WrapperStar } from './styles'
|
|
3
|
+
import BsDot from '@meronex/icons/bs/BsDot'
|
|
4
|
+
import { LinkButton } from '../../../styles'
|
|
5
|
+
import { useLanguage, useUtils } from 'ordering-components-admin-external'
|
|
6
|
+
import { useTheme } from 'styled-components'
|
|
7
|
+
|
|
8
|
+
const DriverPropsAreEqual = (prevProps, nextProps) => {
|
|
9
|
+
return JSON.stringify(prevProps.driver) === JSON.stringify(nextProps.driver) &&
|
|
10
|
+
prevProps?.selectedDriver?.id === nextProps?.selectedDriver?.id
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export const Driver = React.memo((props) => {
|
|
14
|
+
const {
|
|
15
|
+
driver,
|
|
16
|
+
handleClickDriver,
|
|
17
|
+
selectedDriver,
|
|
18
|
+
hidePhoto,
|
|
19
|
+
onOpenDriverOrdersDetail,
|
|
20
|
+
getStarWidth,
|
|
21
|
+
showCompressedInfo
|
|
22
|
+
} = props
|
|
23
|
+
|
|
24
|
+
const theme = useTheme()
|
|
25
|
+
const [{ optimizeImage }] = useUtils()
|
|
26
|
+
const [, t] = useLanguage()
|
|
27
|
+
|
|
28
|
+
return (
|
|
29
|
+
<DriverCard
|
|
30
|
+
key={driver.id}
|
|
31
|
+
onClick={(e) => handleClickDriver(e, driver)}
|
|
32
|
+
active={selectedDriver?.id === driver.id}
|
|
33
|
+
showCompressedInfo={showCompressedInfo}
|
|
34
|
+
>
|
|
35
|
+
{!hidePhoto && (
|
|
36
|
+
<WrapperImage>
|
|
37
|
+
<Image bgimage={optimizeImage(driver?.photo || theme.images?.icons?.noDriver, 'h_50,c_limit')} />
|
|
38
|
+
</WrapperImage>
|
|
39
|
+
)}
|
|
40
|
+
<DriverInfo hidePhoto={hidePhoto} showCompressedInfo={showCompressedInfo}>
|
|
41
|
+
<div className='driver-info-container'>
|
|
42
|
+
<p className='name'>{driver.name} {driver.lastname}</p>
|
|
43
|
+
<BsDot />
|
|
44
|
+
<div>
|
|
45
|
+
<LinkButton
|
|
46
|
+
className='driver-orders'
|
|
47
|
+
disabled={!driver?.assigned_orders_count || driver?.assigned_orders_count === 0}
|
|
48
|
+
onClick={() => onOpenDriverOrdersDetail(driver)}
|
|
49
|
+
>
|
|
50
|
+
{driver?.assigned_orders_count} {t('ORDERS', 'Orders')}
|
|
51
|
+
</LinkButton>
|
|
52
|
+
<span className='text-red'>{(driver?.busy && `(${t('BUSY', 'Busy')})`)}</span>
|
|
53
|
+
</div>
|
|
54
|
+
</div>
|
|
55
|
+
{driver?.qualification && (
|
|
56
|
+
<WrapperStar width={getStarWidth(driver?.qualification)} />
|
|
57
|
+
)}
|
|
58
|
+
</DriverInfo>
|
|
59
|
+
</DriverCard>
|
|
60
|
+
)
|
|
61
|
+
}, DriverPropsAreEqual)
|
|
@@ -1,19 +1,14 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
|
-
import { useUtils, useLanguage } from 'ordering-components-admin-external'
|
|
3
2
|
import Skeleton from 'react-loading-skeleton'
|
|
4
|
-
import BsDot from '@meronex/icons/bs/BsDot'
|
|
5
|
-
import { useTheme } from 'styled-components'
|
|
6
3
|
import { getStarWidth } from '../../../utils'
|
|
7
4
|
import { useWindowSize } from '../../../hooks/useWindowSize'
|
|
8
|
-
import { LinkButton } from '../../../styles'
|
|
9
5
|
import {
|
|
10
6
|
DriversListContainer,
|
|
11
7
|
DriverCard,
|
|
12
8
|
WrapperImage,
|
|
13
|
-
Image,
|
|
14
9
|
DriverInfo,
|
|
15
|
-
WrapperStar
|
|
16
10
|
} from './styles'
|
|
11
|
+
import { Driver } from './Driver'
|
|
17
12
|
|
|
18
13
|
export const DriversList = (props) => {
|
|
19
14
|
const {
|
|
@@ -24,12 +19,10 @@ export const DriversList = (props) => {
|
|
|
24
19
|
selectedDriver,
|
|
25
20
|
handleChangeDriver,
|
|
26
21
|
handleOpenDriverOrders,
|
|
27
|
-
hidePhoto
|
|
22
|
+
hidePhoto,
|
|
23
|
+
showCompressedInfo
|
|
28
24
|
} = props
|
|
29
25
|
|
|
30
|
-
const theme = useTheme()
|
|
31
|
-
const [, t] = useLanguage()
|
|
32
|
-
const [{ optimizeImage }] = useUtils()
|
|
33
26
|
const { width } = useWindowSize()
|
|
34
27
|
|
|
35
28
|
const handleClickDriver = (e, driver) => {
|
|
@@ -48,7 +41,7 @@ export const DriversList = (props) => {
|
|
|
48
41
|
}
|
|
49
42
|
|
|
50
43
|
return (
|
|
51
|
-
<DriversListContainer>
|
|
44
|
+
<DriversListContainer showCompressedInfo={showCompressedInfo}>
|
|
52
45
|
{loading ? (
|
|
53
46
|
<>
|
|
54
47
|
{[...Array(10).keys()].map(i => (
|
|
@@ -72,36 +65,16 @@ export const DriversList = (props) => {
|
|
|
72
65
|
) : (
|
|
73
66
|
<>
|
|
74
67
|
{(driversIsOnline ? onlineDrivers : offlineDrivers).map(driver => (
|
|
75
|
-
<
|
|
76
|
-
key={driver
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
{
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
<DriverInfo hidePhoto={hidePhoto}>
|
|
86
|
-
<div className='driver-info-container'>
|
|
87
|
-
<p className='name'>{driver.name} {driver.lastname}</p>
|
|
88
|
-
<BsDot />
|
|
89
|
-
<div>
|
|
90
|
-
<LinkButton
|
|
91
|
-
className='driver-orders'
|
|
92
|
-
disabled={!driver?.assigned_orders_count || driver?.assigned_orders_count === 0}
|
|
93
|
-
onClick={() => onOpenDriverOrdersDetail(driver)}
|
|
94
|
-
>
|
|
95
|
-
{driver?.assigned_orders_count} {t('ORDERS', 'Orders')}
|
|
96
|
-
</LinkButton>
|
|
97
|
-
<span className='text-red'>{(driver?.busy && `(${t('BUSY', 'Busy')})`)}</span>
|
|
98
|
-
</div>
|
|
99
|
-
</div>
|
|
100
|
-
{driver?.qualification && (
|
|
101
|
-
<WrapperStar width={getStarWidth(driver?.qualification)} />
|
|
102
|
-
)}
|
|
103
|
-
</DriverInfo>
|
|
104
|
-
</DriverCard>
|
|
68
|
+
<Driver
|
|
69
|
+
key={driver?.id}
|
|
70
|
+
driver={driver}
|
|
71
|
+
handleClickDriver={handleClickDriver}
|
|
72
|
+
selectedDriver={selectedDriver}
|
|
73
|
+
hidePhoto={hidePhoto}
|
|
74
|
+
onOpenDriverOrdersDetail={onOpenDriverOrdersDetail}
|
|
75
|
+
getStarWidth={getStarWidth}
|
|
76
|
+
showCompressedInfo={showCompressedInfo}
|
|
77
|
+
/>
|
|
105
78
|
))}
|
|
106
79
|
</>
|
|
107
80
|
)}
|
|
@@ -3,6 +3,11 @@ import styled, { css } from 'styled-components'
|
|
|
3
3
|
|
|
4
4
|
export const DriversListContainer = styled.div`
|
|
5
5
|
padding: 15px 0px;
|
|
6
|
+
@media (min-width: 992px) {
|
|
7
|
+
${({ showCompressedInfo }) => showCompressedInfo && css`
|
|
8
|
+
padding: 0px 0px;
|
|
9
|
+
`}
|
|
10
|
+
}
|
|
6
11
|
`
|
|
7
12
|
|
|
8
13
|
export const DriverCard = styled.div`
|
|
@@ -25,6 +30,12 @@ export const DriverCard = styled.div`
|
|
|
25
30
|
background-color: ${props => props.theme.colors.lightPrimary};
|
|
26
31
|
border: 1px solid ${props => props.theme.colors.primary};
|
|
27
32
|
`}
|
|
33
|
+
|
|
34
|
+
@media (min-width: 992px) {
|
|
35
|
+
${({ showCompressedInfo }) => showCompressedInfo && css`
|
|
36
|
+
margin-bottom: 5px;
|
|
37
|
+
`}
|
|
38
|
+
}
|
|
28
39
|
`
|
|
29
40
|
|
|
30
41
|
export const WrapperImage = styled.div`
|
|
@@ -74,7 +85,7 @@ export const WrapperStar = styled.div`
|
|
|
74
85
|
position: relative;
|
|
75
86
|
width: fit-content;
|
|
76
87
|
|
|
77
|
-
&::before {
|
|
88
|
+
&::before {
|
|
78
89
|
content: '★★★★★';
|
|
79
90
|
opacity: .3;
|
|
80
91
|
}
|
|
@@ -126,6 +137,19 @@ export const DriverInfo = styled.div`
|
|
|
126
137
|
margin-left: 2px;
|
|
127
138
|
`}
|
|
128
139
|
}
|
|
140
|
+
@media (min-width: 992px) {
|
|
141
|
+
${({ showCompressedInfo }) => showCompressedInfo && css`
|
|
142
|
+
p.name {
|
|
143
|
+
font-size: 12px;
|
|
144
|
+
}
|
|
145
|
+
.text-red {
|
|
146
|
+
font-size: 11px;
|
|
147
|
+
}
|
|
148
|
+
.driver-orders {
|
|
149
|
+
font-size: 11px;
|
|
150
|
+
}
|
|
151
|
+
`}
|
|
152
|
+
}
|
|
129
153
|
}
|
|
130
154
|
`
|
|
131
155
|
|
|
@@ -9,7 +9,16 @@ import {
|
|
|
9
9
|
WrapperMap
|
|
10
10
|
} from './styles'
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
const DriversLocationPropsAreEqual = (prevProps, nextProps) => {
|
|
13
|
+
return JSON.stringify(prevProps.selectedDriver) === JSON.stringify(nextProps.selectedDriver) &&
|
|
14
|
+
JSON.stringify(prevProps.assignedOrders) === JSON.stringify(nextProps.assignedOrders) &&
|
|
15
|
+
prevProps.driversIsOnline === nextProps.driversIsOnline &&
|
|
16
|
+
prevProps.onlineDrivers?.length === nextProps.onlineDrivers?.length &&
|
|
17
|
+
prevProps.offlineDrivers?.length === nextProps.offlineDrivers?.length &&
|
|
18
|
+
JSON.stringify(prevProps.selectedOrder) === JSON.stringify(nextProps.selectedOrder)
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export const DriversLocation = React.memo((props) => {
|
|
13
22
|
const {
|
|
14
23
|
driversIsOnline,
|
|
15
24
|
onlineDrivers,
|
|
@@ -158,9 +167,8 @@ export const DriversLocation = (props) => {
|
|
|
158
167
|
}
|
|
159
168
|
|
|
160
169
|
useEffect(() => {
|
|
161
|
-
if (!selectedDriver?.id) return
|
|
162
170
|
setMapFitted(false)
|
|
163
|
-
}, [
|
|
171
|
+
}, [selectedOrder])
|
|
164
172
|
|
|
165
173
|
return (
|
|
166
174
|
<>
|
|
@@ -184,27 +192,6 @@ export const DriversLocation = (props) => {
|
|
|
184
192
|
onChange={(data) => handleMapChange(data)}
|
|
185
193
|
yesIWantToUseGoogleMapApiInternals
|
|
186
194
|
>
|
|
187
|
-
{!selectedOrder && showDrivers.length !== 0 &&
|
|
188
|
-
showDrivers.map((driver) => (
|
|
189
|
-
<DriverMapMarkerAndInfo
|
|
190
|
-
key={driver.id}
|
|
191
|
-
driver={driver}
|
|
192
|
-
lat={
|
|
193
|
-
(driver.location !== null && typeof driver.location === 'object' && driver.location?.lat)
|
|
194
|
-
? driver.location.lat
|
|
195
|
-
: typeof driver.location === 'string'
|
|
196
|
-
? parseFloat(driver?.location?.split(',')[0].replace(/[^-.0-9]/g, ''))
|
|
197
|
-
: defaultCenter.lat
|
|
198
|
-
}
|
|
199
|
-
lng={
|
|
200
|
-
(driver.location !== null && typeof driver.location === 'object' && driver.location?.lng)
|
|
201
|
-
? driver.location.lng
|
|
202
|
-
: typeof driver.location === 'string'
|
|
203
|
-
? parseFloat(driver?.location?.split(',')[1].replace(/[^-.0-9]/g, ''))
|
|
204
|
-
: defaultCenter.lng
|
|
205
|
-
}
|
|
206
|
-
/>
|
|
207
|
-
))}
|
|
208
195
|
{selectedOrder && (
|
|
209
196
|
<InterActOrderMarker
|
|
210
197
|
customer={selectedOrder?.customer}
|
|
@@ -267,4 +254,4 @@ export const DriversLocation = (props) => {
|
|
|
267
254
|
</WrapperMap>
|
|
268
255
|
</>
|
|
269
256
|
)
|
|
270
|
-
}
|
|
257
|
+
}, DriversLocationPropsAreEqual)
|
|
@@ -6,7 +6,7 @@ import { OrdersLateralBar } from '../OrdersLateralBar'
|
|
|
6
6
|
import { SearchBar } from '../../Shared'
|
|
7
7
|
import { OrderNotification } from '../OrderNotification'
|
|
8
8
|
import { List as MenuIcon } from 'react-bootstrap-icons'
|
|
9
|
-
import { IconButton } from '../../../styles/Buttons'
|
|
9
|
+
import { IconButton, LinkButton } from '../../../styles/Buttons'
|
|
10
10
|
import { useInfoShare } from '../../../contexts/InfoShareContext'
|
|
11
11
|
import { GoogleMapsApiKeySettingButton } from '../GoogleMapsApiKeySettingButton'
|
|
12
12
|
import { WebsocketStatus } from '../WebsocketStatus'
|
|
@@ -15,8 +15,10 @@ import {
|
|
|
15
15
|
DriversHeader,
|
|
16
16
|
HeaderTitleContainer,
|
|
17
17
|
DriversContainer,
|
|
18
|
-
DriversContent
|
|
18
|
+
DriversContent,
|
|
19
|
+
WarningMessage
|
|
19
20
|
} from './styles'
|
|
21
|
+
import TiWarningOutline from '@meronex/icons/ti/TiWarningOutline'
|
|
20
22
|
|
|
21
23
|
const DriversManagerUI = (props) => {
|
|
22
24
|
const {
|
|
@@ -58,6 +60,10 @@ const DriversManagerUI = (props) => {
|
|
|
58
60
|
setIsOpenDriverOrders(true)
|
|
59
61
|
}
|
|
60
62
|
|
|
63
|
+
const handleClearFilters = () => {
|
|
64
|
+
if (searchValue) handleChangeSearch('')
|
|
65
|
+
}
|
|
66
|
+
|
|
61
67
|
useEffect(() => {
|
|
62
68
|
if (loading) return
|
|
63
69
|
const id = query.get('id')
|
|
@@ -92,6 +98,13 @@ const DriversManagerUI = (props) => {
|
|
|
92
98
|
{!googleMapsApiKey && (
|
|
93
99
|
<GoogleMapsApiKeySettingButton />
|
|
94
100
|
)}
|
|
101
|
+
{(!!searchValue) && (
|
|
102
|
+
<WarningMessage>
|
|
103
|
+
<TiWarningOutline />
|
|
104
|
+
<span>{t('WARNING_FILTER_APPLIED', 'Filters applied. You may miss new orders.')}</span>
|
|
105
|
+
<LinkButton onClick={() => handleClearFilters()}>{t('CLEAR_FILTERS', 'Clear filters')}</LinkButton>
|
|
106
|
+
</WarningMessage>
|
|
107
|
+
)}
|
|
95
108
|
<SearchBar
|
|
96
109
|
isCustomLayout
|
|
97
110
|
lazyLoad
|
|
@@ -69,3 +69,58 @@ export const HeaderTitleContainer = styled.div`
|
|
|
69
69
|
|
|
70
70
|
export const DriversContent = styled.div`
|
|
71
71
|
`
|
|
72
|
+
|
|
73
|
+
export const WarningMessage = styled.div`
|
|
74
|
+
position: absolute;
|
|
75
|
+
display: flex;
|
|
76
|
+
align-items: center;
|
|
77
|
+
z-index: 100;
|
|
78
|
+
top: 50px;
|
|
79
|
+
background: ${props => props.theme.colors.warning100};
|
|
80
|
+
border: 1px solid ${props => props.theme.colors.warning};
|
|
81
|
+
box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.12);
|
|
82
|
+
border-radius: 7.6px;
|
|
83
|
+
padding: 0px 15px;
|
|
84
|
+
box-sizing: border-box;
|
|
85
|
+
margin: 10px 0px 0px 0px !important;
|
|
86
|
+
|
|
87
|
+
right: 0px;
|
|
88
|
+
${props => props.theme?.rtl && css`
|
|
89
|
+
left: 0px;
|
|
90
|
+
right: initial;
|
|
91
|
+
`}
|
|
92
|
+
|
|
93
|
+
svg {
|
|
94
|
+
font-size: 20px;
|
|
95
|
+
color: ${props => props.theme.colors.warning};
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
span {
|
|
99
|
+
font-size: 12px;
|
|
100
|
+
line-height: 18px;
|
|
101
|
+
color: ${props => props.theme.colors.headingColor};
|
|
102
|
+
margin: 0 10px;
|
|
103
|
+
flex: 1;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
a {
|
|
107
|
+
font-size: 12px;
|
|
108
|
+
white-space: nowrap;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
@media (min-width: 768px) {
|
|
112
|
+
padding: 0px 20px;
|
|
113
|
+
font-size: 14px;
|
|
114
|
+
line-height: 24px;
|
|
115
|
+
right: 0px;
|
|
116
|
+
z-index: 10;
|
|
117
|
+
${props => props.theme?.rtl && css`
|
|
118
|
+
left: 0px;
|
|
119
|
+
right: initial;
|
|
120
|
+
`}
|
|
121
|
+
|
|
122
|
+
span {
|
|
123
|
+
white-space: nowrap;
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
`
|
|
@@ -10,11 +10,12 @@ export const DriversOnlineOfflineFilter = (props) => {
|
|
|
10
10
|
driversIsOnline,
|
|
11
11
|
handleChangeDriverIsOnline,
|
|
12
12
|
numberOfonlineDrivers,
|
|
13
|
-
numberOfofflineDrivers
|
|
13
|
+
numberOfofflineDrivers,
|
|
14
|
+
showCompressedInfo
|
|
14
15
|
} = props
|
|
15
16
|
const [, t] = useLanguage()
|
|
16
17
|
return (
|
|
17
|
-
<Container>
|
|
18
|
+
<Container showCompressedInfo={showCompressedInfo}>
|
|
18
19
|
<Tab
|
|
19
20
|
active={driversIsOnline}
|
|
20
21
|
onClick={() => handleChangeDriverIsOnline(true)}
|
|
@@ -4,6 +4,17 @@ export const Container = styled.div`
|
|
|
4
4
|
width: 100%;
|
|
5
5
|
display: flex;
|
|
6
6
|
border-bottom: 1px solid #CCC;
|
|
7
|
+
${({ showCompressedInfo }) => showCompressedInfo && css`
|
|
8
|
+
justify-content: space-around;
|
|
9
|
+
@media (min-width: 992px) {
|
|
10
|
+
max-width: 350px;
|
|
11
|
+
}
|
|
12
|
+
> div {
|
|
13
|
+
max-width: 150px;
|
|
14
|
+
overflow-x: hidden;
|
|
15
|
+
text-overflow: ellipsis;
|
|
16
|
+
}
|
|
17
|
+
`}
|
|
7
18
|
`
|
|
8
19
|
|
|
9
20
|
export const Tab = styled.div`
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { useContext, useState, useRef } from 'react'
|
|
2
|
-
import { useLanguage, useSession, useUtils, useConfig, GoogleAutocompleteInput } from 'ordering-components-admin-external'
|
|
2
|
+
import { useLanguage, useSession, useUtils, useConfig, GoogleAutocompleteInput, GoogleMapsMap } from 'ordering-components-admin-external'
|
|
3
3
|
import FaUserAlt from '@meronex/icons/fa/FaUserAlt'
|
|
4
4
|
import BisBusiness from '@meronex/icons/bi/BisBusiness'
|
|
5
5
|
import { DriverSelector } from '../DriverSelector'
|
|
@@ -26,7 +26,8 @@ import {
|
|
|
26
26
|
ReviewButton,
|
|
27
27
|
CustomerEditWrapper,
|
|
28
28
|
ActionIconWrapper,
|
|
29
|
-
ReviewWrapper
|
|
29
|
+
ReviewWrapper,
|
|
30
|
+
WrapperMap
|
|
30
31
|
} from './styles'
|
|
31
32
|
|
|
32
33
|
export const OrderContactInformation = (props) => {
|
|
@@ -41,7 +42,8 @@ export const OrderContactInformation = (props) => {
|
|
|
41
42
|
handleUpdateCustomerInfo,
|
|
42
43
|
setAddressState,
|
|
43
44
|
setCommentInfostate,
|
|
44
|
-
commentInfoState
|
|
45
|
+
commentInfoState,
|
|
46
|
+
addressState
|
|
45
47
|
} = props
|
|
46
48
|
|
|
47
49
|
const [, t] = useLanguage()
|
|
@@ -53,6 +55,20 @@ export const OrderContactInformation = (props) => {
|
|
|
53
55
|
const googleMapsApiKey = configs?.google_maps_api_key?.value
|
|
54
56
|
const isDisableDriverCompanies = configs?.disable_companies_order_details?.value === '1'
|
|
55
57
|
|
|
58
|
+
const googleMapsControls = {
|
|
59
|
+
defaultZoom: 15,
|
|
60
|
+
zoomControl: true,
|
|
61
|
+
streetViewControl: false,
|
|
62
|
+
fullscreenControl: false,
|
|
63
|
+
mapTypeId: 'roadmap', // 'roadmap', 'satellite', 'hybrid', 'terrain'
|
|
64
|
+
mapTypeControl: false,
|
|
65
|
+
mapTypeControlOptions: {
|
|
66
|
+
mapTypeIds: ['roadmap', 'satellite']
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
const defaultPosition = { lat: 40.77473399999999, lng: -73.9653844 }
|
|
71
|
+
|
|
56
72
|
const [isModalOpen, setIsModalOpen] = useState(false)
|
|
57
73
|
const [currentCustomer, setCurrentCustomer] = useState(null)
|
|
58
74
|
const [isEdit, setIsEdit] = useState(false)
|
|
@@ -239,6 +255,13 @@ export const OrderContactInformation = (props) => {
|
|
|
239
255
|
autoComplete='new-password'
|
|
240
256
|
countryCode={configs?.country_autocomplete?.value || '*'}
|
|
241
257
|
/>
|
|
258
|
+
<WrapperMap>
|
|
259
|
+
<GoogleMapsMap
|
|
260
|
+
apiKey={configs?.google_maps_api_key?.value}
|
|
261
|
+
location={addressState?.location ?? order?.customer?.location ?? defaultPosition}
|
|
262
|
+
mapControls={googleMapsControls}
|
|
263
|
+
/>
|
|
264
|
+
</WrapperMap>
|
|
242
265
|
<Input
|
|
243
266
|
placeholder={t('NOTES', 'Notes')}
|
|
244
267
|
defaultValue={customerInfoState?.customer?.address_notes ?? order?.customer?.address_notes ?? ''}
|
|
@@ -268,3 +268,19 @@ export const CustomerEditWrapper = styled.div`
|
|
|
268
268
|
margin-left: auto;
|
|
269
269
|
}
|
|
270
270
|
`
|
|
271
|
+
export const WrapperMap = styled.div`
|
|
272
|
+
width: 100%;
|
|
273
|
+
height: 150px;
|
|
274
|
+
margin-bottom: 10px;
|
|
275
|
+
|
|
276
|
+
> div {
|
|
277
|
+
position: relative !important;
|
|
278
|
+
width: 100% !important;
|
|
279
|
+
height: 100% !important;
|
|
280
|
+
border-radius: 8px;
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
@media (min-width: 768px) {
|
|
284
|
+
height: 200px;
|
|
285
|
+
}
|
|
286
|
+
`
|
|
@@ -41,7 +41,21 @@ import {
|
|
|
41
41
|
ErrorMessage
|
|
42
42
|
} from './styles'
|
|
43
43
|
|
|
44
|
-
const
|
|
44
|
+
const OrderDetailsPropsAreEqual = (prevProps, nextProps) => {
|
|
45
|
+
return prevProps.isSelectedOrders === nextProps.isSelectedOrders &&
|
|
46
|
+
prevProps.open === nextProps.open &&
|
|
47
|
+
prevProps.isTourOpen === nextProps.isTourOpen &&
|
|
48
|
+
JSON.stringify(prevProps.messages) === JSON.stringify(nextProps.messages) &&
|
|
49
|
+
JSON.stringify(prevProps.order) === JSON.stringify(nextProps.order) &&
|
|
50
|
+
prevProps.loading === nextProps.loading &&
|
|
51
|
+
prevProps.isTourFlag === nextProps.isTourFlag &&
|
|
52
|
+
prevProps.isServiceOrder === nextProps.isServiceOrder &&
|
|
53
|
+
prevProps.currentTourStep === nextProps.currentTourStep &&
|
|
54
|
+
prevProps.customerInfoState === nextProps.customerInfoState &&
|
|
55
|
+
JSON.stringify(prevProps.addressState) === JSON.stringify(nextProps.addressState)
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
const OrderDetailsUI = React.memo((props) => {
|
|
45
59
|
const {
|
|
46
60
|
isSelectedOrders,
|
|
47
61
|
handleChangeCustomerInfoState,
|
|
@@ -50,6 +64,7 @@ const OrderDetailsUI = (props) => {
|
|
|
50
64
|
open,
|
|
51
65
|
handleBackRedirect,
|
|
52
66
|
handleUpdateOrderStatus,
|
|
67
|
+
addressState,
|
|
53
68
|
setAddressState,
|
|
54
69
|
isTourOpen,
|
|
55
70
|
handleUpdateOrderForUnreadCount,
|
|
@@ -409,6 +424,7 @@ const OrderDetailsUI = (props) => {
|
|
|
409
424
|
handleShowOption={handleShowOption}
|
|
410
425
|
setCommentInfostate={setCommentInfostate}
|
|
411
426
|
commentInfoState={commentInfoState}
|
|
427
|
+
addressState={addressState}
|
|
412
428
|
/>
|
|
413
429
|
<OrderProducts>
|
|
414
430
|
<h2>{t('EXPORT_SUMMARY', 'Summary')}</h2>
|
|
@@ -591,7 +607,8 @@ const OrderDetailsUI = (props) => {
|
|
|
591
607
|
</Modal>
|
|
592
608
|
</Container>
|
|
593
609
|
)
|
|
594
|
-
}
|
|
610
|
+
}, OrderDetailsPropsAreEqual)
|
|
611
|
+
|
|
595
612
|
export const OrderDetails = (props) => {
|
|
596
613
|
const orderDetailsProps = {
|
|
597
614
|
...props,
|
|
@@ -10,12 +10,14 @@ export const OrderDetailsHeaderContainer = styled.div`
|
|
|
10
10
|
font-size: 20px;
|
|
11
11
|
margin: 0px;
|
|
12
12
|
font-weight: 700;
|
|
13
|
+
word-break: break-word;
|
|
13
14
|
}
|
|
14
15
|
h2 {
|
|
15
16
|
width: 100%;
|
|
16
17
|
font-size: 18px;
|
|
17
18
|
margin: 0px;
|
|
18
19
|
font-weight: 700;
|
|
20
|
+
word-break: break-word;
|
|
19
21
|
}
|
|
20
22
|
> div {
|
|
21
23
|
display: flex;
|
|
@@ -34,7 +36,7 @@ export const OrderDetailsHeaderContainer = styled.div`
|
|
|
34
36
|
@media (min-width: 768px) {
|
|
35
37
|
> div {
|
|
36
38
|
flex-direction: row;
|
|
37
|
-
align-items:
|
|
39
|
+
align-items: flex-start;
|
|
38
40
|
}
|
|
39
41
|
> div {
|
|
40
42
|
> div {
|