ordering-ui-external 14.1.8 → 14.1.9

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 (41) hide show
  1. package/_bundles/{7.ordering-ui.8668ba2c7ba56b89cbdd.js → 7.ordering-ui.8deae335e250e653c308.js} +1 -1
  2. package/_bundles/ordering-ui.8deae335e250e653c308.js +2 -0
  3. package/_modules/themes/callcenterOriginal/src/components/AddressForm/index.js +27 -9
  4. package/_modules/themes/callcenterOriginal/src/components/AddressList/styles.js +1 -1
  5. package/_modules/themes/callcenterOriginal/src/components/InputPhoneNumber/styles.js +1 -1
  6. package/_modules/themes/callcenterOriginal/src/components/PhoneAutocomplete/index.js +10 -11
  7. package/_modules/themes/callcenterOriginal/src/components/PhoneAutocomplete/styles.js +3 -4
  8. package/_modules/themes/five/src/components/Cart/index.js +1 -1
  9. package/_modules/themes/five/src/components/Cart/styles.js +5 -2
  10. package/_modules/themes/five/src/components/Checkout/index.js +1 -1
  11. package/_modules/themes/five/src/components/Checkout/styles.js +5 -4
  12. package/_modules/themes/five/src/components/OrderDetails/index.js +12 -5
  13. package/_modules/themes/five/src/components/ProductOptionSubOption/index.js +6 -5
  14. package/_modules/themes/five/src/components/UserFormDetails/index.js +5 -5
  15. package/package.json +2 -2
  16. package/src/themes/callcenterOriginal/src/components/AddressForm/index.js +47 -16
  17. package/src/themes/callcenterOriginal/src/components/AddressList/styles.js +1 -1
  18. package/src/themes/callcenterOriginal/src/components/InputPhoneNumber/styles.js +1 -1
  19. package/src/themes/callcenterOriginal/src/components/PhoneAutocomplete/index.js +7 -10
  20. package/src/themes/callcenterOriginal/src/components/PhoneAutocomplete/styles.js +1 -1
  21. package/src/themes/five/src/components/Cart/index.js +7 -1
  22. package/src/themes/five/src/components/Cart/styles.js +6 -0
  23. package/src/themes/five/src/components/Checkout/index.js +19 -19
  24. package/src/themes/five/src/components/Checkout/styles.js +8 -0
  25. package/src/themes/five/src/components/FavoriteList/index.js +9 -8
  26. package/src/themes/five/src/components/FavoriteList/styles.js +1 -0
  27. package/src/themes/five/src/components/OrderDetails/index.js +38 -3
  28. package/src/themes/five/src/components/ProductOptionSubOption/index.js +2 -1
  29. package/src/themes/five/src/components/SingleProductCard/layouts/original/index.js +1 -1
  30. package/src/themes/five/src/components/UserFormDetails/index.js +2 -4
  31. package/_bundles/ordering-ui.8668ba2c7ba56b89cbdd.js +0 -2
  32. /package/_bundles/{0.ordering-ui.8668ba2c7ba56b89cbdd.js → 0.ordering-ui.8deae335e250e653c308.js} +0 -0
  33. /package/_bundles/{1.ordering-ui.8668ba2c7ba56b89cbdd.js → 1.ordering-ui.8deae335e250e653c308.js} +0 -0
  34. /package/_bundles/{2.ordering-ui.8668ba2c7ba56b89cbdd.js → 2.ordering-ui.8deae335e250e653c308.js} +0 -0
  35. /package/_bundles/{4.ordering-ui.8668ba2c7ba56b89cbdd.js → 4.ordering-ui.8deae335e250e653c308.js} +0 -0
  36. /package/_bundles/{5.ordering-ui.8668ba2c7ba56b89cbdd.js → 5.ordering-ui.8deae335e250e653c308.js} +0 -0
  37. /package/_bundles/{6.ordering-ui.8668ba2c7ba56b89cbdd.js → 6.ordering-ui.8deae335e250e653c308.js} +0 -0
  38. /package/_bundles/{7.ordering-ui.8668ba2c7ba56b89cbdd.js.LICENSE.txt → 7.ordering-ui.8deae335e250e653c308.js.LICENSE.txt} +0 -0
  39. /package/_bundles/{8.ordering-ui.8668ba2c7ba56b89cbdd.js → 8.ordering-ui.8deae335e250e653c308.js} +0 -0
  40. /package/_bundles/{9.ordering-ui.8668ba2c7ba56b89cbdd.js → 9.ordering-ui.8deae335e250e653c308.js} +0 -0
  41. /package/_bundles/{ordering-ui.8668ba2c7ba56b89cbdd.js.LICENSE.txt → ordering-ui.8deae335e250e653c308.js.LICENSE.txt} +0 -0
