ordering-ui-external 1.9.5 → 2.0.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.
Files changed (100) hide show
  1. package/_bundles/{0.ordering-ui.55652fab015bca672f9d.js → 0.ordering-ui.32113e17b220a7b5ae09.js} +1 -1
  2. package/_bundles/{1.ordering-ui.55652fab015bca672f9d.js → 1.ordering-ui.32113e17b220a7b5ae09.js} +1 -1
  3. package/_bundles/{2.ordering-ui.55652fab015bca672f9d.js → 2.ordering-ui.32113e17b220a7b5ae09.js} +1 -1
  4. package/_bundles/{4.ordering-ui.55652fab015bca672f9d.js → 4.ordering-ui.32113e17b220a7b5ae09.js} +1 -1
  5. package/_bundles/{5.ordering-ui.55652fab015bca672f9d.js → 5.ordering-ui.32113e17b220a7b5ae09.js} +1 -1
  6. package/_bundles/{6.ordering-ui.55652fab015bca672f9d.js → 6.ordering-ui.32113e17b220a7b5ae09.js} +1 -1
  7. package/_bundles/{7.ordering-ui.55652fab015bca672f9d.js → 7.ordering-ui.32113e17b220a7b5ae09.js} +2 -2
  8. package/_bundles/{7.ordering-ui.55652fab015bca672f9d.js.LICENSE.txt → 7.ordering-ui.32113e17b220a7b5ae09.js.LICENSE.txt} +0 -0
  9. package/_bundles/{8.ordering-ui.55652fab015bca672f9d.js → 8.ordering-ui.32113e17b220a7b5ae09.js} +1 -1
  10. package/_bundles/{9.ordering-ui.55652fab015bca672f9d.js → 9.ordering-ui.32113e17b220a7b5ae09.js} +1 -1
  11. package/_bundles/ordering-ui.32113e17b220a7b5ae09.js +2 -0
  12. package/_bundles/{ordering-ui.55652fab015bca672f9d.js.LICENSE.txt → ordering-ui.32113e17b220a7b5ae09.js.LICENSE.txt} +0 -0
  13. package/_modules/components/Confirm/index.js +4 -2
  14. package/_modules/components/Header/index.js +4 -2
  15. package/_modules/components/SmartAppBanner/index.js +4 -2
  16. package/_modules/themes/callcenterOriginal/src/components/Orders/OrdersTable/index.js +32 -11
  17. package/_modules/themes/callcenterOriginal/src/components/Orders/OrdersTable/styles.js +1 -1
  18. package/_modules/themes/five/src/components/BusinessesListing/layouts/OriginalBusinessesListing/OrdersSection/index.js +60 -0
  19. package/_modules/themes/five/src/components/Cart/index.js +5 -5
  20. package/_modules/themes/five/src/components/Checkout/index.js +4 -0
  21. package/_modules/themes/five/src/components/Footer/index.js +4 -2
  22. package/_modules/themes/five/src/components/Header/layouts/Kiosk/index.js +4 -2
  23. package/_modules/themes/five/src/components/Modal/index.js +4 -2
  24. package/_modules/themes/five/src/components/MultiCartsPaymethodsAndWallets/index.js +1 -1
  25. package/_modules/themes/five/src/components/MultiCheckout/index.js +12 -10
  26. package/_modules/themes/five/src/components/MultiOrdersDetails/SingleOrderCard.js +1 -1
  27. package/_modules/themes/five/src/components/MultiOrdersDetails/index.js +1 -0
  28. package/_modules/themes/five/src/components/NavigationBar/index.js +4 -2
  29. package/_modules/themes/five/src/components/NotNetworkConnectivity/index.js +4 -2
  30. package/_modules/themes/five/src/components/OrdersOption/index.js +26 -97
  31. package/_modules/themes/five/src/components/ProductForm/index.js +27 -26
  32. package/_modules/themes/five/src/components/ReviewDriver/index.js +4 -2
  33. package/_modules/themes/five/src/components/ReviewOrder/index.js +4 -2
  34. package/_modules/themes/five/src/components/ReviewProduct/index.js +4 -2
  35. package/_modules/themes/five/src/components/ReviewTrigger/index.js +4 -2
  36. package/_modules/themes/five/src/components/SignUpApproval/index.js +4 -2
  37. package/_modules/themes/five/src/styles/Buttons/index.js +5 -3
  38. package/_modules/themes/five/src/styles/Inputs/index.js +1 -1
  39. package/_modules/themes/seven/src/components/Header/index.js +4 -2
  40. package/_modules/themes/six/src/components/Header/index.js +4 -2
  41. package/package.json +2 -2
  42. package/src/components/CancellationComponent/index.js +31 -27
  43. package/src/components/Confirm/index.js +2 -0
  44. package/src/components/Header/index.js +2 -0
  45. package/src/components/SmartAppBanner/index.js +2 -0
  46. package/src/themes/callcenterOriginal/src/components/Orders/OrdersTable/index.js +43 -19
  47. package/src/themes/callcenterOriginal/src/components/Orders/OrdersTable/styles.js +1 -0
  48. package/src/themes/five/src/components/BusinessesListing/layouts/OriginalBusinessesListing/OrdersSection/index.js +52 -0
  49. package/src/themes/five/src/components/Cart/index.js +9 -4
  50. package/src/themes/five/src/components/Checkout/index.js +2 -0
  51. package/src/themes/five/src/components/Footer/index.js +2 -0
  52. package/src/themes/five/src/components/Header/layouts/Kiosk/index.js +2 -0
  53. package/src/themes/five/src/components/Modal/index.js +2 -0
  54. package/src/themes/five/src/components/MultiCartsPaymethodsAndWallets/index.js +1 -1
  55. package/src/themes/five/src/components/MultiCheckout/index.js +11 -6
  56. package/src/themes/five/src/components/MultiOrdersDetails/SingleOrderCard.js +1 -1
  57. package/src/themes/five/src/components/MultiOrdersDetails/index.js +1 -0
  58. package/src/themes/five/src/components/NavigationBar/index.js +2 -0
  59. package/src/themes/five/src/components/NotNetworkConnectivity/index.js +2 -0
  60. package/src/themes/five/src/components/OrdersOption/index.js +14 -48
  61. package/src/themes/five/src/components/ProductForm/index.js +11 -11
  62. package/src/themes/five/src/components/ReviewDriver/index.js +2 -0
  63. package/src/themes/five/src/components/ReviewOrder/index.js +2 -0
  64. package/src/themes/five/src/components/ReviewProduct/index.js +2 -0
  65. package/src/themes/five/src/components/ReviewTrigger/index.js +2 -0
  66. package/src/themes/five/src/components/SignUpApproval/index.js +2 -0
  67. package/src/themes/five/src/styles/Buttons/index.js +3 -1
  68. package/src/themes/five/src/styles/Inputs/index.js +1 -1
  69. package/src/themes/seven/src/components/Header/index.js +2 -0
  70. package/src/themes/six/src/components/Header/index.js +2 -0
  71. package/template/components/HelmetTags/index.js +2 -0
  72. package/template/components/ListenPageChanges/index.js +2 -0
  73. package/template/components/ScrollToTop/index.js +2 -0
  74. package/template/components/SubdomainComponent/index.js +4 -39
  75. package/template/config.json +2 -1
  76. package/template/pages/AddressList/index.js +2 -0
  77. package/template/pages/BusinessListingSearch/index.js +2 -0
  78. package/template/pages/BusinessProductsList/index.js +2 -0
  79. package/template/pages/BusinessesList/index.js +2 -0
  80. package/template/pages/Checkout/index.js +2 -0
  81. package/template/pages/Cms/index.js +2 -0
  82. package/template/pages/Favorite/index.js +2 -0
  83. package/template/pages/Help/index.js +2 -0
  84. package/template/pages/Home/index.js +2 -0
  85. package/template/pages/MessagesList/index.js +2 -0
  86. package/template/pages/MultiCheckout/index.js +5 -0
  87. package/template/pages/MultiOrdersDetails/index.js +2 -0
  88. package/template/pages/MyOrders/index.js +2 -0
  89. package/template/pages/OrderDetails/index.js +2 -0
  90. package/template/pages/PageNotFound/index.js +2 -0
  91. package/template/pages/PagesList/index.js +2 -0
  92. package/template/pages/Profile/index.js +2 -0
  93. package/template/pages/Promotions/index.js +2 -0
  94. package/template/pages/ResetPassword/index.js +2 -0
  95. package/template/pages/SessionsList/index.js +2 -0
  96. package/template/pages/SignUpBusiness/index.js +2 -0
  97. package/template/pages/SignUpDriver/index.js +2 -0
  98. package/template/pages/UserVerification/index.js +2 -0
  99. package/template/pages/Wallets/index.js +2 -0
  100. package/_bundles/ordering-ui.55652fab015bca672f9d.js +0 -2
