ordering-ui-admin-external 1.37.2 → 1.37.3

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.
Files changed (28) hide show
  1. package/_bundles/{ordering-ui-admin.15bab79d358eee4bd125.js → ordering-ui-admin.316f4761de9be1fdca7c.js} +2 -2
  2. package/_modules/components/BusinessIntelligence/InvoiceBusinessPdf/index.js +5 -8
  3. package/_modules/components/BusinessIntelligence/InvoiceDriverPdf/index.js +5 -8
  4. package/_modules/components/Delivery/AddressForm/index.js +5 -8
  5. package/_modules/components/Delivery/DeliveryUsersListing/index.js +9 -14
  6. package/_modules/components/Delivery/DriversGroupsListing/index.js +5 -8
  7. package/_modules/components/Marketing/BannerImageDetails/index.js +5 -8
  8. package/_modules/components/OrderingProducts/SiteTheme/ThemeImage.js +5 -7
  9. package/_modules/components/Orders/CreateCustomOrder/Checkout/index.js +5 -8
  10. package/_modules/components/Orders/CreateCustomOrder/StripeMethodForm/index.js +5 -8
  11. package/_modules/components/Orders/OrderContactInformation/index.js +5 -8
  12. package/_modules/components/Orders/OrdersCards/index.js +32 -81
  13. package/_modules/components/Orders/OrdersTable/index.js +39 -89
  14. package/_modules/components/Orders/OrdersTable/styles.js +2 -2
  15. package/_modules/components/Shared/ImageCrop/index.js +5 -7
  16. package/_modules/components/SidebarMenu/index.js +5 -8
  17. package/_modules/components/Stores/BusinessDeliveryGroupsDetails/index.js +5 -8
  18. package/_modules/components/Stores/BusinessLocation/index.js +5 -8
  19. package/_modules/components/Stores/BusinessServiceProfessionalDetail/index.js +10 -15
  20. package/_modules/components/Stores/BusinessesListing/index.js +5 -8
  21. package/_modules/components/Stores/ProductDetailsAdvanced/index.js +5 -8
  22. package/_modules/components/Stores/ProductExtras/index.js +5 -7
  23. package/_modules/utils/index.js +13 -21
  24. package/package.json +1 -1
  25. package/src/components/Orders/OrdersCards/index.js +30 -31
  26. package/src/components/Orders/OrdersTable/index.js +41 -42
  27. package/src/components/Orders/OrdersTable/styles.js +26 -24
  28. /package/_bundles/{ordering-ui-admin.15bab79d358eee4bd125.js.LICENSE.txt → ordering-ui-admin.316f4761de9be1fdca7c.js.LICENSE.txt} +0 -0
@@ -38,7 +38,7 @@ export const OrdersCards = (props) => {
38
38
  isDelivery,
39
39
  isUseQuery
40
40
  } = props
41
- const [, t] = useLanguage()
41
+ const [{ dictionary }, t] = useLanguage()
42
42
  const theme = useTheme()
43
43
  const { width } = useWindowSize()
44
44
  const [{ parseDate, optimizeImage }] = useUtils()
@@ -68,37 +68,36 @@ export const OrdersCards = (props) => {
68
68
  }
69
69
 
