ordering-ui-external 14.1.40 → 14.1.42
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/{7.ordering-ui.2a09e7e0162e34ea955c.js → 7.ordering-ui.0bcf027ad972ccbec19e.js} +1 -1
- package/_bundles/{ordering-ui.2a09e7e0162e34ea955c.js → ordering-ui.0bcf027ad972ccbec19e.js} +2 -2
- package/_modules/themes/callcenterOriginal/src/components/AddressForm/SpreadForm/index.js +322 -0
- package/_modules/themes/callcenterOriginal/src/components/AddressForm/SpreadForm/styles.js +25 -0
- package/_modules/themes/callcenterOriginal/src/components/AddressForm/index.js +57 -58
- package/_modules/themes/callcenterOriginal/src/components/AddressForm/styles.js +3 -1
- package/_modules/themes/callcenterOriginal/src/components/AddressList/index.js +50 -20
- package/_modules/themes/callcenterOriginal/src/components/PhoneAutocomplete/index.js +18 -26
- package/_modules/themes/five/src/components/BusinessesListing/layouts/OriginalBusinessesListing/index.js +1 -1
- package/package.json +1 -1
- package/src/themes/callcenterOriginal/src/components/AddressForm/SpreadForm/index.js +251 -0
- package/src/themes/callcenterOriginal/src/components/AddressForm/SpreadForm/styles.js +111 -0
- package/src/themes/callcenterOriginal/src/components/AddressForm/index.js +246 -230
- package/src/themes/callcenterOriginal/src/components/AddressForm/styles.js +2 -3
- package/src/themes/callcenterOriginal/src/components/AddressList/index.js +243 -214
- package/src/themes/callcenterOriginal/src/components/PhoneAutocomplete/index.js +1 -11
- package/src/themes/five/src/components/BusinessesListing/layouts/OriginalBusinessesListing/index.js +1 -1
- /package/_bundles/{0.ordering-ui.2a09e7e0162e34ea955c.js → 0.ordering-ui.0bcf027ad972ccbec19e.js} +0 -0
- /package/_bundles/{1.ordering-ui.2a09e7e0162e34ea955c.js → 1.ordering-ui.0bcf027ad972ccbec19e.js} +0 -0
- /package/_bundles/{2.ordering-ui.2a09e7e0162e34ea955c.js → 2.ordering-ui.0bcf027ad972ccbec19e.js} +0 -0
- /package/_bundles/{4.ordering-ui.2a09e7e0162e34ea955c.js → 4.ordering-ui.0bcf027ad972ccbec19e.js} +0 -0
- /package/_bundles/{5.ordering-ui.2a09e7e0162e34ea955c.js → 5.ordering-ui.0bcf027ad972ccbec19e.js} +0 -0
- /package/_bundles/{6.ordering-ui.2a09e7e0162e34ea955c.js → 6.ordering-ui.0bcf027ad972ccbec19e.js} +0 -0
- /package/_bundles/{7.ordering-ui.2a09e7e0162e34ea955c.js.LICENSE.txt → 7.ordering-ui.0bcf027ad972ccbec19e.js.LICENSE.txt} +0 -0
- /package/_bundles/{8.ordering-ui.2a09e7e0162e34ea955c.js → 8.ordering-ui.0bcf027ad972ccbec19e.js} +0 -0
- /package/_bundles/{9.ordering-ui.2a09e7e0162e34ea955c.js → 9.ordering-ui.0bcf027ad972ccbec19e.js} +0 -0
- /package/_bundles/{ordering-ui.2a09e7e0162e34ea955c.js.LICENSE.txt → ordering-ui.0bcf027ad972ccbec19e.js.LICENSE.txt} +0 -0
|
@@ -50,6 +50,7 @@ import { AddressForm } from '../AddressForm'
|
|
|
50
50
|
import { Confirm } from '../Confirm'
|
|
51
51
|
import { useTheme } from 'styled-components'
|
|
52
52
|
import { scrollTo } from '../../../../../utils'
|
|
53
|
+
import { SpreadForm } from '../AddressForm/SpreadForm'
|
|
53
54
|
|
|
54
55
|
const AddressListUI = (props) => {
|
|
55
56
|
const {
|
|
@@ -87,6 +88,8 @@ const AddressListUI = (props) => {
|
|
|
87
88
|
const [confirm, setConfirm] = useState({ open: false, content: null, handleOnAccept: null })
|
|
88
89
|
const theme = useTheme()
|
|
89
90
|
const [{ user }] = useCustomer()
|
|
91
|
+
const [addressSpreadForm, setAddressSpreadForm] = useState(null)
|
|
92
|
+
const [editSpreadAddress, setEditSpreadAddress] = useState(false)
|
|
90
93
|
|
|
91
94
|
const addFormRestrictions = userCustomerSetup?.imported_address_text && addressList.addresses?.length === 0 && !addressList?.loading && !addressList?.error
|
|
92
95
|
const uniqueAddressesList = (addressList.addresses && addressList.addresses.filter(
|
|
@@ -99,6 +102,9 @@ const AddressListUI = (props) => {
|
|
|
99
102
|
)))) || []
|
|
100
103
|
const unaddressedTypes = configs?.unaddressed_order_types_allowed?.value.split('|').map(value => Number(value)) || []
|
|
101
104
|
const isAllowUnaddressOrderType = unaddressedTypes.includes(orderState?.options?.type) && user?.id === orderState?.options?.user_id
|
|
105
|
+
const countryAutocomplete = configs?.country_autocomplete?.value?.toUpperCase() ?? '*'
|
|
106
|
+
const showSpreadForm = configs?.addresses_form_type?.value === 'country'
|
|
107
|
+
|
|
102
108
|
const openAddress = (address) => {
|
|
103
109
|
setCurAddress(address)
|
|
104
110
|
setAddressOpen(true)
|
|
@@ -227,236 +233,259 @@ const AddressListUI = (props) => {
|
|
|
227
233
|
}, [userCustomerSetup?.imported_address_text, addressList.addresses, addressList?.loading, addressList?.error, isOpenUserData])
|
|
228
234
|
|
|
229
235
|
return (
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
<
|
|
233
|
-
{
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
)
|
|
273
|
-
}
|
|
236
|
+
<AddressListContainer id='address_control' isLoading={actionStatus?.loading || orderState?.loading}>
|
|
237
|
+
<AddressHalfContainer>
|
|
238
|
+
<List
|
|
239
|
+
halfWidth={addressOpen}
|
|
240
|
+
isOpenUserData={isOpenUserData}
|
|
241
|
+
isHeader={isHeader}
|
|
242
|
+
notUseCustomerInfo={notUseCustomerInfo}
|
|
243
|
+
addFormRestrictions={addFormRestrictions}
|
|
244
|
+
>
|
|
245
|
+
{
|
|
246
|
+
!addFormRestrictions && !addressOpen && !isOpenUserData && (
|
|
247
|
+
<Button
|
|
248
|
+
className='add'
|
|
249
|
+
outline
|
|
250
|
+
color={addressList?.addresses?.length > 0 ? 'secondary' : 'primary'}
|
|
251
|
+
onClick={() => openAddress({})}
|
|
252
|
+
disabled={orderState?.loading || actionStatus.loading}
|
|
253
|
+
hoverColor='#CCC'
|
|
254
|
+
>
|
|
255
|
+
{(orderState?.loading || actionStatus.loading) ? t('LOADING', 'Loading') : t('ADD_NEW_ADDRESS', 'Add New Address')}
|
|
256
|
+
</Button>
|
|
257
|
+
)
|
|
258
|
+
}
|
|
259
|
+
{
|
|
260
|
+
isPopover && addressOpen && (
|
|
261
|
+
<AddressForm
|
|
262
|
+
userId={userId}
|
|
263
|
+
addressesList={addressList?.addresses}
|
|
264
|
+
showSpreadForm={showSpreadForm}
|
|
265
|
+
addressSpreadForm={addressSpreadForm}
|
|
266
|
+
setAddressSpreadForm={setAddressSpreadForm}
|
|
267
|
+
editSpreadAddress={editSpreadAddress}
|
|
268
|
+
setEditSpreadAddress={setEditSpreadAddress}
|
|
269
|
+
useValidationFileds
|
|
270
|
+
address={curAddress}
|
|
271
|
+
onCancel={() => handleCloseAddressForm()}
|
|
272
|
+
onSaveAddress={handleSaveAddress}
|
|
273
|
+
userCustomerSetup={userCustomerSetup}
|
|
274
|
+
isAllowUnaddressOrderType={isAllowUnaddressOrderType}
|
|
275
|
+
/>
|
|
276
|
+
)
|
|
277
|
+
}
|
|
274
278
|
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
</div>
|
|
311
|
-
{(!address?.location?.lat || !address?.location?.lng) && (
|
|
312
|
-
<AddressBookMarkContainer>
|
|
313
|
-
<AddressBookMark>
|
|
314
|
-
<img
|
|
315
|
-
src={theme?.images?.general?.bookmark}
|
|
316
|
-
width={20}
|
|
317
|
-
height={20}
|
|
318
|
-
/>
|
|
319
|
-
</AddressBookMark>
|
|
320
|
-
<AddressHoverInfo className='hover-info'>
|
|
321
|
-
<p>{t('PLEASE_VERIFY_CUSTOMER_ADDRESS', 'Please verify the address with the customer.')}</p>
|
|
322
|
-
</AddressHoverInfo>
|
|
323
|
-
</AddressBookMarkContainer>
|
|
324
|
-
)}
|
|
279
|
+
{
|
|
280
|
+
!addressList.loading &&
|
|
281
|
+
!actionStatus.loading &&
|
|
282
|
+
!orderState.loading &&
|
|
283
|
+
!addressList.error &&
|
|
284
|
+
addressList?.addresses?.length > 0 &&
|
|
285
|
+
typeof orderState.options?.address === 'object' &&
|
|
286
|
+
!addressOpen &&
|
|
287
|
+
user?.id === orderState?.options?.user_id &&
|
|
288
|
+
((!addressOpen && isPopover) || isModal) && (
|
|
289
|
+
<AddressListUl id='list'>
|
|
290
|
+
<AddressTitleContainer style={{ display: 'flex' }}>
|
|
291
|
+
<AddressTitle>{t('SELECT_ONE_OF_SAVED_PLACES', 'Select one of your saved places')}</AddressTitle>
|
|
292
|
+
{isAllowUnaddressOrderType && (
|
|
293
|
+
<>
|
|
294
|
+
<p>{' '}{t('OR', 'or')}{' '}</p>
|
|
295
|
+
<WithoutAddressText onClick={() => events.emit('go_to_page', { page: 'search' })}>{t('CONTINUE_WITHOUT_ADDRESS', 'Continue without address')}</WithoutAddressText>
|
|
296
|
+
</>
|
|
297
|
+
)}
|
|
298
|
+
</AddressTitleContainer>
|
|
299
|
+
{uniqueAddressesList.map(address => (
|
|
300
|
+
<AddressItem key={address?.id}>
|
|
301
|
+
<div className='wrapAddress' onClick={() => handleSetAddress(address)}>
|
|
302
|
+
<span className='radio'>
|
|
303
|
+
{checkAddress(address) ? <RiRadioButtonFill className='address-checked' /> : <IosRadioButtonOff />}
|
|
304
|
+
</span>
|
|
305
|
+
<span className={checkAddress(address) ? 'selected-tag tag' : 'tag'}>
|
|
306
|
+
{address?.tag === 'home' && <House />}
|
|
307
|
+
{address?.tag === 'office' && <Building />}
|
|
308
|
+
{address?.tag === 'favorite' && <Heart />}
|
|
309
|
+
{address?.tag === 'other' && <PlusLg />}
|
|
310
|
+
</span>
|
|
311
|
+
<div className='address'>
|
|
312
|
+
<span>{address.address}</span>
|
|
313
|
+
<span>{address.internal_number} {address.zipcode}</span>
|
|
325
314
|
</div>
|
|
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
|
-
|
|
353
|
-
|
|
354
|
-
|
|
315
|
+
{(!address?.location?.lat || !address?.location?.lng) && (
|
|
316
|
+
<AddressBookMarkContainer>
|
|
317
|
+
<AddressBookMark>
|
|
318
|
+
<img
|
|
319
|
+
src={theme?.images?.general?.bookmark}
|
|
320
|
+
width={20}
|
|
321
|
+
height={20}
|
|
322
|
+
/>
|
|
323
|
+
</AddressBookMark>
|
|
324
|
+
<AddressHoverInfo className='hover-info'>
|
|
325
|
+
<p>{t('PLEASE_VERIFY_CUSTOMER_ADDRESS', 'Please verify the address with the customer.')}</p>
|
|
326
|
+
</AddressHoverInfo>
|
|
327
|
+
</AddressBookMarkContainer>
|
|
328
|
+
)}
|
|
329
|
+
</div>
|
|
330
|
+
<AddressItemActions className='form'>
|
|
331
|
+
<a className={actionStatus.loading || isOpenUserData ? 'disabled' : ''} onClick={() => openAddress(address)}>
|
|
332
|
+
<Pencil />
|
|
333
|
+
</a>
|
|
334
|
+
<a className={actionStatus.loading || address.default ? 'disabled' : ''} onClick={() => handleDeleteClick(address)}>
|
|
335
|
+
<Trash />
|
|
336
|
+
</a>
|
|
337
|
+
</AddressItemActions>
|
|
338
|
+
</AddressItem>
|
|
339
|
+
))}
|
|
340
|
+
{isEnableContinueButton && uniqueAddressesList.map(address => address.default && (
|
|
341
|
+
<ContinueButton key={address.id}>
|
|
342
|
+
<Button color='primary' onClick={() => handleSetAddress(address)}>
|
|
343
|
+
{t('CONTINUE_WITH', 'Continue with')}: {address.address}
|
|
344
|
+
</Button>
|
|
345
|
+
</ContinueButton>
|
|
346
|
+
))}
|
|
347
|
+
</AddressListUl>
|
|
348
|
+
)
|
|
349
|
+
}
|
|
350
|
+
{!(addressList.loading || actionStatus.loading || orderState.loading) && addressList.error && (
|
|
351
|
+
addressList.error.length > 0 && (
|
|
355
352
|
<NotFoundSource
|
|
356
|
-
content={
|
|
353
|
+
content={addressList.error[0]?.message || addressList.error[0]}
|
|
357
354
|
/>
|
|
358
|
-
)
|
|
359
|
-
{!isPopover && addressOpen && (
|
|
360
|
-
<AddressFormContainer>
|
|
361
|
-
<AddressForm
|
|
362
|
-
userId={userId}
|
|
363
|
-
addressesList={addressList?.addresses}
|
|
364
|
-
useValidationFileds
|
|
365
|
-
address={curAddress}
|
|
366
|
-
onCancel={() => handleCloseAddressForm()}
|
|
367
|
-
onSaveAddress={handleSaveAddress}
|
|
368
|
-
userCustomerSetup={userCustomerSetup}
|
|
369
|
-
notUseCustomerInfo={notUseCustomerInfo}
|
|
370
|
-
franchiseId={franchiseId}
|
|
371
|
-
addFormRestrictions={addFormRestrictions}
|
|
372
|
-
isAllowUnaddressOrderType={isAllowUnaddressOrderType}
|
|
373
|
-
/>
|
|
374
|
-
</AddressFormContainer>
|
|
375
|
-
)}
|
|
376
|
-
</List>
|
|
377
|
-
{addressOpen && !notUseCustomerInfo && (
|
|
378
|
-
<AddressFormContainer
|
|
379
|
-
width='50%'
|
|
380
|
-
addFormRestrictions={addFormRestrictions}
|
|
381
|
-
>
|
|
382
|
-
<TitleFormContainer>
|
|
383
|
-
{!addFormRestrictions && (
|
|
384
|
-
<CloseIcon>
|
|
385
|
-
<MdClose onClick={() => handleCloseAddressForm()} />
|
|
386
|
-
</CloseIcon>
|
|
387
|
-
)}
|
|
388
|
-
<h1>{t('ADD_NEW_ADDRESS', 'Add new address')}</h1>
|
|
389
|
-
</TitleFormContainer>
|
|
390
|
-
</AddressFormContainer>
|
|
355
|
+
)
|
|
391
356
|
)}
|
|
392
|
-
</AddressHalfContainer>
|
|
393
|
-
|
|
394
|
-
{(addressList.loading || actionStatus.loading || orderState.loading || (user?.id !== orderState?.options?.user_id)) && !isProductForm && !addressOpen && (
|
|
395
|
-
<AddressListUl>
|
|
396
|
-
<Skeleton height={50} count={3} style={{ marginBottom: '10px' }} />
|
|
397
|
-
</AddressListUl>
|
|
398
|
-
)}
|
|
399
357
|
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
hoverColor='#CCC'
|
|
408
|
-
>
|
|
409
|
-
{t('CANCEL', 'Cancel')}
|
|
410
|
-
</Button>
|
|
411
|
-
<Button
|
|
412
|
-
disabled={(addressList.loading || actionStatus.loading || orderState.loading)}
|
|
413
|
-
id='second-btn'
|
|
414
|
-
color='primary'
|
|
415
|
-
onClick={() => onAccept()}
|
|
416
|
-
>
|
|
417
|
-
{t('ACCEPT', 'Accept')}
|
|
418
|
-
</Button>
|
|
419
|
-
</FormActions>
|
|
420
|
-
)}
|
|
421
|
-
|
|
422
|
-
{
|
|
423
|
-
!isPopover && (
|
|
424
|
-
<Modal
|
|
425
|
-
title={t('WHAT_IS_YOUR_ADDRESS', 'What\'s your address?')}
|
|
426
|
-
open={isPopover}
|
|
427
|
-
onClose={() => handleCloseAddressForm()}
|
|
428
|
-
>
|
|
358
|
+
{!(addressList.loading || actionStatus.loading || orderState.loading) && (typeof orderState.options?.address !== 'object') && !addressList.error && (
|
|
359
|
+
<NotFoundSource
|
|
360
|
+
content={t('NETWORK_ERROR', 'Network error, please reload the page')}
|
|
361
|
+
/>
|
|
362
|
+
)}
|
|
363
|
+
{!isPopover && addressOpen && (
|
|
364
|
+
<AddressFormContainer>
|
|
429
365
|
<AddressForm
|
|
430
366
|
userId={userId}
|
|
431
367
|
addressesList={addressList?.addresses}
|
|
368
|
+
showSpreadForm={showSpreadForm}
|
|
369
|
+
addressSpreadForm={addressSpreadForm}
|
|
370
|
+
setAddressSpreadForm={setAddressSpreadForm}
|
|
371
|
+
editSpreadAddress={editSpreadAddress}
|
|
372
|
+
setEditSpreadAddress={setEditSpreadAddress}
|
|
432
373
|
useValidationFileds
|
|
433
374
|
address={curAddress}
|
|
434
375
|
onCancel={() => handleCloseAddressForm()}
|
|
435
376
|
onSaveAddress={handleSaveAddress}
|
|
436
377
|
userCustomerSetup={userCustomerSetup}
|
|
378
|
+
notUseCustomerInfo={notUseCustomerInfo}
|
|
379
|
+
franchiseId={franchiseId}
|
|
380
|
+
addFormRestrictions={addFormRestrictions}
|
|
437
381
|
isAllowUnaddressOrderType={isAllowUnaddressOrderType}
|
|
438
382
|
/>
|
|
439
|
-
</
|
|
440
|
-
)
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
383
|
+
</AddressFormContainer>
|
|
384
|
+
)}
|
|
385
|
+
</List>
|
|
386
|
+
{addressOpen && !notUseCustomerInfo && (
|
|
387
|
+
<AddressFormContainer
|
|
388
|
+
width='50%'
|
|
389
|
+
addFormRestrictions={addFormRestrictions}
|
|
390
|
+
>
|
|
391
|
+
<TitleFormContainer>
|
|
392
|
+
{!addFormRestrictions && (
|
|
393
|
+
<CloseIcon>
|
|
394
|
+
<MdClose onClick={() => handleCloseAddressForm()} />
|
|
395
|
+
</CloseIcon>
|
|
396
|
+
)}
|
|
397
|
+
<h1>{t('ADD_NEW_ADDRESS', 'Add new address')}</h1>
|
|
398
|
+
</TitleFormContainer>
|
|
399
|
+
{showSpreadForm && (
|
|
400
|
+
<SpreadForm
|
|
401
|
+
address={curAddress?.address && {
|
|
402
|
+
route: curAddress?.route,
|
|
403
|
+
street_number: curAddress?.street_number,
|
|
404
|
+
neighborhood: curAddress?.neighborhood,
|
|
405
|
+
city: curAddress?.city,
|
|
406
|
+
state: curAddress?.state,
|
|
407
|
+
country_code: curAddress?.country_code,
|
|
408
|
+
country: curAddress?.country,
|
|
409
|
+
address: curAddress?.address,
|
|
410
|
+
locality: curAddress?.locality,
|
|
411
|
+
location: curAddress?.location,
|
|
412
|
+
zipcode: curAddress?.zipcode
|
|
413
|
+
}}
|
|
414
|
+
countryAutocomplete={countryAutocomplete}
|
|
415
|
+
editSpreadAddress={editSpreadAddress}
|
|
416
|
+
setEditSpreadAddress={setEditSpreadAddress}
|
|
417
|
+
onCancel={() => handleCloseAddressForm()}
|
|
418
|
+
onChangeAddress={setAddressSpreadForm}
|
|
419
|
+
/>
|
|
420
|
+
)}
|
|
421
|
+
</AddressFormContainer>
|
|
422
|
+
)}
|
|
423
|
+
</AddressHalfContainer>
|
|
424
|
+
|
|
425
|
+
{(addressList.loading || actionStatus.loading || orderState.loading || (user?.id !== orderState?.options?.user_id)) && !isProductForm && !addressOpen && (
|
|
426
|
+
<AddressListUl>
|
|
427
|
+
<Skeleton height={50} count={3} style={{ marginBottom: '10px' }} />
|
|
428
|
+
</AddressListUl>
|
|
429
|
+
)}
|
|
430
|
+
|
|
431
|
+
{onCancel && onAccept && typeof orderState.options?.address === 'object' && !notUseCustomerInfo && (
|
|
432
|
+
<FormActions>
|
|
433
|
+
<Button
|
|
434
|
+
outline
|
|
435
|
+
type='button'
|
|
436
|
+
disabled={(addressList.loading || actionStatus.loading || orderState.loading)}
|
|
437
|
+
onClick={() => onCancel()}
|
|
438
|
+
hoverColor='#CCC'
|
|
439
|
+
>
|
|
440
|
+
{t('CANCEL', 'Cancel')}
|
|
441
|
+
</Button>
|
|
442
|
+
<Button
|
|
443
|
+
disabled={(addressList.loading || actionStatus.loading || orderState.loading)}
|
|
444
|
+
id='second-btn'
|
|
445
|
+
color='primary'
|
|
446
|
+
onClick={() => onAccept()}
|
|
447
|
+
>
|
|
448
|
+
{t('ACCEPT', 'Accept')}
|
|
449
|
+
</Button>
|
|
450
|
+
</FormActions>
|
|
451
|
+
)}
|
|
452
|
+
|
|
453
|
+
{
|
|
454
|
+
!isPopover && (
|
|
455
|
+
<Modal
|
|
456
|
+
title={t('WHAT_IS_YOUR_ADDRESS', 'What\'s your address?')}
|
|
457
|
+
open={isPopover}
|
|
458
|
+
onClose={() => handleCloseAddressForm()}
|
|
459
|
+
>
|
|
460
|
+
<AddressForm
|
|
461
|
+
userId={userId}
|
|
462
|
+
addressesList={addressList?.addresses}
|
|
463
|
+
showSpreadForm={showSpreadForm}
|
|
464
|
+
addressSpreadForm={addressSpreadForm}
|
|
465
|
+
setAddressSpreadForm={setAddressSpreadForm}
|
|
466
|
+
editSpreadAddress={editSpreadAddress}
|
|
467
|
+
setEditSpreadAddress={setEditSpreadAddress}
|
|
468
|
+
useValidationFileds
|
|
469
|
+
address={curAddress}
|
|
470
|
+
onCancel={() => handleCloseAddressForm()}
|
|
471
|
+
onSaveAddress={handleSaveAddress}
|
|
472
|
+
userCustomerSetup={userCustomerSetup}
|
|
473
|
+
isAllowUnaddressOrderType={isAllowUnaddressOrderType}
|
|
474
|
+
/>
|
|
475
|
+
</Modal>
|
|
476
|
+
)
|
|
477
|
+
}
|
|
478
|
+
<Confirm
|
|
479
|
+
title={t('SEARCH', 'Search')}
|
|
480
|
+
content={confirm.content}
|
|
481
|
+
acceptText={t('ACCEPT', 'Accept')}
|
|
482
|
+
open={confirm.open}
|
|
483
|
+
onClose={() => setConfirm({ ...confirm, open: false })}
|
|
484
|
+
onCancel={() => setConfirm({ ...confirm, open: false })}
|
|
485
|
+
onAccept={confirm.handleOnAccept}
|
|
486
|
+
closeOnBackdrop={false}
|
|
487
|
+
/>
|
|
488
|
+
</AddressListContainer>
|
|
460
489
|
)
|
|
461
490
|
}
|
|
462
491
|
|
|
@@ -30,7 +30,6 @@ import {
|
|
|
30
30
|
AdditionalTypesContainer,
|
|
31
31
|
PhoneAutocompleteContainer,
|
|
32
32
|
ImageWrapper,
|
|
33
|
-
ContinueButton,
|
|
34
33
|
NotFoundUser,
|
|
35
34
|
OptionContainer
|
|
36
35
|
} from './styles'
|
|
@@ -99,10 +98,8 @@ const PhoneAutocompleteUI = (props) => {
|
|
|
99
98
|
}
|
|
100
99
|
|
|
101
100
|
const handleFindClick = () => {
|
|
102
|
-
if (optSelected
|
|
101
|
+
if (optSelected) {
|
|
103
102
|
onChange(optSelected)
|
|
104
|
-
} else if (userCustomer?.id && orderState?.options?.address?.address) {
|
|
105
|
-
onRedirectPage && onRedirectPage('search')
|
|
106
103
|
} else {
|
|
107
104
|
setAlertState({ open: true, content: t('SELECT_ADDRESS_CUSTOMER', 'Please select an address for the selected customer') })
|
|
108
105
|
}
|
|
@@ -406,13 +403,6 @@ const PhoneAutocompleteUI = (props) => {
|
|
|
406
403
|
options={optionsToSelect.filter(opt => inputValue ? opt.value.toString().includes(inputValue) : opt)}
|
|
407
404
|
components={{ Option, ClearIndicator }}
|
|
408
405
|
/>
|
|
409
|
-
{optSelected && (
|
|
410
|
-
<ContinueButton>
|
|
411
|
-
<Button onClick={() => onChange(optSelected)} color='primary'>
|
|
412
|
-
{t('CONTINUE', 'Continue')}
|
|
413
|
-
</Button>
|
|
414
|
-
</ContinueButton>
|
|
415
|
-
)}
|
|
416
406
|
</SelectContainer>
|
|
417
407
|
</PhoneAutocompleteContainer>
|
|
418
408
|
</>
|
package/src/themes/five/src/components/BusinessesListing/layouts/OriginalBusinessesListing/index.js
CHANGED
|
@@ -201,7 +201,7 @@ const BusinessesListingUI = (props) => {
|
|
|
201
201
|
}, [preorderBusiness])
|
|
202
202
|
|
|
203
203
|
useEffect(() => {
|
|
204
|
-
setActiveMap(false)
|
|
204
|
+
!isCustomerMode && setActiveMap(false)
|
|
205
205
|
if (!businessesList?.businesses?.length) return
|
|
206
206
|
if (businessesList?.businesses?.length === 1 && configs?.activate_single_store_automatically?.value === '1') {
|
|
207
207
|
onBusinessClick(businessesList?.businesses[0])
|
/package/_bundles/{0.ordering-ui.2a09e7e0162e34ea955c.js → 0.ordering-ui.0bcf027ad972ccbec19e.js}
RENAMED
|
File without changes
|
/package/_bundles/{1.ordering-ui.2a09e7e0162e34ea955c.js → 1.ordering-ui.0bcf027ad972ccbec19e.js}
RENAMED
|
File without changes
|
/package/_bundles/{2.ordering-ui.2a09e7e0162e34ea955c.js → 2.ordering-ui.0bcf027ad972ccbec19e.js}
RENAMED
|
File without changes
|
/package/_bundles/{4.ordering-ui.2a09e7e0162e34ea955c.js → 4.ordering-ui.0bcf027ad972ccbec19e.js}
RENAMED
|
File without changes
|
/package/_bundles/{5.ordering-ui.2a09e7e0162e34ea955c.js → 5.ordering-ui.0bcf027ad972ccbec19e.js}
RENAMED
|
File without changes
|
/package/_bundles/{6.ordering-ui.2a09e7e0162e34ea955c.js → 6.ordering-ui.0bcf027ad972ccbec19e.js}
RENAMED
|
File without changes
|
|
File without changes
|
/package/_bundles/{8.ordering-ui.2a09e7e0162e34ea955c.js → 8.ordering-ui.0bcf027ad972ccbec19e.js}
RENAMED
|
File without changes
|
/package/_bundles/{9.ordering-ui.2a09e7e0162e34ea955c.js → 9.ordering-ui.0bcf027ad972ccbec19e.js}
RENAMED
|
File without changes
|