@@ -17,45 +17,49 @@ export const CancellationComponent = props => {
17
17
  <>
18
18
  <Hero>
19
19
  {(bgUrl || theme.images?.general?.businessHero) && (
20
- <BgImg src={bgUrl || theme.images?.general?.businessHero} alt="bg"/>
20
+ <BgImg src={bgUrl || theme.images?.general?.businessHero} alt='bg' />
21
21
  )}
22
22
  <HeroText>
23
- {(logoUrl || theme.images?.logos?.logotype) && (
24
- <LogoImg src={logoUrl || theme.images?.logos?.logotype} alt="logo"/>
25
- )}
26
- <h1 className="title">{t('CANCELLATION_TITLE', 'SITE OUT OF SERVICE')}</h1>
27
- <h4 className="sub-title" dangerouslySetInnerHTML={{
28
- __html:t('CANCELLATION_SUBTITLE', 'This website has been archived or suspended in accordance with our :Terms of Service').replace(':Terms of Service', `<b><i>${t('CANCELLATION_TERMS', 'Terms of Service')}</i></b>`)
29
- }}/>
23
+ {(logoUrl || theme.images?.logos?.logotype) && (
24
+ <LogoImg src={logoUrl || theme.images?.logos?.logotype} alt='logo' />
25
+ )}
26
+ <h1 className='title'>{t('CANCELLATION_TITLE', 'SITE OUT OF SERVICE')}</h1>
27
+ <h4
28
+ className='sub-title' dangerouslySetInnerHTML={{
29
+ __html: t('CANCELLATION_SUBTITLE', 'This website has been archived or suspended in accordance with our :Terms of Service').replace(':Terms of Service', `<b><i>${t('CANCELLATION_TERMS', 'Terms of Service')}</i></b>`)
30
+ }}
31
+ />
30
32
  </HeroText>
31
33
  </Hero>
32
34
  <Content>
33
35
  <p dangerouslySetInnerHTML={{
34
- __html:t('CANCELLATION_OWNER_TEXT', 'If you are the :owner of this website contact us to reactivate your website.').replace(':owner', `<b>${t('CANCELLATION_OWNER', 'owner')}</b>`)
35
- }}/>
36
- {ButtonComponent &&(
37
- <ButtonComponent color='primary'>{t('CANCELLATION_CONTACT_US', 'Contact us')}</ButtonComponent>
38
- )}
36
+ __html: t('CANCELLATION_OWNER_TEXT', 'If you are the :owner of this website contact us to reactivate your website.').replace(':owner', `<b>${t('CANCELLATION_OWNER', 'owner')}</b>`)
37
+ }}
38
+ />
39
+ {ButtonComponent && (
40
+ <ButtonComponent color='primary'>{t('CANCELLATION_CONTACT_US', 'Contact us')}</ButtonComponent>
41
+ )}
39
42
  </Content>