70
70
  const getOrderStatus = (s) => {
71
- const status = parseInt(s)
72
- const orderStatus = [
73
- { key: 0, value: t('PENDING', theme?.defaultLanguages?.PENDING || 'Pending') },
74
- { key: 1, value: t('COMPLETED', theme?.defaultLanguages?.COMPLETED || 'Completed') },
75
- { key: 2, value: t('REJECTED', theme?.defaultLanguages?.REJECTED || 'Rejected') },
76
- { key: 3, value: t('DRIVER_IN_BUSINESS', theme?.defaultLanguages?.DRIVER_IN_BUSINESS || 'Driver in business') },
77
- { key: 4, value: t('PREPARATION_COMPLETED', theme?.defaultLanguages?.PREPARATION_COMPLETED || 'Preparation Completed') },
78
- { key: 5, value: t('REJECTED_BY_BUSINESS', theme?.defaultLanguages?.REJECTED_BY_BUSINESS || 'Rejected by business') },
79
- { key: 6, value: t('REJECTED_BY_DRIVER', theme?.defaultLanguages?.REJECTED_BY_DRIVER || 'Rejected by Driver') },
80
- { key: 7, value: t('ACCEPTED_BY_BUSINESS', theme?.defaultLanguages?.ACCEPTED_BY_BUSINESS || 'Accepted by business') },
81
- { key: 8, value: t('ACCEPTED_BY_DRIVER', theme?.defaultLanguages?.ACCEPTED_BY_DRIVER || 'Accepted by driver') },
82
- { key: 9, value: t('PICK_UP_COMPLETED_BY_DRIVER', theme?.defaultLanguages?.PICK_UP_COMPLETED_BY_DRIVER || 'Pick up completed by driver') },
83
- { key: 10, value: t('PICK_UP_FAILED_BY_DRIVER', theme?.defaultLanguages?.PICK_UP_FAILED_BY_DRIVER || 'Pick up Failed by driver') },
84
- { key: 11, value: t('DELIVERY_COMPLETED_BY_DRIVER', theme?.defaultLanguages?.DELIVERY_COMPLETED_BY_DRIVER || 'Delivery completed by driver') },
85
- { key: 12, value: t('DELIVERY_FAILED_BY_DRIVER', theme?.defaultLanguages?.DELIVERY_FAILED_BY_DRIVER || 'Delivery Failed by driver') },
86
- { key: 13, value: t('PREORDER', theme?.defaultLanguages?.PREORDER || 'PreOrder') },
87
- { key: 14, value: t('ORDER_NOT_READY', theme?.defaultLanguages?.ORDER_NOT_READY || 'Order not ready') },
88
- { key: 15, value: t('ORDER_PICKEDUP_COMPLETED_BY_CUSTOMER', theme?.defaultLanguages?.ORDER_PICKEDUP_COMPLETED_BY_CUSTOMER || 'Order picked up completed by customer') },
89
- { key: 16, value: t('ORDER_STATUS_CANCELLED_BY_CUSTOMER', theme?.defaultLanguages?.ORDER_STATUS_CANCELLED_BY_CUSTOMER || 'Order cancelled by customer') },
90
- { key: 17, value: t('ORDER_NOT_PICKEDUP_BY_CUSTOMER', theme?.defaultLanguages?.ORDER_NOT_PICKEDUP_BY_CUSTOMER || 'Order not picked up by customer') },
91
- { key: 18, value: t('ORDER_DRIVER_ALMOST_ARRIVED_BUSINESS', theme?.defaultLanguages?.ORDER_DRIVER_ALMOST_ARRIVED_BUSINESS || 'Driver almost arrived to business') },
92
- { key: 19, value: t('ORDER_DRIVER_ALMOST_ARRIVED_CUSTOMER', theme?.defaultLanguages?.ORDER_DRIVER_ALMOST_ARRIVED_CUSTOMER || 'Driver almost arrived to customer') },
93
- { key: 20, value: t('ORDER_CUSTOMER_ALMOST_ARRIVED_BUSINESS', theme?.defaultLanguages?.ORDER_CUSTOMER_ALMOST_ARRIVED_BUSINESS || 'Customer almost arrived to business') },
94
- { key: 21, value: t('ORDER_CUSTOMER_ARRIVED_BUSINESS', theme?.defaultLanguages?.ORDER_CUSTOMER_ARRIVED_BUSINESS || 'Customer arrived to business') },
95
- { key: 22, value: t('ORDER_LOOKING_FOR_DRIVER', 'Looking for driver') },
96
- { key: 23, value: t('ORDER_DRIVER_ON_WAY', 'Driver on way') }
97
- ]
71
+ if (!dictionary) return s
98
72
 
99
- const objectStatus = orderStatus.find((o) => o.key === status)
73
+ const orderStatus = {
74
+ 0: dictionary?.PENDING ?? 'Pending',
75
+ 1: dictionary?.COMPLETED_BY_ADMIN ?? 'Completed by admin',
76
+ 2: dictionary?.REJECTED ?? 'Rejected',
77
+ 3: dictionary?.ORDER_STATUS_IN_BUSINESS ?? 'Driver arrived to business',
78
+ 4: dictionary?.PREPARATION_COMPLETED ?? 'Preparation Completed',
79
+ 5: dictionary?.REJECTED_BY_BUSINESS ?? 'Rejected by business',
80
+ 6: dictionary?.REJECTED_BY_DRIVER ?? 'Rejected by Driver',
81
+ 7: dictionary?.ACCEPTED_BY_BUSINESS ?? 'Accepted by business',
82
+ 8: dictionary?.ACCEPTED_BY_DRIVER ?? 'Accepted by driver',
83
+ 9: dictionary?.PICK_UP_COMPLETED_BY_DRIVER ?? 'Pick up completed by driver',
84
+ 10: dictionary?.PICK_UP_FAILED_BY_DRIVER ?? 'Pick up Failed by driver',
85
+ 11: dictionary?.DELIVERY_COMPLETED_BY_DRIVER ?? 'Delivery completed by driver',
86
+ 12: dictionary?.DELIVERY_FAILED_BY_DRIVER ?? 'Delivery Failed by driver',
87
+ 13: dictionary?.PREORDER ?? 'PreOrder',
88
+ 14: dictionary?.ORDER_NOT_READY ?? 'Order not ready',
89
+ 15: dictionary?.ORDER_PICKEDUP_COMPLETED_BY_CUSTOMER ?? 'Order picked up completed by customer',
90
+ 16: dictionary?.ORDER_STATUS_CANCELLED_BY_CUSTOMER ?? 'Order cancelled by customer',
91
+ 17: dictionary?.ORDER_NOT_PICKEDUP_BY_CUSTOMER ?? 'Order not picked up by customer',
92
+ 18: dictionary?.ORDER_DRIVER_ALMOST_ARRIVED_BUSINESS ?? 'Driver almost arrived to business',
93
+ 19: dictionary?.ORDER_DRIVER_ALMOST_ARRIVED_CUSTOMER ?? 'Driver almost arrived to customer',
94
+ 20: dictionary?.ORDER_CUSTOMER_ALMOST_ARRIVED_BUSINESS ?? 'Customer almost arrived to business',
95
+ 21: dictionary?.ORDER_CUSTOMER_ARRIVED_BUSINESS ?? 'Customer arrived to business',
96
+ 22: dictionary?.ORDER_LOOKING_FOR_DRIVER ?? 'Looking for driver',
97
+ 23: dictionary?.ORDER_DRIVER_ON_WAY ?? 'Driver on way'
98
+ }
100
99
 
101
- return objectStatus && objectStatus
100
+ return orderStatus?.[Number(s)] ?? s
102
101
  }
