ordering-ui-external 1.5.4 → 1.6.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 (81) hide show
  1. package/_bundles/0.ordering-ui.ff76ec87ed271a678f9d.js +1 -0
  2. package/_bundles/{1.ordering-ui.5de718771fdf8a9bc402.js → 1.ordering-ui.ff76ec87ed271a678f9d.js} +0 -0
  3. package/_bundles/{2.ordering-ui.5de718771fdf8a9bc402.js → 2.ordering-ui.ff76ec87ed271a678f9d.js} +0 -0
  4. package/_bundles/{4.ordering-ui.5de718771fdf8a9bc402.js → 4.ordering-ui.ff76ec87ed271a678f9d.js} +0 -0
  5. package/_bundles/{5.ordering-ui.5de718771fdf8a9bc402.js → 5.ordering-ui.ff76ec87ed271a678f9d.js} +1 -1
  6. package/_bundles/{6.ordering-ui.5de718771fdf8a9bc402.js → 6.ordering-ui.ff76ec87ed271a678f9d.js} +0 -0
  7. package/_bundles/{7.ordering-ui.5de718771fdf8a9bc402.js → 7.ordering-ui.ff76ec87ed271a678f9d.js} +2 -2
  8. package/_bundles/{7.ordering-ui.5de718771fdf8a9bc402.js.LICENSE.txt → 7.ordering-ui.ff76ec87ed271a678f9d.js.LICENSE.txt} +0 -0
  9. package/_bundles/{8.ordering-ui.5de718771fdf8a9bc402.js → 8.ordering-ui.ff76ec87ed271a678f9d.js} +0 -0
  10. package/_bundles/{9.ordering-ui.5de718771fdf8a9bc402.js → 9.ordering-ui.ff76ec87ed271a678f9d.js} +0 -0
  11. package/_bundles/ordering-ui.ff76ec87ed271a678f9d.js +2 -0
  12. package/_bundles/{ordering-ui.5de718771fdf8a9bc402.js.LICENSE.txt → ordering-ui.ff76ec87ed271a678f9d.js.LICENSE.txt} +0 -0
  13. package/_modules/components/BusinessTypeFilter/index.js +6 -3
  14. package/_modules/components/CancellationComponent/index.js +58 -0
  15. package/_modules/components/CancellationComponent/styles.js +43 -0
  16. package/_modules/components/Header/index.js +1 -1
  17. package/_modules/index.js +7 -0
  18. package/_modules/themes/callcenterOriginal/src/components/Header/styles.js +1 -1
  19. package/_modules/themes/five/src/components/AddressForm/index.js +5 -5
  20. package/_modules/themes/five/src/components/AddressList/index.js +3 -1
  21. package/_modules/themes/five/src/components/AddressList/styles.js +1 -1
  22. package/_modules/themes/five/src/components/BusinessBasicInformation/index.js +4 -2
  23. package/_modules/themes/five/src/components/BusinessController/index.js +22 -13
  24. package/_modules/themes/five/src/components/BusinessReviews/index.js +4 -4
  25. package/_modules/themes/five/src/components/BusinessesListing/layouts/OriginalBusinessesListing/index.js +8 -5
  26. package/_modules/themes/five/src/components/Cart/index.js +13 -2
  27. package/_modules/themes/five/src/components/HomeHero/index.js +5 -3
  28. package/_modules/themes/five/src/components/MultiOrdersDetails/styles.js +1 -1
  29. package/_modules/themes/five/src/components/OrderDetails/OrderActionsSection.js +38 -0
  30. package/_modules/themes/five/src/components/OrderDetails/OrderHeaderInfoSection.js +27 -0
  31. package/_modules/themes/five/src/components/OrderDetails/index.js +64 -60
  32. package/_modules/themes/five/src/components/OrderDetails/styles.js +7 -5
  33. package/_modules/themes/five/src/components/OrderTypeSelectorContent/index.js +7 -2
  34. package/_modules/themes/five/src/components/OrdersOption/PreviousBusinessOrdered/index.js +2 -2
  35. package/_modules/themes/five/src/components/OrdersOption/index.js +4 -2
  36. package/_modules/themes/five/src/components/ProductItemAccordion/index.js +5 -3
  37. package/_modules/themes/five/src/components/ServiceForm/index.js +33 -7
  38. package/_modules/themes/five/src/components/ServiceForm/styles.js +8 -3
  39. package/_modules/themes/five/src/components/SignUpApproval/index.js +6 -6
  40. package/_modules/themes/five/src/components/SingleProductCard/index.js +4 -4
  41. package/_modules/themes/five/src/components/UserFormDetails/index.js +51 -26
  42. package/_modules/themes/five/src/components/UserFormDetails/styles.js +9 -3
  43. package/_modules/themes/five/src/components/UserVerification/index.js +7 -2
  44. package/index-template.js +7 -5
  45. package/package.json +2 -2
  46. package/src/components/BusinessTypeFilter/index.js +2 -2
  47. package/src/components/CancellationComponent/index.js +62 -0
  48. package/src/components/CancellationComponent/styles.js +162 -0
  49. package/src/components/Header/index.js +1 -1
  50. package/src/index.js +2 -0
  51. package/src/themes/callcenterOriginal/src/components/Header/styles.js +1 -0
  52. package/src/themes/five/src/components/AddressForm/index.js +2 -2
  53. package/src/themes/five/src/components/AddressList/index.js +2 -1
  54. package/src/themes/five/src/components/AddressList/styles.js +4 -1
  55. package/src/themes/five/src/components/BusinessBasicInformation/index.js +3 -2
  56. package/src/themes/five/src/components/BusinessController/index.js +68 -44
  57. package/src/themes/five/src/components/BusinessReviews/index.js +4 -4
  58. package/src/themes/five/src/components/BusinessesListing/layouts/OriginalBusinessesListing/index.js +15 -11
  59. package/src/themes/five/src/components/Cart/index.js +24 -9
  60. package/src/themes/five/src/components/HomeHero/index.js +4 -2
  61. package/src/themes/five/src/components/MultiOrdersDetails/styles.js +5 -1
  62. package/src/themes/five/src/components/OrderDetails/OrderActionsSection.js +33 -0
  63. package/src/themes/five/src/components/OrderDetails/OrderHeaderInfoSection.js +20 -0
  64. package/src/themes/five/src/components/OrderDetails/index.js +84 -100
  65. package/src/themes/five/src/components/OrderDetails/styles.js +4 -1
  66. package/src/themes/five/src/components/OrderTypeSelectorContent/index.js +4 -2
  67. package/src/themes/five/src/components/OrdersOption/PreviousBusinessOrdered/index.js +2 -2
  68. package/src/themes/five/src/components/OrdersOption/index.js +3 -1
  69. package/src/themes/five/src/components/ProductItemAccordion/index.js +4 -2
  70. package/src/themes/five/src/components/ServiceForm/index.js +162 -139
  71. package/src/themes/five/src/components/ServiceForm/styles.js +10 -0
  72. package/src/themes/five/src/components/SignUpApproval/index.js +6 -7
  73. package/src/themes/five/src/components/SingleProductCard/index.js +3 -3
  74. package/src/themes/five/src/components/UserFormDetails/index.js +59 -23
  75. package/src/themes/five/src/components/UserFormDetails/styles.js +26 -0
  76. package/src/themes/five/src/components/UserVerification/index.js +18 -11
  77. package/template/app.js +385 -367
  78. package/template/components/SubdomainComponent/index.js +54 -0
  79. package/template/config.json +4 -1
  80. package/_bundles/0.ordering-ui.5de718771fdf8a9bc402.js +0 -1
  81. package/_bundles/ordering-ui.5de718771fdf8a9bc402.js +0 -2