40
43
  <Segment>
41
- <p dangerouslySetInnerHTML={{
42
- __html:t('CANCELLATION_OWNER_TEXT', 'If you are a :customer let the owner know you midd this website, just write your email below.').replace(':customer', `<b>${t('CANCELLATION_CUSTOMER', 'customer')}</b>`)
43
- }}/>
44
- <InputWrapper>
44
+ <p dangerouslySetInnerHTML={{
45
+ __html: t('CANCELLATION_OWNER_TEXT', 'If you are a :customer let the owner know you midd this website, just write your email below.').replace(':customer', `<b>${t('CANCELLATION_CUSTOMER', 'customer')}</b>`)
46
+ }}
47
+ />
48
+ <InputWrapper>
45
49
  <BusinessSearch>
46
- {InputComponent &&(
50
+ {InputComponent && (
47
51
  <InputComponent
48
- name='Email'
49
- placeholder={t('CANCELLATION_INPUT_PLACEHOLDER', 'Email')}
50
- />
51
- )}
52
+ name='Email'
53
+ placeholder={t('CANCELLATION_INPUT_PLACEHOLDER', 'Email')}
54
+ />
55
+ )}
52
56
  </BusinessSearch>
53
- {ButtonComponent &&(
54
- <ButtonComponent color='primary'>
55
- {t('CANCELLATION_SEND_BUTTON', 'Send')}
56
- </ButtonComponent>
57
+ {ButtonComponent && (
58
+ <ButtonComponent color='primary'>
59
+ {t('CANCELLATION_SEND_BUTTON', 'Send')}
60
+ </ButtonComponent>
57
61
  )}
58
- </InputWrapper>
62
+ </InputWrapper>
59
63
  </Segment>
60
64
  </>
61
65
  )
@@ -87,3 +87,5 @@ export const Confirm = (props) => {
87
87
  }
88
88
 
89
89
  export const Alert = Confirm
90
+
91
+ export default Confirm
@@ -443,3 +443,5 @@ const styles = {
443
443
  Header.defaultProps = {
444
444
  isShowOrderOptions: true
445
445
  }
446
+
447
+ export default Header
@@ -38,3 +38,5 @@ export const SmartAppBanner = (props) => {
38
38
  }
39
39
  return <SmartAppBannerController {...smartAppBannerProps} />
40
40
  }
41
+
42
+ export default SmartAppBanner
@@ -309,7 +309,18 @@ export const OrdersTable = (props) => {
309
309
  {!isSelectedOrders && (
310
310
  <thead>
311
311
  <tr>
312
- {allowColumns && Object.keys(allowColumns).filter(col => allowColumns[col]?.visable && allowColumns[col]?.order !== 0)
312
+ {allowColumns && (Object.keys(allowColumns).filter(col => allowColumns[col]?.visable && allowColumns[col]?.order !== 0)?.length === 0 ?
313
+ (
314
+ <th className='orderPrice' key={`noDragTh-${i}`}>
315
+ <ColumnAllowSettingPopover
316
+ allowColumns={allowColumns}
317
+ optionsDefault={optionsDefault}
318
+ handleChangeAllowColumns={handleChangeAllowColumns}
319
+ isOrder
320
+ />
321
+ </th>
322
+ ) : (
323
+ Object.keys(allowColumns).filter(col => allowColumns[col]?.visable && allowColumns[col]?.order !== 0)
313
324
  .sort((col1, col2) => allowColumns[col1]?.order - allowColumns[col2]?.order)
314
325
  .map((column, i, array) => {
315
326
  if (column === 'slaBar') {
@@ -317,24 +328,36 @@ export const OrdersTable = (props) => {
317
328
  }
318
329
  if (column === 'orderNumber') {
319
330
  return (
320
- <th
321
- className={!(allowColumns?.orderNumber?.visable || allowColumns?.dateTime?.visable) ? 'orderNo small' : 'orderNo'}
322
- key={`noDragTh-${i}`}
323
- colSpan={allowColumns?.slaBar?.visable ? 2 : 1}
324
- >
325
- <CheckBox
326
- isChecked={!orderList.loading && isAllChecked}
327
- onClick={() => handleSelecteAllOrder()}
328
- className='orderCheckBox'
331
+ <React.Fragment key={i}>
332
+ <th
333
+ className={!(allowColumns?.orderNumber?.visable || allowColumns?.dateTime?.visable) ? 'orderNo small' : 'orderNo'}
334
+ key={`noDragTh-${i}`}
335
+ colSpan={allowColumns?.slaBar?.visable ? 2 : 1}
329
336
  >
330
- {(!orderList.loading && isAllChecked) ? (
331
- <RiCheckboxFill />
332
- ) : (
333
- <RiCheckboxBlankLine />
334
- )}
335
- </CheckBox>
336
- {t('ORDER', 'Order')}
337
- </th>
337
+ <CheckBox
338
+ isChecked={!orderList.loading && isAllChecked}
339
+ onClick={() => handleSelecteAllOrder()}
340
+ className='orderCheckBox'
341
+ >
342
+ {(!orderList.loading && isAllChecked) ? (
343
+ <RiCheckboxFill />
344
+ ) : (
345
+ <RiCheckboxBlankLine />
346
+ )}
347
+ </CheckBox>
348
+ {t('ORDER', 'Order')}
349
+ </th>
350
+ {column === [...array].pop() && (
351
+ <th className='orderPrice' key={`noDragTh-${i}`}>
352
+ <ColumnAllowSettingPopover
353
+ allowColumns={allowColumns}
354
+ optionsDefault={optionsDefault}
355
+ handleChangeAllowColumns={handleChangeAllowColumns}
356
+ isOrder
357
+ />
358
+ </th>
359
+ )}
360
+ </React.Fragment>
338
361
  )
339
362
  }
340
363
  if (column === 'total' || (column !== 'total' && column === [...array].pop())) {
@@ -388,7 +411,8 @@ export const OrdersTable = (props) => {
388
411
  <span>{allowColumns[column]?.title}</span>
389
412
  </div>
390
413
  </DragTh>)
391
- })}
414
+ })
415
+ ))}
392
416
  </tr>
393
417
  </thead>
394
418
  )}
@@ -29,6 +29,7 @@ export const OrdersContainer = styled.div`
29
29
  export const Table = styled.table`
30
30
  width: calc(100% - 10px);
31
31
  min-width: 900px;
32
+ min-height: 35vh;
32
33
 
33
34
  th,
34
35
  td {
@@ -0,0 +1,52 @@
1
+ import React from 'react'
2
+ import { OrdersOption } from '../../../../OrdersOption'
3
+ import { useLanguage, useOrder } from 'ordering-components-external'
4
+ export const OrdersSection = (props) => {
5
+ const {
6
+ titleContent,
7
+ onRedirectPage,
8
+ businessesIds,
9
+ getCustomArray,
10
+ businessesList,
11
+ isCustomerMode,
12
+ userCustomer
13
+ } = props
14
+ const [orderState] = useOrder()
15
+ const [, t] = useLanguage()
16
+ return (
17
+ <>
18
+ {onRedirectPage && (
19
+ <>
20
+ <OrdersOption
21
+ horizontal
22
+ isBusinessesPage
23
+ onRedirectPage={onRedirectPage}
24
+ titleContent={t('CARTS', 'Carts')}
25
+ businessesIds={businessesIds}
26
+ customArray={
27
+ getCustomArray(orderState.carts)?.filter(cart => cart.products.length > 0)
28
+ }
29
+ isCustomLayout
30
+ isBusinessesLoading={businessesList.loading}
31
+ isCustomerMode={isCustomerMode}
32
+ franchiseId={props.franchiseId}
33
+ />
34
+ <OrdersOption
35
+ pastOrders
36
+ horizontal
37
+ asDashboard
38
+ isBusinessesPage
39
+ businessesIds={businessesIds}
40
+ onRedirectPage={onRedirectPage}
41
+ userCustomerId={userCustomer?.id}
42
+ isCustomLayout
43
+ titleContent={titleContent}
44
+ isBusinessesLoading={businessesList.loading}
45
+ isCustomerMode={isCustomerMode}
46
+ franchiseId={props.franchiseId}
47
+ />
48
+ </>
49
+ )}
50
+ </>
51
+ )
52
+ }
@@ -391,7 +391,9 @@ const CartUI = (props) => {
391
391
  )}
392
392
  <IconContainer>
393
393
  <BsInfoCircle size='20' color={theme.colors.primary} onClick={() => setOpenTaxModal({ open: true, data: offer, type: 'offer_target_3' })} />
394
- <MdCloseCircle size='24' color={theme.colors.primary} onClick={() => onRemoveOffer(offer?.id)} />
394
+ {!offer?.type && (
395
+ <MdCloseCircle size='24' color={theme.colors.primary} onClick={() => onRemoveOffer(offer?.id)} />
396
+ )}
395
397
  </IconContainer>
396
398
  </td>
397
399
  <td>
@@ -403,7 +405,7 @@ const CartUI = (props) => {
403
405
  {orderState?.options?.type === 1 && cart?.delivery_price > 0 && !hideDeliveryFee && (
404
406
  <tr>
405
407
  <td>{t('DELIVERY_FEE', 'Delivery Fee')}</td>
406
- <td>{parsePrice(cart?.delivery_price_with_discount ?? cart?.delivery_price)}</td>
408
+ <td>{parsePrice(cart?.delivery_price)}</td>
407
409
  </tr>
408
410
  )}
409
411
  {
@@ -416,7 +418,9 @@ const CartUI = (props) => {
416
418
  )}
417
419
  <IconContainer>
418
420
  <BsInfoCircle size='20' color={theme.colors.primary} onClick={() => setOpenTaxModal({ open: true, data: offer, type: 'offer_target_2' })} />
419
- <MdCloseCircle size='24' color={theme.colors.primary} onClick={() => onRemoveOffer(offer?.id)} />
421
+ {!offer?.type && (
422
+ <MdCloseCircle size='24' color={theme.colors.primary} onClick={() => onRemoveOffer(offer?.id)} />
423
+ )}
420
424
  </IconContainer>
421
425
  </td>
422
426
  <td>
@@ -450,7 +454,8 @@ const CartUI = (props) => {
450
454
  </CouponContainer>
451
455
  )}
452
456
  {
453
- isMultiCheckout &&
457
+ !isStore &&
458
+ !isMultiCheckout &&
454
459
  cart &&
455
460
  cart?.business_id &&
456
461
  orderState?.options?.type === 1 &&
@@ -784,6 +784,8 @@ export const Checkout = (props) => {
784
784
  useEffect(() => {
785
785
  if (token && cartUuid) {
786
786
  getOrder(cartUuid)
787
+ } else {
788
+ setCartState({ ...cartState, loading: false })
787
789
  }
788
790
  }, [token, cartUuid])
789
791
 
@@ -63,3 +63,5 @@ export const Footer = ({ isFooterPage }) => {
63
63
  </Container>
64
64
  )
65
65
  }
66
+
67
+ export default Footer
@@ -178,3 +178,5 @@ export const Header = (props) => {
178
178
  </HeaderContainer>
179
179
  )
180
180
  }
181
+
182
+ export default Header
@@ -104,3 +104,5 @@ export const Modal = (props) => {
104
104
  <Popup {...ModalProps} />
105
105
  )
106
106
  }
107
+
108
+ export default Modal
@@ -34,7 +34,7 @@ const getPayIcon = (method) => {
34
34
  case 1:
35
35
  return <Cash />
36
36
  case 22:
37
- return <BilStripe />
37
+ return <CreditCard />
38
38
  case 28:
39
39
  return <FaCcStripe />
40
40
  case 31:
@@ -1,5 +1,6 @@
1
1
  import React, { useState, useEffect } from 'react'
2
2
  import { useHistory } from 'react-router-dom'
3
+ import { useTheme } from 'styled-components'
3
4
  import {
4
5
  useLanguage,
5
6
  useUtils,
@@ -8,7 +9,6 @@ import {
8
9
  useSession,
9
10
  useValidationFields,
10
11
  useOrder,
11
- useOrderingTheme,
12
12
  MultiCheckout as MultiCheckoutController
13
13
  } from 'ordering-components-external'
14
14
 
@@ -62,14 +62,15 @@ const MultiCheckoutUI = (props) => {
62
62
  onRedirectPage,
63
63
  cartGroup,
64
64
  cartUuid,
65
- totalCartsFee
65
+ totalCartsFee,
66
+ handleSearchRedirect
66
67
  } = props
67
68
 
69
+ const theme = useTheme()
68
70
  const [, t] = useLanguage()
69
71
  const [{ configs }] = useConfig()
70
72
  const [{ parsePrice }] = useUtils()
71
73
  const [customerState] = useCustomer()
72
- const [orderingTheme] = useOrderingTheme()
73
74
  const [validationFields] = useValidationFields()
74
75
  const [{ user }] = useSession()
75
76
  const [orderState] = useOrder()
@@ -80,8 +81,10 @@ const MultiCheckoutUI = (props) => {
80
81
  const [alertState, setAlertState] = useState({ open: false, content: [] })
81
82
  const isDisablePlaceOrderButton = !(paymethodSelected?.paymethod_id || paymethodSelected?.wallet_id) || (paymethodSelected?.paymethod?.gateway === 'stripe' && !paymethodSelected?.paymethod_data)
82
83
  const walletCarts = (Object.values(orderState?.carts)?.filter(cart => cart?.products && cart?.products?.length && cart?.status !== 2 && cart?.valid_schedule && cart?.valid_products && cart?.valid_address && cart?.valid_maximum && cart?.valid_minimum && cart?.wallets) || null) || []
83
- const isMultiDriverTips = orderingTheme?.theme?.header?.components?.layout?.type?.toLowerCase() === 'chew'
84
+ const isMultiDriverTips = theme?.header?.components?.layout?.type?.toLowerCase() === 'chew'
84
85
  const driverTipsOptions = typeof configs?.driver_tip_options?.value === 'string'
86
+ ? JSON.parse(configs?.driver_tip_options?.value) || []
87
+ : configs?.driver_tip_options?.value || []
85
88
  const totalFeeEnabled = configs?.multi_business_checkout_show_combined_delivery_fee?.value === '1'
86
89
  ? JSON.parse(configs?.driver_tip_options?.value) || []
87
90
  : configs?.driver_tip_options?.value || []
@@ -159,9 +162,11 @@ const MultiCheckoutUI = (props) => {
159
162
 
160
163
  return (
161
164
  <>
162
- {!cartGroup?.loading && openCarts.length === 0 ? (
165
+ {((!cartGroup?.loading && openCarts.length === 0) || !cartUuid) ? (
163
166
  <NotFoundSource
164
- content={t('CARTS_NOT_FOUND', 'You dont have carts available')}
167
+ content={t('NOT_FOUND_CARTS', 'Sorry, You don\'t seem to have any carts.')}
168
+ btnTitle={t('SEARCH_REDIRECT', 'Go to Businesses')}
169
+ onClickButton={handleSearchRedirect}
165
170
  />
166
171
  ) : (
167
172
  <Container>
@@ -75,7 +75,7 @@ const SingleOrderCardUI = (props) => {
75
75
  }
76
76
 
77
77
  const handleGoToOrderDetails = (uuid) => {
78
- events.emit('go_to_page', { page: 'order_detail', params: { orderId: uuid }, replace: true })
78
+ events.emit('go_to_page', { page: 'order_detail', params: { orderId: uuid }, replace: !props.isMultiOrders })
79
79
  }
80
80
 
81
81
  const handleOpenMessages = (data) => {
@@ -168,6 +168,7 @@ const MultiOrdersDetailsUI = (props) => {
168
168
  {orders.map(order => (
169
169
  <SingleOrderCard
170
170
  key={order.id}
171
+ isMultiOrders
171
172
  getOrderStatus={getOrderStatus}
172
173
  order={order}
173
174
  />
@@ -216,3 +216,5 @@ export const NavigationBar = () => {
216
216
  </>
217
217
  )
218
218
  }
219
+
220
+ export default NavigationBar
@@ -61,3 +61,5 @@ export const NotNetworkConnectivity = (props) => {
61
61
  </>
62
62
  )
63
63
  }
64
+
65
+ export default NotNetworkConnectivity
@@ -5,8 +5,6 @@ import { useLanguage, useOrder, useEvent, OrderList } from 'ordering-components-
5
5
  import { HorizontalOrdersLayout } from '../HorizontalOrdersLayout'
6
6
  import { VerticalOrdersLayout } from '../../../../../components/VerticalOrdersLayout'
7
7
 
8
- import { useTheme } from 'styled-components'
9
-
10
8
  import {
11
9
  OptionTitle,
12
10
  OrdersContainer,
@@ -27,6 +25,7 @@ import { SingleProductCard } from '../SingleProductCard'
27
25
  import { useWindowSize } from '../../../../../hooks/useWindowSize'
28
26
  import { Alert } from '../Confirm'
29
27
  import { PreviousProfessionalOrdered } from './PreviousProfessionalOrdered'
28
+ import { getOrderStatus } from '../../../../../utils'
30
29
 
31
30
  const OrdersOptionUI = (props) => {
32
31
  const {
@@ -70,7 +69,6 @@ const OrdersOptionUI = (props) => {
70
69
  } = props
71
70
 
72
71
  const [, t] = useLanguage()
73
- const theme = useTheme()
74
72
  const [{ carts }] = useOrder()
75
73
  const [events] = useEvent()
76
74
  const { width } = useWindowSize()
@@ -81,16 +79,19 @@ const OrdersOptionUI = (props) => {
81
79
  const ordersReduced = _orders.map(order => order?.cart_group_id
82
80
  ? _orders
83
81
  .filter(_order => _order?.cart_group_id === order?.cart_group_id)
84
- ?.reduce((orderCompleted, currentOrder) => ({
85
- ...orderCompleted,
86
- total: orderCompleted.summary?.total + currentOrder?.summary?.total,
87
- business: [orderCompleted.business, currentOrder.business].flat(),
88
- business_id: [orderCompleted.business_id, currentOrder.business_id].flat(),
89
- id: [orderCompleted.id, currentOrder.id].flat(),
90
- review: orderCompleted.review && currentOrder.review,
91
- user_review: orderCompleted.user_review && currentOrder.user_review,
92
- products: [orderCompleted.products, currentOrder.products].flat()
93
- }))
82
+ .map((_o, _, _ordersList) => {
83
+ const obj = {
84
+ ..._o,
85
+ id: _ordersList.map(o => o.id),
86
+ review: _o.review,
87
+ user_review: _o.user_review,
88
+ total: _ordersList.reduce((acc, o) => acc + o.summary.total, 0),
89
+ business: _ordersList.map(o => o.business),
90
+ business_id: _ordersList.map(o => o.business_id),
91
+ products: _ordersList.map(o => o.products)
92
+ }
93
+ return obj
94
+ }).find(o => o)
94
95
  : order)
95
96
  const orders = ordersReduced?.filter(order => {
96
97
  if (!order?.cart_group_id) return true
@@ -123,41 +124,6 @@ const OrdersOptionUI = (props) => {
123
124
  }
124
125
 
125
126
  const showSkeletons = (!isBusiness && !isProducts && loading) || (businesses?.loading && isBusiness) || (products?.length === 0 && isProducts && ((!businessesSearchList && loading) || businessesSearchList?.loading))
126
-
127
- const getOrderStatus = (s) => {
128
- const status = parseInt(s)
129
- const orderStatus = [
130
- { key: 0, value: t('PENDING', theme?.defaultLanguages?.PENDING || 'Pending') },
131
- { key: 1, value: t('COMPLETED', theme?.defaultLanguages?.COMPLETED || 'Completed') },
132
- { key: 2, value: t('REJECTED', theme?.defaultLanguages?.REJECTED || 'Rejected') },
133
- { key: 3, value: t('DRIVER_IN_BUSINESS', theme?.defaultLanguages?.DRIVER_IN_BUSINESS || 'Driver in business') },
134
- { key: 4, value: t('PREPARATION_COMPLETED', theme?.defaultLanguages?.PREPARATION_COMPLETED || 'Preparation Completed') },
135
- { key: 5, value: t('REJECTED_BY_BUSINESS', theme?.defaultLanguages?.REJECTED_BY_BUSINESS || 'Rejected by business') },
136
- { key: 6, value: t('REJECTED_BY_DRIVER', theme?.defaultLanguages?.REJECTED_BY_DRIVER || 'Rejected by Driver') },
137
- { key: 7, value: t('ACCEPTED_BY_BUSINESS', theme?.defaultLanguages?.ACCEPTED_BY_BUSINESS || 'Accepted by business') },
138
- { key: 8, value: t('ACCEPTED_BY_DRIVER', theme?.defaultLanguages?.ACCEPTED_BY_DRIVER || 'Accepted by driver') },
139
- { key: 9, value: t('PICK_UP_COMPLETED_BY_DRIVER', theme?.defaultLanguages?.PICK_UP_COMPLETED_BY_DRIVER || 'Pick up completed by driver') },
140
- { key: 10, value: t('PICK_UP_FAILED_BY_DRIVER', theme?.defaultLanguages?.PICK_UP_FAILED_BY_DRIVER || 'Pick up Failed by driver') },
141
- { key: 11, value: t('DELIVERY_COMPLETED_BY_DRIVER', theme?.defaultLanguages?.DELIVERY_COMPLETED_BY_DRIVER || 'Delivery completed by driver') },
142
- { key: 12, value: t('DELIVERY_FAILED_BY_DRIVER', theme?.defaultLanguages?.DELIVERY_FAILED_BY_DRIVER || 'Delivery Failed by driver') },
143
- { key: 13, value: t('PREORDER', theme?.defaultLanguages?.PREORDER || 'PreOrder') },
144
- { key: 14, value: t('ORDER_NOT_READY', theme?.defaultLanguages?.ORDER_NOT_READY || 'Order not ready') },
145
- { key: 15, value: t('ORDER_PICKEDUP_COMPLETED_BY_CUSTOMER', theme?.defaultLanguages?.ORDER_PICKEDUP_COMPLETED_BY_CUSTOMER || 'Order picked up completed by customer') },
146
- { key: 16, value: t('ORDER_STATUS_CANCELLED_BY_CUSTOMER', theme?.defaultLanguages?.ORDER_STATUS_CANCELLED_BY_CUSTOMER || 'Order cancelled by customer') },
147
- { key: 17, value: t('ORDER_NOT_PICKEDUP_BY_CUSTOMER', theme?.defaultLanguages?.ORDER_NOT_PICKEDUP_BY_CUSTOMER || 'Order not picked up by customer') },
148
- { key: 18, value: t('ORDER_DRIVER_ALMOST_ARRIVED_BUSINESS', theme?.defaultLanguages?.ORDER_DRIVER_ALMOST_ARRIVED_BUSINESS || 'Driver almost arrived to business') },
149
- { key: 19, value: t('ORDER_DRIVER_ALMOST_ARRIVED_CUSTOMER', theme?.defaultLanguages?.ORDER_DRIVER_ALMOST_ARRIVED_CUSTOMER || 'Driver almost arrived to customer') },
150
- { key: 20, value: t('ORDER_CUSTOMER_ALMOST_ARRIVED_BUSINESS', theme?.defaultLanguages?.ORDER_CUSTOMER_ALMOST_ARRIVED_BUSINESS || 'Customer almost arrived to business') },
151
- { key: 21, value: t('ORDER_CUSTOMER_ARRIVED_BUSINESS', theme?.defaultLanguages?.ORDER_CUSTOMER_ARRIVED_BUSINESS || 'Customer arrived to business') },
152
- { key: 22, value: t('ORDER_LOOKING_FOR_DRIVER', theme?.defaultLanguages?.ORDER_LOOKING_FOR_DRIVER || 'Looking for driver') },
153
- { key: 23, value: t('ORDER_DRIVER_ON_WAY', theme?.defaultLanguages?.ORDER_DRIVER_ON_WAY || 'Driver on way') }
154
- ]
155
-
156
- const objectStatus = orderStatus.find((o) => o.key === status)
157
-
158
- return objectStatus && objectStatus
159
- }
160
-
161
127
  const onProductClick = (product, slug) => {
162
128
  if (slug) {
163
129
  onProductRedirect({
@@ -151,7 +151,7 @@ const ProductOptionsUI = (props) => {
151
151
  }
152
152
 
153
153
  const handleSaveProduct = () => {
154
- const isErrors = Object.values(errors).length > 0
154
+ const isErrors = Object.values(errors)?.length > 0
155
155
  if (!isErrors) {
156
156
  handleSave && handleSave()
157
157
  return
@@ -212,7 +212,7 @@ const ProductOptionsUI = (props) => {
212
212
 
213
213
  const getOverFlowImage = (url) => {
214
214
  const keys = url.split('/')
215
- const _videoId = keys[keys.length - 1]
215
+ const _videoId = keys[keys?.length - 1]
216
216
  const overFlowImg = 'http://img.youtube.com/vi/' + _videoId + '/0.jpg'
217
217
  return overFlowImg
218
218
  }
@@ -230,7 +230,7 @@ const ProductOptionsUI = (props) => {
230
230
 
231
231
  const scrollDown = () => {
232
232
  const adjustHeight = windowSize?.width > 768 ? 50 : 55
233
- const isErrors = Object.values(errors).length > 0
233
+ const isErrors = Object.values(errors)?.length > 0
234
234
  if (!isErrors) {
235
235
  return
236
236
  }
@@ -272,8 +272,8 @@ const ProductOptionsUI = (props) => {
272
272
  if (product?.ingredients.length > 0 || product?.extras.length > 0) {
273
273
  const menuList = []
274
274
  if (product?.ingredients?.length > 0) menuList.push('ingredients')
275
- product?.extras?.length > 0 && product.extras.sort((a, b) => a.rank - b.rank).forEach(extra => {
276
- extra.options?.length > 0 && extra.options.sort((a, b) => a.rank - b.rank).forEach(option => {
275
+ product?.extras.length > 0 && product?.extras.sort((a, b) => a.rank - b.rank).forEach(extra => {
276
+ extra?.options.length > 0 && extra?.options.sort((a, b) => a.rank - b.rank).forEach(option => {
277
277
  showOption(option) && menuList.push(`id_${option?.id}`)
278
278
  })
279
279
  })
@@ -545,12 +545,12 @@ const ProductOptionsUI = (props) => {
545
545
  <Divider />
546
546
  <ProductEdition>
547
547
  {
548
- (product?.ingredients.length > 0 || product?.extras.length > 0) && (
548
+ (product?.ingredients?.length > 0 || product?.extras?.length > 0) && (
549
549
  <ProductTabContainer id='all'>
550
550
  <Tabs>
551
551
  <AutoScroll scrollId='optionList'>
552
552
  {
553
- product?.ingredients.length > 0 && (
553
+ product?.ingredients?.length > 0 && (
554
554
  <Tab
555
555
  key='ingredients'
556
556
  id='menu_ingredients'
@@ -563,7 +563,7 @@ const ProductOptionsUI = (props) => {
563
563
  )
564
564
  }
565
565
  {
566
- product?.extras.sort((a, b) => a.rank - b.rank).map(extra => extra.options.sort((a, b) => a.rank - b.rank).map(option => {
566
+ product?.extras.sort((a, b) => a.rank - b.rank).map(extra => extra.options?.sort((a, b) => a.rank - b.rank).map(option => {
567
567
  return (
568
568
  showOption(option) && (
569
569
  <Tab
@@ -584,9 +584,9 @@ const ProductOptionsUI = (props) => {
584
584
  </ProductTabContainer>
585
585
  )
586
586
  }
587
- {product?.ingredients.length > 0 && (
587
+ {product?.ingredients?.length > 0 && (
588
588
  <div id='ingredients'>
589
- {product?.ingredients.length > 0 && (<SectionTitle>{t('INGREDIENTS', theme?.defaultLanguages?.INGREDIENTS || 'Ingredients')}</SectionTitle>)}
589
+ {product?.ingredients?.length > 0 && (<SectionTitle>{t('INGREDIENTS', theme?.defaultLanguages.INGREDIENTS || 'Ingredients')}</SectionTitle>)}
590
590
  <WrapperIngredients isProductSoldout={isSoldOut || maxProductQuantity <= 0}>
591
591
  {product?.ingredients.map(ingredient => (
592
592
  <ProductIngredient
@@ -602,7 +602,7 @@ const ProductOptionsUI = (props) => {
602
602
  )}
603
603
  <div>
604
604
  {
605
- product?.extras.sort((a, b) => a.rank - b.rank).map(extra => extra.options.sort((a, b) => a.rank - b.rank).map(option => {
605
+ product?.extras?.sort((a, b) => a.rank - b.rank).map(extra => extra.options.sort((a, b) => a.rank - b.rank).map(option => {
606
606
  const currentState = productCart.options[`id:${option?.id}`] || {}
607
607
  return (
608
608
  <React.Fragment key={option?.id}>
@@ -251,3 +251,5 @@ export const ReviewDriver = (props) => {
251
251
 
252
252
  return <ReviewDriverController {...reviewDriverProps} />
253
253
  }
254
+
255
+ export default ReviewDriver
@@ -247,3 +247,5 @@ export const ReviewOrder = (props) => {
247
247
 
248
248
  return <ReviewOrderController {...ReviewOrderProps} />
249
249
  }
250
+
251
+ export default ReviewOrder
@@ -257,3 +257,5 @@ export const ReviewProduct = (props) => {
257
257
  }
258
258
  return <ReviewProductController {...reviewProductProps} />
259
259
  }
260
+
261
+ export default ReviewProduct
@@ -84,3 +84,5 @@ export const ReviewTrigger = (props) => {
84
84
  </>
85
85
  )
86
86
  }
87
+
88
+ export default ReviewTrigger
@@ -106,3 +106,5 @@ export const SignUpApproval = (props) => {
106
106
  </Container>
107
107
  )
108
108
  }
109
+
110
+ export default SignUpApproval