@@ -4,7 +4,6 @@ import {
4
4
  PhoneAutocomplete as PhoneAutocompleteController,
5
5
  useLanguage,
6
6
  useOrder,
7
- useCustomer,
8
7
  useConfig,
9
8
  useEvent
10
9
  } from 'ordering-components-external'
@@ -62,7 +61,6 @@ const PhoneAutocompleteUI = (props) => {
62
61
  const [orderState, { changeType }] = useOrder()
63
62
  const [, t] = useLanguage()
64
63
  const theme = useTheme()
65
- const [, { deleteUserCustomer }] = useCustomer()
66
64
  const [configState] = useConfig()
67
65
  const [events] = useEvent()
68
66
  const [alertState, setAlertState] = useState({ open: false, content: [] })
@@ -78,7 +76,7 @@ const PhoneAutocompleteUI = (props) => {
78
76
  value: userCustomer.cellphone || userCustomer.phone,
79
77
  label: `${countryPhoneCode ? `(${countryPhoneCode})` : ''} ${userCustomer?.phone && !userCustomer?.cellphone ? `${userCustomer?.phone}` : ''} ${userCustomer?.cellphone ? `${userCustomer.cellphone}` : ''} - {${userCustomer.name}}`,
80
78
  flag: userCustomer?.imported_address_text && userCustomer?.addresses?.length === 0,
81
- lastname: userCustomer.lastname
79
+ lastname: `${userCustomer.name} ${userCustomer.lastname}`
82
80
  } : null)
83
81
  const configTypes = configState?.configs?.order_types_allowed?.value.split('|').filter(value => (allOrderTypes.includes(Number(value)))).map(value => Number(value)) || []
84
82
  const userName = userCustomer?.lastname