103
102
 
104
103
  const getDelayMinutes = (order) => {
@@ -220,7 +219,7 @@ export const OrdersCards = (props) => {
220
219
  <h2>
221
220
  <span>{t('INVOICE_ORDER_NO', 'Order No.')} {(showExternalId && !!order?.external_id) ? order.external_id : order.id}</span>
222
221
  </h2>
223
- <p>{getOrderStatus(order.status)?.value}</p>
222
+ <p>{getOrderStatus(order.status)}</p>
224
223
  <div>
225
224
  <p>
226
225
  {
@@ -59,7 +59,7 @@ export const OrdersTable = memo((props) => {
59
59
  saveUserSettings,
60
60
  isUseQuery
61
61
  } = props
62
- const [, t] = useLanguage()
62
+ const [{ dictionary }, t] = useLanguage()
63
63
  const theme = useTheme()
64
64
  const [{ parseDate, optimizeImage, getTimeAgo, parsePrice }] = useUtils()
65
65
  const [isAllChecked, setIsAllChecked] = useState(false)
@@ -208,37 +208,36 @@ export const OrdersTable = memo((props) => {
208
208
  }
209
209
 
210
210
  const getOrderStatus = (s) => {
211
- const status = parseInt(s)
212
- const orderStatus = [
213
- { key: 0, value: t('PENDING', theme?.defaultLanguages?.PENDING || 'Pending') },
214
- { key: 1, value: t('COMPLETED_BY_ADMIN', theme?.defaultLanguages?.COMPLETED || 'Completed by admin') },
215
- { key: 2, value: t('REJECTED', theme?.defaultLanguages?.REJECTED || 'Rejected') },
216
- { key: 3, value: t('ORDER_STATUS_IN_BUSINESS', theme?.defaultLanguages?.DRIVER_IN_BUSINESS || 'Driver arrived to business') },
217
- { key: 4, value: t('PREPARATION_COMPLETED', theme?.defaultLanguages?.PREPARATION_COMPLETED || 'Preparation Completed') },
218
- { key: 5, value: t('REJECTED_BY_BUSINESS', theme?.defaultLanguages?.REJECTED_BY_BUSINESS || 'Rejected by business') },
219
- { key: 6, value: t('REJECTED_BY_DRIVER', theme?.defaultLanguages?.REJECTED_BY_DRIVER || 'Rejected by Driver') },
220
- { key: 7, value: t('ACCEPTED_BY_BUSINESS', theme?.defaultLanguages?.ACCEPTED_BY_BUSINESS || 'Accepted by business') },
221
- { key: 8, value: t('ACCEPTED_BY_DRIVER', theme?.defaultLanguages?.ACCEPTED_BY_DRIVER || 'Accepted by driver') },
222
- { key: 9, value: t('PICK_UP_COMPLETED_BY_DRIVER', theme?.defaultLanguages?.PICK_UP_COMPLETED_BY_DRIVER || 'Pick up completed by driver') },
223
- { key: 10, value: t('PICK_UP_FAILED_BY_DRIVER', theme?.defaultLanguages?.PICK_UP_FAILED_BY_DRIVER || 'Pick up Failed by driver') },
224
- { key: 11, value: t('DELIVERY_COMPLETED_BY_DRIVER', theme?.defaultLanguages?.DELIVERY_COMPLETED_BY_DRIVER || 'Delivery completed by driver') },
225
- { key: 12, value: t('DELIVERY_FAILED_BY_DRIVER', theme?.defaultLanguages?.DELIVERY_FAILED_BY_DRIVER || 'Delivery Failed by driver') },
226
- { key: 13, value: t('PREORDER', theme?.defaultLanguages?.PREORDER || 'PreOrder') },
227
- { key: 14, value: t('ORDER_NOT_READY', theme?.defaultLanguages?.ORDER_NOT_READY || 'Order not ready') },
228
- { key: 15, value: t('ORDER_PICKEDUP_COMPLETED_BY_CUSTOMER', theme?.defaultLanguages?.ORDER_PICKEDUP_COMPLETED_BY_CUSTOMER || 'Order picked up completed by customer') },
229
- { key: 16, value: t('ORDER_STATUS_CANCELLED_BY_CUSTOMER', theme?.defaultLanguages?.ORDER_STATUS_CANCELLED_BY_CUSTOMER || 'Order cancelled by customer') },
230
- { key: 17, value: t('ORDER_NOT_PICKEDUP_BY_CUSTOMER', theme?.defaultLanguages?.ORDER_NOT_PICKEDUP_BY_CUSTOMER || 'Order not picked up by customer') },
231
- { key: 18, value: t('ORDER_DRIVER_ALMOST_ARRIVED_BUSINESS', theme?.defaultLanguages?.ORDER_DRIVER_ALMOST_ARRIVED_BUSINESS || 'Driver almost arrived to business') },
232
- { key: 19, value: t('ORDER_DRIVER_ALMOST_ARRIVED_CUSTOMER', theme?.defaultLanguages?.ORDER_DRIVER_ALMOST_ARRIVED_CUSTOMER || 'Driver almost arrived to customer') },
233
- { key: 20, value: t('ORDER_CUSTOMER_ALMOST_ARRIVED_BUSINESS', theme?.defaultLanguages?.ORDER_CUSTOMER_ALMOST_ARRIVED_BUSINESS || 'Customer almost arrived to business') },
234
- { key: 21, value: t('ORDER_CUSTOMER_ARRIVED_BUSINESS', theme?.defaultLanguages?.ORDER_CUSTOMER_ARRIVED_BUSINESS || 'Customer arrived to business') },
235
- { key: 22, value: t('ORDER_LOOKING_FOR_DRIVER', 'Looking for driver') },
236
- { key: 23, value: t('ORDER_DRIVER_ON_WAY', 'Driver on way') }
237
- ]
211
+ if (!dictionary) return s
238
212
 
239
- const objectStatus = orderStatus.find((o) => o.key === status)
213
+ const orderStatus = {
214
+ 0: dictionary?.PENDING ?? 'Pending',
215
+ 1: dictionary?.COMPLETED_BY_ADMIN ?? 'Completed by admin',
216
+ 2: dictionary?.REJECTED ?? 'Rejected',
217
+ 3: dictionary?.ORDER_STATUS_IN_BUSINESS ?? 'Driver arrived to business',
218
+ 4: dictionary?.PREPARATION_COMPLETED ?? 'Preparation Completed',
219
+ 5: dictionary?.REJECTED_BY_BUSINESS ?? 'Rejected by business',
220
+ 6: dictionary?.REJECTED_BY_DRIVER ?? 'Rejected by Driver',
221
+ 7: dictionary?.ACCEPTED_BY_BUSINESS ?? 'Accepted by business',
222
+ 8: dictionary?.ACCEPTED_BY_DRIVER ?? 'Accepted by driver',
223
+ 9: dictionary?.PICK_UP_COMPLETED_BY_DRIVER ?? 'Pick up completed by driver',
224
+ 10: dictionary?.PICK_UP_FAILED_BY_DRIVER ?? 'Pick up Failed by driver',
225
+ 11: dictionary?.DELIVERY_COMPLETED_BY_DRIVER ?? 'Delivery completed by driver',
226
+ 12: dictionary?.DELIVERY_FAILED_BY_DRIVER ?? 'Delivery Failed by driver',
227
+ 13: dictionary?.PREORDER ?? 'PreOrder',
228
+ 14: dictionary?.ORDER_NOT_READY ?? 'Order not ready',
229
+ 15: dictionary?.ORDER_PICKEDUP_COMPLETED_BY_CUSTOMER ?? 'Order picked up completed by customer',
230
+ 16: dictionary?.ORDER_STATUS_CANCELLED_BY_CUSTOMER ?? 'Order cancelled by customer',
231
+ 17: dictionary?.ORDER_NOT_PICKEDUP_BY_CUSTOMER ?? 'Order not picked up by customer',
232
+ 18: dictionary?.ORDER_DRIVER_ALMOST_ARRIVED_BUSINESS ?? 'Driver almost arrived to business',
233
+ 19: dictionary?.ORDER_DRIVER_ALMOST_ARRIVED_CUSTOMER ?? 'Driver almost arrived to customer',
234
+ 20: dictionary?.ORDER_CUSTOMER_ALMOST_ARRIVED_BUSINESS ?? 'Customer almost arrived to business',
235
+ 21: dictionary?.ORDER_CUSTOMER_ARRIVED_BUSINESS ?? 'Customer arrived to business',
236
+ 22: dictionary?.ORDER_LOOKING_FOR_DRIVER ?? 'Looking for driver',
237
+ 23: dictionary?.ORDER_DRIVER_ON_WAY ?? 'Driver on way'
238
+ }
240
239
 
241
- return objectStatus && objectStatus
240
+ return orderStatus?.[Number(s)] ?? s
242
241
  }
243
242
 
244
243
  const handleChangeAllowColumns = (type) => {
@@ -621,15 +620,15 @@ export const OrdersTable = memo((props) => {
621
620
  </OrderTbody>
622
621
  ))
623
622
  ) : (
624
- orderList.orders.map((order, i) => (
625
- <OrderTbody
626
- key={i}
627
- className={parseInt(orderDetailId) === order.id ? 'active' : ''}
628
- onClick={(e) => handleClickOrder(order, e)}
629
- data-tour={i === 0 ? 'tour_start' : ''}
630
- data-status={isEnabledRowInColor && order?.time_status}
631
- >
632
- <tr>
623
+ <OrderTbody>
624
+ {orderList.orders.map((order, i) => (
625
+ <tr
626
+ key={i}
627
+ className={parseInt(orderDetailId) === order.id ? 'active' : ''}
628
+ data-tour={i === 0 ? 'tour_start' : ''}
629
+ data-status={isEnabledRowInColor && order?.time_status}
630
+ onClick={(e) => handleClickOrder(order, e)}
631
+ >
633
632
  {Object.keys(allowColumns).filter(col => allowColumns[col]?.visable)
634
633
  .sort((col1, col2) => allowColumns[col1]?.order - allowColumns[col2]?.order)
635
634
  .map((column, index) => {
@@ -693,7 +692,7 @@ export const OrdersTable = memo((props) => {
693
692
  return (
694
693
  <td className='statusInfo' key={`statusInfo${i}-${index}`}>
695
694
  <StatusInfo>
696
- <p className='bold'>{getOrderStatus(order.status)?.value}</p>
695
+ <p className='bold'>{getOrderStatus(order.status)}</p>
697
696
  </StatusInfo>
698
697
  </td>
699
698
  )
@@ -865,8 +864,8 @@ export const OrdersTable = memo((props) => {
865
864
  }
866
865
  })}
867
866
  </tr>
868
- </OrderTbody>
869
- ))
867
+ ))}
868
+ </OrderTbody>
870
869
  )}
871
870
  </Table>
872
871
  </OrdersContainer>
@@ -93,31 +93,33 @@ export const Table = styled.table`
93
93
  `
94
94
 
95
95
  export const OrderTbody = styled.tbody`
96
- border-bottom: 1px solid ${props => props.theme.colors.borderColor};
97
- cursor: pointer;
98
-
99
- &[data-status="delayed"] {
100
- background-color: ${props => props.theme.colors.danger100};
101
- td {
102
- border-top: 1px solid ${props => props.theme.colors.danger} !important;
103
- border-bottom: 1px solid ${props => props.theme.colors.danger} !important;
96
+ tr {
97
+ border-bottom: 1px solid ${props => props.theme.colors.borderColor};
98
+ cursor: pointer;
99
+
100
+ &[data-status="delayed"] {
101
+ background-color: ${props => props.theme.colors.danger100};
102
+ td {
103
+ border-top: 1px solid ${props => props.theme.colors.danger} !important;
104
+ border-bottom: 1px solid ${props => props.theme.colors.danger} !important;
105
+ }
104
106
  }
105
- }
106
- &[data-status="at_risk"] {
107
- background-color: ${props => props.theme.colors.warning100};
108
- td {
109
- border-top: 1px solid ${props => props.theme.colors.warning} !important;
110
- border-bottom: 1px solid ${props => props.theme.colors.warning} !important;
107
+ &[data-status="at_risk"] {
108
+ background-color: ${props => props.theme.colors.warning100};
109
+ td {
110
+ border-top: 1px solid ${props => props.theme.colors.warning} !important;
111
+ border-bottom: 1px solid ${props => props.theme.colors.warning} !important;
112
+ }
111
113
  }
112
- }
113
- &:hover {
114
- background-color: ${props => props.theme.colors.lightPrimary};
115
- }
116
- &.active {
117
- background-color: ${props => props.theme.colors.lightPrimary};
118
- td {
119
- border-top: 1px solid ${props => props.theme.colors.primary} !important;
120
- border-bottom: 1px solid ${props => props.theme.colors.primary} !important;
114
+ &:hover {
115
+ background-color: ${props => props.theme.colors.lightPrimary};
116
+ }
117
+ &.active {
118
+ background-color: ${props => props.theme.colors.lightPrimary};
119
+ td {
120
+ border-top: 1px solid ${props => props.theme.colors.primary} !important;
121
+ border-bottom: 1px solid ${props => props.theme.colors.primary} !important;
122
+ }
121
123
  }
122
124
  }
123
125
  `
@@ -372,7 +374,7 @@ export const Timer = styled.div`
372
374
  .at_risk {
373
375
  color: #FFC700;
374
376
  }
375
-
377
+
376
378
  .delayed {
377
379
  color: #E63757;
378
380
  }