ordering-ui-admin-external 1.43.86 → 1.43.88
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.89cc92ea829107eb0896.js → ordering-ui-admin.79d573230ba669643af1.js} +2 -2
- package/_modules/components/Orders/AllInOne/index.js +38 -38
- package/_modules/components/Orders/DeliveriesManager/index.js +13 -15
- package/_modules/components/Orders/OrderContactInformation/index.js +4 -2
- package/_modules/components/Orders/OrderDetails/index.js +3 -1
- package/_modules/components/Orders/OrdersContentHeader/index.js +4 -2
- package/_modules/components/Orders/OrdersFilterGroup/index.js +1 -2
- package/_modules/components/Orders/OrdersHeaderFilterGroup/index.js +4 -2
- package/_modules/components/Orders/OrdersManager/index.js +35 -33
- package/_modules/components/Stores/BusinessPaymentMethods/index.js +39 -2
- package/_modules/components/Stores/PaymentOptionStripeLink/index.js +347 -0
- package/_modules/components/Stores/PaymentOptionStripeLink/styles.js +57 -0
- package/_modules/components/Stores/ProductExtraOptionDetails/index.js +10 -8
- package/_modules/components/Stores/ProductExtraSuboption/index.js +13 -3
- package/_modules/components/Stores/index.js +7 -0
- package/_modules/index.js +6 -0
- package/package.json +2 -2
- package/src/components/Orders/AllInOne/index.js +5 -2
- package/src/components/Orders/DeliveriesManager/index.js +3 -2
- package/src/components/Orders/OrderContactInformation/index.js +3 -1
- package/src/components/Orders/OrderDetails/index.js +3 -1
- package/src/components/Orders/OrdersContentHeader/index.js +3 -1
- package/src/components/Orders/OrdersFilterGroup/index.js +0 -2
- package/src/components/Orders/OrdersHeaderFilterGroup/index.js +3 -1
- package/src/components/Orders/OrdersManager/index.js +7 -2
- package/src/components/Stores/BusinessPaymentMethods/index.js +41 -0
- package/src/components/Stores/PaymentOptionStripeLink/index.js +357 -0
- package/src/components/Stores/PaymentOptionStripeLink/styles.js +171 -0
- package/src/components/Stores/ProductExtraOptionDetails/index.js +5 -4
- package/src/components/Stores/ProductExtraSuboption/index.js +15 -3
- package/src/components/Stores/index.js +2 -0
- package/src/index.js +2 -0
- /package/_bundles/{ordering-ui-admin.89cc92ea829107eb0896.js.LICENSE.txt → ordering-ui-admin.79d573230ba669643af1.js.LICENSE.txt} +0 -0
|
@@ -0,0 +1,347 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.PaymentOptionStripeLink = void 0;
|
|
8
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
9
|
+
var _reactRouterDom = require("react-router-dom");
|
|
10
|
+
var _orderingComponentsAdminExternal = require("ordering-components-admin-external");
|
|
11
|
+
var _RiCheckboxBlankLine = _interopRequireDefault(require("@meronex/icons/ri/RiCheckboxBlankLine"));
|
|
12
|
+
var _RiCheckboxFill = _interopRequireDefault(require("@meronex/icons/ri/RiCheckboxFill"));
|
|
13
|
+
var _styles = require("../../../styles");
|
|
14
|
+
var _useWindowSize2 = require("../../../hooks/useWindowSize");
|
|
15
|
+
var _styledComponents = require("styled-components");
|
|
16
|
+
var _reactBootstrapIcons = require("react-bootstrap-icons");
|
|
17
|
+
var _reactBootstrap = require("react-bootstrap");
|
|
18
|
+
var _Shared = require("../../Shared");
|
|
19
|
+
var _utils = require("../../../utils");
|
|
20
|
+
var _styles2 = require("./styles");
|
|
21
|
+
var _styles3 = require("../BusinessMenu/styles");
|
|
22
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
23
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
24
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
25
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
26
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
27
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
28
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
29
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
30
|
+
function _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); }
|
|
31
|
+
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."); }
|
|
32
|
+
function _iterableToArray(r) { if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); }
|
|
33
|
+
function _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(r); }
|
|
34
|
+
function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
|
|
35
|
+
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."); }
|
|
36
|
+
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
37
|
+
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
38
|
+
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; } }
|
|
39
|
+
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
40
|
+
var PaymentOptionStripeLinkUI = function PaymentOptionStripeLinkUI(props) {
|
|
41
|
+
var _localState$sites, _businessPaymethod$si, _sitesState$sites2, _ref2, _changesState$sandbox, _changesState$data, _changesState$data2, _businessPaymethod$da, _changesState$data3, _changesState$data4, _businessPaymethod$da2, _changesState$data_sa, _changesState$data_sa2, _businessPaymethod$da3, _changesState$data_sa3, _changesState$data_sa4, _businessPaymethod$da4, _configsState$configs, _sitesState$sites3;
|
|
42
|
+
var open = props.open,
|
|
43
|
+
onClose = props.onClose,
|
|
44
|
+
orderTypes = props.orderTypes,
|
|
45
|
+
sitesState = props.sitesState,
|
|
46
|
+
configsState = props.configsState,
|
|
47
|
+
changesState = props.changesState,
|
|
48
|
+
handleChangeBusinessPaymentState = props.handleChangeBusinessPaymentState,
|
|
49
|
+
cleanChangesState = props.cleanChangesState,
|
|
50
|
+
actionState = props.actionState,
|
|
51
|
+
handleChangeSandbox = props.handleChangeSandbox,
|
|
52
|
+
handleChangeInput = props.handleChangeInput,
|
|
53
|
+
handleSaveClick = props.handleSaveClick,
|
|
54
|
+
businessPaymethod = props.businessPaymethod,
|
|
55
|
+
handleDeletePaymethod = props.handleDeletePaymethod,
|
|
56
|
+
handleUpdateConfigs = props.handleUpdateConfigs;
|
|
57
|
+
var query = new URLSearchParams((0, _reactRouterDom.useLocation)().search);
|
|
58
|
+
var theme = (0, _styledComponents.useTheme)();
|
|
59
|
+
var _useLanguage = (0, _orderingComponentsAdminExternal.useLanguage)(),
|
|
60
|
+
_useLanguage2 = _slicedToArray(_useLanguage, 2),
|
|
61
|
+
t = _useLanguage2[1];
|
|
62
|
+
var _useWindowSize = (0, _useWindowSize2.useWindowSize)(),
|
|
63
|
+
width = _useWindowSize.width;
|
|
64
|
+
var _useState = (0, _react.useState)(false),
|
|
65
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
66
|
+
isMenuOpen = _useState2[0],
|
|
67
|
+
setIsMenuOpen = _useState2[1];
|
|
68
|
+
var _useState3 = (0, _react.useState)(0),
|
|
69
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
70
|
+
paymentTabs = _useState4[0],
|
|
71
|
+
setPaymentTabs = _useState4[1];
|
|
72
|
+
var _useState5 = (0, _react.useState)({
|
|
73
|
+
open: false,
|
|
74
|
+
content: null,
|
|
75
|
+
handleOnAccept: null
|
|
76
|
+
}),
|
|
77
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
78
|
+
confirm = _useState6[0],
|
|
79
|
+
setConfirm = _useState6[1];
|
|
80
|
+
var _useState7 = (0, _react.useState)({
|
|
81
|
+
allowed_order_types: businessPaymethod === null || businessPaymethod === void 0 ? void 0 : businessPaymethod.allowed_order_types,
|
|
82
|
+
sites: businessPaymethod === null || businessPaymethod === void 0 ? void 0 : businessPaymethod.sites
|
|
83
|
+
}),
|
|
84
|
+
_useState8 = _slicedToArray(_useState7, 2),
|
|
85
|
+
localState = _useState8[0],
|
|
86
|
+
setLocalState = _useState8[1];
|
|
87
|
+
var filteredOptions = (_localState$sites = localState === null || localState === void 0 ? void 0 : localState.sites) !== null && _localState$sites !== void 0 ? _localState$sites : businessPaymethod === null || businessPaymethod === void 0 || (_businessPaymethod$si = businessPaymethod.sites) === null || _businessPaymethod$si === void 0 ? void 0 : _businessPaymethod$si.filter(function (a) {
|
|
88
|
+
var _sitesState$sites;
|
|
89
|
+
return sitesState === null || sitesState === void 0 || (_sitesState$sites = sitesState.sites) === null || _sitesState$sites === void 0 ? void 0 : _sitesState$sites.find(function (b) {
|
|
90
|
+
return a.id === b.id;
|
|
91
|
+
});
|
|
92
|
+
});
|
|
93
|
+
var _useState9 = (0, _react.useState)(!(filteredOptions !== null && filteredOptions !== void 0 && filteredOptions.length)),
|
|
94
|
+
_useState10 = _slicedToArray(_useState9, 2),
|
|
95
|
+
all = _useState10[0],
|
|
96
|
+
setAll = _useState10[1];
|
|
97
|
+
var configsToShow = {
|
|
98
|
+
allow_text_messages_sms: true,
|
|
99
|
+
allow_text_messages_whatsapp: true
|
|
100
|
+
};
|
|
101
|
+
var setPaymethodInfo = function setPaymethodInfo(values) {
|
|
102
|
+
var data = {};
|
|
103
|
+
if ((values === null || values === void 0 ? void 0 : values.value) === 'All') {
|
|
104
|
+
data[values.key] = [];
|
|
105
|
+
setAll(!all);
|
|
106
|
+
} else {
|
|
107
|
+
var _ref, _changesState$values$, _businessPaymethod$va;
|
|
108
|
+
var array = (_ref = (_changesState$values$ = changesState === null || changesState === void 0 ? void 0 : changesState[values.key]) !== null && _changesState$values$ !== void 0 ? _changesState$values$ : values.key === 'allowed_order_types' ? businessPaymethod === null || businessPaymethod === void 0 ? void 0 : businessPaymethod[values.key] : businessPaymethod === null || businessPaymethod === void 0 || (_businessPaymethod$va = businessPaymethod[values.key]) === null || _businessPaymethod$va === void 0 ? void 0 : _businessPaymethod$va.map(function (i) {
|
|
109
|
+
return i.id;
|
|
110
|
+
})) !== null && _ref !== void 0 ? _ref : [];
|
|
111
|
+
array = _toConsumableArray(new Set(array.includes(values.value) ? array.filter(function (item) {
|
|
112
|
+
return item !== values.value;
|
|
113
|
+
}) : [].concat(_toConsumableArray(array), [values.value])));
|
|
114
|
+
data[values.key] = array.length > 0 ? array : [];
|
|
115
|
+
if (values.key === 'sites') {
|
|
116
|
+
var _data$sites;
|
|
117
|
+
setAll(!(data !== null && data !== void 0 && (_data$sites = data.sites) !== null && _data$sites !== void 0 && _data$sites.length));
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
handleChangeBusinessPaymentState(data);
|
|
121
|
+
};
|
|
122
|
+
var actionSidebar = function actionSidebar(value) {
|
|
123
|
+
if (!value) {
|
|
124
|
+
props.onClose();
|
|
125
|
+
}
|
|
126
|
+
setIsMenuOpen(value);
|
|
127
|
+
};
|
|
128
|
+
var onClickDeletePaymethod = function onClickDeletePaymethod() {
|
|
129
|
+
setConfirm({
|
|
130
|
+
open: true,
|
|
131
|
+
content: t('QUESTION_DELETE_ITEM', 'Are you sure to delete this _item_?').replace('_item_', t('PAYMETHOD_ID', 'Paymethod')),
|
|
132
|
+
handleOnAccept: function handleOnAccept() {
|
|
133
|
+
var _businessPaymethod$pa;
|
|
134
|
+
setConfirm(_objectSpread(_objectSpread({}, confirm), {}, {
|
|
135
|
+
open: false
|
|
136
|
+
}));
|
|
137
|
+
handleDeletePaymethod(businessPaymethod === null || businessPaymethod === void 0 || (_businessPaymethod$pa = businessPaymethod.paymethod) === null || _businessPaymethod$pa === void 0 ? void 0 : _businessPaymethod$pa.id);
|
|
138
|
+
}
|
|
139
|
+
});
|
|
140
|
+
};
|
|
141
|
+
(0, _react.useEffect)(function () {
|
|
142
|
+
if (isMenuOpen) {
|
|
143
|
+
if (width < 1000) {
|
|
144
|
+
document.getElementById('stripe_link').style.width = '100%';
|
|
145
|
+
} else {
|
|
146
|
+
document.getElementById('stripe_link').style.width = '500px';
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
}, [width]);
|
|
150
|
+
(0, _react.useEffect)(function () {
|
|
151
|
+
if (!open) return;
|
|
152
|
+
actionSidebar(true);
|
|
153
|
+
}, [open]);
|
|
154
|
+
(0, _react.useEffect)(function () {
|
|
155
|
+
var initState = {
|
|
156
|
+
sandbox: businessPaymethod === null || businessPaymethod === void 0 ? void 0 : businessPaymethod.sandbox,
|
|
157
|
+
allowed_order_types: (businessPaymethod === null || businessPaymethod === void 0 ? void 0 : businessPaymethod.allowed_order_types) || [1, 2, 3, 4, 5]
|
|
158
|
+
};
|
|
159
|
+
if (businessPaymethod !== null && businessPaymethod !== void 0 && businessPaymethod.data) {
|
|
160
|
+
initState.data = businessPaymethod.data;
|
|
161
|
+
}
|
|
162
|
+
if (businessPaymethod !== null && businessPaymethod !== void 0 && businessPaymethod.data_sandbox) {
|
|
163
|
+
initState.data_sandbox = businessPaymethod.data_sandbox;
|
|
164
|
+
}
|
|
165
|
+
cleanChangesState(initState);
|
|
166
|
+
}, []);
|
|
167
|
+
(0, _react.useEffect)(function () {
|
|
168
|
+
var changes = {};
|
|
169
|
+
if (changesState !== null && changesState !== void 0 && changesState.allowed_order_types) changes.allowed_order_types = changesState === null || changesState === void 0 ? void 0 : changesState.allowed_order_types;
|
|
170
|
+
if (changesState !== null && changesState !== void 0 && changesState.sites) changes.sites = changesState === null || changesState === void 0 ? void 0 : changesState.sites;
|
|
171
|
+
if (Object.keys(changes).length > 0) setLocalState(JSON.parse(JSON.stringify(changes)));
|
|
172
|
+
}, [changesState === null || changesState === void 0 ? void 0 : changesState.sites, changesState === null || changesState === void 0 ? void 0 : changesState.allowed_order_types]);
|
|
173
|
+
var handleTabClick = function handleTabClick(tab, isInitialRender) {
|
|
174
|
+
setPaymentTabs(tab);
|
|
175
|
+
if (!isInitialRender) {
|
|
176
|
+
(0, _utils.addQueryToUrl)({
|
|
177
|
+
payemthod_tab: tab
|
|
178
|
+
});
|
|
179
|
+
}
|
|
180
|
+
};
|
|
181
|
+
(0, _react.useEffect)(function () {
|
|
182
|
+
var payemthodTab = query.get('payemthod_tab');
|
|
183
|
+
if (payemthodTab) {
|
|
184
|
+
handleTabClick(Number(payemthodTab), true);
|
|
185
|
+
} else {
|
|
186
|
+
handleTabClick(0);
|
|
187
|
+
}
|
|
188
|
+
}, []);
|
|
189
|
+
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_styles2.Container, {
|
|
190
|
+
id: "stripe_link"
|
|
191
|
+
}, /*#__PURE__*/_react.default.createElement(_styles2.Header, null, /*#__PURE__*/_react.default.createElement("h1", null, t('STRIPE_LINK', 'Stripe link (Only for callcenter)')), /*#__PURE__*/_react.default.createElement(_styles2.ActionSelectorWrapper, null, /*#__PURE__*/_react.default.createElement(_reactBootstrap.DropdownButton, {
|
|
192
|
+
menuAlign: theme !== null && theme !== void 0 && theme.rtl ? 'left' : 'right',
|
|
193
|
+
title: /*#__PURE__*/_react.default.createElement(_reactBootstrapIcons.ThreeDots, null),
|
|
194
|
+
id: theme !== null && theme !== void 0 && theme.rtl ? 'dropdown-menu-align-left' : 'dropdown-menu-align-right'
|
|
195
|
+
}, /*#__PURE__*/_react.default.createElement(_reactBootstrap.Dropdown.Item, {
|
|
196
|
+
onClick: function onClick() {
|
|
197
|
+
return onClickDeletePaymethod();
|
|
198
|
+
}
|
|
199
|
+
}, t('DELETE', 'Delete')))), /*#__PURE__*/_react.default.createElement(_styles2.CloseButton, null, /*#__PURE__*/_react.default.createElement(_styles.IconButton, {
|
|
200
|
+
color: "black",
|
|
201
|
+
onClick: function onClick() {
|
|
202
|
+
return onClose();
|
|
203
|
+
}
|
|
204
|
+
}, /*#__PURE__*/_react.default.createElement(_reactBootstrapIcons.XLg, null)))), /*#__PURE__*/_react.default.createElement("p", {
|
|
205
|
+
className: "message"
|
|
206
|
+
}, t('STRIPE_AND_TWILIO_CONFIGS_REQUIERED', 'Stripe and Twilio keys are requiered to use this Payment Method')), /*#__PURE__*/_react.default.createElement(_styles3.TabsContainer, null, /*#__PURE__*/_react.default.createElement(_styles3.Tab, {
|
|
207
|
+
active: paymentTabs === 0,
|
|
208
|
+
onClick: function onClick() {
|
|
209
|
+
return handleTabClick(0);
|
|
210
|
+
}
|
|
211
|
+
}, t('GENERAL', 'General')), (sitesState === null || sitesState === void 0 || (_sitesState$sites2 = sitesState.sites) === null || _sitesState$sites2 === void 0 ? void 0 : _sitesState$sites2.length) > 0 && /*#__PURE__*/_react.default.createElement(_styles3.Tab, {
|
|
212
|
+
active: paymentTabs === 1,
|
|
213
|
+
onClick: function onClick() {
|
|
214
|
+
return handleTabClick(1);
|
|
215
|
+
}
|
|
216
|
+
}, t('CHANNELS', 'Channels')), /*#__PURE__*/_react.default.createElement(_styles3.Tab, {
|
|
217
|
+
active: paymentTabs === 2,
|
|
218
|
+
onClick: function onClick() {
|
|
219
|
+
return handleTabClick(2);
|
|
220
|
+
}
|
|
221
|
+
}, t('ORDER_TYPE', 'Order type'))), paymentTabs === 0 && /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_styles2.SandboxWrapper, null, /*#__PURE__*/_react.default.createElement(_styles.Checkbox, {
|
|
222
|
+
checked: (_ref2 = (_changesState$sandbox = changesState === null || changesState === void 0 ? void 0 : changesState.sandbox) !== null && _changesState$sandbox !== void 0 ? _changesState$sandbox : businessPaymethod === null || businessPaymethod === void 0 ? void 0 : businessPaymethod.sandbox) !== null && _ref2 !== void 0 ? _ref2 : false,
|
|
223
|
+
onChange: function onChange(e) {
|
|
224
|
+
return handleChangeSandbox(e.target.checked);
|
|
225
|
+
}
|
|
226
|
+
}), /*#__PURE__*/_react.default.createElement("span", null, t('SANDBOX', 'Sandbox'))), /*#__PURE__*/_react.default.createElement(_styles2.FieldName, null, t('PUBLISHABLE_KEY', 'Publishable key')), /*#__PURE__*/_react.default.createElement(_styles.Input, {
|
|
227
|
+
name: "publishable",
|
|
228
|
+
defaultValue: changesState !== null && changesState !== void 0 && (_changesState$data = changesState.data) !== null && _changesState$data !== void 0 && _changesState$data.publishable ? changesState === null || changesState === void 0 || (_changesState$data2 = changesState.data) === null || _changesState$data2 === void 0 ? void 0 : _changesState$data2.publishable : businessPaymethod === null || businessPaymethod === void 0 || (_businessPaymethod$da = businessPaymethod.data) === null || _businessPaymethod$da === void 0 ? void 0 : _businessPaymethod$da.publishable,
|
|
229
|
+
placeholder: t('PUBLISHABLE_KEY', 'Publishable key'),
|
|
230
|
+
onChange: function onChange(e) {
|
|
231
|
+
return handleChangeInput(e, false);
|
|
232
|
+
}
|
|
233
|
+
}), /*#__PURE__*/_react.default.createElement(_styles2.FieldName, null, t('SECRET_KEY', 'Secret key')), /*#__PURE__*/_react.default.createElement(_styles.Input, {
|
|
234
|
+
name: "secret",
|
|
235
|
+
defaultValue: changesState !== null && changesState !== void 0 && (_changesState$data3 = changesState.data) !== null && _changesState$data3 !== void 0 && _changesState$data3.secret ? changesState === null || changesState === void 0 || (_changesState$data4 = changesState.data) === null || _changesState$data4 === void 0 ? void 0 : _changesState$data4.secret : businessPaymethod === null || businessPaymethod === void 0 || (_businessPaymethod$da2 = businessPaymethod.data) === null || _businessPaymethod$da2 === void 0 ? void 0 : _businessPaymethod$da2.secret,
|
|
236
|
+
placeholder: t('SECRET_KEY', 'Secret key'),
|
|
237
|
+
onChange: function onChange(e) {
|
|
238
|
+
return handleChangeInput(e, false);
|
|
239
|
+
}
|
|
240
|
+
}), /*#__PURE__*/_react.default.createElement(_styles2.FieldName, null, t('PUBLISHABLE_KEY', 'Publishable key'), " (", t('SANDBOX', 'Sandbox'), ")"), /*#__PURE__*/_react.default.createElement(_styles.Input, {
|
|
241
|
+
name: "publishable",
|
|
242
|
+
defaultValue: changesState !== null && changesState !== void 0 && (_changesState$data_sa = changesState.data_sandbox) !== null && _changesState$data_sa !== void 0 && _changesState$data_sa.publishable ? changesState === null || changesState === void 0 || (_changesState$data_sa2 = changesState.data_sandbox) === null || _changesState$data_sa2 === void 0 ? void 0 : _changesState$data_sa2.publishable : businessPaymethod === null || businessPaymethod === void 0 || (_businessPaymethod$da3 = businessPaymethod.data_sandbox) === null || _businessPaymethod$da3 === void 0 ? void 0 : _businessPaymethod$da3.publishable,
|
|
243
|
+
placeholder: "".concat(t('PUBLISHABLE_KEY', 'Publishable key'), " (").concat(t('SANDBOX', 'Sandbox'), ")"),
|
|
244
|
+
onChange: function onChange(e) {
|
|
245
|
+
return handleChangeInput(e, true);
|
|
246
|
+
}
|
|
247
|
+
}), /*#__PURE__*/_react.default.createElement(_styles2.FieldName, null, t('SECRECT_KEY', 'Secret key'), " (", t('SANDBOX', 'Sandbox'), ")"), /*#__PURE__*/_react.default.createElement(_styles.Input, {
|
|
248
|
+
name: "secret",
|
|
249
|
+
defaultValue: changesState !== null && changesState !== void 0 && (_changesState$data_sa3 = changesState.data_sandbox) !== null && _changesState$data_sa3 !== void 0 && _changesState$data_sa3.secret ? changesState === null || changesState === void 0 || (_changesState$data_sa4 = changesState.data_sandbox) === null || _changesState$data_sa4 === void 0 ? void 0 : _changesState$data_sa4.secret : businessPaymethod === null || businessPaymethod === void 0 || (_businessPaymethod$da4 = businessPaymethod.data_sandbox) === null || _businessPaymethod$da4 === void 0 ? void 0 : _businessPaymethod$da4.secret,
|
|
250
|
+
placeholder: "".concat(t('SECRECT_KEY', 'Secret key'), " (").concat(t('SANDBOX', 'Sandbox'), ")"),
|
|
251
|
+
onChange: function onChange(e) {
|
|
252
|
+
return handleChangeInput(e, true);
|
|
253
|
+
}
|
|
254
|
+
}), /*#__PURE__*/_react.default.createElement("p", {
|
|
255
|
+
className: "alert-message"
|
|
256
|
+
}, t('TWILIO_CONFIGURATION_MESSAGE', '*Enable these options after twilio configuration')), !(configsState !== null && configsState !== void 0 && configsState.loading) && (configsState === null || configsState === void 0 || (_configsState$configs = configsState.configs) === null || _configsState$configs === void 0 ? void 0 : _configsState$configs.filter(function (config) {
|
|
257
|
+
return configsToShow[config === null || config === void 0 ? void 0 : config.key];
|
|
258
|
+
}).map(function (config) {
|
|
259
|
+
var _config$options;
|
|
260
|
+
var options = config === null || config === void 0 || (_config$options = config.options) === null || _config$options === void 0 ? void 0 : _config$options.map(function (item) {
|
|
261
|
+
return {
|
|
262
|
+
value: item.value,
|
|
263
|
+
content: /*#__PURE__*/_react.default.createElement(_styles2.Option, null, t(item.text.toUpperCase()))
|
|
264
|
+
};
|
|
265
|
+
});
|
|
266
|
+
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_styles2.FieldName, null, config === null || config === void 0 ? void 0 : config.name), (config === null || config === void 0 ? void 0 : config.type) === 2 && options && /*#__PURE__*/_react.default.createElement(_styles.DefaultSelect, {
|
|
267
|
+
notAsync: true,
|
|
268
|
+
defaultValue: config === null || config === void 0 ? void 0 : config.value,
|
|
269
|
+
options: options,
|
|
270
|
+
onChange: function onChange(typeValue) {
|
|
271
|
+
return handleUpdateConfigs(config === null || config === void 0 ? void 0 : config.id, {
|
|
272
|
+
value: typeValue
|
|
273
|
+
});
|
|
274
|
+
},
|
|
275
|
+
placeholder: t('SELECT_A_OPTION', 'Select a option')
|
|
276
|
+
}));
|
|
277
|
+
}))), paymentTabs === 1 && (sitesState === null || sitesState === void 0 || (_sitesState$sites3 = sitesState.sites) === null || _sitesState$sites3 === void 0 ? void 0 : _sitesState$sites3.length) > 0 && /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_styles2.TabOption, {
|
|
278
|
+
key: "all",
|
|
279
|
+
onClick: function onClick() {
|
|
280
|
+
return setPaymethodInfo({
|
|
281
|
+
key: 'sites',
|
|
282
|
+
value: 'All'
|
|
283
|
+
});
|
|
284
|
+
}
|
|
285
|
+
}, all ? /*#__PURE__*/_react.default.createElement(_RiCheckboxFill.default, {
|
|
286
|
+
className: "fill"
|
|
287
|
+
}) : /*#__PURE__*/_react.default.createElement(_RiCheckboxBlankLine.default, null), /*#__PURE__*/_react.default.createElement(_styles2.TabOptionName, null, t('ALL', 'All'))), !all && (sitesState === null || sitesState === void 0 ? void 0 : sitesState.sites.map(function (site) {
|
|
288
|
+
var _ref3, _localState$sites2, _businessPaymethod$si2;
|
|
289
|
+
return /*#__PURE__*/_react.default.createElement(_styles2.TabOption, {
|
|
290
|
+
key: site.id,
|
|
291
|
+
onClick: function onClick() {
|
|
292
|
+
return setPaymethodInfo({
|
|
293
|
+
key: 'sites',
|
|
294
|
+
value: site.id
|
|
295
|
+
});
|
|
296
|
+
}
|
|
297
|
+
}, (_ref3 = (_localState$sites2 = localState === null || localState === void 0 ? void 0 : localState.sites) !== null && _localState$sites2 !== void 0 ? _localState$sites2 : businessPaymethod === null || businessPaymethod === void 0 || (_businessPaymethod$si2 = businessPaymethod.sites) === null || _businessPaymethod$si2 === void 0 ? void 0 : _businessPaymethod$si2.map(function (s) {
|
|
298
|
+
return s.id;
|
|
299
|
+
})) !== null && _ref3 !== void 0 && _ref3.includes(site.id) ? /*#__PURE__*/_react.default.createElement(_RiCheckboxFill.default, {
|
|
300
|
+
className: "fill"
|
|
301
|
+
}) : /*#__PURE__*/_react.default.createElement(_RiCheckboxBlankLine.default, null), /*#__PURE__*/_react.default.createElement(_styles2.TabOptionName, null, site.name));
|
|
302
|
+
}))), paymentTabs === 2 && orderTypes.map(function (type) {
|
|
303
|
+
var _ref4, _localState$allowed_o;
|
|
304
|
+
return /*#__PURE__*/_react.default.createElement(_styles2.TabOption, {
|
|
305
|
+
key: type.value,
|
|
306
|
+
onClick: function onClick() {
|
|
307
|
+
return setPaymethodInfo({
|
|
308
|
+
key: 'allowed_order_types',
|
|
309
|
+
value: type.value
|
|
310
|
+
});
|
|
311
|
+
}
|
|
312
|
+
}, (_ref4 = (_localState$allowed_o = localState === null || localState === void 0 ? void 0 : localState.allowed_order_types) !== null && _localState$allowed_o !== void 0 ? _localState$allowed_o : businessPaymethod === null || businessPaymethod === void 0 ? void 0 : businessPaymethod.allowed_order_types) !== null && _ref4 !== void 0 && _ref4.includes(type.value) ? /*#__PURE__*/_react.default.createElement(_RiCheckboxFill.default, {
|
|
313
|
+
className: "fill"
|
|
314
|
+
}) : /*#__PURE__*/_react.default.createElement(_RiCheckboxBlankLine.default, null), /*#__PURE__*/_react.default.createElement(_styles2.TabOptionName, null, type.text));
|
|
315
|
+
}), /*#__PURE__*/_react.default.createElement(_styles.Button, {
|
|
316
|
+
borderRadius: "5px",
|
|
317
|
+
color: "primary",
|
|
318
|
+
disabled: actionState.loading || Object.keys(changesState).length === 0,
|
|
319
|
+
onClick: function onClick() {
|
|
320
|
+
return handleSaveClick(businessPaymethod.id);
|
|
321
|
+
}
|
|
322
|
+
}, actionState.loading ? t('LOADING', 'Loading') : t('SAVE', 'Save'))), /*#__PURE__*/_react.default.createElement(_Shared.Confirm, {
|
|
323
|
+
width: "700px",
|
|
324
|
+
title: t('WEB_APPNAME', 'Ordering'),
|
|
325
|
+
content: confirm.content,
|
|
326
|
+
acceptText: t('ACCEPT', 'Accept'),
|
|
327
|
+
open: confirm.open,
|
|
328
|
+
onClose: function onClose() {
|
|
329
|
+
return setConfirm(_objectSpread(_objectSpread({}, confirm), {}, {
|
|
330
|
+
open: false
|
|
331
|
+
}));
|
|
332
|
+
},
|
|
333
|
+
onCancel: function onCancel() {
|
|
334
|
+
return setConfirm(_objectSpread(_objectSpread({}, confirm), {}, {
|
|
335
|
+
open: false
|
|
336
|
+
}));
|
|
337
|
+
},
|
|
338
|
+
onAccept: confirm.handleOnAccept,
|
|
339
|
+
closeOnBackdrop: false
|
|
340
|
+
}));
|
|
341
|
+
};
|
|
342
|
+
var PaymentOptionStripeLink = exports.PaymentOptionStripeLink = function PaymentOptionStripeLink(props) {
|
|
343
|
+
var paymentOptionStripeLinkProps = _objectSpread(_objectSpread({}, props), {}, {
|
|
344
|
+
UIComponent: PaymentOptionStripeLinkUI
|
|
345
|
+
});
|
|
346
|
+
return /*#__PURE__*/_react.default.createElement(_orderingComponentsAdminExternal.PaymentOptionStripeLink, paymentOptionStripeLinkProps);
|
|
347
|
+
};
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.TabOptionName = exports.TabOption = exports.SandboxWrapper = exports.Option = exports.Header = exports.FieldName = exports.Container = exports.CloseButton = exports.ActionSelectorWrapper = 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;
|
|
11
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
12
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
13
|
+
function _taggedTemplateLiteral(e, t) { return t || (t = e.slice(0)), Object.freeze(Object.defineProperties(e, { raw: { value: Object.freeze(t) } })); }
|
|
14
|
+
var Container = exports.Container = _styledComponents.default.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n padding: 20px;\n overflow: auto;\n transition: 0.3s;\n box-sizing: border-box;\n display: flex;\n flex-direction: column;\n\n > button {\n margin-top: 20px;\n padding: 5px 15px 35px;\n position: sticky;\n top: 100%;\n width: fit-content;\n height: 42px;\n }\n\n .message {\n margin: 0px;\n font-size: 12px;\n }\n\n .alert-message {\n margin: 30px 0 0 0;\n font-weight: 700;\n }\n\n .select {\n width: 100%;\n > div:first-child {\n padding: 8px 15px;\n }\n }\n\n @media (min-width: 1000px) {\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 #E9ECEF;\n "]))) : (0, _styledComponents.css)(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n border-left: 1px solid #E9ECEF;\n "])));
|
|
17
|
+
});
|
|
18
|
+
var Option = exports.Option = _styledComponents.default.div(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n display: flex;\n align-items: center;\n column-gap: 10px;\n font-size: 13px;\n line-height: 2;\n font-weight: 500;\n"])));
|
|
19
|
+
var SandboxWrapper = exports.SandboxWrapper = _styledComponents.default.div(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n margin-top: 30px;\n display: flex;\n align-items: center;\n color: ", ";\n span {\n ", "\n }\n"])), function (props) {
|
|
20
|
+
return props.theme.colors.headingColor;
|
|
21
|
+
}, function (props) {
|
|
22
|
+
var _props$theme2;
|
|
23
|
+
return (_props$theme2 = props.theme) !== null && _props$theme2 !== void 0 && _props$theme2.rtl ? (0, _styledComponents.css)(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n margin-right: 10px;\n "]))) : (0, _styledComponents.css)(_templateObject7 || (_templateObject7 = _taggedTemplateLiteral(["\n margin-left: 10px;\n "])));
|
|
24
|
+
});
|
|
25
|
+
var FieldName = exports.FieldName = _styledComponents.default.p(_templateObject8 || (_templateObject8 = _taggedTemplateLiteral(["\n color: ", ";\n margin: 30px 0 10px;\n"])), function (props) {
|
|
26
|
+
return props.theme.colors.headingColor;
|
|
27
|
+
});
|
|
28
|
+
var Header = exports.Header = _styledComponents.default.div(_templateObject9 || (_templateObject9 = _taggedTemplateLiteral(["\n display: flex;\n align-items: center;\n h1 {\n font-size: 20px;\n color: ", ";\n font-weight: 700;\n flex: 1;\n margin: 0;\n }\n"])), function (props) {
|
|
29
|
+
return props.theme.colors.headingColor;
|
|
30
|
+
});
|
|
31
|
+
var CloseButton = exports.CloseButton = _styledComponents.default.div(_templateObject10 || (_templateObject10 = _taggedTemplateLiteral(["\n display: none;\n @media (min-width: 1000px) {\n display: flex;\n align-items: center;\n }\n"])));
|
|
32
|
+
var TabOption = exports.TabOption = _styledComponents.default.div(_templateObject11 || (_templateObject11 = _taggedTemplateLiteral(["\n display: flex;\n align-items: center;\n padding: 12px 0;\n cursor: pointer;\n color: ", ";\n\n > svg {\n font-size: 20px;\n &.fill {\n color: ", ";\n }\n }\n"])), function (props) {
|
|
33
|
+
return props.theme.colors.headingColor;
|
|
34
|
+
}, function (props) {
|
|
35
|
+
return props.theme.colors.primary;
|
|
36
|
+
});
|
|
37
|
+
var TabOptionName = exports.TabOptionName = _styledComponents.default.span(_templateObject12 || (_templateObject12 = _taggedTemplateLiteral(["\n color: ", ";\n ", "\n"])), function (props) {
|
|
38
|
+
return props.theme.colors.headingColor;
|
|
39
|
+
}, function (props) {
|
|
40
|
+
var _props$theme3;
|
|
41
|
+
return (_props$theme3 = props.theme) !== null && _props$theme3 !== void 0 && _props$theme3.rtl ? (0, _styledComponents.css)(_templateObject13 || (_templateObject13 = _taggedTemplateLiteral(["\n margin-right: 10px;\n "]))) : (0, _styledComponents.css)(_templateObject14 || (_templateObject14 = _taggedTemplateLiteral(["\n margin-left: 10px;\n "])));
|
|
42
|
+
});
|
|
43
|
+
var ActionSelectorWrapper = exports.ActionSelectorWrapper = _styledComponents.default.div(_templateObject15 || (_templateObject15 = _taggedTemplateLiteral(["\n margin: 0 10px;\n button {\n background: transparent !important;\n border: none;\n padding: 0px 5px;\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 button {\n background: ", " !important;\n }\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 &:active {\n background: ", " !important;\n }\n }\n .dropdown-item:last-child {\n color: #E63757;\n }\n }\n }\n"])), function (props) {
|
|
44
|
+
return props.theme.colors.headingColor;
|
|
45
|
+
}, function (props) {
|
|
46
|
+
return (0, _polished.darken)(0.04, props.theme.colors.secundary);
|
|
47
|
+
}, function (props) {
|
|
48
|
+
return (0, _polished.darken)(0.1, props.theme.colors.secundary);
|
|
49
|
+
}, function (props) {
|
|
50
|
+
return (0, _polished.darken)(0.04, props.theme.colors.secundary);
|
|
51
|
+
}, function (props) {
|
|
52
|
+
return props.theme.colors.borderColor;
|
|
53
|
+
}, function (props) {
|
|
54
|
+
return props.theme.colors.headingColor;
|
|
55
|
+
}, function (props) {
|
|
56
|
+
return (0, _polished.darken)(0.1, props.theme.colors.secundary);
|
|
57
|
+
});
|
|
@@ -124,6 +124,10 @@ var ProductExtraOptionDetailsUI = function ProductExtraOptionDetailsUI(props) {
|
|
|
124
124
|
_useState14 = _slicedToArray(_useState13, 2),
|
|
125
125
|
isExtraOptionSnooze = _useState14[0],
|
|
126
126
|
setIsExtraOptionSnooze = _useState14[1];
|
|
127
|
+
var _useState15 = (0, _react.useState)(false),
|
|
128
|
+
_useState16 = _slicedToArray(_useState15, 2),
|
|
129
|
+
isDraggingExtraOption = _useState16[0],
|
|
130
|
+
setIsDraggingExtraOption = _useState16[1];
|
|
127
131
|
var handleClickSubOptionImage = function handleClickSubOptionImage(id) {
|
|
128
132
|
document.getElementById(id).click();
|
|
129
133
|
};
|
|
@@ -292,7 +296,9 @@ var ProductExtraOptionDetailsUI = function ProductExtraOptionDetailsUI(props) {
|
|
|
292
296
|
hanldeDragOver: hanldeDragOver,
|
|
293
297
|
handleDrop: handleDrop,
|
|
294
298
|
handleDragEnd: handleDragEnd,
|
|
295
|
-
handleDuplicateSubOption: handleDuplicateSubOption
|
|
299
|
+
handleDuplicateSubOption: handleDuplicateSubOption,
|
|
300
|
+
isDraggingExtraOption: isDraggingExtraOption,
|
|
301
|
+
setIsDraggingExtraOption: setIsDraggingExtraOption
|
|
296
302
|
});
|
|
297
303
|
}), isAddForm && /*#__PURE__*/_react.default.createElement(_styles2.AdddSubOptionForm, {
|
|
298
304
|
onSubmit: handleSubmit(handleAddOption)
|
|
@@ -302,7 +308,7 @@ var ProductExtraOptionDetailsUI = function ProductExtraOptionDetailsUI(props) {
|
|
|
302
308
|
name: "image",
|
|
303
309
|
control: control,
|
|
304
310
|
render: function render() {
|
|
305
|
-
var _changesState$
|
|
311
|
+
var _changesState$changes, _changesState$changes2;
|
|
306
312
|
return /*#__PURE__*/_react.default.createElement(_styles2.SubOptionImage, {
|
|
307
313
|
onClick: function onClick() {
|
|
308
314
|
return handleClickSubOptionImage('add_suboption_image');
|
|
@@ -319,12 +325,8 @@ var ProductExtraOptionDetailsUI = function ProductExtraOptionDetailsUI(props) {
|
|
|
319
325
|
return handleSubOptionFiles(dataTransfer.files, 'add_suboption_image');
|
|
320
326
|
},
|
|
321
327
|
accept: "image/png, image/jpeg, image/jpg",
|
|
322
|
-
disabled: optionState.loading
|
|
323
|
-
}, changesState
|
|
324
|
-
src: changesState === null || changesState === void 0 || (_changesState$result2 = changesState.result) === null || _changesState$result2 === void 0 ? void 0 : _changesState$result2.image,
|
|
325
|
-
alt: "sub option image",
|
|
326
|
-
loading: "lazy"
|
|
327
|
-
}) : (changesState === null || changesState === void 0 || (_changesState$changes = changesState.changes) === null || _changesState$changes === void 0 ? void 0 : _changesState$changes.image) && editSubOptionId === null && /*#__PURE__*/_react.default.createElement("img", {
|
|
328
|
+
disabled: optionState.loading || isDraggingExtraOption
|
|
329
|
+
}, (changesState === null || changesState === void 0 || (_changesState$changes = changesState.changes) === null || _changesState$changes === void 0 ? void 0 : _changesState$changes.image) && editSubOptionId === null && /*#__PURE__*/_react.default.createElement("img", {
|
|
328
330
|
src: changesState === null || changesState === void 0 || (_changesState$changes2 = changesState.changes) === null || _changesState$changes2 === void 0 ? void 0 : _changesState$changes2.image,
|
|
329
331
|
alt: "sub option image",
|
|
330
332
|
loading: "lazy"
|
|
@@ -52,7 +52,9 @@ var ProductExtraSuboption = exports.ProductExtraSuboption = function ProductExtr
|
|
|
52
52
|
hanldeDragOver = props.hanldeDragOver,
|
|
53
53
|
handleDrop = props.handleDrop,
|
|
54
54
|
handleDragEnd = props.handleDragEnd,
|
|
55
|
-
handleDuplicateSubOption = props.handleDuplicateSubOption
|
|
55
|
+
handleDuplicateSubOption = props.handleDuplicateSubOption,
|
|
56
|
+
isDraggingExtraOption = props.isDraggingExtraOption,
|
|
57
|
+
setIsDraggingExtraOption = props.setIsDraggingExtraOption;
|
|
56
58
|
var theme = (0, _styledComponents.useTheme)();
|
|
57
59
|
var _useLanguage = (0, _orderingComponentsAdminExternal.useLanguage)(),
|
|
58
60
|
_useLanguage2 = _slicedToArray(_useLanguage, 2),
|
|
@@ -177,6 +179,13 @@ var ProductExtraSuboption = exports.ProductExtraSuboption = function ProductExtr
|
|
|
177
179
|
});
|
|
178
180
|
setExternalIdOpen(false);
|
|
179
181
|
};
|
|
182
|
+
var handleDropSubOption = function handleDropSubOption(e, subOption) {
|
|
183
|
+
setIsDraggingExtraOption(false);
|
|
184
|
+
handleDrop(e, subOption);
|
|
185
|
+
};
|
|
186
|
+
var handleDragStartSubOption = function handleDragStartSubOption() {
|
|
187
|
+
setIsDraggingExtraOption(true);
|
|
188
|
+
};
|
|
180
189
|
(0, _react.useEffect)(function () {
|
|
181
190
|
if (Object.keys(errors).length > 0) {
|
|
182
191
|
setAlertState({
|
|
@@ -202,11 +211,12 @@ var ProductExtraSuboption = exports.ProductExtraSuboption = function ProductExtr
|
|
|
202
211
|
onSubmit: handleSubmit(onSubmit),
|
|
203
212
|
isDragOver: dragoverSubOptionId === subOption.id,
|
|
204
213
|
isBorderBottom: isSubOptionsBottom && isLastSubOption,
|
|
214
|
+
onDragStart: handleDragStartSubOption,
|
|
205
215
|
onDragOver: function onDragOver(e) {
|
|
206
216
|
return hanldeDragOver(e, subOption, isLastSubOption);
|
|
207
217
|
},
|
|
208
218
|
onDrop: function onDrop(e) {
|
|
209
|
-
return
|
|
219
|
+
return handleDropSubOption(e, subOption);
|
|
210
220
|
},
|
|
211
221
|
onDragEnd: handleDragEnd,
|
|
212
222
|
className: "draggable-suboption"
|
|
@@ -233,7 +243,7 @@ var ProductExtraSuboption = exports.ProductExtraSuboption = function ProductExtr
|
|
|
233
243
|
return handleSubOptionFiles(dataTransfer.files, subOption.id);
|
|
234
244
|
},
|
|
235
245
|
accept: "image/png, image/jpeg, image/jpg",
|
|
236
|
-
disabled: optionState.loading
|
|
246
|
+
disabled: optionState.loading || isDraggingExtraOption
|
|
237
247
|
}, changesState !== null && changesState !== void 0 && (_changesState$result = changesState.result) !== null && _changesState$result !== void 0 && _changesState$result.image && editSubOptionId === subOption.id ? /*#__PURE__*/_react.default.createElement("img", {
|
|
238
248
|
src: changesState === null || changesState === void 0 || (_changesState$result2 = changesState.result) === null || _changesState$result2 === void 0 ? void 0 : _changesState$result2.image,
|
|
239
249
|
alt: "sub option image",
|
|
@@ -507,6 +507,12 @@ Object.defineProperty(exports, "PaymentOptionStripeDirect", {
|
|
|
507
507
|
return _PaymentOptionStripeDirect.PaymentOptionStripeDirect;
|
|
508
508
|
}
|
|
509
509
|
});
|
|
510
|
+
Object.defineProperty(exports, "PaymentOptionStripeLink", {
|
|
511
|
+
enumerable: true,
|
|
512
|
+
get: function get() {
|
|
513
|
+
return _PaymentOptionStripeLink.PaymentOptionStripeLink;
|
|
514
|
+
}
|
|
515
|
+
});
|
|
510
516
|
Object.defineProperty(exports, "PaymethodOptionPaypalExpress", {
|
|
511
517
|
enumerable: true,
|
|
512
518
|
get: function get() {
|
|
@@ -751,6 +757,7 @@ var _BusinessMenuOptions = require("./BusinessMenuOptions");
|
|
|
751
757
|
var _BusinessDeliveryDetails = require("./BusinessDeliveryDetails");
|
|
752
758
|
var _BusinessPickupDetails = require("./BusinessPickupDetails");
|
|
753
759
|
var _PaymentOptionStripeDirect = require("./PaymentOptionStripeDirect");
|
|
760
|
+
var _PaymentOptionStripeLink = require("./PaymentOptionStripeLink");
|
|
754
761
|
var _PaymentOption = require("./PaymentOption");
|
|
755
762
|
var _PaymethodOptionPaypalExpress = require("./PaymethodOptionPaypalExpress");
|
|
756
763
|
var _PaymethodOptionStripeRedirect = require("./PaymethodOptionStripeRedirect");
|
package/_modules/index.js
CHANGED
|
@@ -1695,6 +1695,12 @@ Object.defineProperty(exports, "PaymentOptionStripeDirect", {
|
|
|
1695
1695
|
return _Stores.PaymentOptionStripeDirect;
|
|
1696
1696
|
}
|
|
1697
1697
|
});
|
|
1698
|
+
Object.defineProperty(exports, "PaymentOptionStripeLink", {
|
|
1699
|
+
enumerable: true,
|
|
1700
|
+
get: function get() {
|
|
1701
|
+
return _Stores.PaymentOptionStripeLink;
|
|
1702
|
+
}
|
|
1703
|
+
});
|
|
1698
1704
|
Object.defineProperty(exports, "PaymethodOptionPaypalExpress", {
|
|
1699
1705
|
enumerable: true,
|
|
1700
1706
|
get: function get() {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ordering-ui-admin-external",
|
|
3
|
-
"version": "1.43.
|
|
3
|
+
"version": "1.43.88",
|
|
4
4
|
"description": "Ordering UI Admin Components",
|
|
5
5
|
"main": "./_modules/index.js",
|
|
6
6
|
"exports": {
|
|
@@ -83,7 +83,7 @@
|
|
|
83
83
|
"lodash": "^4.17.20",
|
|
84
84
|
"moment": "^2.29.1",
|
|
85
85
|
"moment-range": "^4.0.2",
|
|
86
|
-
"ordering-components-admin-external": "1.43.
|
|
86
|
+
"ordering-components-admin-external": "1.43.57",
|
|
87
87
|
"polished": "^3.6.7",
|
|
88
88
|
"prop-types": "^15.7.2",
|
|
89
89
|
"react-big-calendar": "^1.4.2",
|
|
@@ -60,7 +60,9 @@ const OrdersManagerUI = (props) => {
|
|
|
60
60
|
adminsList,
|
|
61
61
|
assignableDriverGroupList,
|
|
62
62
|
mapsData,
|
|
63
|
-
setMapsData
|
|
63
|
+
setMapsData,
|
|
64
|
+
detailsOrder,
|
|
65
|
+
setDetailsOrder
|
|
64
66
|
} = props
|
|
65
67
|
|
|
66
68
|
const [, t] = useLanguage()
|
|
@@ -72,7 +74,6 @@ const OrdersManagerUI = (props) => {
|
|
|
72
74
|
const query = new URLSearchParams(useLocation().search)
|
|
73
75
|
const [isOpenOrderDetail, setIsOpenOrderDetail] = useState(false)
|
|
74
76
|
const [orderDetailId, setOrderDetailId] = useState(null)
|
|
75
|
-
const [detailsOrder, setDetailsOrder] = useState(null)
|
|
76
77
|
const [filterModalOpen, setFilterModalOpen] = useState(false)
|
|
77
78
|
const [assignedOrders, setAssignedOrders] = useState({ loading: false, error: null, orders: [] })
|
|
78
79
|
|
|
@@ -195,6 +196,7 @@ const OrdersManagerUI = (props) => {
|
|
|
195
196
|
isSelectedOrders={isSelectedOrders}
|
|
196
197
|
>
|
|
197
198
|
<OrdersContentHeader
|
|
199
|
+
disableSocketRoomDriver
|
|
198
200
|
isDisableTitle={isSelectedOrders}
|
|
199
201
|
isDisableControl={isSelectedOrders}
|
|
200
202
|
title={t('ORDER_MANAGER', 'Orders manager')}
|
|
@@ -223,6 +225,7 @@ const OrdersManagerUI = (props) => {
|
|
|
223
225
|
<DriversContainer>
|
|
224
226
|
<DriversManager
|
|
225
227
|
disableSocketRoomDriver
|
|
228
|
+
disableDriverLocationsSockets
|
|
226
229
|
showCompressedInfo
|
|
227
230
|
filterValues={filterValues}
|
|
228
231
|
driverGroupList={driverGroupList}
|
|
@@ -34,7 +34,9 @@ const DeliveriesManagerUI = (props) => {
|
|
|
34
34
|
setTimeStatus,
|
|
35
35
|
isUseQuery,
|
|
36
36
|
adminsList,
|
|
37
|
-
assignableDriverGroupList
|
|
37
|
+
assignableDriverGroupList,
|
|
38
|
+
detailsOrder,
|
|
39
|
+
setDetailsOrder
|
|
38
40
|
} = props
|
|
39
41
|
|
|
40
42
|
const [, t] = useLanguage()
|
|
@@ -42,7 +44,6 @@ const DeliveriesManagerUI = (props) => {
|
|
|
42
44
|
const query = new URLSearchParams(useLocation().search)
|
|
43
45
|
const [isOpenOrderDetail, setIsOpenOrderDetail] = useState(false)
|
|
44
46
|
const [orderDetailId, setOrderDetailId] = useState(null)
|
|
45
|
-
const [detailsOrder, setDetailsOrder] = useState(null)
|
|
46
47
|
const [filterModalOpen, setFilterModalOpen] = useState(false)
|
|
47
48
|
const [slaSettingTime, setSlaSettingTime] = useState(60000)
|
|
48
49
|
const [ordersAmountByStatus, setOrdersAmountByStatus] = useState({
|
|
@@ -42,7 +42,8 @@ export const OrderContactInformation = (props) => {
|
|
|
42
42
|
setAddressState,
|
|
43
43
|
setCommentInfostate,
|
|
44
44
|
commentInfoState,
|
|
45
|
-
addressState
|
|
45
|
+
addressState,
|
|
46
|
+
disableSocketRoomDriver
|
|
46
47
|
} = props
|
|
47
48
|
|
|
48
49
|
const [, t] = useLanguage()
|
|
@@ -393,6 +394,7 @@ export const OrderContactInformation = (props) => {
|
|
|
393
394
|
isOrderDrivers
|
|
394
395
|
orderId={order?.id}
|
|
395
396
|
setCommentInfostate={setCommentInfostate}
|
|
397
|
+
disableSocketRoomDriver={disableSocketRoomDriver}
|
|
396
398
|
/>
|
|
397
399
|
</DriverSelectorContainer>
|
|
398
400
|
)}
|