@@ -33,7 +33,6 @@ import { Confirm } from '../Confirm'
33
33
  import {
34
34
  Container,
35
35
  WrapperContainer,
36
- HeaderInfo,
37
36
  Content,
38
37
  OrderBusiness,
39
38
  BusinessWrapper,
@@ -52,7 +51,6 @@ import {
52
51
  ShareOrder,
53
52
  WrapperLeftContainer,
54
53
  WrapperRightContainer,
55
- MyOrderActions,
56
54
  ReviewOrderLink,
57
55
  SkeletonWrapper,
58
56
  ReviewWrapper,
@@ -67,6 +65,7 @@ import {
67
65
  LinkWrapper,
68
66
  MapWrapper,
69
67
  BusinessExternalWrapper,
68
+ DirectionButtonWrapper,
70
69
  ProfessionalWrapper,
71
70
  ProfessionalBlock
72
71
  } from './styles'
@@ -76,6 +75,8 @@ import { TaxInformation } from '../TaxInformation'
76
75
  import { getGoogleMapImage } from '../../../../../utils'
77
76
  import { OrderHistory } from './OrderHistory'
78
77
  import { ReviewProfessional } from '../ReviewProfessional'
78
+ import { OrderActionsSection } from './OrderActionsSection'
79
+ import { OrderHeaderInfoSection } from './OrderHeaderInfoSection'
79
80
 
80
81
  const OrderDetailsUI = (props) => {
81
82
  const {
@@ -142,6 +143,7 @@ const OrderDetailsUI = (props) => {
142
143
  const showCustomerPhone = !orderingTheme?.theme?.confirmation?.components?.customer?.components?.phone?.hidden
143
144
  const showCustomerAddress = !orderingTheme?.theme?.confirmation?.components?.customer?.components?.address?.hidden
144
145
  const showCustomerEmail = !orderingTheme?.theme?.confirmation?.components?.customer?.components?.email?.hidden
146
+ const showCustomerPhoto = !orderingTheme?.theme?.confirmation?.components?.customer?.components?.photo?.hidden
145
147
 
146
148
  const getOrderStatus = (s) => {
147
149
  const status = parseInt(s)
@@ -177,6 +179,9 @@ const OrderDetailsUI = (props) => {
177
179
  return objectStatus && objectStatus
178
180
  }
179
181
 
182
+ const validTrackingStatus = [9, 19, 23]
183
+ const mapConfigs = { zoom: 15 }
184
+
180
185
  const handleGoToPage = (data) => {
181
186
  events.emit('go_to_page', data)
182
187
  }
@@ -337,9 +342,19 @@ const OrderDetailsUI = (props) => {
337
342
  setUnreadAlert
338
343
  }
339
344
 
345
+ const driverLocationString = typeof order?.driver?.location?.location === 'string' && order?.driver?.location?.location?.split(',').map((l) => l.replace(/[^-.0-9]/g, ''))
346
+ const parsedLocations = locations.map(location => typeof location?.location === 'string' ? {
347
+ ...location,
348
+ lat: parseFloat(location?.location?.split(',')[0].replace(/[^-.0-9]/g, '')),
349
+ lng: parseFloat(location?.location?.split(',')[1].replace(/[^-.0-9]/g, ''))
350
+ } : location)
351
+
340
352
  useEffect(() => {
341
353
  if (driverLocation) {
342
- locations[0] = driverLocation
354
+ parsedLocations[0] = {
355
+ ...locations[0],
356
+ ...driverLocation
357
+ }
343
358
  }
344
359
  }, [driverLocation])
345
360
 
@@ -382,70 +397,6 @@ const OrderDetailsUI = (props) => {
382
397
  businessLogoUrlValidation()
383
398
  }, [order])
384
399
 
385
- const OrderMapSection = (props) => {
386
- const validStatuses = props.validStatuses ?? [9, 19, 23]
387
- const location = props.location ?? order?.driver?.location
388
- const mapConfigs = { zoom: 15 }
389
- return (
390
- showBusinessMap ? (
391
- props.isMapImg ? (
392
- <Map style={props.mapStyle}>
393
- <img
394
- src={getGoogleMapImage(location, googleMapsApiKey, mapConfigs)}
395
- id='google-maps-image'
396
- alt='google-maps-location'
397
- width='100%'
398
- height='100%'
399
- loading='lazy'
400
- />
401
- </Map>
402
- ) : (
403
- location?.lat && location?.lng && validStatuses.includes(parseInt(order?.status)) ? (
404
- <>
405
- <Map style={props.mapStyle}>
406
- <GoogleMapsMap
407
- apiKey={configs?.google_maps_api_key?.value}
408
- location={location}
409
- locations={!props.location && locations}
410
- mapControls={googleMapsControls}
411
- />
412
- </Map>
413
- </>
414
- ) : null
415
- )
416
- ) : null
417
- )
418
- }
419
-
420
- const OrderHeaderInfoSection = () => {
421
- return (
422
- <HeaderInfo>
423
- <h1>{isService ? t('SERVICES', 'Services') : t('ORDER_MESSAGE_RECEIVED', theme?.defaultLanguages?.ORDER_MESSAGE_RECEIVED || 'Your order has been received')}</h1>
424
- <p>{!isService && t('ORDER_MESSAGE_HEADER_TEXT', theme?.defaultLanguages?.ORDER_MESSAGE_HEADER_TEXT || 'Once business accepts your order, we will send you an email, thank you!')}</p>
425
- </HeaderInfo>
426
- )
427
- }
428
-
429
- const OrderActionsSection = () => {
430
- return (
431
- <>
432
- {!userCustomerId && (
433
- <MyOrderActions>
434
- <Button
435
- color='primary'
436
- outline
437
- onClick={() => handleGoToPage({ page: 'orders' })}
438
- >
439
- {isService
440
- ? t('YOUR_APPOINTMENTS', 'Your appointments')
441
- : t('YOUR_ORDERS', theme?.defaultLanguages?.YOUR_ORDERS || 'Your Orders')}
442
- </Button>
443
- </MyOrderActions>
444
- )}
445
- </>
446
- )
447
- }
448
-
449
400
  return (
450
401
  <Container>
451
402
  {!loading && order && Object.keys(order).length > 0 && !(openMessages.driver || openMessages.business) && (
@@ -484,33 +435,33 @@ const OrderDetailsUI = (props) => {
484
435
  }
485
436
  </p>
486
437
  )}
487
- {(
488
- acceptedStatus.includes(parseInt(order?.status, 10)) ||
438
+ {(acceptedStatus.includes(parseInt(order?.status, 10)) ||
489
439
  !isOriginalLayout
490
- ) && (
491
- <ReOrder>
492
- <Button
493
- color='primary'
494
- outline
495
- onClick={() => handleStartNewOrder(order.id)}
496
- disabled={reorderState?.loading}
497
- >
498
- {t('START_NEW_ORDER', 'Start new order')}
499
- </Button>
500
- {completedStatus.includes(parseInt(order?.status, 10)) && (
440
+ ) &&
441
+ (
442
+ <ReOrder>
501
443
  <Button
502
444
  color='primary'
503
445
  outline
504
- onClick={() => handleClickReorder(order)}
446
+ onClick={() => handleStartNewOrder(order.id)}
505
447
  disabled={reorderState?.loading}
506
448
  >
507
- {reorderState?.loading
508
- ? t('LOADING', 'Loading...')
509
- : t('REORDER', 'Reorder')}
449
+ {t('START_NEW_ORDER', 'Start new order')}
510
450
  </Button>
511
- )}
512
- </ReOrder>
513
- )}
451
+ {completedStatus.includes(parseInt(order?.status, 10)) && (
452
+ <Button
453
+ color='primary'
454
+ outline
455
+ onClick={() => handleClickReorder(order)}
456
+ disabled={reorderState?.loading}
457
+ >
458
+ {reorderState?.loading
459
+ ? t('LOADING', 'Loading...')
460
+ : t('REORDER', 'Reorder')}
461
+ </Button>
462
+ )}
463
+ </ReOrder>
464
+ )}
514
465
  </TitleContainer>
515
466
  {showDeliveryProgress && (
516
467
  <>
@@ -570,6 +521,16 @@ const OrderDetailsUI = (props) => {
570
521
  </p>
571
522
  </PlaceSpotSection>
572
523
  )}
524
+ {showOrderActions && (
525
+ <DirectionButtonWrapper>
526
+ <Button
527
+ color='primary'
528
+ onClick={() => window.open(`http://maps.google.com/?q=${order?.business?.address}`)}
529
+ >
530
+ {t('GET_DIRECTIONS', 'Get Directions')}
531
+ </Button>
532
+ </DirectionButtonWrapper>
533
+ )}
573
534
  </BusinessInfo>
574
535
  </BusinessWrapper>
575
536
 
@@ -618,20 +579,24 @@ const OrderDetailsUI = (props) => {
618
579
  </BusinessWrapper>
619
580
  )}
620
581
  </BusinessExternalWrapper>
621
- {googleMapsApiKey && (
582
+ {googleMapsApiKey && showBusinessMap && (
622
583
  <MapWrapper>
623
- <OrderMapSection
624
- isMapImg
625
- validStatuses={[order?.status]}
626
- location={order?.business?.location}
627
- mapStyle={{ width: '100%' }}
628
- />
584
+ <Map style={{ width: '100%' }}>
585
+ <img
586
+ src={getGoogleMapImage(order?.business?.location, googleMapsApiKey, mapConfigs)}
587
+ id='google-maps-image'
588
+ alt='google-maps-location'
589
+ width='100%'
590
+ height='100%'
591
+ loading='lazy'
592
+ />
593
+ </Map>
629
594
  </MapWrapper>
630
595
  )}
631
596
  </OrderBusiness>
632
597
  <OrderCustomer>
633
598
  <BusinessWrapper>
634
- {order?.customer?.photo && (
599
+ {showCustomerPhoto && order?.customer?.photo && (
635
600
  <img src={order?.customer?.photo} />
636
601
  )}
637
602
  <BusinessInfo>
@@ -683,9 +648,24 @@ const OrderDetailsUI = (props) => {
683
648
  </div>
684
649
  </WrapperDriver>
685
650
  </OrderDriver>
686
- {!isOriginalLayout && (
687
- <OrderMapSection />
688
- )}
651
+ {
652
+ order?.driver?.location &&
653
+ validTrackingStatus.includes(parseInt(order?.status)) &&
654
+ (
655
+ <Map style={{ width: '100%' }}>
656
+ <GoogleMapsMap
657
+ location={typeof order?.driver?.location?.location === 'string'
658
+ ? {
659
+ lat: parseFloat(driverLocationString[0]),
660
+ lng: parseFloat(driverLocationString[1])
661
+ } : driverLocation ?? order?.driver?.location}
662
+ locations={parsedLocations}
663
+ mapControls={googleMapsControls}
664
+ apiKey={configs?.google_maps_api_key?.value}
665
+ />
666
+ </Map>
667
+ )
668
+ }
689
669
  </>
690
670
  )}
691
671
  {(order?.delivery_type === 1 || order?.comment) && (
@@ -700,8 +680,12 @@ const OrderDetailsUI = (props) => {
700
680
  <WrapperRightContainer>
701
681
  <OrderProducts>
702
682
  <HeaderTitle>
703
- <OrderHeaderInfoSection />
704
- <OrderActionsSection />
683
+ <OrderHeaderInfoSection isService={isService} />
684
+ <OrderActionsSection
685
+ userCustomerId={userCustomerId}
686
+ isService={isService}
687
+ handleGoToPage={handleGoToPage}
688
+ />
705
689
  </HeaderTitle>
706
690
  {sortedProductList}
707
691
  <OrderBillSection
@@ -737,6 +737,9 @@ export const BusinessExternalWrapper = styled.div`
737
737
  width: 50%;
738
738
  }
739
739
  `
740
+ export const DirectionButtonWrapper = styled.div`
741
+ margin-top: 30px;
742
+ `
740
743
 
741
744
  export const ProfessionalWrapper = styled.div`
742
745
  display: flex;
@@ -786,4 +789,4 @@ export const ProfessionalWrapper = styled.div`
786
789
  export const ProfessionalBlock = styled.div`
787
790
  border-bottom: 1px solid ${props => props.theme.colors.disabled};
788
791
  margin-bottom: 15px;
789
- `
792
+ `
@@ -22,12 +22,14 @@ export const OrderTypeSelectorContentUI = (props) => {
22
22
 
23
23
  const [, t] = useLanguage()
24
24
  const [orderStatus] = useOrder()
25
-
25
+ const theme = useTheme()
26
26
  const handleClickOrderType = (orderType) => {
27
27
  onClose && onClose()
28
28
  handleChangeOrderType && handleChangeOrderType(orderType)
29
29
  }
30
30
 
31
+ const orderTypeImage = (type) => theme?.header?.components?.order_types?.components?.[type]?.components?.image
32
+
31
33
  return (
32
34
  <div className='order-type' style={{ overflow: 'hidden' }}>
33
35
  {props.beforeElements?.map((BeforeElement, i) => (
@@ -42,7 +44,7 @@ export const OrderTypeSelectorContentUI = (props) => {
42
44
  orderTypes && (configTypes ? orderTypes.filter(type => configTypes?.includes(type.value)) : orderTypes).map((item, i) => (
43
45
  <OrderTypeListItemContainer
44
46
  key={i}
45
- bgimage={item?.image}
47
+ bgimage={orderTypeImage(item?.text?.replace(' ', '_')?.toLowerCase()) || item?.image}
46
48
  onClick={() => handleClickOrderType(item.value)}
47
49
  active={orderStatus?.options?.type === item?.value}
48
50
  >
@@ -10,7 +10,7 @@ export const PreviousBusinessOrdered = (props) => {
10
10
  isCustomLayout,
11
11
  isCustomerMode,
12
12
  onRedirectPage,
13
- handleUpdateBusinessList,
13
+ handleUpdateBusinesses,
14
14
  businesses
15
15
  } = props
16
16
 
@@ -45,7 +45,7 @@ export const PreviousBusinessOrdered = (props) => {
45
45
  businessPickupTime={business?.pickup_time}
46
46
  businessDistance={business?.distance}
47
47
  firstCard={i === 0 && width > 681}
48
- handleUpdateBusinessList={handleUpdateBusinessList}
48
+ handleUpdateBusinessList={handleUpdateBusinesses}
49
49
  />
50
50
  ))
51
51
  }
@@ -66,7 +66,8 @@ const OrdersOptionUI = (props) => {
66
66
  onBusinessClick,
67
67
  professionals,
68
68
  handleUpdateProfessionals,
69
- businesses
69
+ businesses,
70
+ handleUpdateBusinesses
70
71
  } = props
71
72
 
72
73
  const [, t] = useLanguage()
@@ -228,6 +229,7 @@ const OrdersOptionUI = (props) => {
228
229
  businesses={businesses}
229
230
  onRedirectPage={onRedirectPage}
230
231
  isLoadingOrders={loading}
232
+ handleUpdateBusinesses={handleUpdateBusinesses}
231
233
  />
232
234
  )}
233
235
 
@@ -29,6 +29,7 @@ import {
29
29
  ScheduleInfoWrapper,
30
30
  ScheduleInfo
31
31
  } from './styles'
32
+ import { useTheme } from 'styled-components'
32
33
 
33
34
  export const ProductItemAccordion = (props) => {
34
35
  const {
@@ -44,6 +45,7 @@ export const ProductItemAccordion = (props) => {
44
45
  isStore,
45
46
  isConfirmationPage
46
47
  } = props
48
+ const theme = useTheme()
47
49
  const [, t] = useLanguage()
48
50
  const [orderState] = useOrder()
49
51
  const [{ parsePrice, parseDate }] = useUtils()
@@ -119,9 +121,9 @@ export const ProductItemAccordion = (props) => {
119
121
  onClick={(e) => toggleAccordion(e)}
120
122
  >
121
123
  <ProductInfo className='info'>
122
- {product?.images && showProductImage && (
124
+ {(product?.images || theme?.images?.dummies?.product) && showProductImage && (
123
125
  <WrapperProductImage>
124
- <ProductImage bgimage={product?.images} />
126
+ <ProductImage bgimage={product?.images || theme?.images?.dummies?.product} />
125
127
  </WrapperProductImage>
126
128
  )}
127
129
  {product?.calendar_event ? (