@@ -99,8 +97,7 @@ const PhoneAutocompleteUI = (props) => {
99
97
  const handleFindClick = () => {
100
98
  if (optSelected && !(userCustomer?.id && orderState?.options?.address?.address)) {
101
99
  onChange(optSelected)
102
- }
103
- else if (userCustomer?.id && orderState?.options?.address?.address) {
100
+ } else if (userCustomer?.id && orderState?.options?.address?.address) {
104
101
  onRedirectPage && onRedirectPage('search')
105
102
  } else {
106
103
  setAlertState({ open: true, content: t('SELECT_ADDRESS_CUSTOMER', 'Please select an address for the selected customer') })
@@ -142,6 +139,7 @@ const PhoneAutocompleteUI = (props) => {
142
139
  setOptSelected(null)
143
140
  setCustomersPhones({ ...customersPhones, users: [] })
144
141
  setInputValue('')
142
+ onChangeNumber('')
145
143
  return
146
144
  }
147
145
  let user
@@ -150,7 +148,7 @@ const PhoneAutocompleteUI = (props) => {
150
148
  }
151
149
  setOptSelected({
152
150
  ...option,
153
- lastname: user?.lastname ?? user?.name
151
+ lastname: `${user?.name} ${user?.lastname}`
154
152
  })
155
153
  setInputValue(option ? option?.value : '')
156
154
  if (!option) {
@@ -182,7 +180,6 @@ const PhoneAutocompleteUI = (props) => {
182
180
  const handleCloseAddressList = () => {
183
181
  setOpenModal({ ...openModal, customer: false })
184
182
  setCustomerState({ ...customerState, result: { error: false } })
185
- deleteUserCustomer(true)
186
183
  if (isFromUrlPhone) {
187
184
  onRedirectPhoneUrlPage && onRedirectPhoneUrlPage('home')
188
185
  }
@@ -198,7 +195,7 @@ const PhoneAutocompleteUI = (props) => {
198
195
  const countryPhoneCode = user?.country_phone_code ?? user?.country_code
199
196
  const obj = {}
200
197
  obj.value = user.cellphone || user.phone
201
- obj.label = `${countryPhoneCode ? `(${countryPhoneCode})` : ''} ${user?.phone && !user?.cellphone ? `${user?.phone}` : ''} ${user?.cellphone ? `${user.cellphone}` : ''} - {${user.name}}`
198
+ obj.label = `${countryPhoneCode ? `(${countryPhoneCode})` : ''} ${user?.phone && !user?.cellphone ? `${user?.phone}` : ''} ${user?.cellphone ? `${user.cellphone}` : ''} - {${user.name} ${user?.lastname ?? ''}}`
202
199
  obj.flag = user?.imported_address_text && user?.addresses?.length === 0
203
200
  return obj
204
201
  }) || []
@@ -329,7 +326,7 @@ const PhoneAutocompleteUI = (props) => {
329
326
  onChange={onChange}
330
327
  onInputChange={onInputChange}
331
328
  isLoading={customersPhones?.loading}
332
- options={optionsToSelect}
329
+ options={optionsToSelect.filter(opt => inputValue ? opt.value.toString().includes(inputValue) : opt)}
333
330
  components={{ Option }}
334
331
  />
335
332
  {optSelected && (
@@ -352,7 +349,7 @@ const PhoneAutocompleteUI = (props) => {
352
349
  onClose={() => setOpenModal({ ...openModal, signup: false })}
353
350
  >
354
351
  <SignUpForm
355
- externalPhoneNumber={`${localPhoneCode || countryCallingCode} ${optSelected?.value || phone}`}
352
+ externalPhoneNumber={`${countryCallingCode || localPhoneCode} ${optSelected?.value || phone}`}
356
353
  saveCustomerUser={saveCustomerUser}
357
354
  fieldsNotValid={props.fieldsNotValid}
358
355
  useChekoutFileds
@@ -357,7 +357,7 @@ export const IconTypeButton = styled.div`
357
357
  align-items: center;
358
358
  width: 44px;
359
359
  height: 44px;
360
- background: ${({ activated, theme }) => activated ? theme?.colors?.white : '#F3F9FF'};
360
+ background: ${({ theme }) => theme?.colors?.danger100 ?? '#FEEDF0'};
361
361
  border-radius: 44px;
362
362
  `
363
363
 
@@ -39,7 +39,8 @@ import {
39
39
  IconContainer,
40
40
  NoValidProductMessage,
41
41
  DriverTipContainer,
42
- SpinnerCart
42
+ SpinnerCart,
43
+ WarningText
43
44
  } from './styles'
44
45
  import { getCateringValues, verifyDecimals } from '../../../../../utils'
45
46
  import BsInfoCircle from '@meronex/icons/bs/BsInfoCircle'
@@ -660,6 +661,11 @@ const CartUI = (props) => {
660
661
  />
661
662
  </div>
662
663
  )}
664
+ {!cart?.valid_address && cart?.status !== 2 && !isCheckout && (
665
+ <WarningText>
666
+ {t('INVALID_CART_ADDRESS', 'Selected address is invalid, please select a closer address.')}
667
+ </WarningText>
668
+ )}
663
669
  {(onClickCheckout || isForceOpenCart) && !isCheckout && cart?.valid && (!isMultiCheckout || isStore || !cart?.business_id) && (
664
670
  <CheckoutAction>
665
671
  <p>{cart?.total >= 1 && parsePrice(cart?.total)}</p>
@@ -244,3 +244,9 @@ export const SpinnerCart = styled.div`
244
244
  top: 0;
245
245
  `}
246
246
  `
247
+
248
+ export const WarningText = styled.p`
249
+ margin: 10px auto;
250
+ text-align: center;
251
+ color: ${props => props.theme.colors.primary};
252
+ `
@@ -136,7 +136,7 @@ const CheckoutUI = (props) => {
136
136
 
137
137
  const shouldActivateOrderDetailModal = ordering?.project?.includes('alsea')
138
138
  const cardsMethods = ['stripe', 'credomatic']
139
- const stripePaymethods = ['stripe', 'stripe_direct', 'stripe_connect', 'stripe_redirect']
139
+ const stripePaymethods = ['stripe', 'stripe_connect', 'stripe_redirect']
140
140
  const businessConfigs = businessDetails?.business?.configs ?? []
141
141
  const isTableNumberEnabled = configs?.table_numer_enabled?.value
142
142
  const isWalletCashEnabled = businessConfigs.find(config => config.key === 'wallet_cash_enabled')?.value === '1'
@@ -594,24 +594,24 @@ const CheckoutUI = (props) => {
594
594
 
595
595
  {
596
596
  !!(!isMultiDriverTips && driverTipsField) &&
597
- <>
598
- <DriverTipContainer>
599
- <h1>{t('DRIVER_TIPS', 'Driver Tips')}</h1>
600
- <p>{t('100%_OF_THE_TIP_YOUR_DRIVER', '100% of the tip goes to your driver')}</p>
601
- <DriverTips
602
- businessId={cart?.business_id}
603
- driverTipsOptions={driverTipsOptions}
604
- isFixedPrice={parseInt(configs?.driver_tip_type?.value, 10) === 1}
605
- isDriverTipUseCustom={!!parseInt(configs?.driver_tip_use_custom?.value, 10)}
606
- driverTip={parseInt(configs?.driver_tip_type?.value, 10) === 1
607
- ? cart?.driver_tip
608
- : cart?.driver_tip_rate}
609
- cart={cart}
610
- useOrderContext
611
- />
612
- </DriverTipContainer>
613
- <DriverTipDivider />
614
- </>
597
+ <>
598
+ <DriverTipContainer>
599
+ <h1>{t('DRIVER_TIPS', 'Driver Tips')}</h1>
600
+ <p>{t('100%_OF_THE_TIP_YOUR_DRIVER', '100% of the tip goes to your driver')}</p>
601
+ <DriverTips
602
+ businessId={cart?.business_id}
603
+ driverTipsOptions={driverTipsOptions}
604
+ isFixedPrice={parseInt(configs?.driver_tip_type?.value, 10) === 1}
605
+ isDriverTipUseCustom={!!parseInt(configs?.driver_tip_use_custom?.value, 10)}
606
+ driverTip={parseInt(configs?.driver_tip_type?.value, 10) === 1
607
+ ? cart?.driver_tip
608
+ : cart?.driver_tip_rate}
609
+ cart={cart}
610
+ useOrderContext
611
+ />
612
+ </DriverTipContainer>
613
+ <DriverTipDivider />
614
+ </>
615
615
  }
616
616
  {!cartState.loading && placeSpotsEnabled && cart?.business_id && (
617
617
  <SelectSpotContainer>
@@ -95,6 +95,7 @@ export const DriverTipContainer = styled(PaymentMethodContainer)`
95
95
 
96
96
  export const CartContainer = styled(PaymentMethodContainer)`
97
97
  margin-bottom: 20px;
98
+ position: relative;
98
99
  `
99
100
 
100
101
  export const WalletPaymentOptionContainer = styled(PaymentMethodContainer)`
@@ -378,3 +379,10 @@ export const OrderDetailContainer = styled.div`
378
379
  flex-direction: column;
379
380
  padding: 10px 30px 20px;
380
381
  `
382
+
383
+ export const SpinnerContainer = styled.div`
384
+ position: absolute;
385
+ width: 100%;
386
+ left: 0;
387
+ top: -100%;
388
+ `
@@ -363,18 +363,19 @@ const FavoriteListUI = (props) => {
363
363
  <FavPopupView>
364
364
  {(favProduct?.images) && (
365
365
  <Image>
366
- <img src={favProduct.images} alt={`product-${i}`} width='150px' height='150px' loading='lazy' />
366
+ <img src={favProduct.images} alt={`product-${i}`} width='150px' height='150px' loading='lazy' />
367
367
  </Image>
368
- )}
369
- <h2>
370
- {favProduct?.name}
371
- </h2>
372
- <h2>
373
- {favProduct?.businesses && favProduct?.businesses?.length > 1
368
+ )}
369
+ <h2>
370
+ {favProduct?.name}
371
+ </h2>
372
+ <h2>
373
+ { favProduct?.businesses && favProduct?.businesses?.length > 1
374
374
  ? t('AVAILABLE_BUSINESSES_FOR_PRODUCT', 'Available businesses for this product')
375
375
  : favProduct?.businesses && favProduct?.businesses?.length == 1
376
376
  ? t('AVAILABLE_BUSINESSE_FOR_PRODUCT', 'Available business for this product')
377
- : t('NOT_AVAILABLE_BUSINESSE', 'Business is not available for this product')}
377
+ : t('NOT_AVAILABLE_BUSINESSE', 'Business is not available for this product')
378
+ }
378
379
  </h2>
379
380
  <div>
380
381
  {favProduct?.businesses?.map(business => {
@@ -168,3 +168,4 @@ export const BusinessLogo = (props) => {
168
168
  </BusinessLogoStyled>
169
169
  )
170
170
  }
171
+
@@ -100,7 +100,8 @@ const OrderDetailsUI = (props) => {
100
100
  reorderState,
101
101
  handleReorder,
102
102
  orderTypes,
103
- handleRemoveCart
103
+ handleRemoveCart,
104
+ hideStaticMap
104
105
  } = props
105
106
  const [, t] = useLanguage()
106
107
  const [{ configs }] = useConfig()
@@ -183,8 +184,8 @@ const OrderDetailsUI = (props) => {
183
184
  }
184
185
  try {
185
186
  const image = new Image()
187
+ image.onload = resolve
186
188
  image.src = src
187
- image.complete ? resolve(true) : resolve(false)
188
189
  } catch (err) {
189
190
  resolve(false)
190
191
  }
@@ -521,7 +522,7 @@ const OrderDetailsUI = (props) => {
521
522
  </>
522
523
  )}
523
524
  </OrderInfo>
524
- {!isGiftCardOrder && (
525
+ {!isGiftCardOrder && !hideStaticMap && (
525
526
  <OrderBusiness>
526
527
  <BusinessExternalWrapper>
527
528
  <BusinessWrapper
@@ -640,6 +641,40 @@ const OrderDetailsUI = (props) => {
640
641
  }
641
642
  />
642
643
  )}
644
+ {hideStaticMap && (
645
+ <OrderCustomer>
646
+ <WrapperDriver>
647
+ {isShowBusinessLogo && order?.business?.logo && (
648
+ <PhotoBlock src={order?.business?.logo} />
649
+ )}
650
+ <div>
651
+ <p>{order?.business?.name}</p>
652
+ <ActionsSection
653
+ {...ActionsSectionProps}
654
+ actionType='business'
655
+ showPhone={!hideBusinessPhone}
656
+ showMessages={!hideBusinessMessages}
657
+ />
658
+ {!hideBusinessEmail && (
659
+ <p>{order?.business?.email}</p>
660
+ )}
661
+ {!hideBusinessPhone && (
662
+ <p>{order?.business?.cellphone}</p>
663
+ )}
664
+ {!hideBusinessAddress && (
665
+ <p>{order?.business?.address}</p>
666
+ )}
667
+ {order?.place?.name && (
668
+ <PlaceSpotSection>
669
+ <p>
670
+ {yourSpotString}: {order?.place?.name}
671
+ </p>
672
+ </PlaceSpotSection>
673
+ )}
674
+ </div>
675
+ </WrapperDriver>
676
+ </OrderCustomer>
677
+ )}
643
678
  <OrderCustomer>
644
679
  <WrapperDriver>
645
680
  {!hideCustomerPhoto && order?.customer?.photo && (
@@ -60,6 +60,7 @@ const ProductOptionSubOptionUI = React.memo((props) => {
60
60
  ? (balance === option?.max || state.quantity === suboption.max)
61
61
  : state.quantity === suboption?.max || (!state.selected && balance === option?.max)
62
62
 
63
+ const quesoYSalsa = option?.name?.toLowerCase?.() === 'queso y salsa'
63
64
  const price = option?.with_half_option && suboption?.half_price && state.position !== 'whole' ? suboption?.half_price : suboption?.price
64
65
  const [, t] = useLanguage()
65
66
  const [{ parsePrice }] = useUtils()
@@ -187,7 +188,7 @@ const ProductOptionSubOptionUI = React.memo((props) => {
187
188
  )
188
189
  }
189
190
  </PositionControl>
190
- {option?.with_half_option && state?.selected && isAlsea && (
191
+ {(option?.with_half_option || quesoYSalsa) && state?.selected && isAlsea && (
191
192
  <ExtraControl>
192
193
  {(state.quantity >= 2) ? (
193
194
  <ExtraItem
@@ -192,7 +192,7 @@ const SingleProductCardUI = React.memo((props) => {
192
192
  <WrapTags>
193
193
  {product?.tags.map((tag, i) => (
194
194
  <div key={i}>
195
- <img src={tag.image ?? ''} />
195
+ <img src={tag.image ?? ''}></img>
196
196
  </div>
197
197
  ))}
198
198
  </WrapTags>
@@ -135,15 +135,13 @@ export const UserFormDetailsUI = (props) => {
135
135
 
136
136
  const onSubmit = () => {
137
137
  const isPhoneNumberValid = userPhoneNumber && showInputPhoneNumber ? isValidPhoneNumber : true
138
- const requiredPhone = (user?.guest_id && requiredFields?.includes?.('cellphone')) || (validationFields?.fields?.checkout?.cellphone?.enabled && validationFields?.fields?.checkout?.cellphone?.required)
138
+ const requiredPhone = (user?.guest_id && requiredFields?.includes?.('cellphone')) || (validationFields?.fields?.checkout?.cellphone?.enabled && validationFields?.fields?.checkout?.cellphone?.required && !user?.guest_id)
139
139
  const content = []
140
140
  if (requiredFields?.includes?.('birthdate') && !birthdate) {
141
141
  content.push(t('VALIDATION_ERROR_BIRTHDATE_REQUIRED', 'Birthdate is required'))
142
142
  }
143
143
  if (!userPhoneNumber &&
144
- ((validationFields?.fields?.checkout?.cellphone?.enabled &&
145
- validationFields?.fields?.checkout?.cellphone?.required) ||
146
- configs?.verification_phone_required?.value === '1')
144
+ (requiredPhone || (configs?.verification_phone_required?.value === '1'))
147
145
  ) {
148
146
  content.push(t('VALIDATION_ERROR_MOBILE_PHONE_REQUIRED', 'The field Phone Number is required.'))
149
147
  setAlertState({