ordering-ui-admin-external 1.2.0 → 1.3.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/main.css +2 -2
- package/_bundles/{ordering-ui-admin.509785f9d6ed069b4b5d.js → ordering-ui-admin.0bfe9a0aef33a990bc0a.js} +2 -2
- package/_bundles/{ordering-ui-admin.509785f9d6ed069b4b5d.js.LICENSE.txt → ordering-ui-admin.0bfe9a0aef33a990bc0a.js.LICENSE.txt} +10 -4
- package/_modules/components/BusinessIntelligence/Reports/index.js +27 -3
- package/_modules/components/BusinessIntelligence/Reports/styles.js +9 -2
- package/_modules/components/BusinessIntelligence/ReviewsListing/index.js +9 -1
- package/_modules/components/DisabledFeatureAlert/index.js +63 -0
- package/_modules/components/DisabledFeatureAlert/styles.js +42 -0
- package/_modules/components/Loyalty/RewardsPrograms/index.js +38 -12
- package/_modules/components/Loyalty/RewardsPrograms/styles.js +13 -6
- package/_modules/components/Marketing/CampaignHeader/index.js +5 -2
- package/_modules/components/Marketing/CampaignHeader/styles.js +7 -4
- package/_modules/components/Marketing/CampaignList/index.js +8 -4
- package/_modules/components/Marketing/CampaignList/styles.js +30 -22
- package/_modules/components/Marketing/CampaignListing/index.js +29 -3
- package/_modules/components/Marketing/EnterprisePromotionListing/index.js +46 -22
- package/_modules/components/Marketing/EnterprisePromotionListing/styles.js +1 -1
- package/_modules/components/OrderingProducts/OrderingProductDetails/index.js +24 -428
- package/_modules/components/OrderingProducts/OrderingProductDetails/styles.js +35 -114
- package/_modules/components/OrderingProducts/OrderingProductGeneralDetails/index.js +480 -0
- package/_modules/components/OrderingProducts/OrderingProductGeneralDetails/styles.js +127 -0
- package/_modules/components/OrderingProducts/OrderingProductsListing/index.js +3 -1
- package/_modules/components/OrderingProducts/OrderingProductsListing/styles.js +23 -3
- package/_modules/components/OrderingProducts/SiteTheme/ThemeComponent.js +119 -0
- package/_modules/components/OrderingProducts/SiteTheme/ThemeImage.js +267 -0
- package/_modules/components/OrderingProducts/SiteTheme/ThemeOption.js +135 -0
- package/_modules/components/OrderingProducts/SiteTheme/index.js +266 -0
- package/_modules/components/OrderingProducts/SiteTheme/styles.js +114 -0
- package/_modules/components/Orders/CountryFilter/index.js +114 -0
- package/_modules/components/Orders/CountryFilter/styles.js +34 -0
- package/_modules/components/Orders/CurrencyFilter/index.js +114 -0
- package/_modules/components/Orders/CurrencyFilter/styles.js +34 -0
- package/_modules/components/Orders/DeliveriesLocation/index.js +22 -12
- package/_modules/components/Orders/DriversLocation/index.js +13 -7
- package/_modules/components/Orders/OrdersFilterGroup/index.js +13 -1
- package/_modules/components/Orders/OrdersListing/index.js +8 -2
- package/_modules/components/Orders/OrdersTable/index.js +296 -174
- package/_modules/components/Orders/OrdersTable/styles.js +30 -4
- package/_modules/components/Orders/index.js +9 -1
- package/_modules/components/Settings/SettingItemUI/index.js +3 -1
- package/_modules/components/Settings/SettingItemUI/styles.js +18 -11
- package/_modules/components/Settings/Settings/index.js +1 -11
- package/_modules/components/Settings/SettingsDetail/index.js +40 -3
- package/_modules/components/Settings/SettingsDetail/styles.js +27 -8
- package/_modules/components/Settings/SettingsList/index.js +43 -6
- package/_modules/components/Shared/ColorPicker/styles.js +3 -1
- package/_modules/components/Shared/ColumnAllowSettingPopover/index.js +4 -2
- package/_modules/components/Shared/SearchBar/index.js +4 -2
- package/_modules/components/SidebarMenu/index.js +25 -14
- package/_modules/components/SidebarMenu/styles.js +19 -9
- package/_modules/components/Stores/BusinessMenu/index.js +36 -5
- package/_modules/components/Stores/BusinessMenu/styles.js +27 -16
- package/_modules/components/Stores/BusinessMenuOptions/styles.js +9 -4
- package/_modules/components/Stores/BusinessPaymentMethods/index.js +53 -16
- package/_modules/components/Stores/BusinessProductList/index.js +7 -10
- package/_modules/components/Stores/BusinessProductsCategories/index.js +2 -2
- package/_modules/components/Stores/BusinessProductsListing/index.js +44 -21
- package/_modules/components/Stores/BusinessProductsListing/styles.js +20 -16
- package/_modules/components/Stores/BusinessesListing/index.js +4 -1
- package/_modules/components/Stores/BusinessesListingHeader/index.js +20 -3
- package/_modules/components/Stores/BusinessesListingHeader/styles.js +6 -2
- package/_modules/components/Stores/ImportersList/index.js +5 -2
- package/_modules/components/Stores/ImportersList/styles.js +18 -15
- package/_modules/components/Stores/ImportersListing/index.js +31 -4
- package/_modules/components/Stores/PaymentOption/index.js +12 -7
- package/_modules/components/Stores/PaymentOption/styles.js +9 -4
- package/_modules/components/Stores/PaymentOptionMethods/index.js +9 -4
- package/_modules/components/Stores/PaymentOptionMethods/styles.js +10 -5
- package/_modules/components/Stores/PaymentOptionPaypal/index.js +9 -4
- package/_modules/components/Stores/PaymentOptionSquare/index.js +10 -5
- package/_modules/components/Stores/PaymentOptionStripeDirect/index.js +10 -5
- package/_modules/components/Stores/PaymentOptionStripeDirect/styles.js +10 -5
- package/_modules/components/Stores/PaymethodOptionPaypalExpress/index.js +9 -4
- package/_modules/components/Stores/PaymethodOptionStripeConnect/index.js +9 -4
- package/_modules/components/Stores/PaymethodOptionStripeRedirect/index.js +9 -4
- package/_modules/components/Users/UsersList/index.js +8 -2
- package/_modules/components/Users/UsersList/styles.js +15 -12
- package/package.json +2 -2
- package/src/components/BusinessIntelligence/Reports/index.js +18 -4
- package/src/components/BusinessIntelligence/Reports/styles.js +11 -0
- package/src/components/BusinessIntelligence/ReviewsListing/index.js +12 -0
- package/src/components/DisabledFeatureAlert/index.js +37 -0
- package/src/components/DisabledFeatureAlert/styles.js +32 -0
- package/src/components/Loyalty/RewardsPrograms/index.js +18 -5
- package/src/components/Loyalty/RewardsPrograms/styles.js +10 -0
- package/src/components/Marketing/CampaignHeader/index.js +3 -2
- package/src/components/Marketing/CampaignHeader/styles.js +8 -0
- package/src/components/Marketing/CampaignList/index.js +5 -3
- package/src/components/Marketing/CampaignList/styles.js +16 -0
- package/src/components/Marketing/CampaignListing/index.js +18 -2
- package/src/components/Marketing/EnterprisePromotionListing/index.js +17 -4
- package/src/components/Marketing/EnterprisePromotionListing/styles.js +5 -1
- package/src/components/OrderingProducts/OrderingProductDetails/index.js +34 -497
- package/src/components/OrderingProducts/OrderingProductDetails/styles.js +38 -288
- package/src/components/OrderingProducts/OrderingProductGeneralDetails/index.js +514 -0
- package/src/components/OrderingProducts/OrderingProductGeneralDetails/styles.js +279 -0
- package/src/components/OrderingProducts/OrderingProductsListing/index.js +14 -2
- package/src/components/OrderingProducts/OrderingProductsListing/styles.js +62 -0
- package/src/components/OrderingProducts/SiteTheme/ThemeComponent.js +104 -0
- package/src/components/OrderingProducts/SiteTheme/ThemeImage.js +151 -0
- package/src/components/OrderingProducts/SiteTheme/ThemeOption.js +118 -0
- package/src/components/OrderingProducts/SiteTheme/index.js +221 -0
- package/src/components/OrderingProducts/SiteTheme/styles.js +160 -0
- package/src/components/Orders/CountryFilter/index.js +68 -0
- package/src/components/Orders/CountryFilter/styles.js +29 -0
- package/src/components/Orders/CurrencyFilter/index.js +68 -0
- package/src/components/Orders/CurrencyFilter/styles.js +29 -0
- package/src/components/Orders/DeliveriesLocation/index.js +60 -8
- package/src/components/Orders/DriversLocation/index.js +32 -4
- package/src/components/Orders/OrdersFilterGroup/index.js +15 -1
- package/src/components/Orders/OrdersListing/index.js +8 -1
- package/src/components/Orders/OrdersTable/index.js +297 -252
- package/src/components/Orders/OrdersTable/styles.js +33 -0
- package/src/components/Orders/index.js +3 -1
- package/src/components/Settings/SettingItemUI/index.js +2 -1
- package/src/components/Settings/SettingItemUI/styles.js +5 -0
- package/src/components/Settings/Settings/index.js +0 -11
- package/src/components/Settings/SettingsDetail/index.js +23 -4
- package/src/components/Settings/SettingsDetail/styles.js +9 -2
- package/src/components/Settings/SettingsList/index.js +30 -3
- package/src/components/Shared/ColorPicker/styles.js +1 -0
- package/src/components/Shared/ColumnAllowSettingPopover/index.js +2 -2
- package/src/components/Shared/SearchBar/index.js +3 -2
- package/src/components/SidebarMenu/index.js +22 -7
- package/src/components/SidebarMenu/styles.js +13 -0
- package/src/components/Stores/BusinessMenu/index.js +21 -3
- package/src/components/Stores/BusinessMenu/styles.js +19 -0
- package/src/components/Stores/BusinessMenuOptions/styles.js +6 -0
- package/src/components/Stores/BusinessPaymentMethods/index.js +62 -32
- package/src/components/Stores/BusinessProductList/index.js +2 -1
- package/src/components/Stores/BusinessProductsCategories/index.js +2 -2
- package/src/components/Stores/BusinessProductsListing/index.js +18 -4
- package/src/components/Stores/BusinessProductsListing/styles.js +40 -10
- package/src/components/Stores/BusinessesListing/index.js +3 -0
- package/src/components/Stores/BusinessesListingHeader/index.js +15 -3
- package/src/components/Stores/BusinessesListingHeader/styles.js +38 -0
- package/src/components/Stores/ImportersList/index.js +3 -2
- package/src/components/Stores/ImportersList/styles.js +8 -1
- package/src/components/Stores/ImportersListing/index.js +25 -1
- package/src/components/Stores/PaymentOption/index.js +9 -5
- package/src/components/Stores/PaymentOption/styles.js +8 -0
- package/src/components/Stores/PaymentOptionMethods/index.js +8 -3
- package/src/components/Stores/PaymentOptionMethods/styles.js +8 -0
- package/src/components/Stores/PaymentOptionPaypal/index.js +8 -3
- package/src/components/Stores/PaymentOptionSquare/index.js +183 -176
- package/src/components/Stores/PaymentOptionStripeDirect/index.js +8 -3
- package/src/components/Stores/PaymentOptionStripeDirect/styles.js +8 -0
- package/src/components/Stores/PaymethodOptionPaypalExpress/index.js +8 -3
- package/src/components/Stores/PaymethodOptionStripeConnect/index.js +8 -3
- package/src/components/Stores/PaymethodOptionStripeRedirect/index.js +8 -3
- package/src/components/Users/UsersList/index.js +10 -1
- package/src/components/Users/UsersList/styles.js +9 -0
- package/template/app.js +8 -8
|
@@ -30,7 +30,9 @@ import {
|
|
|
30
30
|
LogisticStatusDot,
|
|
31
31
|
PriorityDot,
|
|
32
32
|
Timestatus,
|
|
33
|
-
Timer
|
|
33
|
+
Timer,
|
|
34
|
+
OrdersCountWrapper,
|
|
35
|
+
DragTh
|
|
34
36
|
} from './styles'
|
|
35
37
|
|
|
36
38
|
export const OrdersTable = (props) => {
|
|
@@ -49,13 +51,17 @@ export const OrdersTable = (props) => {
|
|
|
49
51
|
handleOpenTour,
|
|
50
52
|
setIsTourOpen,
|
|
51
53
|
slaSettingTime,
|
|
52
|
-
groupStatus
|
|
54
|
+
groupStatus,
|
|
55
|
+
allowColumns,
|
|
56
|
+
setAllowColumns,
|
|
57
|
+
handleDrop
|
|
53
58
|
} = props
|
|
54
59
|
const [, t] = useLanguage()
|
|
55
60
|
const theme = useTheme()
|
|
56
|
-
const [{
|
|
61
|
+
const [{ parseDate, optimizeImage, getTimeAgo }] = useUtils()
|
|
57
62
|
const [isAllChecked, setIsAllChecked] = useState(false)
|
|
58
63
|
const [, setCurrentTime] = useState()
|
|
64
|
+
const [dragOverd, setDragOverd] = useState('')
|
|
59
65
|
const handleChangePage = (page) => {
|
|
60
66
|
getPageOrders(pagination.pageSize, page)
|
|
61
67
|
}
|
|
@@ -64,18 +70,6 @@ export const OrdersTable = (props) => {
|
|
|
64
70
|
getPageOrders(pageSize, expectedPage)
|
|
65
71
|
}
|
|
66
72
|
const [configState] = useConfig()
|
|
67
|
-
const [allowColumns, setAllowColumns] = useState({
|
|
68
|
-
status: true,
|
|
69
|
-
orderNumber: true,
|
|
70
|
-
dateTime: true,
|
|
71
|
-
business: true,
|
|
72
|
-
customer: true,
|
|
73
|
-
driver: true,
|
|
74
|
-
advanced: true,
|
|
75
|
-
timer: configState?.configs?.order_deadlines_enabled?.value === '1',
|
|
76
|
-
slaBar: configState?.configs?.order_deadlines_enabled?.value === '1',
|
|
77
|
-
total: true
|
|
78
|
-
})
|
|
79
73
|
|
|
80
74
|
const optionsDefault = [
|
|
81
75
|
{
|
|
@@ -227,9 +221,10 @@ export const OrdersTable = (props) => {
|
|
|
227
221
|
}
|
|
228
222
|
|
|
229
223
|
const handleChangeAllowColumns = (type) => {
|
|
224
|
+
const _column = allowColumns[type]
|
|
230
225
|
setAllowColumns({
|
|
231
226
|
...allowColumns,
|
|
232
|
-
[type]: !
|
|
227
|
+
[type]: { ..._column, visable: !_column?.visable }
|
|
233
228
|
})
|
|
234
229
|
}
|
|
235
230
|
|
|
@@ -251,6 +246,35 @@ export const OrdersTable = (props) => {
|
|
|
251
246
|
setSelectedOrderIds(updatedSelectedOrderIds)
|
|
252
247
|
}
|
|
253
248
|
}
|
|
249
|
+
/**
|
|
250
|
+
* Method to handle drag start
|
|
251
|
+
*/
|
|
252
|
+
const handleDragStart = (event, columnName) => {
|
|
253
|
+
event.dataTransfer.setData('transferColumnName', columnName)
|
|
254
|
+
const ghostEle = document.createElement('div')
|
|
255
|
+
ghostEle.classList.add('ghostDragging')
|
|
256
|
+
ghostEle.innerHTML = allowColumns[columnName]?.title
|
|
257
|
+
document.body.appendChild(ghostEle)
|
|
258
|
+
event.dataTransfer.setDragImage(ghostEle, 0, 0)
|
|
259
|
+
}
|
|
260
|
+
/**
|
|
261
|
+
* Method to handle drag over
|
|
262
|
+
*/
|
|
263
|
+
const handleDragOver = (event, columnName) => {
|
|
264
|
+
event.preventDefault()
|
|
265
|
+
setDragOverd(columnName)
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
/**
|
|
269
|
+
* Method to handle drag end
|
|
270
|
+
*/
|
|
271
|
+
const handleDragEnd = () => {
|
|
272
|
+
const elements = document.getElementsByClassName('ghostDragging')
|
|
273
|
+
while (elements.length > 0) {
|
|
274
|
+
elements[0].parentNode.removeChild(elements[0])
|
|
275
|
+
}
|
|
276
|
+
setDragOverd('')
|
|
277
|
+
}
|
|
254
278
|
|
|
255
279
|
useEffect(() => {
|
|
256
280
|
if (orderList.loading) return
|
|
@@ -272,24 +296,6 @@ export const OrdersTable = (props) => {
|
|
|
272
296
|
return () => document.removeEventListener('keydown', handleChangeKeyboard)
|
|
273
297
|
}, [isTourOpen, currentTourStep])
|
|
274
298
|
|
|
275
|
-
useEffect(() => {
|
|
276
|
-
if (groupStatus === 'completed' || groupStatus === 'cancelled') {
|
|
277
|
-
setAllowColumns({
|
|
278
|
-
...allowColumns,
|
|
279
|
-
timer: false
|
|
280
|
-
})
|
|
281
|
-
}
|
|
282
|
-
}, [groupStatus])
|
|
283
|
-
|
|
284
|
-
useEffect(() => {
|
|
285
|
-
const slaSettings = configState?.configs?.order_deadlines_enabled?.value === '1'
|
|
286
|
-
setAllowColumns({
|
|
287
|
-
...allowColumns,
|
|
288
|
-
timer: slaSettings,
|
|
289
|
-
slaBar: slaSettings
|
|
290
|
-
})
|
|
291
|
-
}, [configState.loading])
|
|
292
|
-
|
|
293
299
|
return (
|
|
294
300
|
<>
|
|
295
301
|
<OrdersContainer
|
|
@@ -304,82 +310,97 @@ export const OrdersTable = (props) => {
|
|
|
304
310
|
{!isSelectedOrders && (
|
|
305
311
|
<thead>
|
|
306
312
|
<tr>
|
|
307
|
-
{allowColumns?.
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
313
|
+
{allowColumns && Object.keys(allowColumns).filter(col => allowColumns[col]?.visable && allowColumns[col]?.order !== 0)
|
|
314
|
+
.sort((col1, col2) => allowColumns[col1]?.order - allowColumns[col2]?.order)
|
|
315
|
+
.map((column, i) => {
|
|
316
|
+
if (column === 'slaBar') {
|
|
317
|
+
return (
|
|
318
|
+
<th key={`noDragTh-${i}`}>
|
|
319
|
+
<Timestatus />
|
|
320
|
+
</th>
|
|
321
|
+
)
|
|
322
|
+
}
|
|
323
|
+
if (column === 'orderNumber') {
|
|
324
|
+
return (
|
|
325
|
+
<th
|
|
326
|
+
className={!(allowColumns?.orderNumber?.visable || allowColumns?.dateTime?.visable) ? 'orderNo small' : 'orderNo'}
|
|
327
|
+
key={`noDragTh-${i}`}
|
|
328
|
+
>
|
|
329
|
+
<CheckBox
|
|
330
|
+
isChecked={!orderList.loading && isAllChecked}
|
|
331
|
+
onClick={() => handleSelecteAllOrder()}
|
|
332
|
+
className='orderCheckBox'
|
|
333
|
+
>
|
|
334
|
+
{(!orderList.loading && isAllChecked) ? (
|
|
335
|
+
<RiCheckboxFill />
|
|
336
|
+
) : (
|
|
337
|
+
<RiCheckboxBlankLine />
|
|
338
|
+
)}
|
|
339
|
+
</CheckBox>
|
|
340
|
+
{t('ORDER', 'Order')}
|
|
341
|
+
</th>
|
|
342
|
+
)
|
|
343
|
+
}
|
|
344
|
+
if (column === 'total') {
|
|
345
|
+
return (
|
|
346
|
+
<th className='orderPrice' key={`noDragTh-${i}`}>
|
|
347
|
+
<ColumnAllowSettingPopover
|
|
348
|
+
allowColumns={allowColumns}
|
|
349
|
+
optionsDefault={optionsDefault}
|
|
350
|
+
handleChangeAllowColumns={handleChangeAllowColumns}
|
|
351
|
+
/>
|
|
352
|
+
</th>
|
|
353
|
+
)
|
|
354
|
+
}
|
|
355
|
+
return (column !== 'timer' || (column === 'timer' && (groupStatus === 'pending' || groupStatus === 'inProgress'))) && (
|
|
356
|
+
<DragTh
|
|
357
|
+
key={`dragTh-${i}`}
|
|
358
|
+
onDragOver={e => handleDragOver?.(e, column)}
|
|
359
|
+
onDrop={e => handleDrop(e, column)}
|
|
360
|
+
onDragEnd={e => handleDragEnd(e)}
|
|
361
|
+
colSpan={allowColumns[column]?.colSpan ?? 1}
|
|
362
|
+
className={allowColumns[column]?.className}
|
|
363
|
+
selectedDragOver={column === dragOverd}
|
|
364
|
+
>
|
|
365
|
+
<div draggable onDragStart={e => handleDragStart?.(e, column)}>
|
|
366
|
+
<img
|
|
367
|
+
src={theme.images.icons?.sixDots}
|
|
368
|
+
alt='six dots'
|
|
369
|
+
/>
|
|
370
|
+
<span>{allowColumns[column]?.title}</span>
|
|
371
|
+
</div>
|
|
372
|
+
</DragTh>)
|
|
373
|
+
})}
|
|
353
374
|
</tr>
|
|
354
375
|
</thead>
|
|
355
376
|
)}
|
|
356
|
-
{orderList.loading ? (
|
|
377
|
+
{(orderList.loading || !allowColumns) ? (
|
|
357
378
|
[...Array(10).keys()].map(i => (
|
|
358
379
|
<OrderTbody key={i}>
|
|
359
380
|
<tr>
|
|
360
|
-
{allowColumns?.slaBar && (
|
|
381
|
+
{allowColumns?.slaBar?.visable && (
|
|
361
382
|
<td>
|
|
362
383
|
<Timestatus />
|
|
363
384
|
</td>
|
|
364
385
|
)}
|
|
365
386
|
<td
|
|
366
|
-
className={!(allowColumns?.orderNumber || allowColumns?.dateTime) ? 'orderNo small' : 'orderNo'}
|
|
387
|
+
className={!(allowColumns?.orderNumber?.visable || allowColumns?.dateTime?.visable) ? 'orderNo small' : 'orderNo'}
|
|
367
388
|
>
|
|
368
389
|
<OrderNumberContainer>
|
|
369
390
|
<CheckBox>
|
|
370
391
|
<Skeleton width={25} height={25} style={{ margin: '10px' }} />
|
|
371
392
|
</CheckBox>
|
|
372
393
|
<div className='info'>
|
|
373
|
-
{allowColumns?.orderNumber && (
|
|
394
|
+
{allowColumns?.orderNumber?.visable && (
|
|
374
395
|
<p><Skeleton width={100} /></p>
|
|
375
396
|
)}
|
|
376
|
-
{allowColumns?.dateTime && (
|
|
397
|
+
{allowColumns?.dateTime?.visable && (
|
|
377
398
|
<Skeleton width={120} />
|
|
378
399
|
)}
|
|
379
400
|
</div>
|
|
380
401
|
</OrderNumberContainer>
|
|
381
402
|
</td>
|
|
382
|
-
{allowColumns?.status && !isSelectedOrders && (
|
|
403
|
+
{allowColumns?.status?.visable && !isSelectedOrders && (
|
|
383
404
|
<td className='statusInfo'>
|
|
384
405
|
<StatusInfo>
|
|
385
406
|
<div className='info'>
|
|
@@ -388,7 +409,7 @@ export const OrdersTable = (props) => {
|
|
|
388
409
|
</StatusInfo>
|
|
389
410
|
</td>
|
|
390
411
|
)}
|
|
391
|
-
{allowColumns?.business && (
|
|
412
|
+
{allowColumns?.business?.visable && (
|
|
392
413
|
<td className='businessInfo'>
|
|
393
414
|
<BusinessInfo>
|
|
394
415
|
<Skeleton width={45} height={45} />
|
|
@@ -399,7 +420,7 @@ export const OrdersTable = (props) => {
|
|
|
399
420
|
</BusinessInfo>
|
|
400
421
|
</td>
|
|
401
422
|
)}
|
|
402
|
-
{allowColumns?.customer && (
|
|
423
|
+
{allowColumns?.customer?.visable && (
|
|
403
424
|
<td className='customerInfo'>
|
|
404
425
|
<CustomerInfo>
|
|
405
426
|
<Skeleton width={45} height={45} />
|
|
@@ -410,7 +431,7 @@ export const OrdersTable = (props) => {
|
|
|
410
431
|
</CustomerInfo>
|
|
411
432
|
</td>
|
|
412
433
|
)}
|
|
413
|
-
{allowColumns?.driver && !isSelectedOrders && (
|
|
434
|
+
{allowColumns?.driver?.visable && !isSelectedOrders && (
|
|
414
435
|
<td className='driverInfo'>
|
|
415
436
|
<DriversInfo className='d-flex align-items-center'>
|
|
416
437
|
<Skeleton width={45} height={45} />
|
|
@@ -418,21 +439,21 @@ export const OrdersTable = (props) => {
|
|
|
418
439
|
</DriversInfo>
|
|
419
440
|
</td>
|
|
420
441
|
)}
|
|
421
|
-
{allowColumns?.deliveryType && !isSelectedOrders && (
|
|
442
|
+
{allowColumns?.deliveryType?.visable && !isSelectedOrders && (
|
|
422
443
|
<td className='orderType'>
|
|
423
444
|
<OrderType>
|
|
424
445
|
<Skeleton width={35} height={35} />
|
|
425
446
|
</OrderType>
|
|
426
447
|
</td>
|
|
427
448
|
)}
|
|
428
|
-
{allowColumns?.status && !isSelectedOrders && (
|
|
449
|
+
{allowColumns?.status?.visable && !isSelectedOrders && (
|
|
429
450
|
<td className='orderStatusTitle'>
|
|
430
451
|
<WrapOrderStatusSelector>
|
|
431
452
|
<Skeleton width={100} height={30} />
|
|
432
453
|
</WrapOrderStatusSelector>
|
|
433
454
|
</td>
|
|
434
455
|
)}
|
|
435
|
-
{allowColumns?.advanced && !isSelectedOrders && (
|
|
456
|
+
{allowColumns?.advanced?.visable && !isSelectedOrders && (
|
|
436
457
|
<td className='logistic'>
|
|
437
458
|
<div className='info'>
|
|
438
459
|
<p className='bold'><Skeleton width={60} /></p>
|
|
@@ -440,7 +461,7 @@ export const OrdersTable = (props) => {
|
|
|
440
461
|
</div>
|
|
441
462
|
</td>
|
|
442
463
|
)}
|
|
443
|
-
{allowColumns?.advanced && !isSelectedOrders && (
|
|
464
|
+
{allowColumns?.advanced?.visable && !isSelectedOrders && (
|
|
444
465
|
<td className='attempts'>
|
|
445
466
|
<div className='info'>
|
|
446
467
|
<p className='bold'><Skeleton width={60} /></p>
|
|
@@ -448,7 +469,7 @@ export const OrdersTable = (props) => {
|
|
|
448
469
|
</div>
|
|
449
470
|
</td>
|
|
450
471
|
)}
|
|
451
|
-
{allowColumns?.advanced && !isSelectedOrders && (
|
|
472
|
+
{allowColumns?.advanced?.visable && !isSelectedOrders && (
|
|
452
473
|
<td className='priority'>
|
|
453
474
|
<div className='info'>
|
|
454
475
|
<p className='bold'><Skeleton width={60} /></p>
|
|
@@ -459,7 +480,7 @@ export const OrdersTable = (props) => {
|
|
|
459
480
|
{!isSelectedOrders && (
|
|
460
481
|
<td className='orderPrice'>
|
|
461
482
|
<div className='info'>
|
|
462
|
-
{allowColumns?.total && (
|
|
483
|
+
{allowColumns?.total?.visable && (
|
|
463
484
|
<p className='bold'><Skeleton width={60} /></p>
|
|
464
485
|
)}
|
|
465
486
|
<p>
|
|
@@ -480,164 +501,188 @@ export const OrdersTable = (props) => {
|
|
|
480
501
|
data-tour={i === 0 ? 'tour_start' : ''}
|
|
481
502
|
>
|
|
482
503
|
<tr>
|
|
483
|
-
{allowColumns
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
<
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
<
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
<
|
|
504
|
+
{Object.keys(allowColumns).filter(col => allowColumns[col]?.visable)
|
|
505
|
+
.sort((col1, col2) => allowColumns[col1]?.order - allowColumns[col2]?.order)
|
|
506
|
+
.map((column, index) => {
|
|
507
|
+
if (column === 'slaBar') {
|
|
508
|
+
return (
|
|
509
|
+
<td key={`slaBar${i}-${index}`}>
|
|
510
|
+
<Timestatus
|
|
511
|
+
timeState={getStatusClassName(getDelayMinutes(order))}
|
|
512
|
+
/>
|
|
513
|
+
</td>
|
|
514
|
+
)
|
|
515
|
+
}
|
|
516
|
+
if (column === 'orderNumber') {
|
|
517
|
+
return (
|
|
518
|
+
<td
|
|
519
|
+
className={!(allowColumns?.orderNumber?.visable || allowColumns?.dateTime?.visable) ? 'small' : ''}
|
|
520
|
+
key={`orderNumber${i}-${index}`}
|
|
521
|
+
>
|
|
522
|
+
<OrderNumberContainer>
|
|
523
|
+
{!isSelectedOrders && (
|
|
524
|
+
<CheckBox
|
|
525
|
+
isChecked={selectedOrderIds.includes(order?.id)}
|
|
526
|
+
onClick={() => handleSelectedOrderIds(order.id)}
|
|
527
|
+
className='orderCheckBox'
|
|
528
|
+
>
|
|
529
|
+
{selectedOrderIds.includes(order?.id) ? (
|
|
530
|
+
<RiCheckboxFill />
|
|
531
|
+
) : (
|
|
532
|
+
<RiCheckboxBlankLine />
|
|
533
|
+
)}
|
|
534
|
+
</CheckBox>
|
|
535
|
+
)}
|
|
536
|
+
<div className='info'>
|
|
537
|
+
{allowColumns?.orderNumber?.visable && (
|
|
538
|
+
<p className='bold'>{t('INVOICE_ORDER_NO', 'Order No.')} {order?.id}</p>
|
|
539
|
+
)}
|
|
540
|
+
{allowColumns?.dateTime?.visable && (
|
|
541
|
+
<p className='date'>
|
|
542
|
+
{parseDate(order?.delivery_datetime, { utc: false })}
|
|
543
|
+
</p>
|
|
544
|
+
)}
|
|
545
|
+
</div>
|
|
546
|
+
</OrderNumberContainer>
|
|
547
|
+
</td>
|
|
548
|
+
)
|
|
549
|
+
}
|
|
550
|
+
if (column === 'status' && !isSelectedOrders) {
|
|
551
|
+
return (
|
|
552
|
+
<td className='statusInfo' key={`statusInfo${i}-${index}`}>
|
|
553
|
+
<StatusInfo>
|
|
554
|
+
<p className='bold'>{getOrderStatus(order.status)?.value}</p>
|
|
555
|
+
</StatusInfo>
|
|
556
|
+
</td>
|
|
557
|
+
)
|
|
558
|
+
}
|
|
559
|
+
if (column === 'business') {
|
|
560
|
+
return (
|
|
561
|
+
<td className='businessInfo' key={`businessInfo${i}-${index}`}>
|
|
562
|
+
<BusinessInfo>
|
|
563
|
+
<WrapperImage>
|
|
564
|
+
<img src={optimizeImage(order.business?.logo || theme.images?.dummies?.businessLogo, 'h_50,c_limit')} loading='lazy' alt='' />
|
|
565
|
+
</WrapperImage>
|
|
566
|
+
<div className='info'>
|
|
567
|
+
<p className='bold'>{order?.business?.name}</p>
|
|
568
|
+
<p>{order?.business?.city?.name}</p>
|
|
569
|
+
</div>
|
|
570
|
+
</BusinessInfo>
|
|
571
|
+
</td>
|
|
572
|
+
)
|
|
573
|
+
}
|
|
574
|
+
if (column === 'customer') {
|
|
575
|
+
return (
|
|
576
|
+
<td className='customerInfo' key={`customerInfo${i}-${index}`}>
|
|
577
|
+
<CustomerInfo>
|
|
578
|
+
<WrapperImage>
|
|
579
|
+
{order?.customer?.photo ? (
|
|
580
|
+
<img src={optimizeImage(order?.customer?.photo, 'h_50,c_limit')} loading='lazy' alt='' />
|
|
581
|
+
) : (
|
|
582
|
+
<FaUserAlt />
|
|
583
|
+
)}
|
|
584
|
+
<OrdersCountWrapper isNew={order?.customer?.orders_count === 0}>
|
|
585
|
+
{order?.customer?.orders_count || t('NEW', 'New')}
|
|
586
|
+
</OrdersCountWrapper>
|
|
587
|
+
</WrapperImage>
|
|
588
|
+
<div className='info'>
|
|
589
|
+
<p className='bold'>{order?.customer?.name}</p>
|
|
590
|
+
<p>{order?.customer?.cellphone}</p>
|
|
591
|
+
</div>
|
|
592
|
+
</CustomerInfo>
|
|
593
|
+
</td>
|
|
594
|
+
)
|
|
595
|
+
}
|
|
596
|
+
if (column === 'driver' && !isSelectedOrders) {
|
|
597
|
+
return (
|
|
598
|
+
<td key={`driver${i}-${index}`}>
|
|
599
|
+
{order?.delivery_type === 1 && (
|
|
600
|
+
<CustomerInfo>
|
|
601
|
+
<WrapperImage>
|
|
602
|
+
{order?.driver?.photo ? (
|
|
603
|
+
<img src={optimizeImage(order?.driver?.photo, 'h_50,c_limit')} loading='lazy' alt='' />
|
|
604
|
+
) : (
|
|
605
|
+
<FaUserAlt />
|
|
606
|
+
)}
|
|
607
|
+
</WrapperImage>
|
|
608
|
+
<div className='info'>
|
|
609
|
+
{order?.driver ? (
|
|
610
|
+
<>
|
|
611
|
+
<p className='bold'>{order?.driver?.name}</p>
|
|
612
|
+
<p>{order?.driver?.cellphone}</p>
|
|
613
|
+
</>
|
|
614
|
+
) : (
|
|
615
|
+
<p className='bold'>{t('NO_DRIVER', 'No Driver')}</p>
|
|
616
|
+
)}
|
|
617
|
+
</div>
|
|
618
|
+
</CustomerInfo>
|
|
580
619
|
)}
|
|
581
|
-
</
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
620
|
+
</td>
|
|
621
|
+
)
|
|
622
|
+
}
|
|
623
|
+
if (column === 'advanced' && !isSelectedOrders) {
|
|
624
|
+
return (
|
|
625
|
+
<React.Fragment key={`advanced${i}-${index}`}>
|
|
626
|
+
<td className='logistic'>
|
|
627
|
+
<div className='info'>
|
|
628
|
+
<p className='bold'>{t('LOGISTIC', 'Logistic')}</p>
|
|
629
|
+
<p>
|
|
630
|
+
{getLogisticTag(order?.logistic_status)}
|
|
631
|
+
<LogisticStatusDot
|
|
632
|
+
status={order?.logistic_status}
|
|
633
|
+
/>
|
|
634
|
+
</p>
|
|
635
|
+
</div>
|
|
636
|
+
</td>
|
|
637
|
+
<td className='attempts'>
|
|
638
|
+
<div className='info'>
|
|
639
|
+
<p className='bold'>{t('ATTEMPTS', 'Attempts')}</p>
|
|
640
|
+
<p>{order?.logistic_attemps}</p>
|
|
641
|
+
</div>
|
|
642
|
+
</td>
|
|
643
|
+
<td className='priority'>
|
|
644
|
+
<div className='info'>
|
|
645
|
+
<p className='bold'>{t('PRIORITY', 'Priority')}</p>
|
|
646
|
+
<p>
|
|
647
|
+
{getPriorityTag(order?.priority)}
|
|
648
|
+
<PriorityDot priority={order?.priority} />
|
|
649
|
+
</p>
|
|
650
|
+
</div>
|
|
651
|
+
</td>
|
|
652
|
+
</React.Fragment>
|
|
653
|
+
)
|
|
654
|
+
}
|
|
655
|
+
if (column === 'timer' && (groupStatus === 'pending' || groupStatus === 'inProgress')) {
|
|
656
|
+
return (
|
|
657
|
+
<td className='timer' key={`timer${i}-${index}`}>
|
|
658
|
+
<Timer>
|
|
659
|
+
<p className='bold'>{t('TIMER', 'Timer')}</p>
|
|
660
|
+
<p className={getStatusClassName(getDelayMinutes(order))}>{displayDelayedTime(order)}</p>
|
|
661
|
+
</Timer>
|
|
662
|
+
</td>
|
|
663
|
+
)
|
|
664
|
+
}
|
|
665
|
+
if (column === 'total') {
|
|
666
|
+
return (
|
|
667
|
+
<td className='orderPrice' key={`total${i}-${index}`}>
|
|
668
|
+
<div className='info'>
|
|
669
|
+
{allowColumns?.total?.visable && (
|
|
670
|
+
<p className='bold'>{order?.summary?.total} {order?.currency}</p>
|
|
671
|
+
)}
|
|
672
|
+
{!(order?.status === 1 || order?.status === 11 || order?.status === 2 || order?.status === 5 || order?.status === 6 || order?.status === 10 || order.status === 12) && (
|
|
673
|
+
<p>
|
|
674
|
+
{
|
|
675
|
+
order?.delivery_datetime_utc
|
|
676
|
+
? getTimeAgo(order?.delivery_datetime_utc)
|
|
677
|
+
: getTimeAgo(order?.delivery_datetime, { utc: false })
|
|
678
|
+
}
|
|
679
|
+
</p>
|
|
680
|
+
)}
|
|
681
|
+
</div>
|
|
682
|
+
</td>
|
|
683
|
+
)
|
|
684
|
+
}
|
|
685
|
+
})}
|
|
641
686
|
</tr>
|
|
642
687
|
</OrderTbody>
|
|
643
688
|
))
|