ordering-ui-external 14.1.16 → 14.1.18
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.e14afc24fc210d5a0a80.js → 7.ordering-ui.8e4771eb64248a6c4b6b.js} +1 -1
- package/_bundles/{ordering-ui.e14afc24fc210d5a0a80.js → ordering-ui.8e4771eb64248a6c4b6b.js} +2 -2
- package/_modules/components/BusinessesMap/index.js +5 -4
- package/_modules/themes/callcenterOriginal/src/components/AddressList/index.js +12 -12
- package/_modules/themes/five/src/components/OrderDetails/index.js +1 -1
- package/package.json +2 -2
- package/src/components/BusinessesMap/index.js +7 -5
- package/src/themes/callcenterOriginal/src/components/AddressList/index.js +3 -2
- package/src/themes/five/src/components/OrderDetails/index.js +5 -2
- /package/_bundles/{0.ordering-ui.e14afc24fc210d5a0a80.js → 0.ordering-ui.8e4771eb64248a6c4b6b.js} +0 -0
- /package/_bundles/{1.ordering-ui.e14afc24fc210d5a0a80.js → 1.ordering-ui.8e4771eb64248a6c4b6b.js} +0 -0
- /package/_bundles/{2.ordering-ui.e14afc24fc210d5a0a80.js → 2.ordering-ui.8e4771eb64248a6c4b6b.js} +0 -0
- /package/_bundles/{4.ordering-ui.e14afc24fc210d5a0a80.js → 4.ordering-ui.8e4771eb64248a6c4b6b.js} +0 -0
- /package/_bundles/{5.ordering-ui.e14afc24fc210d5a0a80.js → 5.ordering-ui.8e4771eb64248a6c4b6b.js} +0 -0
- /package/_bundles/{6.ordering-ui.e14afc24fc210d5a0a80.js → 6.ordering-ui.8e4771eb64248a6c4b6b.js} +0 -0
- /package/_bundles/{7.ordering-ui.e14afc24fc210d5a0a80.js.LICENSE.txt → 7.ordering-ui.8e4771eb64248a6c4b6b.js.LICENSE.txt} +0 -0
- /package/_bundles/{8.ordering-ui.e14afc24fc210d5a0a80.js → 8.ordering-ui.8e4771eb64248a6c4b6b.js} +0 -0
- /package/_bundles/{9.ordering-ui.e14afc24fc210d5a0a80.js → 9.ordering-ui.8e4771eb64248a6c4b6b.js} +0 -0
- /package/_bundles/{ordering-ui.e14afc24fc210d5a0a80.js.LICENSE.txt → ordering-ui.8e4771eb64248a6c4b6b.js.LICENSE.txt} +0 -0
|
@@ -74,11 +74,12 @@ var BusinessesMapUI = function BusinessesMapUI(props) {
|
|
|
74
74
|
}),
|
|
75
75
|
fallbackIcon: (_theme$images = theme.images) === null || _theme$images === void 0 || (_theme$images = _theme$images.dummies) === null || _theme$images === void 0 ? void 0 : _theme$images.businessLogo,
|
|
76
76
|
setErrors: setErrors,
|
|
77
|
-
fixedLocation: !userLocation && {
|
|
77
|
+
fixedLocation: !userLocation && (businessLocations !== null && businessLocations !== void 0 && businessLocations.length ? _objectSpread(_objectSpread({}, businessLocations[0]), {}, {
|
|
78
|
+
hideicon: true
|
|
79
|
+
}) : {
|
|
78
80
|
lat: parseFloat((_configState$configs$ = configState === null || configState === void 0 || (_configState$configs3 = configState.configs) === null || _configState$configs3 === void 0 || (_configState$configs3 = _configState$configs3.location_default_latitude) === null || _configState$configs3 === void 0 ? void 0 : _configState$configs3.value) !== null && _configState$configs$ !== void 0 ? _configState$configs$ : 0, 10),
|
|
79
|
-
lng: parseFloat((_configState$configs$2 = configState === null || configState === void 0 || (_configState$configs4 = configState.configs) === null || _configState$configs4 === void 0 || (_configState$configs4 = _configState$configs4.location_default_longitude) === null || _configState$configs4 === void 0 ? void 0 : _configState$configs4.value) !== null && _configState$configs$2 !== void 0 ? _configState$configs$2 : 0, 10)
|
|
80
|
-
|
|
81
|
-
}
|
|
81
|
+
lng: parseFloat((_configState$configs$2 = configState === null || configState === void 0 || (_configState$configs4 = configState.configs) === null || _configState$configs4 === void 0 || (_configState$configs4 = _configState$configs4.location_default_longitude) === null || _configState$configs4 === void 0 ? void 0 : _configState$configs4.value) !== null && _configState$configs$2 !== void 0 ? _configState$configs$2 : 0, 10)
|
|
82
|
+
})
|
|
82
83
|
})), (_props$afterComponent = props.afterComponents) === null || _props$afterComponent === void 0 ? void 0 : _props$afterComponent.map(function (AfterComponent, i) {
|
|
83
84
|
return /*#__PURE__*/_react.default.createElement(AfterComponent, _extends({
|
|
84
85
|
key: i
|
|
@@ -36,7 +36,7 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
|
36
36
|
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
37
37
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
38
38
|
var AddressListUI = function AddressListUI(props) {
|
|
39
|
-
var _addressList$addresse, _configs$unaddressed_, _orderState$options, _props$beforeElements, _props$beforeComponen, _addressList$addresse3, _addressList$addresse4, _orderState$
|
|
39
|
+
var _addressList$addresse, _configs$unaddressed_, _orderState$options, _orderState$options2, _props$beforeElements, _props$beforeComponen, _addressList$addresse3, _addressList$addresse4, _orderState$options8, _orderState$options9, _addressList$error$, _orderState$options10, _orderState$options11, _orderState$options12, _props$afterComponent, _props$afterElements;
|
|
40
40
|
var actionStatus = props.actionStatus,
|
|
41
41
|
addressList = props.addressList,
|
|
42
42
|
handleDelete = props.handleDelete,
|
|
@@ -101,7 +101,7 @@ var AddressListUI = function AddressListUI(props) {
|
|
|
101
101
|
var unaddressedTypes = (configs === null || configs === void 0 || (_configs$unaddressed_ = configs.unaddressed_order_types_allowed) === null || _configs$unaddressed_ === void 0 ? void 0 : _configs$unaddressed_.value.split('|').map(function (value) {
|
|
102
102
|
return Number(value);
|
|
103
103
|
})) || [];
|
|
104
|
-
var isAllowUnaddressOrderType = unaddressedTypes.includes(orderState === null || orderState === void 0 || (_orderState$options = orderState.options) === null || _orderState$options === void 0 ? void 0 : _orderState$options.type);
|
|
104
|
+
var isAllowUnaddressOrderType = unaddressedTypes.includes(orderState === null || orderState === void 0 || (_orderState$options = orderState.options) === null || _orderState$options === void 0 ? void 0 : _orderState$options.type) && (user === null || user === void 0 ? void 0 : user.id) === (orderState === null || orderState === void 0 || (_orderState$options2 = orderState.options) === null || _orderState$options2 === void 0 ? void 0 : _orderState$options2.user_id);
|
|
105
105
|
var openAddress = function openAddress(address) {
|
|
106
106
|
setCurAddress(address);
|
|
107
107
|
setAddressOpen(true);
|
|
@@ -180,15 +180,15 @@ var AddressListUI = function AddressListUI(props) {
|
|
|
180
180
|
props.forEach(function (prop) {
|
|
181
181
|
if (address !== null && address !== void 0 && address[prop]) {
|
|
182
182
|
if (prop === 'location') {
|
|
183
|
-
var _orderState$
|
|
184
|
-
values.push((address === null || address === void 0 ? void 0 : address[prop].lat) === (orderState === null || orderState === void 0 || (_orderState$
|
|
183
|
+
var _orderState$options3, _orderState$options4;
|
|
184
|
+
values.push((address === null || address === void 0 ? void 0 : address[prop].lat) === (orderState === null || orderState === void 0 || (_orderState$options3 = orderState.options) === null || _orderState$options3 === void 0 || (_orderState$options3 = _orderState$options3.address) === null || _orderState$options3 === void 0 || (_orderState$options3 = _orderState$options3[prop]) === null || _orderState$options3 === void 0 ? void 0 : _orderState$options3.lat) && (address === null || address === void 0 ? void 0 : address[prop].lng) === (orderState === null || orderState === void 0 || (_orderState$options4 = orderState.options) === null || _orderState$options4 === void 0 || (_orderState$options4 = _orderState$options4.address) === null || _orderState$options4 === void 0 || (_orderState$options4 = _orderState$options4[prop]) === null || _orderState$options4 === void 0 ? void 0 : _orderState$options4.lng));
|
|
185
185
|
} else {
|
|
186
|
-
var _orderState$
|
|
187
|
-
values.push((address === null || address === void 0 ? void 0 : address[prop]) === (orderState === null || orderState === void 0 || (_orderState$
|
|
186
|
+
var _orderState$options5;
|
|
187
|
+
values.push((address === null || address === void 0 ? void 0 : address[prop]) === (orderState === null || orderState === void 0 || (_orderState$options5 = orderState.options) === null || _orderState$options5 === void 0 || (_orderState$options5 = _orderState$options5.address) === null || _orderState$options5 === void 0 ? void 0 : _orderState$options5[prop]));
|
|
188
188
|
}
|
|
189
189
|
} else {
|
|
190
|
-
var _orderState$
|
|
191
|
-
values.push((orderState === null || orderState === void 0 || (_orderState$
|
|
190
|
+
var _orderState$options6, _orderState$options7;
|
|
191
|
+
values.push((orderState === null || orderState === void 0 || (_orderState$options6 = orderState.options) === null || _orderState$options6 === void 0 || (_orderState$options6 = _orderState$options6.address) === null || _orderState$options6 === void 0 ? void 0 : _orderState$options6[prop]) === null || (orderState === null || orderState === void 0 || (_orderState$options7 = orderState.options) === null || _orderState$options7 === void 0 || (_orderState$options7 = _orderState$options7.address) === null || _orderState$options7 === void 0 ? void 0 : _orderState$options7[prop]) === '');
|
|
192
192
|
}
|
|
193
193
|
});
|
|
194
194
|
return values.every(function (value) {
|
|
@@ -265,7 +265,7 @@ var AddressListUI = function AddressListUI(props) {
|
|
|
265
265
|
onSaveAddress: handleSaveAddress,
|
|
266
266
|
userCustomerSetup: userCustomerSetup,
|
|
267
267
|
isAllowUnaddressOrderType: isAllowUnaddressOrderType
|
|
268
|
-
}), !addressList.loading && !actionStatus.loading && !orderState.loading && !addressList.error && (addressList === null || addressList === void 0 || (_addressList$addresse4 = addressList.addresses) === null || _addressList$addresse4 === void 0 ? void 0 : _addressList$addresse4.length) > 0 && _typeof((_orderState$
|
|
268
|
+
}), !addressList.loading && !actionStatus.loading && !orderState.loading && !addressList.error && (addressList === null || addressList === void 0 || (_addressList$addresse4 = addressList.addresses) === null || _addressList$addresse4 === void 0 ? void 0 : _addressList$addresse4.length) > 0 && _typeof((_orderState$options8 = orderState.options) === null || _orderState$options8 === void 0 ? void 0 : _orderState$options8.address) === 'object' && !addressOpen && (user === null || user === void 0 ? void 0 : user.id) === (orderState === null || orderState === void 0 || (_orderState$options9 = orderState.options) === null || _orderState$options9 === void 0 ? void 0 : _orderState$options9.user_id) && (!addressOpen && isPopover || isModal) && /*#__PURE__*/_react.default.createElement(_styles.AddressListUl, {
|
|
269
269
|
id: "list"
|
|
270
270
|
}, /*#__PURE__*/_react.default.createElement(_styles.AddressTitleContainer, {
|
|
271
271
|
style: {
|
|
@@ -324,7 +324,7 @@ var AddressListUI = function AddressListUI(props) {
|
|
|
324
324
|
}, t('CONTINUE_WITH', 'Continue with'), ": ", address.address));
|
|
325
325
|
})), !(addressList.loading || actionStatus.loading || orderState.loading) && addressList.error && addressList.error.length > 0 && /*#__PURE__*/_react.default.createElement(_NotFoundSource.NotFoundSource, {
|
|
326
326
|
content: ((_addressList$error$ = addressList.error[0]) === null || _addressList$error$ === void 0 ? void 0 : _addressList$error$.message) || addressList.error[0]
|
|
327
|
-
}), !(addressList.loading || actionStatus.loading || orderState.loading) && _typeof((_orderState$
|
|
327
|
+
}), !(addressList.loading || actionStatus.loading || orderState.loading) && _typeof((_orderState$options10 = orderState.options) === null || _orderState$options10 === void 0 ? void 0 : _orderState$options10.address) !== 'object' && !addressList.error && /*#__PURE__*/_react.default.createElement(_NotFoundSource.NotFoundSource, {
|
|
328
328
|
content: t('NETWORK_ERROR', 'Network error, please reload the page')
|
|
329
329
|
}), !isPopover && addressOpen && /*#__PURE__*/_react.default.createElement(_styles.AddressFormContainer, null, /*#__PURE__*/_react.default.createElement(_AddressForm.AddressForm, {
|
|
330
330
|
userId: userId,
|
|
@@ -347,13 +347,13 @@ var AddressListUI = function AddressListUI(props) {
|
|
|
347
347
|
onClick: function onClick() {
|
|
348
348
|
return handleCloseAddressForm();
|
|
349
349
|
}
|
|
350
|
-
})), /*#__PURE__*/_react.default.createElement("h1", null, t('ADD_NEW_ADDRESS', 'Add new address'))))), (addressList.loading || actionStatus.loading || orderState.loading) && !isProductForm && !addressOpen && /*#__PURE__*/_react.default.createElement(_styles.AddressListUl, null, /*#__PURE__*/_react.default.createElement(_reactLoadingSkeleton.default, {
|
|
350
|
+
})), /*#__PURE__*/_react.default.createElement("h1", null, t('ADD_NEW_ADDRESS', 'Add new address'))))), (addressList.loading || actionStatus.loading || orderState.loading || (user === null || user === void 0 ? void 0 : user.id) !== (orderState === null || orderState === void 0 || (_orderState$options11 = orderState.options) === null || _orderState$options11 === void 0 ? void 0 : _orderState$options11.user_id)) && !isProductForm && !addressOpen && /*#__PURE__*/_react.default.createElement(_styles.AddressListUl, null, /*#__PURE__*/_react.default.createElement(_reactLoadingSkeleton.default, {
|
|
351
351
|
height: 50,
|
|
352
352
|
count: 3,
|
|
353
353
|
style: {
|
|
354
354
|
marginBottom: '10px'
|
|
355
355
|
}
|
|
356
|
-
})), onCancel && onAccept && _typeof((_orderState$
|
|
356
|
+
})), onCancel && onAccept && _typeof((_orderState$options12 = orderState.options) === null || _orderState$options12 === void 0 ? void 0 : _orderState$options12.address) === 'object' && !notUseCustomerInfo && /*#__PURE__*/_react.default.createElement(_styles.FormActions, null, /*#__PURE__*/_react.default.createElement(_Buttons.Button, {
|
|
357
357
|
outline: true,
|
|
358
358
|
type: "button",
|
|
359
359
|
disabled: addressList.loading || actionStatus.loading || orderState.loading,
|
|
@@ -538,7 +538,7 @@ var OrderDetailsUI = function OrderDetailsUI(props) {
|
|
|
538
538
|
images: (_order$business4 = order.business) === null || _order$business4 === void 0 ? void 0 : _order$business4.logo,
|
|
539
539
|
name: (_order$business5 = order.business) === null || _order$business5 === void 0 ? void 0 : _order$business5.name
|
|
540
540
|
}
|
|
541
|
-
})))),
|
|
541
|
+
})))), !!(order !== null && order !== void 0 && order.integration_id) && /*#__PURE__*/_react.default.createElement("h1", null, t('TICKET', 'Ticket'), ": ", order === null || order === void 0 ? void 0 : order.integration_id), !!(order !== null && order !== void 0 && order.integration_id_date) && /*#__PURE__*/_react.default.createElement("h1", null, order === null || order === void 0 ? void 0 : order.integration_id_date), !hideDeliveryType && /*#__PURE__*/_react.default.createElement("p", {
|
|
542
542
|
className: "types"
|
|
543
543
|
}, isService ? t('SERVICE_AT_HOME', 'Service at home') : orderTypes === null || orderTypes === void 0 || (_orderTypes$find = orderTypes.find(function (type) {
|
|
544
544
|
return (order === null || order === void 0 ? void 0 : order.delivery_type) === (type === null || type === void 0 ? void 0 : type.value);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ordering-ui-external",
|
|
3
|
-
"version": "14.1.
|
|
3
|
+
"version": "14.1.18",
|
|
4
4
|
"description": "Ordering UI Components",
|
|
5
5
|
"main": "./_modules/index.js",
|
|
6
6
|
"exports": {
|
|
@@ -88,7 +88,7 @@
|
|
|
88
88
|
"lodash": "^4.17.19",
|
|
89
89
|
"moment": "^2.29.4",
|
|
90
90
|
"nanoid": "^4.0.0",
|
|
91
|
-
"ordering-components-external": "13.0.
|
|
91
|
+
"ordering-components-external": "13.0.28",
|
|
92
92
|
"payment": "^2.4.6",
|
|
93
93
|
"polished": "^3.6.6",
|
|
94
94
|
"react-bootstrap-icons": "^1.7.2",
|
|
@@ -50,11 +50,13 @@ const BusinessesMapUI = (props) => {
|
|
|
50
50
|
businessZones={businessList?.map(business => business?.zones)}
|
|
51
51
|
fallbackIcon={theme.images?.dummies?.businessLogo}
|
|
52
52
|
setErrors={setErrors}
|
|
53
|
-
fixedLocation={!userLocation &&
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
53
|
+
fixedLocation={!userLocation && (businessLocations?.length
|
|
54
|
+
? { ...businessLocations[0], hideicon: true }
|
|
55
|
+
: {
|
|
56
|
+
lat: parseFloat(configState?.configs?.location_default_latitude?.value ?? 0, 10),
|
|
57
|
+
lng: parseFloat(configState?.configs?.location_default_longitude?.value ?? 0, 10)
|
|
58
|
+
}
|
|
59
|
+
)}
|
|
58
60
|
/>
|
|
59
61
|
</WrapperMap>
|
|
60
62
|
{props.afterComponents?.map((AfterComponent, i) => (
|
|
@@ -98,7 +98,7 @@ const AddressListUI = (props) => {
|
|
|
98
98
|
address.internal_number === obj.internal_number
|
|
99
99
|
)))) || []
|
|
100
100
|
const unaddressedTypes = configs?.unaddressed_order_types_allowed?.value.split('|').map(value => Number(value)) || []
|
|
101
|
-
const isAllowUnaddressOrderType = unaddressedTypes.includes(orderState?.options?.type)
|
|
101
|
+
const isAllowUnaddressOrderType = unaddressedTypes.includes(orderState?.options?.type) && user?.id === orderState?.options?.user_id
|
|
102
102
|
const openAddress = (address) => {
|
|
103
103
|
setCurAddress(address)
|
|
104
104
|
setAddressOpen(true)
|
|
@@ -280,6 +280,7 @@ const AddressListUI = (props) => {
|
|
|
280
280
|
addressList?.addresses?.length > 0 &&
|
|
281
281
|
typeof orderState.options?.address === 'object' &&
|
|
282
282
|
!addressOpen &&
|
|
283
|
+
user?.id === orderState?.options?.user_id &&
|
|
283
284
|
((!addressOpen && isPopover) || isModal) && (
|
|
284
285
|
<AddressListUl id='list'>
|
|
285
286
|
<AddressTitleContainer style={{ display: 'flex' }}>
|
|
@@ -390,7 +391,7 @@ const AddressListUI = (props) => {
|
|
|
390
391
|
)}
|
|
391
392
|
</AddressHalfContainer>
|
|
392
393
|
|
|
393
|
-
{(addressList.loading || actionStatus.loading || orderState.loading) && !isProductForm && !addressOpen && (
|
|
394
|
+
{(addressList.loading || actionStatus.loading || orderState.loading || (user?.id !== orderState?.options?.user_id)) && !isProductForm && !addressOpen && (
|
|
394
395
|
<AddressListUl>
|
|
395
396
|
<Skeleton height={50} count={3} style={{ marginBottom: '10px' }} />
|
|
396
397
|
</AddressListUl>
|
|
@@ -429,8 +429,11 @@ const OrderDetailsUI = (props) => {
|
|
|
429
429
|
</ShareOrder>
|
|
430
430
|
</Content>
|
|
431
431
|
)}
|
|
432
|
-
{
|
|
433
|
-
<h1>{t('TICKET', 'Ticket')}: {
|
|
432
|
+
{!!order?.integration_id && (
|
|
433
|
+
<h1>{t('TICKET', 'Ticket')}: {order?.integration_id}</h1>
|
|
434
|
+
)}
|
|
435
|
+
{!!order?.integration_id_date && (
|
|
436
|
+
<h1>{order?.integration_id_date}</h1>
|
|
434
437
|
)}
|
|
435
438
|
{!hideDeliveryType && (
|
|
436
439
|
<p className='types'>
|
/package/_bundles/{0.ordering-ui.e14afc24fc210d5a0a80.js → 0.ordering-ui.8e4771eb64248a6c4b6b.js}
RENAMED
|
File without changes
|
/package/_bundles/{1.ordering-ui.e14afc24fc210d5a0a80.js → 1.ordering-ui.8e4771eb64248a6c4b6b.js}
RENAMED
|
File without changes
|
/package/_bundles/{2.ordering-ui.e14afc24fc210d5a0a80.js → 2.ordering-ui.8e4771eb64248a6c4b6b.js}
RENAMED
|
File without changes
|
/package/_bundles/{4.ordering-ui.e14afc24fc210d5a0a80.js → 4.ordering-ui.8e4771eb64248a6c4b6b.js}
RENAMED
|
File without changes
|
/package/_bundles/{5.ordering-ui.e14afc24fc210d5a0a80.js → 5.ordering-ui.8e4771eb64248a6c4b6b.js}
RENAMED
|
File without changes
|
/package/_bundles/{6.ordering-ui.e14afc24fc210d5a0a80.js → 6.ordering-ui.8e4771eb64248a6c4b6b.js}
RENAMED
|
File without changes
|
|
File without changes
|
/package/_bundles/{8.ordering-ui.e14afc24fc210d5a0a80.js → 8.ordering-ui.8e4771eb64248a6c4b6b.js}
RENAMED
|
File without changes
|
/package/_bundles/{9.ordering-ui.e14afc24fc210d5a0a80.js → 9.ordering-ui.8e4771eb64248a6c4b6b.js}
RENAMED
|
File without changes
|