ordering-ui-external 14.1.1 → 14.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/_bundles/{7.ordering-ui.a407efaab5937b12a967.js → 7.ordering-ui.cb382f2d6328bf2368fb.js} +1 -1
- package/_bundles/{ordering-ui.a407efaab5937b12a967.js → ordering-ui.cb382f2d6328bf2368fb.js} +2 -2
- package/_modules/components/InputPhoneNumber/index.js +2 -2
- package/_modules/themes/callcenterOriginal/src/components/AddressForm/styles.js +3 -3
- package/_modules/themes/callcenterOriginal/src/components/AddressList/index.js +3 -9
- package/_modules/themes/callcenterOriginal/src/components/AddressList/styles.js +7 -7
- package/_modules/themes/callcenterOriginal/src/components/Header/index.js +5 -2
- package/_modules/themes/callcenterOriginal/src/components/PhoneAutocomplete/index.js +6 -4
- package/_modules/themes/callcenterOriginal/src/components/UserDetails/index.js +4 -3
- package/_modules/themes/callcenterOriginal/src/components/UserFormDetails/index.js +5 -19
- package/_modules/themes/five/src/components/BusinessPreorder/index.js +17 -11
- package/_modules/themes/five/src/components/MomentControl/index.js +2 -2
- package/package.json +2 -2
- package/src/components/InputPhoneNumber/index.js +3 -3
- package/src/themes/callcenterOriginal/src/components/AddressForm/styles.js +3 -1
- package/src/themes/callcenterOriginal/src/components/AddressList/index.js +1 -12
- package/src/themes/callcenterOriginal/src/components/AddressList/styles.js +6 -7
- package/src/themes/callcenterOriginal/src/components/Header/index.js +11 -4
- package/src/themes/callcenterOriginal/src/components/PhoneAutocomplete/index.js +6 -4
- package/src/themes/callcenterOriginal/src/components/UserDetails/index.js +3 -2
- package/src/themes/callcenterOriginal/src/components/UserFormDetails/index.js +4 -26
- package/src/themes/five/src/components/BusinessPreorder/index.js +21 -11
- package/src/themes/five/src/components/MomentControl/index.js +1 -1
- /package/_bundles/{0.ordering-ui.a407efaab5937b12a967.js → 0.ordering-ui.cb382f2d6328bf2368fb.js} +0 -0
- /package/_bundles/{1.ordering-ui.a407efaab5937b12a967.js → 1.ordering-ui.cb382f2d6328bf2368fb.js} +0 -0
- /package/_bundles/{2.ordering-ui.a407efaab5937b12a967.js → 2.ordering-ui.cb382f2d6328bf2368fb.js} +0 -0
- /package/_bundles/{4.ordering-ui.a407efaab5937b12a967.js → 4.ordering-ui.cb382f2d6328bf2368fb.js} +0 -0
- /package/_bundles/{5.ordering-ui.a407efaab5937b12a967.js → 5.ordering-ui.cb382f2d6328bf2368fb.js} +0 -0
- /package/_bundles/{6.ordering-ui.a407efaab5937b12a967.js → 6.ordering-ui.cb382f2d6328bf2368fb.js} +0 -0
- /package/_bundles/{7.ordering-ui.a407efaab5937b12a967.js.LICENSE.txt → 7.ordering-ui.cb382f2d6328bf2368fb.js.LICENSE.txt} +0 -0
- /package/_bundles/{8.ordering-ui.a407efaab5937b12a967.js → 8.ordering-ui.cb382f2d6328bf2368fb.js} +0 -0
- /package/_bundles/{9.ordering-ui.a407efaab5937b12a967.js → 9.ordering-ui.cb382f2d6328bf2368fb.js} +0 -0
- /package/_bundles/{ordering-ui.a407efaab5937b12a967.js.LICENSE.txt → ordering-ui.cb382f2d6328bf2368fb.js.LICENSE.txt} +0 -0
|
@@ -45,6 +45,7 @@ const UserDetailsUI = (props) => {
|
|
|
45
45
|
const userData = userState.result?.result || props.userData || formState.result?.result || user
|
|
46
46
|
|
|
47
47
|
const validationFieldsLength = Object.values(validationFields?.fields?.checkout)?.map(field => field.enabled)
|
|
48
|
+
const countryPhoneCode = userData?.country_phone_code ?? userData?.country_code
|
|
48
49
|
|
|
49
50
|
useEffect(() => {
|
|
50
51
|
if (isUserDetailsEdit) {
|
|
@@ -121,8 +122,8 @@ const UserDetailsUI = (props) => {
|
|
|
121
122
|
<PhoneContainer>
|
|
122
123
|
<CountryFlag>
|
|
123
124
|
{
|
|
124
|
-
|
|
125
|
-
<PhoneInput onChange={() => { }} defaultCountry={parsePhoneNumber(`+${(
|
|
125
|
+
countryPhoneCode && userData?.cellphone && (
|
|
126
|
+
<PhoneInput onChange={() => { }} defaultCountry={parsePhoneNumber(`+${(countryPhoneCode?.replace('+', ''))} ${userData?.cellphone?.replace(`+${countryPhoneCode}`, '')}`)?.country} />
|
|
126
127
|
)
|
|
127
128
|
}
|
|
128
129
|
</CountryFlag>
|
|
@@ -47,6 +47,7 @@ export const UserFormDetailsUI = (props) => {
|
|
|
47
47
|
const emailInput = useRef(null)
|
|
48
48
|
|
|
49
49
|
const user = userData || userSession
|
|
50
|
+
const countryPhoneCode = user?.country_phone_code ?? user?.country_code
|
|
50
51
|
|
|
51
52
|
const closeAlert = () => {
|
|
52
53
|
setAlertState({
|
|
@@ -70,8 +71,8 @@ export const UserFormDetailsUI = (props) => {
|
|
|
70
71
|
setUserPhoneNumber(phone)
|
|
71
72
|
return
|
|
72
73
|
}
|
|
73
|
-
if (
|
|
74
|
-
phone = `+${
|
|
74
|
+
if (countryPhoneCode) {
|
|
75
|
+
phone = `+${countryPhoneCode} ${user?.cellphone}`
|
|
75
76
|
} else {
|
|
76
77
|
phone = user?.cellphone
|
|
77
78
|
}
|
|
@@ -94,7 +95,7 @@ export const UserFormDetailsUI = (props) => {
|
|
|
94
95
|
return
|
|
95
96
|
}
|
|
96
97
|
if (!isPhoneNumberValid && userPhoneNumber) {
|
|
97
|
-
if (
|
|
98
|
+
if (countryPhoneCode) {
|
|
98
99
|
setAlertState({
|
|
99
100
|
open: true,
|
|
100
101
|
content: [t('INVALID_ERROR_PHONE_NUMBER', 'The Phone Number field is invalid')]
|
|
@@ -308,29 +309,6 @@ export const UserFormDetailsUI = (props) => {
|
|
|
308
309
|
/>
|
|
309
310
|
</InputPhoneNumberWrapper>
|
|
310
311
|
)}
|
|
311
|
-
{!isCheckout && (
|
|
312
|
-
<InputGroup>
|
|
313
|
-
<p>{t('PASSWORD', 'Password')}</p>
|
|
314
|
-
<Input
|
|
315
|
-
type='password'
|
|
316
|
-
name='password'
|
|
317
|
-
className='form'
|
|
318
|
-
disabled={!isEdit}
|
|
319
|
-
borderBottom
|
|
320
|
-
placeholder={t('FRONT_VISUALS_PASSWORD', 'Password')}
|
|
321
|
-
onChange={handleChangeInput}
|
|
322
|
-
ref={formMethods.register({
|
|
323
|
-
required: isRequiredField('password')
|
|
324
|
-
? t('VALIDATION_ERROR_PASSWORD_REQUIRED', 'The field Password is required').replace('_attribute_', t('PASSWORD', 'Password'))
|
|
325
|
-
: null,
|
|
326
|
-
minLength: {
|
|
327
|
-
value: 8,
|
|
328
|
-
message: t('VALIDATION_ERROR_PASSWORD_MIN_STRING', 'The Password must be at least 8 characters.').replace('_attribute_', t('PASSWORD', 'Password')).replace('_min_', 8)
|
|
329
|
-
}
|
|
330
|
-
})}
|
|
331
|
-
/>
|
|
332
|
-
</InputGroup>
|
|
333
|
-
)}
|
|
334
312
|
<Divider />
|
|
335
313
|
{
|
|
336
314
|
props.afterMidElements?.map((MidElement, i) => (
|
|
@@ -132,16 +132,25 @@ const BusinessPreorderUI = (props) => {
|
|
|
132
132
|
|
|
133
133
|
useEffect(() => {
|
|
134
134
|
if (cateringPreorder) {
|
|
135
|
+
let _timeLists = []
|
|
135
136
|
const schedule = business && getActualSchedule()
|
|
136
|
-
if (!schedule &&
|
|
137
|
-
|
|
137
|
+
if (!schedule && business) {
|
|
138
|
+
setTimeList([])
|
|
138
139
|
return
|
|
139
140
|
}
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
141
|
+
|
|
142
|
+
_timeLists = hoursList
|
|
143
|
+
.filter(hour => {
|
|
144
|
+
return (Object.keys(business || {})?.length === 0 || schedule?.lapses?.some((lapse) => {
|
|
145
|
+
const openHour = lapse.open.hour < 10 ? `0${lapse.open.hour}` : lapse.open.hour
|
|
146
|
+
const openMinute = lapse.open.minute < 10 ? `0${lapse.open.minute}` : lapse.open.minute
|
|
147
|
+
const closeHour = lapse.close.hour < 10 ? `0${lapse.close.hour}` : lapse.close.hour
|
|
148
|
+
const closeMinute = lapse.close.minute < 10 ? `0${lapse.close.minute}` : lapse.close.minute
|
|
149
|
+
return moment(dateSelected + ` ${hour.startTime}`) >= moment(dateSelected + ` ${openHour}:${openMinute}`).add(preorderLeadTime, 'minutes') && moment(dateSelected + ` ${hour.endTime}`) <= moment(dateSelected + ` ${closeHour}:${closeMinute}`)
|
|
150
|
+
})) &&
|
|
151
|
+
(moment(dateSelected + ` ${hour.startTime}`) < moment(dateSelected + ` ${hour.endTime}`)) &&
|
|
152
|
+
(moment().add(preorderLeadTime, 'minutes') < moment(dateSelected + ` ${hour.startTime}`) || !cateringPreorder)
|
|
153
|
+
})
|
|
145
154
|
.map(hour => {
|
|
146
155
|
return {
|
|
147
156
|
value: hour.startTime,
|
|
@@ -161,14 +170,15 @@ const BusinessPreorderUI = (props) => {
|
|
|
161
170
|
)
|
|
162
171
|
}
|
|
163
172
|
})
|
|
164
|
-
|
|
165
|
-
|
|
173
|
+
if (_timeLists?.length > 0) {
|
|
174
|
+
setTimeList(_timeLists)
|
|
175
|
+
}
|
|
166
176
|
} else {
|
|
167
177
|
const selectedMenu = menu ? (menu?.use_business_schedule ? business : menu) : business
|
|
168
178
|
const _times = getTimeList(dateSelected, selectedMenu)
|
|
169
179
|
setTimeList(_times)
|
|
170
180
|
}
|
|
171
|
-
}, [dateSelected, menu, business, cateringPreorder, hoursList])
|
|
181
|
+
}, [dateSelected, menu, JSON.stringify(business), cateringPreorder, JSON.stringify(hoursList), dateSelected])
|
|
172
182
|
|
|
173
183
|
useEffect(() => {
|
|
174
184
|
if (type === 'business_hours') setMenu(null)
|
|
@@ -263,7 +273,7 @@ const BusinessPreorderUI = (props) => {
|
|
|
263
273
|
</DateWrapper>
|
|
264
274
|
|
|
265
275
|
<TimeListWrapper>
|
|
266
|
-
{(isEnabled && timeList?.length > 0) ? (
|
|
276
|
+
{((isEnabled || cateringPreorder) && timeList?.length > 0) ? (
|
|
267
277
|
<>
|
|
268
278
|
{timeList.map((time, i) => (
|
|
269
279
|
<TimeItem
|
|
@@ -256,7 +256,7 @@ const MomentControlUI = (props) => {
|
|
|
256
256
|
isLoading={orderState?.loading}
|
|
257
257
|
>
|
|
258
258
|
{isASP ? <CheckedIcon /> : <CgRadioCheck />}
|
|
259
|
-
<span>{t('CHECKOUT_ASAP', 'ASAP')} ({moment(new Date()).format(
|
|
259
|
+
<span>{t('CHECKOUT_ASAP', 'ASAP')} ({moment(new Date()).format(`dddd, MMMM DD, YYYY ${configs?.general_hour_format?.value}`)} + {t('DELIVERY_TIME', 'delivery time')})</span>
|
|
260
260
|
</CheckBoxWrapper>
|
|
261
261
|
)}
|
|
262
262
|
<CheckBoxWrapper
|
/package/_bundles/{0.ordering-ui.a407efaab5937b12a967.js → 0.ordering-ui.cb382f2d6328bf2368fb.js}
RENAMED
|
File without changes
|
/package/_bundles/{1.ordering-ui.a407efaab5937b12a967.js → 1.ordering-ui.cb382f2d6328bf2368fb.js}
RENAMED
|
File without changes
|
/package/_bundles/{2.ordering-ui.a407efaab5937b12a967.js → 2.ordering-ui.cb382f2d6328bf2368fb.js}
RENAMED
|
File without changes
|
/package/_bundles/{4.ordering-ui.a407efaab5937b12a967.js → 4.ordering-ui.cb382f2d6328bf2368fb.js}
RENAMED
|
File without changes
|
/package/_bundles/{5.ordering-ui.a407efaab5937b12a967.js → 5.ordering-ui.cb382f2d6328bf2368fb.js}
RENAMED
|
File without changes
|
/package/_bundles/{6.ordering-ui.a407efaab5937b12a967.js → 6.ordering-ui.cb382f2d6328bf2368fb.js}
RENAMED
|
File without changes
|
|
File without changes
|
/package/_bundles/{8.ordering-ui.a407efaab5937b12a967.js → 8.ordering-ui.cb382f2d6328bf2368fb.js}
RENAMED
|
File without changes
|
/package/_bundles/{9.ordering-ui.a407efaab5937b12a967.js → 9.ordering-ui.cb382f2d6328bf2368fb.js}
RENAMED
|
File without changes
|