ordering-ui-admin-external 1.17.0 → 1.18.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.
- package/_bundles/{ordering-ui-admin.6c1919d6b0356a2f522f.js → ordering-ui-admin.d6ceaa81e226693746d5.js} +2 -2
- package/_modules/components/Delivery/DeliveryUsersListing/index.js +4 -2
- package/_modules/components/Delivery/DriversGroupLogistics/index.js +1 -1
- package/_modules/components/Delivery/DriversGroupLogs/index.js +1 -0
- package/_modules/components/Delivery/UsersList/index.js +47 -51
- package/_modules/components/Delivery/UsersList/styles.js +6 -4
- package/_modules/components/MyProducts/AdvancedSettings/ButtonShadow.js +98 -0
- package/_modules/components/MyProducts/AdvancedSettings/FontStyleGroup.js +28 -7
- package/_modules/components/MyProducts/AdvancedSettings/HideCheckBox.js +47 -0
- package/_modules/components/MyProducts/AdvancedSettings/ImageBox.js +12 -3
- package/_modules/components/MyProducts/AdvancedSettings/SettingComponent.js +15 -15
- package/_modules/components/MyProducts/AdvancedSettings/index.js +102 -117
- package/_modules/components/MyProducts/AppResources/index.js +132 -0
- package/_modules/components/Orders/Messages/index.js +9 -5
- package/_modules/components/Orders/OrderBill/index.js +1 -1
- package/_modules/components/Orders/OrderNotification/index.js +4 -2
- package/_modules/components/Orders/OrdersManager/index.js +3 -1
- package/_modules/components/Stores/BusinessAdd/DeliveryZone/index.js +1 -1
- package/_modules/components/Stores/BusinessDeliveryZoneInformation/index.js +1 -1
- package/_modules/components/Stores/BusinessDetails/index.js +27 -8
- package/_modules/components/Stores/BusinessPlace/index.js +127 -0
- package/_modules/components/Stores/BusinessPlace/styles.js +55 -0
- package/_modules/components/Stores/BusinessPlaceGroup/index.js +258 -0
- package/_modules/components/Stores/BusinessPlaceGroup/styles.js +102 -0
- package/_modules/components/Stores/BusinessPreorderDetails/index.js +13 -1
- package/_modules/components/Stores/BusinessProductList/index.js +3 -3
- package/_modules/components/Stores/BusinessProductsListing/index.js +2 -1
- package/_modules/components/Stores/BusinessSummary/index.js +12 -3
- package/_modules/components/Stores/ProductStep/index.js +15 -3
- package/_modules/components/Stores/SpoonityApiKey/index.js +97 -0
- package/_modules/components/Stores/SpoonityApiKey/styles.js +47 -0
- package/_modules/components/Stores/UploadMenuGuide/index.js +8 -0
- package/_modules/components/Users/CustomerPointsWallet/index.js +126 -9
- package/_modules/components/Users/CustomerPointsWallet/styles.js +8 -4
- package/package.json +2 -2
- package/src/components/Delivery/DeliveryUsersListing/index.js +3 -1
- package/src/components/Delivery/DriversGroupLogistics/index.js +1 -1
- package/src/components/Delivery/DriversGroupLogs/index.js +2 -0
- package/src/components/Delivery/UsersList/index.js +79 -61
- package/src/components/Delivery/UsersList/styles.js +4 -12
- package/src/components/MyProducts/AdvancedSettings/ButtonShadow.js +102 -0
- package/src/components/MyProducts/AdvancedSettings/FontStyleGroup.js +23 -5
- package/src/components/MyProducts/AdvancedSettings/HideCheckBox.js +33 -0
- package/src/components/MyProducts/AdvancedSettings/ImageBox.js +10 -3
- package/src/components/MyProducts/AdvancedSettings/SettingComponent.js +10 -15
- package/src/components/MyProducts/AdvancedSettings/index.js +119 -149
- package/src/components/MyProducts/AppResources/index.js +167 -0
- package/src/components/Orders/Messages/index.js +38 -0
- package/src/components/Orders/OrderBill/index.js +1 -1
- package/src/components/Orders/OrderNotification/index.js +6 -2
- package/src/components/Orders/OrdersManager/index.js +1 -1
- package/src/components/Stores/BusinessAdd/DeliveryZone/index.js +1 -1
- package/src/components/Stores/BusinessDeliveryZoneInformation/index.js +1 -1
- package/src/components/Stores/BusinessDetails/index.js +24 -1
- package/src/components/Stores/BusinessPlace/index.js +137 -0
- package/src/components/Stores/BusinessPlace/styles.js +132 -0
- package/src/components/Stores/BusinessPlaceGroup/index.js +272 -0
- package/src/components/Stores/BusinessPlaceGroup/styles.js +248 -0
- package/src/components/Stores/BusinessPreorderDetails/index.js +2 -2
- package/src/components/Stores/BusinessProductList/index.js +9 -1
- package/src/components/Stores/BusinessProductsListing/index.js +1 -0
- package/src/components/Stores/BusinessSummary/index.js +16 -5
- package/src/components/Stores/ProductStep/index.js +19 -2
- package/src/components/Stores/SpoonityApiKey/index.js +87 -0
- package/src/components/Stores/SpoonityApiKey/styles.js +68 -0
- package/src/components/Stores/UploadMenuGuide/index.js +10 -1
- package/src/components/Users/CustomerPointsWallet/index.js +130 -2
- package/src/components/Users/CustomerPointsWallet/styles.js +40 -1
- /package/_bundles/{ordering-ui-admin.6c1919d6b0356a2f522f.js.LICENSE.txt → ordering-ui-admin.d6ceaa81e226693746d5.js.LICENSE.txt} +0 -0
|
@@ -0,0 +1,258 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.BusinessPlaceGroupUI = exports.BusinessPlaceGroup = void 0;
|
|
8
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
9
|
+
var _orderingComponentsAdminExternal = require("ordering-components-admin-external");
|
|
10
|
+
var _reactBootstrap = require("react-bootstrap");
|
|
11
|
+
var _styledComponents = require("styled-components");
|
|
12
|
+
var _useWindowSize2 = require("../../../hooks/useWindowSize");
|
|
13
|
+
var _styles = require("../../../styles");
|
|
14
|
+
var _reactHookForm = require("react-hook-form");
|
|
15
|
+
var _Shared = require("../../Shared");
|
|
16
|
+
var _reactLoadingSkeleton = _interopRequireDefault(require("react-loading-skeleton"));
|
|
17
|
+
var _BusinessPlace = require("../BusinessPlace");
|
|
18
|
+
var _reactBootstrapIcons = require("react-bootstrap-icons");
|
|
19
|
+
var _styles2 = require("./styles");
|
|
20
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
21
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
22
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
23
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
24
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
25
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
26
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
27
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
28
|
+
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
29
|
+
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
30
|
+
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
31
|
+
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
32
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
33
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
34
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
35
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
36
|
+
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
|
37
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
38
|
+
var BusinessPlaceGroupUI = function BusinessPlaceGroupUI(props) {
|
|
39
|
+
var _ref, _formState$changes$na, _formState$changes, _placeList$places, _placeList$places2;
|
|
40
|
+
var open = props.open,
|
|
41
|
+
onClose = props.onClose,
|
|
42
|
+
placeGroup = props.placeGroup,
|
|
43
|
+
formState = props.formState,
|
|
44
|
+
handleChangeInput = props.handleChangeInput,
|
|
45
|
+
handleAddPlaceGroup = props.handleAddPlaceGroup,
|
|
46
|
+
handleUpdatePlaceGroup = props.handleUpdatePlaceGroup,
|
|
47
|
+
handleDeletePlaceGroup = props.handleDeletePlaceGroup,
|
|
48
|
+
placeList = props.placeList,
|
|
49
|
+
handleSuccessDeletePlace = props.handleSuccessDeletePlace,
|
|
50
|
+
handleSuccessAddPlace = props.handleSuccessAddPlace,
|
|
51
|
+
handleSuccessUpdatePlace = props.handleSuccessUpdatePlace,
|
|
52
|
+
handleChangePlaceEnabled = props.handleChangePlaceEnabled,
|
|
53
|
+
businessId = props.businessId,
|
|
54
|
+
handleMultiPlaceChangeEnabled = props.handleMultiPlaceChangeEnabled,
|
|
55
|
+
getMultiPlaceCheckStatus = props.getMultiPlaceCheckStatus;
|
|
56
|
+
var theme = (0, _styledComponents.useTheme)();
|
|
57
|
+
var _useLanguage = (0, _orderingComponentsAdminExternal.useLanguage)(),
|
|
58
|
+
_useLanguage2 = _slicedToArray(_useLanguage, 2),
|
|
59
|
+
t = _useLanguage2[1];
|
|
60
|
+
var _useWindowSize = (0, _useWindowSize2.useWindowSize)(),
|
|
61
|
+
width = _useWindowSize.width;
|
|
62
|
+
var formMethods = (0, _reactHookForm.useForm)();
|
|
63
|
+
var _useState = (0, _react.useState)(false),
|
|
64
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
65
|
+
isMenuOpen = _useState2[0],
|
|
66
|
+
setIsMenuOpen = _useState2[1];
|
|
67
|
+
var _useState3 = (0, _react.useState)({
|
|
68
|
+
open: false,
|
|
69
|
+
content: []
|
|
70
|
+
}),
|
|
71
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
72
|
+
alertState = _useState4[0],
|
|
73
|
+
setAlertState = _useState4[1];
|
|
74
|
+
var _useState5 = (0, _react.useState)(null),
|
|
75
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
76
|
+
selectedPlace = _useState6[0],
|
|
77
|
+
setSelectedPlace = _useState6[1];
|
|
78
|
+
var _useState7 = (0, _react.useState)(false),
|
|
79
|
+
_useState8 = _slicedToArray(_useState7, 2),
|
|
80
|
+
openModal = _useState8[0],
|
|
81
|
+
setOpenModal = _useState8[1];
|
|
82
|
+
var buttonRef = (0, _react.useRef)(null);
|
|
83
|
+
var actionSidebar = function actionSidebar(value) {
|
|
84
|
+
if (!value) {
|
|
85
|
+
props.onClose();
|
|
86
|
+
}
|
|
87
|
+
setIsMenuOpen(value);
|
|
88
|
+
document.getElementById('business_place').style.width = value ? width > 1000 ? '500px' : '100%' : '0';
|
|
89
|
+
};
|
|
90
|
+
var handleOpenModal = function handleOpenModal(place) {
|
|
91
|
+
setSelectedPlace(place);
|
|
92
|
+
setOpenModal(true);
|
|
93
|
+
};
|
|
94
|
+
var closeAlert = function closeAlert() {
|
|
95
|
+
setAlertState({
|
|
96
|
+
open: false,
|
|
97
|
+
content: []
|
|
98
|
+
});
|
|
99
|
+
};
|
|
100
|
+
var onSubmit = function onSubmit() {
|
|
101
|
+
if (placeGroup) handleUpdatePlaceGroup();else handleAddPlaceGroup();
|
|
102
|
+
};
|
|
103
|
+
var handleCloseModal = function handleCloseModal() {
|
|
104
|
+
setOpenModal(false);
|
|
105
|
+
setSelectedPlace(null);
|
|
106
|
+
};
|
|
107
|
+
(0, _react.useEffect)(function () {
|
|
108
|
+
if (isMenuOpen) {
|
|
109
|
+
if (width < 1000) {
|
|
110
|
+
document.getElementById('business_place').style.width = '100%';
|
|
111
|
+
} else {
|
|
112
|
+
document.getElementById('business_place').style.width = '500px';
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
}, [width]);
|
|
116
|
+
(0, _react.useEffect)(function () {
|
|
117
|
+
if (!open) return;
|
|
118
|
+
actionSidebar(true);
|
|
119
|
+
}, [open]);
|
|
120
|
+
var handlePlaceClick = function handlePlaceClick(e, place) {
|
|
121
|
+
if (e.target.closest('.check-box')) return;
|
|
122
|
+
handleOpenModal(place);
|
|
123
|
+
};
|
|
124
|
+
var handleCheckBoxChange = function handleCheckBoxChange(place) {
|
|
125
|
+
handleChangePlaceEnabled(place === null || place === void 0 ? void 0 : place.id, {
|
|
126
|
+
enabled: !(place !== null && place !== void 0 && place.enabled)
|
|
127
|
+
});
|
|
128
|
+
};
|
|
129
|
+
var handleUpdateSelectedPlace = function handleUpdateSelectedPlace(placeGroup) {
|
|
130
|
+
setSelectedPlace(placeGroup);
|
|
131
|
+
};
|
|
132
|
+
(0, _react.useEffect)(function () {
|
|
133
|
+
if (Object.keys(formMethods.errors).length > 0) {
|
|
134
|
+
setAlertState({
|
|
135
|
+
open: true,
|
|
136
|
+
content: Object.values(formMethods.errors).map(function (error) {
|
|
137
|
+
return error.message;
|
|
138
|
+
})
|
|
139
|
+
});
|
|
140
|
+
}
|
|
141
|
+
}, [formMethods.errors]);
|
|
142
|
+
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_styles2.Container, {
|
|
143
|
+
id: "business_place"
|
|
144
|
+
}, /*#__PURE__*/_react.default.createElement(_styles2.Header, null, /*#__PURE__*/_react.default.createElement("h1", null, placeGroup ? placeGroup === null || placeGroup === void 0 ? void 0 : placeGroup.name : t('NEW_PLACE', 'New place')), /*#__PURE__*/_react.default.createElement(_styles2.ActionBlock, null, placeGroup && /*#__PURE__*/_react.default.createElement(_styles2.ActionSelectorWrapper, null, /*#__PURE__*/_react.default.createElement(_reactBootstrap.DropdownButton, {
|
|
145
|
+
className: "product_actions",
|
|
146
|
+
menuAlign: theme !== null && theme !== void 0 && theme.rtl ? 'left' : 'right',
|
|
147
|
+
title: /*#__PURE__*/_react.default.createElement(_reactBootstrapIcons.ThreeDots, null),
|
|
148
|
+
id: theme !== null && theme !== void 0 && theme.rtl ? 'dropdown-menu-align-left' : 'dropdown-menu-align-right'
|
|
149
|
+
}, /*#__PURE__*/_react.default.createElement(_reactBootstrap.Dropdown.Item, {
|
|
150
|
+
onClick: function onClick() {
|
|
151
|
+
return handleDeletePlaceGroup();
|
|
152
|
+
}
|
|
153
|
+
}, t('DELETE', 'Delete')))), /*#__PURE__*/_react.default.createElement(_styles.IconButton, {
|
|
154
|
+
color: "black",
|
|
155
|
+
onClick: function onClick() {
|
|
156
|
+
return onClose();
|
|
157
|
+
}
|
|
158
|
+
}, /*#__PURE__*/_react.default.createElement(_reactBootstrapIcons.XLg, null)))), /*#__PURE__*/_react.default.createElement(_styles2.Content, {
|
|
159
|
+
onSubmit: formMethods.handleSubmit(onSubmit)
|
|
160
|
+
}, /*#__PURE__*/_react.default.createElement("label", null, t('NAME', 'Name')), /*#__PURE__*/_react.default.createElement(_styles.Input, {
|
|
161
|
+
placeholder: t('NAME', 'Name'),
|
|
162
|
+
name: "name",
|
|
163
|
+
autoComplete: "off",
|
|
164
|
+
onChange: handleChangeInput,
|
|
165
|
+
value: (_ref = (_formState$changes$na = formState === null || formState === void 0 ? void 0 : (_formState$changes = formState.changes) === null || _formState$changes === void 0 ? void 0 : _formState$changes.name) !== null && _formState$changes$na !== void 0 ? _formState$changes$na : placeGroup === null || placeGroup === void 0 ? void 0 : placeGroup.name) !== null && _ref !== void 0 ? _ref : '',
|
|
166
|
+
ref: formMethods.register({
|
|
167
|
+
required: t('VALIDATION_ERROR_REQUIRED', 'Name is required').replace('_attribute_', t('NAME', 'Name'))
|
|
168
|
+
})
|
|
169
|
+
}), /*#__PURE__*/_react.default.createElement(_styles2.HideSubmitBtn, {
|
|
170
|
+
type: "submit",
|
|
171
|
+
ref: buttonRef
|
|
172
|
+
})), placeGroup && (placeList === null || placeList === void 0 ? void 0 : placeList.loading) && /*#__PURE__*/_react.default.createElement(_styles2.OptionList, null, _toConsumableArray(Array(5).keys()).map(function (i) {
|
|
173
|
+
return /*#__PURE__*/_react.default.createElement(_styles2.PlaceItemContainer, {
|
|
174
|
+
key: i
|
|
175
|
+
}, /*#__PURE__*/_react.default.createElement(_styles2.CheckWrapper, null, /*#__PURE__*/_react.default.createElement(_reactLoadingSkeleton.default, {
|
|
176
|
+
width: 16,
|
|
177
|
+
height: 16
|
|
178
|
+
}), /*#__PURE__*/_react.default.createElement("label", null, /*#__PURE__*/_react.default.createElement(_reactLoadingSkeleton.default, {
|
|
179
|
+
width: 100
|
|
180
|
+
}))), /*#__PURE__*/_react.default.createElement(_reactLoadingSkeleton.default, {
|
|
181
|
+
width: 16,
|
|
182
|
+
height: 16
|
|
183
|
+
}));
|
|
184
|
+
})), placeGroup && !(placeList !== null && placeList !== void 0 && placeList.loading) && /*#__PURE__*/_react.default.createElement(_styles2.OptionList, null, (placeList === null || placeList === void 0 ? void 0 : (_placeList$places = placeList.places) === null || _placeList$places === void 0 ? void 0 : _placeList$places.length) > 0 && /*#__PURE__*/_react.default.createElement(_styles2.TableHead, null, /*#__PURE__*/_react.default.createElement(_styles2.CheckWrapper, null, /*#__PURE__*/_react.default.createElement("span", {
|
|
185
|
+
className: "check-box",
|
|
186
|
+
onClick: function onClick() {
|
|
187
|
+
return handleMultiPlaceChangeEnabled();
|
|
188
|
+
}
|
|
189
|
+
}, getMultiPlaceCheckStatus() ? /*#__PURE__*/_react.default.createElement(_reactBootstrapIcons.CheckSquareFill, {
|
|
190
|
+
className: "active"
|
|
191
|
+
}) : /*#__PURE__*/_react.default.createElement(_reactBootstrapIcons.Square, null)), /*#__PURE__*/_react.default.createElement("label", null, t('OPTIONS', 'Options')))), placeList === null || placeList === void 0 ? void 0 : (_placeList$places2 = placeList.places) === null || _placeList$places2 === void 0 ? void 0 : _placeList$places2.map(function (place, i) {
|
|
192
|
+
return /*#__PURE__*/_react.default.createElement(_styles2.PlaceItemContainer, {
|
|
193
|
+
key: i,
|
|
194
|
+
active: (selectedPlace === null || selectedPlace === void 0 ? void 0 : selectedPlace.id) === (place === null || place === void 0 ? void 0 : place.id),
|
|
195
|
+
onClick: function onClick(e) {
|
|
196
|
+
return handlePlaceClick(e, place);
|
|
197
|
+
}
|
|
198
|
+
}, /*#__PURE__*/_react.default.createElement(_styles2.CheckWrapper, null, /*#__PURE__*/_react.default.createElement("span", {
|
|
199
|
+
className: "check-box",
|
|
200
|
+
onClick: function onClick() {
|
|
201
|
+
return handleCheckBoxChange(place);
|
|
202
|
+
}
|
|
203
|
+
}, place !== null && place !== void 0 && place.enabled ? /*#__PURE__*/_react.default.createElement(_reactBootstrapIcons.CheckSquareFill, {
|
|
204
|
+
className: "active"
|
|
205
|
+
}) : /*#__PURE__*/_react.default.createElement(_reactBootstrapIcons.Square, null)), /*#__PURE__*/_react.default.createElement("label", null, place === null || place === void 0 ? void 0 : place.name)), /*#__PURE__*/_react.default.createElement(_reactBootstrapIcons.ChevronRight, null));
|
|
206
|
+
})), placeGroup && /*#__PURE__*/_react.default.createElement(_styles2.AddBtn, {
|
|
207
|
+
onClick: function onClick() {
|
|
208
|
+
return handleOpenModal(null);
|
|
209
|
+
}
|
|
210
|
+
}, t('ADD_OPTION', 'Add option')), /*#__PURE__*/_react.default.createElement(_styles2.ButtonWrapper, null, /*#__PURE__*/_react.default.createElement(_styles.Button, {
|
|
211
|
+
color: "primary",
|
|
212
|
+
borderRadius: "8px",
|
|
213
|
+
disabled: Object.keys(formState === null || formState === void 0 ? void 0 : formState.changes).length === 0,
|
|
214
|
+
onClick: function onClick() {
|
|
215
|
+
return buttonRef.current.click();
|
|
216
|
+
}
|
|
217
|
+
}, placeGroup ? t('SAVE', 'Save') : t('ADD', 'Add')))), /*#__PURE__*/_react.default.createElement(_Shared.Alert, {
|
|
218
|
+
title: t('PLACES', 'Places'),
|
|
219
|
+
content: alertState.content,
|
|
220
|
+
acceptText: t('ACCEPT', 'Accept'),
|
|
221
|
+
open: alertState.open,
|
|
222
|
+
onClose: function onClose() {
|
|
223
|
+
return closeAlert();
|
|
224
|
+
},
|
|
225
|
+
onAccept: function onAccept() {
|
|
226
|
+
return closeAlert();
|
|
227
|
+
},
|
|
228
|
+
closeOnBackdrop: false
|
|
229
|
+
}), /*#__PURE__*/_react.default.createElement(_Shared.Modal, {
|
|
230
|
+
width: "700px",
|
|
231
|
+
height: "80vh",
|
|
232
|
+
padding: "30px",
|
|
233
|
+
open: openModal,
|
|
234
|
+
onClose: function onClose() {
|
|
235
|
+
return handleCloseModal();
|
|
236
|
+
},
|
|
237
|
+
hideCloseDefault: true
|
|
238
|
+
}, /*#__PURE__*/_react.default.createElement(_BusinessPlace.BusinessPlace, {
|
|
239
|
+
businessId: businessId,
|
|
240
|
+
place: selectedPlace,
|
|
241
|
+
placeGroup: placeGroup,
|
|
242
|
+
handleUpdateSelectedPlace: handleUpdateSelectedPlace,
|
|
243
|
+
handleSuccessUpdatePlace: handleSuccessUpdatePlace,
|
|
244
|
+
handleSuccessAddPlace: handleSuccessAddPlace,
|
|
245
|
+
handleSuccessDeletePlace: handleSuccessDeletePlace,
|
|
246
|
+
onClose: function onClose() {
|
|
247
|
+
return handleCloseModal();
|
|
248
|
+
}
|
|
249
|
+
})));
|
|
250
|
+
};
|
|
251
|
+
exports.BusinessPlaceGroupUI = BusinessPlaceGroupUI;
|
|
252
|
+
var BusinessPlaceGroup = function BusinessPlaceGroup(props) {
|
|
253
|
+
var businessPlaceProps = _objectSpread(_objectSpread({}, props), {}, {
|
|
254
|
+
UIComponent: BusinessPlaceGroupUI
|
|
255
|
+
});
|
|
256
|
+
return /*#__PURE__*/_react.default.createElement(_orderingComponentsAdminExternal.BusinessPlaceGroup, businessPlaceProps);
|
|
257
|
+
};
|
|
258
|
+
exports.BusinessPlaceGroup = BusinessPlaceGroup;
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.TableHead = exports.PlaceItemContainer = exports.OptionList = exports.HideSubmitBtn = exports.Header = exports.Content = exports.Container = exports.CheckWrapper = exports.ButtonWrapper = exports.AddBtn = exports.ActionSelectorWrapper = exports.ActionBlock = void 0;
|
|
8
|
+
var _styledComponents = _interopRequireWildcard(require("styled-components"));
|
|
9
|
+
var _polished = require("polished");
|
|
10
|
+
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10, _templateObject11, _templateObject12, _templateObject13, _templateObject14, _templateObject15, _templateObject16, _templateObject17, _templateObject18, _templateObject19, _templateObject20, _templateObject21, _templateObject22, _templateObject23;
|
|
11
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
12
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
13
|
+
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
14
|
+
var Container = _styledComponents.default.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n padding: 20px;\n overflow: auto;\n transition: 0.3s;\n \n > button {\n height: 42px;\n width: 100%;\n margin-top: 20px;\n }\n \n @media (min-width: 1000px) {\n max-width: 500px;\n width: 0;\n ", "\n }\n"])), function (props) {
|
|
15
|
+
var _props$theme;
|
|
16
|
+
return (_props$theme = props.theme) !== null && _props$theme !== void 0 && _props$theme.rtl ? (0, _styledComponents.css)(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n border-right: 1px solid ", ";\n "])), function (props) {
|
|
17
|
+
return props.theme.colors.borderColor;
|
|
18
|
+
}) : (0, _styledComponents.css)(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n border-left: 1px solid ", ";\n "])), function (props) {
|
|
19
|
+
return props.theme.colors.borderColor;
|
|
20
|
+
});
|
|
21
|
+
});
|
|
22
|
+
exports.Container = Container;
|
|
23
|
+
var Header = _styledComponents.default.div(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n display: flex;\n align-items: center;\n justify-content: space-between;\n position: relative;\n h1 {\n font-size: 20px;\n font-weight: 700;\n margin: 5px 0;\n color: ", ";\n\n ", "\n }\n"])), function (props) {
|
|
24
|
+
return props.theme.colors.headingColor;
|
|
25
|
+
}, function (props) {
|
|
26
|
+
var _props$theme2;
|
|
27
|
+
return (_props$theme2 = props.theme) !== null && _props$theme2 !== void 0 && _props$theme2.rtl ? (0, _styledComponents.css)(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n margin-left: 80px;\n "]))) : (0, _styledComponents.css)(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n margin-right: 80px;\n "])));
|
|
28
|
+
});
|
|
29
|
+
exports.Header = Header;
|
|
30
|
+
var ActionBlock = _styledComponents.default.div(_templateObject7 || (_templateObject7 = _taggedTemplateLiteral(["\n background: ", ";\n position: absolute;\n z-index: 1000;\n display: flex;\n align-items: center;\n > button {\n display: none;\n }\n\n ", "\n\n @media (min-width: 1000px) {\n > button {\n display: block;\n ", "\n }\n }\n"])), function (props) {
|
|
31
|
+
var _props$theme$colors;
|
|
32
|
+
return ((_props$theme$colors = props.theme.colors) === null || _props$theme$colors === void 0 ? void 0 : _props$theme$colors.backgroundPage) || '#FFF';
|
|
33
|
+
}, function (props) {
|
|
34
|
+
var _props$theme3;
|
|
35
|
+
return (_props$theme3 = props.theme) !== null && _props$theme3 !== void 0 && _props$theme3.rtl ? (0, _styledComponents.css)(_templateObject8 || (_templateObject8 = _taggedTemplateLiteral(["\n left: 0px;\n "]))) : (0, _styledComponents.css)(_templateObject9 || (_templateObject9 = _taggedTemplateLiteral(["\n right: 0px;\n "])));
|
|
36
|
+
}, function (props) {
|
|
37
|
+
var _props$theme4;
|
|
38
|
+
return (_props$theme4 = props.theme) !== null && _props$theme4 !== void 0 && _props$theme4.rtl ? (0, _styledComponents.css)(_templateObject10 || (_templateObject10 = _taggedTemplateLiteral(["\n margin-right: 10px;\n "]))) : (0, _styledComponents.css)(_templateObject11 || (_templateObject11 = _taggedTemplateLiteral(["\n margin-left: 10px;\n "])));
|
|
39
|
+
});
|
|
40
|
+
exports.ActionBlock = ActionBlock;
|
|
41
|
+
var ActionSelectorWrapper = _styledComponents.default.div(_templateObject12 || (_templateObject12 = _taggedTemplateLiteral(["\n button {\n display: flex;\n background: transparent !important;\n border: none;\n padding: 5px;\n border-radius: 8px;\n\n &:active,\n &:focus {\n border-color: unset !important;\n box-shadow: none !important;\n }\n svg {\n color: ", ";\n font-size: 20px;\n }\n\n &:after {\n display: none;\n }\n\n &:hover {\n background: ", " !important;\n }\n &:active {\n background: ", " !important;\n }\n }\n\n .show {\n >div {\n border: 1px solid ", ";\n box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.12);\n }\n }\n\n > div {\n > div {\n border-radius: 8px;\n .dropdown-item {\n font-size: 12px;\n color: ", ";\n padding: 7px 20px;\n &:active {\n background: ", " !important;\n }\n }\n .dropdown-item:last-child {\n color: ", ";\n }\n }\n }\n"])), function (props) {
|
|
42
|
+
return props.theme.colors.headingColor;
|
|
43
|
+
}, function (props) {
|
|
44
|
+
return (0, _polished.darken)(0.04, props.theme.colors.secundary);
|
|
45
|
+
}, function (props) {
|
|
46
|
+
return (0, _polished.darken)(0.1, props.theme.colors.secundaryDarkContrast);
|
|
47
|
+
}, function (props) {
|
|
48
|
+
return props.theme.colors.borderColor;
|
|
49
|
+
}, function (props) {
|
|
50
|
+
return props.theme.colors.headingColor;
|
|
51
|
+
}, function (props) {
|
|
52
|
+
return (0, _polished.darken)(0.1, props.theme.colors.secundary);
|
|
53
|
+
}, function (props) {
|
|
54
|
+
return props.theme.colors.danger;
|
|
55
|
+
});
|
|
56
|
+
exports.ActionSelectorWrapper = ActionSelectorWrapper;
|
|
57
|
+
var Content = _styledComponents.default.form(_templateObject13 || (_templateObject13 = _taggedTemplateLiteral(["\n margin-top: 30px;\n label {\n font-weight: 400;\n font-size: 14px;\n margin-bottom: 10px;\n }\n input {\n height: 44px;\n width: 100%;\n }\n"])));
|
|
58
|
+
exports.Content = Content;
|
|
59
|
+
var ButtonWrapper = _styledComponents.default.div(_templateObject14 || (_templateObject14 = _taggedTemplateLiteral(["\n position: sticky;\n top: 100%;\n\n button {\n height: 44px;\n }\n"])));
|
|
60
|
+
exports.ButtonWrapper = ButtonWrapper;
|
|
61
|
+
var HideSubmitBtn = _styledComponents.default.button(_templateObject15 || (_templateObject15 = _taggedTemplateLiteral(["\n display: none;\n"])));
|
|
62
|
+
exports.HideSubmitBtn = HideSubmitBtn;
|
|
63
|
+
var OptionList = _styledComponents.default.div(_templateObject16 || (_templateObject16 = _taggedTemplateLiteral(["\n margin-top: 35px;\n"])));
|
|
64
|
+
exports.OptionList = OptionList;
|
|
65
|
+
var AddBtn = _styledComponents.default.span(_templateObject17 || (_templateObject17 = _taggedTemplateLiteral(["\n font-weight: 400;\n font-size: 14px;\n display: block;\n margin: 10px 0px;\n cursor: pointer;\n user-select: none;\n color: ", ";\n transition: color 0.2s ease;\n\n &:hover {\n color: ", ";\n }\n"])), function (props) {
|
|
66
|
+
return props.theme.colors.lightGray;
|
|
67
|
+
}, function (props) {
|
|
68
|
+
return props.theme.colors.primary;
|
|
69
|
+
});
|
|
70
|
+
exports.AddBtn = AddBtn;
|
|
71
|
+
var CheckWrapper = _styledComponents.default.div(_templateObject18 || (_templateObject18 = _taggedTemplateLiteral(["\n display: flex;\n align-items: center;\n\n .check-box {\n cursor: pointer !important;\n }\n\n span {\n svg {\n cursor: pointer !important;\n font-size: 16px;\n color: ", ";\n\n &.active {\n color: ", ";\n }\n }\n }\n\n > label {\n margin-bottom: 0;\n display: flex;\n align-items: center;\n font-size: 14px;\n margin-left: 20px;\n ", "\n }\n"])), function (props) {
|
|
72
|
+
return props.theme.colors.secundaryLight;
|
|
73
|
+
}, function (props) {
|
|
74
|
+
return props.theme.colors.primary;
|
|
75
|
+
}, function (props) {
|
|
76
|
+
return props.theme.rtl && (0, _styledComponents.css)(_templateObject19 || (_templateObject19 = _taggedTemplateLiteral(["\n margin-right: 20px;\n margin-left: 0px;\n "])));
|
|
77
|
+
});
|
|
78
|
+
exports.CheckWrapper = CheckWrapper;
|
|
79
|
+
var PlaceItemContainer = _styledComponents.default.div(_templateObject20 || (_templateObject20 = _taggedTemplateLiteral(["\n display: flex;\n align-items: center;\n padding: 12px 0;\n border-bottom: 1px solid ", ";\n border-top: 1px solid transparent;\n justify-content: space-between;\n transition: all 0.3s linear;\n cursor: pointer;\n\n &:hover {\n background: ", ";\n }\n\n ", "\n\n ", "\n\n > svg {\n font-size: 16px;\n color: ", ";\n }\n"])), function (props) {
|
|
80
|
+
return props.theme.colors.borderColor;
|
|
81
|
+
}, function (props) {
|
|
82
|
+
return props.theme.colors.secundary;
|
|
83
|
+
}, function (_ref) {
|
|
84
|
+
var active = _ref.active;
|
|
85
|
+
return active && (0, _styledComponents.css)(_templateObject21 || (_templateObject21 = _taggedTemplateLiteral(["\n background: ", ";\n border-top: 1px solid ", ";\n border-bottom: 1px solid ", ";\n "])), function (props) {
|
|
86
|
+
return props.theme.colors.backgroundInfo;
|
|
87
|
+
}, function (props) {
|
|
88
|
+
return props.theme.colors.primary;
|
|
89
|
+
}, function (props) {
|
|
90
|
+
return props.theme.colors.primary;
|
|
91
|
+
});
|
|
92
|
+
}, function (_ref2) {
|
|
93
|
+
var notAllow = _ref2.notAllow;
|
|
94
|
+
return notAllow && (0, _styledComponents.css)(_templateObject22 || (_templateObject22 = _taggedTemplateLiteral(["\n cursor: not-allowed;\n * {\n cursor: not-allowed;\n }\n "])));
|
|
95
|
+
}, function (props) {
|
|
96
|
+
return props.theme.colors.secundaryLight;
|
|
97
|
+
});
|
|
98
|
+
exports.PlaceItemContainer = PlaceItemContainer;
|
|
99
|
+
var TableHead = _styledComponents.default.div(_templateObject23 || (_templateObject23 = _taggedTemplateLiteral(["\n display: flex;\n align-items: center;\n padding-bottom: 8px;\n border-bottom: 1px solid ", ";\n\n label {\n font-weight: 700;\n }\n"])), function (props) {
|
|
100
|
+
return props.theme.colors.secundaryLight;
|
|
101
|
+
});
|
|
102
|
+
exports.TableHead = TableHead;
|
|
@@ -125,6 +125,18 @@ var BusinessPreorderDetails = function BusinessPreorderDetails(props) {
|
|
|
125
125
|
color: "primary",
|
|
126
126
|
disabled: formState.loading || Object.keys(formState.changes).length === 0,
|
|
127
127
|
onClick: handleUpdateBusinessClick
|
|
128
|
-
}, t('SAVE', 'Save'))))
|
|
128
|
+
}, t('SAVE', 'Save'))), /*#__PURE__*/_react.default.createElement(_styles3.Divider, null), /*#__PURE__*/_react.default.createElement(_BusinessCateringDelivery.BusinessCateringDelivery, {
|
|
129
|
+
minutes: minutes,
|
|
130
|
+
type: "catering_delivery",
|
|
131
|
+
business: business,
|
|
132
|
+
changePreorderConfigs: changePreorderConfigs,
|
|
133
|
+
disabled: actionStatus === null || actionStatus === void 0 ? void 0 : actionStatus.loading
|
|
134
|
+
}), /*#__PURE__*/_react.default.createElement(_BusinessCateringDelivery.BusinessCateringDelivery, {
|
|
135
|
+
minutes: minutes,
|
|
136
|
+
type: "catering_pickup",
|
|
137
|
+
business: business,
|
|
138
|
+
changePreorderConfigs: changePreorderConfigs,
|
|
139
|
+
disabled: actionStatus === null || actionStatus === void 0 ? void 0 : actionStatus.loading
|
|
140
|
+
}), /*#__PURE__*/_react.default.createElement(_styles2.Margin, null));
|
|
129
141
|
};
|
|
130
142
|
exports.BusinessPreorderDetails = BusinessPreorderDetails;
|
|
@@ -31,7 +31,7 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
|
31
31
|
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
|
32
32
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
33
33
|
var BusinessProductList = function BusinessProductList(props) {
|
|
34
|
-
var _businessState$busine, _businessState$busine2, _businessState$busine3, _categoryState$produc, _categoryState$pagina, _businessState$busine4, _businessState$busine5;
|
|
34
|
+
var _businessState$busine, _businessState$busine2, _businessState$busine3, _categoryState$produc, _categoryState$pagina, _businessState$busine4, _businessState$busine5, _businessState$busine6, _businessState$busine7;
|
|
35
35
|
var productDetailsId = props.productDetailsId,
|
|
36
36
|
categoryState = props.categoryState,
|
|
37
37
|
viewMethod = props.viewMethod,
|
|
@@ -177,7 +177,7 @@ var BusinessProductList = function BusinessProductList(props) {
|
|
|
177
177
|
category: categoryState,
|
|
178
178
|
isLastProduct: currentProducts.length - 1 === i
|
|
179
179
|
}));
|
|
180
|
-
})))), /*#__PURE__*/_react.default.createElement(_styles.ProductListBottom, null, !businessState.loading && (businessState === null || businessState === void 0 ? void 0 : (_businessState$busine2 = businessState.business) === null || _businessState$busine2 === void 0 ? void 0 : (_businessState$busine3 = _businessState$busine2.categories) === null || _businessState$busine3 === void 0 ? void 0 : _businessState$busine3.length) > 0 && /*#__PURE__*/_react.default.createElement(_styles.AddProductBtn, {
|
|
180
|
+
})))), /*#__PURE__*/_react.default.createElement(_styles.ProductListBottom, null, !businessState.loading && (businessState === null || businessState === void 0 ? void 0 : (_businessState$busine2 = businessState.business) === null || _businessState$busine2 === void 0 ? void 0 : (_businessState$busine3 = _businessState$busine2.categories) === null || _businessState$busine3 === void 0 ? void 0 : _businessState$busine3.length) > 0 && categorySelected && /*#__PURE__*/_react.default.createElement(_styles.AddProductBtn, {
|
|
181
181
|
onClick: function onClick() {
|
|
182
182
|
return handleParentProductAdd(true);
|
|
183
183
|
}
|
|
@@ -187,7 +187,7 @@ var BusinessProductList = function BusinessProductList(props) {
|
|
|
187
187
|
handleChangePage: handleChangePage,
|
|
188
188
|
defaultPageSize: productsPerPage,
|
|
189
189
|
handleChangePageSize: handleChangePageSize
|
|
190
|
-
})), !businessState.loading && (businessState === null || businessState === void 0 ? void 0 : (_businessState$busine4 = businessState.business) === null || _businessState$busine4 === void 0 ? void 0 : (_businessState$busine5 = _businessState$busine4.categories) === null || _businessState$busine5 === void 0 ? void 0 : _businessState$busine5.length) === 0 && /*#__PURE__*/_react.default.createElement(_styles.WrapperNotFound, null, t('CREATE_CATEGORY_BEFORE_PRODUCT', 'Please create a category before adding your products.'))), viewMethod === 'spreedsheet' && /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_styles.ProductListSpreadContainer, null, categoryState.loading || businessState.loading ? /*#__PURE__*/_react.default.createElement(_styles.BusinessProductListTable, null, _toConsumableArray(Array(15).keys()).map(function (i) {
|
|
190
|
+
})), !businessState.loading && (businessState === null || businessState === void 0 ? void 0 : (_businessState$busine4 = businessState.business) === null || _businessState$busine4 === void 0 ? void 0 : (_businessState$busine5 = _businessState$busine4.categories) === null || _businessState$busine5 === void 0 ? void 0 : _businessState$busine5.length) === 0 && /*#__PURE__*/_react.default.createElement(_styles.WrapperNotFound, null, t('CREATE_CATEGORY_BEFORE_PRODUCT', 'Please create a category before adding your products.')), !businessState.loading && (businessState === null || businessState === void 0 ? void 0 : (_businessState$busine6 = businessState.business) === null || _businessState$busine6 === void 0 ? void 0 : (_businessState$busine7 = _businessState$busine6.categories) === null || _businessState$busine7 === void 0 ? void 0 : _businessState$busine7.length) > 0 && !categorySelected && /*#__PURE__*/_react.default.createElement(_styles.WrapperNotFound, null, t('SELECT_CATEGORY_BEFORE_PRODUCT', 'Please select a category before adding your products.'))), viewMethod === 'spreedsheet' && /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_styles.ProductListSpreadContainer, null, categoryState.loading || businessState.loading ? /*#__PURE__*/_react.default.createElement(_styles.BusinessProductListTable, null, _toConsumableArray(Array(15).keys()).map(function (i) {
|
|
191
191
|
return /*#__PURE__*/_react.default.createElement(_SingleBusinessProduct.SingleBusinessProduct, {
|
|
192
192
|
key: i,
|
|
193
193
|
isSkeleton: true,
|
|
@@ -490,7 +490,8 @@ var BusinessProductsListingUI = function BusinessProductsListingUI(props) {
|
|
|
490
490
|
return setShowPopup(false);
|
|
491
491
|
},
|
|
492
492
|
orderingBusiness: businessState === null || businessState === void 0 ? void 0 : businessState.business,
|
|
493
|
-
getBusiness: getBusiness
|
|
493
|
+
getBusiness: getBusiness,
|
|
494
|
+
handleOpenCategoryDetails: handleOpenCategoryDetails
|
|
494
495
|
})), /*#__PURE__*/_react.default.createElement(_Shared.Modal, {
|
|
495
496
|
width: "769px",
|
|
496
497
|
padding: "30px",
|
|
@@ -41,7 +41,8 @@ var BusinessSummary = function BusinessSummary(props) {
|
|
|
41
41
|
handleSelectedItem = props.handleSelectedItem,
|
|
42
42
|
handleDuplicateBusiness = props.handleDuplicateBusiness,
|
|
43
43
|
handleDeleteBusiness = props.handleDeleteBusiness,
|
|
44
|
-
extraOpen = props.extraOpen
|
|
44
|
+
extraOpen = props.extraOpen,
|
|
45
|
+
spoonityConfig = props.spoonityConfig;
|
|
45
46
|
var _useLanguage = (0, _orderingComponentsAdminExternal.useLanguage)(),
|
|
46
47
|
_useLanguage2 = _slicedToArray(_useLanguage, 2),
|
|
47
48
|
t = _useLanguage2[1];
|
|
@@ -90,7 +91,7 @@ var BusinessSummary = function BusinessSummary(props) {
|
|
|
90
91
|
var _businessState$busine2;
|
|
91
92
|
window.open("https://".concat(ordering.project, ".tryordering.com/store/").concat(businessState === null || businessState === void 0 ? void 0 : (_businessState$busine2 = businessState.business) === null || _businessState$busine2 === void 0 ? void 0 : _businessState$busine2.slug), '_blank');
|
|
92
93
|
};
|
|
93
|
-
var itemsExcluded = ['publishing'];
|
|
94
|
+
var itemsExcluded = !!spoonityConfig ? ['publishing'] : ['publishing', 'spoonity_key'];
|
|
94
95
|
var businessConfigs = [{
|
|
95
96
|
key: 'store_details',
|
|
96
97
|
value: t('STORE_DETAILS', 'Store details')
|
|
@@ -141,6 +142,12 @@ var BusinessSummary = function BusinessSummary(props) {
|
|
|
141
142
|
}, {
|
|
142
143
|
key: 'webhooks',
|
|
143
144
|
value: t('WEBHOOKS', 'Webhooks')
|
|
145
|
+
}, {
|
|
146
|
+
key: 'places',
|
|
147
|
+
value: t('PLACES', 'Places')
|
|
148
|
+
}, {
|
|
149
|
+
key: 'spoonity_key',
|
|
150
|
+
value: t('SPOONITY_KEY', 'Sponity key')
|
|
144
151
|
}];
|
|
145
152
|
var onClickDeleteBusiness = function onClickDeleteBusiness() {
|
|
146
153
|
setConfirm({
|
|
@@ -233,7 +240,9 @@ var BusinessSummary = function BusinessSummary(props) {
|
|
|
233
240
|
width: 300
|
|
234
241
|
}) : businessState === null || businessState === void 0 ? void 0 : (_businessState$busine7 = businessState.business) === null || _businessState$busine7 === void 0 ? void 0 : _businessState$busine7.description), /*#__PURE__*/_react.default.createElement(_styles2.BusinessConfigsContainer, {
|
|
235
242
|
isLoading: businessState === null || businessState === void 0 ? void 0 : businessState.loading
|
|
236
|
-
}, (isAdmin ? businessConfigs : businessConfigs.filter(function (
|
|
243
|
+
}, (isAdmin ? !!spoonityConfig ? businessConfigs : businessConfigs.filter(function (configs) {
|
|
244
|
+
return configs.key !== 'spoonity_key';
|
|
245
|
+
}) : businessConfigs.filter(function (c) {
|
|
237
246
|
return !itemsExcluded.includes(c.key);
|
|
238
247
|
})).map(function (config) {
|
|
239
248
|
return /*#__PURE__*/_react.default.createElement(_styles2.BusinessConfigItem, {
|
|
@@ -28,6 +28,7 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
|
28
28
|
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
|
29
29
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
30
30
|
var ProductStepUI = function ProductStepUI(props) {
|
|
31
|
+
var _actionState$content, _actionState$content2;
|
|
31
32
|
var onClose = props.onClose,
|
|
32
33
|
businessList = props.businessList,
|
|
33
34
|
setBusiness = props.setBusiness,
|
|
@@ -37,7 +38,8 @@ var ProductStepUI = function ProductStepUI(props) {
|
|
|
37
38
|
business = props.business,
|
|
38
39
|
isLoading = props.isLoading,
|
|
39
40
|
orderingBusiness = props.orderingBusiness,
|
|
40
|
-
countriesState = props.countriesState
|
|
41
|
+
countriesState = props.countriesState,
|
|
42
|
+
handleOpenCategoryDetails = props.handleOpenCategoryDetails;
|
|
41
43
|
var theme = (0, _styledComponents.useTheme)();
|
|
42
44
|
var _useLanguage = (0, _orderingComponentsAdminExternal.useLanguage)(),
|
|
43
45
|
_useLanguage2 = _slicedToArray(_useLanguage, 2),
|
|
@@ -62,6 +64,10 @@ var ProductStepUI = function ProductStepUI(props) {
|
|
|
62
64
|
});
|
|
63
65
|
onClose();
|
|
64
66
|
};
|
|
67
|
+
var handleAddManuallyProduct = function handleAddManuallyProduct() {
|
|
68
|
+
onClose();
|
|
69
|
+
handleOpenCategoryDetails();
|
|
70
|
+
};
|
|
65
71
|
return /*#__PURE__*/_react.default.createElement(_styles2.Container, null, step === 1 && /*#__PURE__*/_react.default.createElement(_ProductStartGuide.ProductStartGuide, {
|
|
66
72
|
onClose: onClose,
|
|
67
73
|
setStep: setStep,
|
|
@@ -80,7 +86,7 @@ var ProductStepUI = function ProductStepUI(props) {
|
|
|
80
86
|
}), step === 3 && option === 2 && (actionState === null || actionState === void 0 ? void 0 : actionState.loading) && /*#__PURE__*/_react.default.createElement(_styles2.ImportMenuContainer, null, /*#__PURE__*/_react.default.createElement("h2", null, t('WE_ARE_IMPORTING_YOUR_MENU', 'We are importing your menu.')), /*#__PURE__*/_react.default.createElement(_styles2.ImageContent, null, /*#__PURE__*/_react.default.createElement("img", {
|
|
81
87
|
src: theme.images.general.importMenu,
|
|
82
88
|
alt: ""
|
|
83
|
-
}))), step === 3 && option === 2 && !(actionState !== null && actionState !== void 0 && actionState.loading) && /*#__PURE__*/_react.default.createElement(_styles2.ImportMenuContainer, null, /*#__PURE__*/_react.default.createElement("h2", null, t('YOUR_MENU_HAS_BEEN_IMPORTED', 'Your menu has been imported')), /*#__PURE__*/_react.default.createElement(_styles2.ImageContent, null, /*#__PURE__*/_react.default.createElement("img", {
|
|
89
|
+
}))), step === 3 && option === 2 && !(actionState !== null && actionState !== void 0 && actionState.loading) && (actionState === null || actionState === void 0 ? void 0 : (_actionState$content = actionState.content) === null || _actionState$content === void 0 ? void 0 : _actionState$content.products) > 0 && /*#__PURE__*/_react.default.createElement(_styles2.ImportMenuContainer, null, /*#__PURE__*/_react.default.createElement("h2", null, t('YOUR_MENU_HAS_BEEN_IMPORTED', 'Your menu has been imported')), /*#__PURE__*/_react.default.createElement(_styles2.ImageContent, null, /*#__PURE__*/_react.default.createElement("img", {
|
|
84
90
|
src: theme.images.general.importedMenu,
|
|
85
91
|
alt: ""
|
|
86
92
|
})), /*#__PURE__*/_react.default.createElement(_styles2.ButtonWrapper, null, /*#__PURE__*/_react.default.createElement(_styles.Button, {
|
|
@@ -88,7 +94,13 @@ var ProductStepUI = function ProductStepUI(props) {
|
|
|
88
94
|
onClick: function onClick() {
|
|
89
95
|
return handleCheckMenu();
|
|
90
96
|
}
|
|
91
|
-
}, t('CHECK_MENU', 'Check menu')))), step ===
|
|
97
|
+
}, t('CHECK_MENU', 'Check menu')))), step === 3 && option === 2 && !(actionState !== null && actionState !== void 0 && actionState.loading) && (actionState === null || actionState === void 0 ? void 0 : (_actionState$content2 = actionState.content) === null || _actionState$content2 === void 0 ? void 0 : _actionState$content2.products) === 0 && /*#__PURE__*/_react.default.createElement(_styles2.ImportMenuContainer, null, /*#__PURE__*/_react.default.createElement("h2", null, t('YOUR_MENU_COULDNT__BE_IMPORTED', 'Your menu couldn\'t be imported')), /*#__PURE__*/_react.default.createElement(_styles2.ImageContent, null, /*#__PURE__*/_react.default.createElement("img", {
|
|
98
|
+
src: theme.images.general.importMenu,
|
|
99
|
+
alt: ""
|
|
100
|
+
})), /*#__PURE__*/_react.default.createElement(_styles2.ButtonWrapper, null, /*#__PURE__*/_react.default.createElement(_styles.Button, {
|
|
101
|
+
color: "primary",
|
|
102
|
+
onClick: handleAddManuallyProduct
|
|
103
|
+
}, t('ADD_PRODUCTS_MANUALLY', 'Add products manually')))), step === 2 && option === 3 && /*#__PURE__*/_react.default.createElement(_UploadMenuGuide.UploadMenuGuide, {
|
|
92
104
|
handleBack: function handleBack() {
|
|
93
105
|
return setStep(1);
|
|
94
106
|
},
|