ordering-ui-admin-external 1.42.16 → 1.43.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.fe5b500282e81ee0fd32.js → ordering-ui-admin.4cea57b9d7d8884bab6f.js} +2 -2
- package/_modules/components/Delivery/DriversGroupGeneralForm/index.js +23 -23
- package/_modules/components/Delivery/DriversGroupGeneralForm/styles.js +28 -3
- package/_modules/components/MyProducts/AdvancedSettings/index.js +4 -0
- package/_modules/components/Orders/AllInOne/index.js +6 -1
- package/_modules/components/Orders/DeliveriesManager/index.js +3 -1
- package/_modules/components/Orders/DeliveryDashboard/index.js +9 -2
- package/_modules/components/Orders/DriverMultiSelector/index.js +9 -7
- package/_modules/components/Orders/DriversGroupTypeSelector/index.js +4 -3
- package/_modules/components/Orders/DriversGroupTypeSelector/styles.js +1 -1
- package/_modules/components/Orders/OrderLogisticInformation/index.js +24 -2
- package/_modules/components/Orders/OrdersFilterGroup/index.js +22 -24
- package/_modules/components/Orders/OrdersHeaderFilterGroup/index.js +101 -0
- package/_modules/components/Orders/OrdersHeaderFilterGroup/styles.js +20 -0
- package/_modules/components/Orders/OrdersManager/index.js +5 -0
- package/_modules/components/Settings/SettingsList/index.js +19 -3
- package/_modules/components/Users/CustomersListing/index.js +2 -1
- package/_modules/contexts/FilterValuesContext/index.js +75 -0
- package/_modules/index.js +19 -0
- package/index-template.js +5 -2
- package/package.json +2 -2
- package/src/components/Delivery/DriversGroupGeneralForm/index.js +36 -18
- package/src/components/Delivery/DriversGroupGeneralForm/styles.js +83 -0
- package/src/components/MyProducts/AdvancedSettings/index.js +2 -1
- package/src/components/Orders/AllInOne/index.js +6 -0
- package/src/components/Orders/DeliveriesManager/index.js +2 -0
- package/src/components/Orders/DeliveryDashboard/index.js +9 -1
- package/src/components/Orders/DriverMultiSelector/index.js +6 -5
- package/src/components/Orders/DriversGroupTypeSelector/index.js +2 -2
- package/src/components/Orders/DriversGroupTypeSelector/styles.js +2 -0
- package/src/components/Orders/OrderLogisticInformation/index.js +21 -3
- package/src/components/Orders/OrdersCards/index.js +1 -1
- package/src/components/Orders/OrdersFilterGroup/index.js +30 -18
- package/src/components/Orders/OrdersHeaderFilterGroup/index.js +94 -0
- package/src/components/Orders/OrdersHeaderFilterGroup/styles.js +68 -0
- package/src/components/Orders/OrdersManager/index.js +6 -0
- package/src/components/Settings/SettingsList/index.js +19 -1
- package/src/components/Users/CustomersListing/index.js +4 -1
- package/src/contexts/FilterValuesContext/index.js +60 -0
- package/src/index.js +4 -0
- /package/_bundles/{ordering-ui-admin.fe5b500282e81ee0fd32.js.LICENSE.txt → ordering-ui-admin.4cea57b9d7d8884bab6f.js.LICENSE.txt} +0 -0
|
@@ -18,6 +18,7 @@ var _OrdersDashboard = require("../OrdersDashboard");
|
|
|
18
18
|
var _OrderStatusSubFilter = require("../OrderStatusSubFilter");
|
|
19
19
|
var _OrderNotification = require("../OrderNotification");
|
|
20
20
|
var _WizardOrders = require("../WizardOrders");
|
|
21
|
+
var _OrdersHeaderFilterGroup = require("../OrdersHeaderFilterGroup");
|
|
21
22
|
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); }
|
|
22
23
|
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 && Object.prototype.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; }
|
|
23
24
|
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; }
|
|
@@ -231,6 +232,10 @@ var OrdersManagerUI = function OrdersManagerUI(props) {
|
|
|
231
232
|
setTimeStatus: setTimeStatus,
|
|
232
233
|
setSlaSettingTime: setSlaSettingTime,
|
|
233
234
|
isLateralBar: isLateralBar
|
|
235
|
+
}), /*#__PURE__*/_react.default.createElement(_OrdersHeaderFilterGroup.OrdersHeaderFilterGroup, {
|
|
236
|
+
driverGroupList: driverGroupList,
|
|
237
|
+
driversList: driversList,
|
|
238
|
+
handleChangeFilterValues: handleChangeFilterValues
|
|
234
239
|
}), /*#__PURE__*/_react.default.createElement(_OrderStatusFilterBar.OrderStatusFilterBar, {
|
|
235
240
|
isUseQuery: isUseQuery,
|
|
236
241
|
selectedOrderStatus: ordersStatusGroup,
|
|
@@ -154,7 +154,7 @@ var SettingsListUI = exports.SettingsListUI = function SettingsListUI(props) {
|
|
|
154
154
|
width: 70,
|
|
155
155
|
height: 44
|
|
156
156
|
})), !settingsState.error && !settingsState.loading && configs && !settingsState.API && /*#__PURE__*/_react.default.createElement(_styles2.GeneralContainer, null, /*#__PURE__*/_react.default.createElement(_styles2.FormContainer, null, configs.length > 0 && configs.map(function (config, i) {
|
|
157
|
-
var _config$options, _config$options2, _config$options3, _config$options4, _config$value;
|
|
157
|
+
var _config$options, _config$options2, _config$options3, _config$options4, _config$options5, _config$options6, _config$value;
|
|
158
158
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
159
159
|
key: i
|
|
160
160
|
}, config.type === 1 && /*#__PURE__*/_react.default.createElement(_styles2.FormGroupText, {
|
|
@@ -183,7 +183,23 @@ var SettingsListUI = exports.SettingsListUI = function SettingsListUI(props) {
|
|
|
183
183
|
handleSelectChange: function handleSelectChange(value) {
|
|
184
184
|
return handleInputChange(value, config === null || config === void 0 ? void 0 : config.id);
|
|
185
185
|
}
|
|
186
|
-
})), config.type === 3 && /*#__PURE__*/_react.default.createElement(_styles2.CheckBoxWrapper, null, (config === null || config === void 0 ? void 0 : config.name) && /*#__PURE__*/_react.default.createElement("label", null, config === null || config === void 0 ? void 0 : config.name), (config === null || config === void 0 ? void 0 : config.description) && /*#__PURE__*/_react.default.createElement("p", null, config === null || config === void 0 ? void 0 : config.description), (config === null || config === void 0 || (_config$options = config.options) === null || _config$options === void 0 ? void 0 : _config$options.length) > 0 && (config === null || config === void 0 || (_config$options2 = config.options) === null || _config$options2 === void 0 ? void 0 : _config$options2.map(function (item, j) {
|
|
186
|
+
})), config.type === 3 && /*#__PURE__*/_react.default.createElement(_styles2.CheckBoxWrapper, null, (config === null || config === void 0 ? void 0 : config.name) && /*#__PURE__*/_react.default.createElement("label", null, config === null || config === void 0 ? void 0 : config.name), (config === null || config === void 0 ? void 0 : config.description) && /*#__PURE__*/_react.default.createElement("p", null, config === null || config === void 0 ? void 0 : config.description), (config === null || config === void 0 ? void 0 : config.key) !== 'filter_order_options' && (config === null || config === void 0 || (_config$options = config.options) === null || _config$options === void 0 ? void 0 : _config$options.length) > 0 && (config === null || config === void 0 || (_config$options2 = config.options) === null || _config$options2 === void 0 ? void 0 : _config$options2.map(function (item, j) {
|
|
187
|
+
return /*#__PURE__*/_react.default.createElement(_styles2.FormGroupWrapper, {
|
|
188
|
+
key: j
|
|
189
|
+
}, /*#__PURE__*/_react.default.createElement(_styles2.FormGroupCheck, {
|
|
190
|
+
className: "checkbox"
|
|
191
|
+
}, /*#__PURE__*/_react.default.createElement("label", null, /*#__PURE__*/_react.default.createElement("input", {
|
|
192
|
+
type: "checkbox",
|
|
193
|
+
name: item === null || item === void 0 ? void 0 : item.value,
|
|
194
|
+
"data-id": config === null || config === void 0 ? void 0 : config.id,
|
|
195
|
+
defaultChecked: config === null || config === void 0 ? void 0 : config.value.split('|').includes(item === null || item === void 0 ? void 0 : item.value),
|
|
196
|
+
onChange: function onChange(e) {
|
|
197
|
+
return handleCheckBoxChange(e, true, config === null || config === void 0 ? void 0 : config.value);
|
|
198
|
+
}
|
|
199
|
+
}), t(item.text.toUpperCase(), item.text.replace(/_/g, ' ').toLowerCase()))));
|
|
200
|
+
})), (config === null || config === void 0 ? void 0 : config.key) === 'filter_order_options' && (config === null || config === void 0 || (_config$options3 = config.options) === null || _config$options3 === void 0 ? void 0 : _config$options3.length) > 0 && (config === null || config === void 0 || (_config$options4 = config.options) === null || _config$options4 === void 0 ? void 0 : _config$options4.filter(function (option) {
|
|
201
|
+
return option.value === 'external_id' || option.value === 'driver' || option.value === 'driver_group_general';
|
|
202
|
+
}).map(function (item, j) {
|
|
187
203
|
return /*#__PURE__*/_react.default.createElement(_styles2.FormGroupWrapper, {
|
|
188
204
|
key: j
|
|
189
205
|
}, /*#__PURE__*/_react.default.createElement(_styles2.FormGroupCheck, {
|
|
@@ -207,7 +223,7 @@ var SettingsListUI = exports.SettingsListUI = function SettingsListUI(props) {
|
|
|
207
223
|
},
|
|
208
224
|
className: "form-control",
|
|
209
225
|
placeholder: "placeholder"
|
|
210
|
-
})) : /*#__PURE__*/_react.default.createElement(_styles2.CheckBoxWrapper, null, (config === null || config === void 0 ? void 0 : config.name) && /*#__PURE__*/_react.default.createElement("label", null, config === null || config === void 0 ? void 0 : config.name), (config === null || config === void 0 ? void 0 : config.description) && /*#__PURE__*/_react.default.createElement("p", null, config === null || config === void 0 ? void 0 : config.description), (config === null || config === void 0 || (_config$
|
|
226
|
+
})) : /*#__PURE__*/_react.default.createElement(_styles2.CheckBoxWrapper, null, (config === null || config === void 0 ? void 0 : config.name) && /*#__PURE__*/_react.default.createElement("label", null, config === null || config === void 0 ? void 0 : config.name), (config === null || config === void 0 ? void 0 : config.description) && /*#__PURE__*/_react.default.createElement("p", null, config === null || config === void 0 ? void 0 : config.description), (config === null || config === void 0 || (_config$options5 = config.options) === null || _config$options5 === void 0 ? void 0 : _config$options5.length) > 0 && (config === null || config === void 0 || (_config$options6 = config.options) === null || _config$options6 === void 0 ? void 0 : _config$options6.map(function (item, j) {
|
|
211
227
|
return /*#__PURE__*/_react.default.createElement(_styles2.FormGroupWrapper, {
|
|
212
228
|
key: j
|
|
213
229
|
}, /*#__PURE__*/_react.default.createElement(_styles2.FormGroupCheck, {
|
|
@@ -246,7 +246,8 @@ var CustomersListing = exports.CustomersListing = function CustomersListing(prop
|
|
|
246
246
|
initialPage: props.isUseQuery && !isNaN(defaultPage) ? Number(defaultPage) : 1,
|
|
247
247
|
pageSize: props.isUseQuery && !isNaN(defaultPage) ? Number(defaultPageSize) : 10,
|
|
248
248
|
controlType: 'pages'
|
|
249
|
-
}
|
|
249
|
+
},
|
|
250
|
+
propsToFetch: ['name', 'lastname', 'email', 'phone', 'photo', 'cellphone', 'loyalty_level', 'loyalty_level_id', 'country_phone_code', 'city_id', 'city', 'address', 'addresses', 'address_notes', 'dropdown_option_id', 'dropdown_option', 'location', 'zipcode', 'level', 'enabled', 'middle_name', 'second_lastname', 'birthdate', 'phone_verified', 'email_verified', 'wallets', 'orders_count', 'push_tokens']
|
|
250
251
|
});
|
|
251
252
|
return /*#__PURE__*/_react.default.createElement(_orderingComponentsAdminExternal.UsersList, customersProps);
|
|
252
253
|
};
|
|
@@ -0,0 +1,75 @@
|
|
|
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.FilterValuesProvider = exports.FilterValuesContext = void 0;
|
|
8
|
+
exports.useFilterValues = useFilterValues;
|
|
9
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
10
|
+
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); }
|
|
11
|
+
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 && Object.prototype.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; }
|
|
12
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
13
|
+
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."); }
|
|
14
|
+
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); }
|
|
15
|
+
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; }
|
|
16
|
+
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; } }
|
|
17
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
18
|
+
/**
|
|
19
|
+
* Create FilterValuesContext
|
|
20
|
+
* This context will manage the info between pages and provide an easy interface
|
|
21
|
+
*/
|
|
22
|
+
var FilterValuesContext = exports.FilterValuesContext = /*#__PURE__*/(0, _react.createContext)();
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Custom provider to mange shared info
|
|
26
|
+
* @param {props} props
|
|
27
|
+
*/
|
|
28
|
+
var FilterValuesProvider = exports.FilterValuesProvider = function FilterValuesProvider(_ref) {
|
|
29
|
+
var children = _ref.children;
|
|
30
|
+
var _useState = (0, _react.useState)({
|
|
31
|
+
orderId: null,
|
|
32
|
+
externalId: null,
|
|
33
|
+
groupTypes: [],
|
|
34
|
+
groupTypesUnassigned: [],
|
|
35
|
+
dateType: null,
|
|
36
|
+
deliveryFromDatetime: null,
|
|
37
|
+
deliveryEndDatetime: null,
|
|
38
|
+
businessIds: [],
|
|
39
|
+
driverIds: [],
|
|
40
|
+
driverGroupIds: [],
|
|
41
|
+
cityIds: [],
|
|
42
|
+
statuses: [],
|
|
43
|
+
deliveryTypes: [],
|
|
44
|
+
paymethodIds: [],
|
|
45
|
+
countryCode: [],
|
|
46
|
+
currency: [],
|
|
47
|
+
metafield: [],
|
|
48
|
+
logisticStatus: null,
|
|
49
|
+
assigned: null,
|
|
50
|
+
driverGroupBusinessIds: [],
|
|
51
|
+
customerName: null,
|
|
52
|
+
customerEmail: null,
|
|
53
|
+
customerCellphone: null,
|
|
54
|
+
customerLastname: null
|
|
55
|
+
}),
|
|
56
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
57
|
+
filterValues = _useState2[0],
|
|
58
|
+
setFilterValues = _useState2[1];
|
|
59
|
+
var handleFilterValues = function handleFilterValues(filterValues) {
|
|
60
|
+
setFilterValues(filterValues);
|
|
61
|
+
};
|
|
62
|
+
var functions = {
|
|
63
|
+
handleFilterValues: handleFilterValues
|
|
64
|
+
};
|
|
65
|
+
return /*#__PURE__*/_react.default.createElement(FilterValuesContext.Provider, {
|
|
66
|
+
value: [filterValues, functions]
|
|
67
|
+
}, children);
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
// hook context
|
|
71
|
+
|
|
72
|
+
function useFilterValues() {
|
|
73
|
+
var filterValuesManager = _react.default.useContext(FilterValuesContext);
|
|
74
|
+
return filterValuesManager || [{}, function () {}];
|
|
75
|
+
}
|
package/_modules/index.js
CHANGED
|
@@ -1161,6 +1161,18 @@ Object.defineProperty(exports, "EnterprisePromotionSpecficProducts", {
|
|
|
1161
1161
|
return _Marketing.EnterprisePromotionSpecficProducts;
|
|
1162
1162
|
}
|
|
1163
1163
|
});
|
|
1164
|
+
Object.defineProperty(exports, "FilterValuesContext", {
|
|
1165
|
+
enumerable: true,
|
|
1166
|
+
get: function get() {
|
|
1167
|
+
return _FilterValuesContext.FilterValuesContext;
|
|
1168
|
+
}
|
|
1169
|
+
});
|
|
1170
|
+
Object.defineProperty(exports, "FilterValuesProvider", {
|
|
1171
|
+
enumerable: true,
|
|
1172
|
+
get: function get() {
|
|
1173
|
+
return _FilterValuesContext.FilterValuesProvider;
|
|
1174
|
+
}
|
|
1175
|
+
});
|
|
1164
1176
|
Object.defineProperty(exports, "ForgotPasswordForm", {
|
|
1165
1177
|
enumerable: true,
|
|
1166
1178
|
get: function get() {
|
|
@@ -2481,6 +2493,12 @@ Object.defineProperty(exports, "setStorageItem", {
|
|
|
2481
2493
|
return _utils.setStorageItem;
|
|
2482
2494
|
}
|
|
2483
2495
|
});
|
|
2496
|
+
Object.defineProperty(exports, "useFilterValues", {
|
|
2497
|
+
enumerable: true,
|
|
2498
|
+
get: function get() {
|
|
2499
|
+
return _FilterValuesContext.useFilterValues;
|
|
2500
|
+
}
|
|
2501
|
+
});
|
|
2484
2502
|
Object.defineProperty(exports, "useInfoShare", {
|
|
2485
2503
|
enumerable: true,
|
|
2486
2504
|
get: function get() {
|
|
@@ -2547,6 +2565,7 @@ var _ThemeContext = require("./contexts/ThemeContext");
|
|
|
2547
2565
|
var _ConfigFileContext = require("./contexts/ConfigFileContext");
|
|
2548
2566
|
var _ProjectContext = require("./contexts/ProjectContext");
|
|
2549
2567
|
var _InfoShareContext = require("./contexts/InfoShareContext");
|
|
2568
|
+
var _FilterValuesContext = require("./contexts/FilterValuesContext");
|
|
2550
2569
|
var _useOnlineStatus = require("./hooks/useOnlineStatus");
|
|
2551
2570
|
var _useWindowSize = require("./hooks/useWindowSize");
|
|
2552
2571
|
var _Buttons = require("./styles/Buttons");
|
package/index-template.js
CHANGED
|
@@ -8,6 +8,7 @@ import { Integrations } from '@sentry/tracing'
|
|
|
8
8
|
import { ThemeProvider } from './src/contexts/ThemeContext'
|
|
9
9
|
import { ConfigFileContext } from './src/contexts/ConfigFileContext'
|
|
10
10
|
import { InfoShareProvider } from './src/contexts/InfoShareContext'
|
|
11
|
+
import { FilterValuesProvider } from './src/contexts/FilterValuesContext'
|
|
11
12
|
import { ProjectProvider } from './src/contexts/ProjectContext'
|
|
12
13
|
import { Toast } from './src/styles/Toast'
|
|
13
14
|
import theme from './template/theme.json'
|
|
@@ -658,8 +659,10 @@ const RouteApp = () => {
|
|
|
658
659
|
<OrderingProvider Alert={Alert}>
|
|
659
660
|
<InfoShareProvider>
|
|
660
661
|
<ProjectProvider>
|
|
661
|
-
<
|
|
662
|
-
|
|
662
|
+
<FilterValuesProvider>
|
|
663
|
+
<Router />
|
|
664
|
+
<Toast />
|
|
665
|
+
</FilterValuesProvider>
|
|
663
666
|
</ProjectProvider>
|
|
664
667
|
</InfoShareProvider>
|
|
665
668
|
</OrderingProvider>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ordering-ui-admin-external",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.43.0",
|
|
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.
|
|
86
|
+
"ordering-components-admin-external": "1.43.0",
|
|
87
87
|
"polished": "^3.6.7",
|
|
88
88
|
"prop-types": "^15.7.2",
|
|
89
89
|
"react-big-calendar": "^1.4.2",
|
|
@@ -1,15 +1,21 @@
|
|
|
1
1
|
import React, { useState, useEffect } from 'react'
|
|
2
2
|
import { useLanguage, useSession } from 'ordering-components-admin-external'
|
|
3
3
|
import { useForm } from 'react-hook-form'
|
|
4
|
-
import { Input, Button, SecondSelect as DefaultSelect } from '../../../styles'
|
|
4
|
+
import { Input, Button, SecondSelect as DefaultSelect, Checkbox } from '../../../styles'
|
|
5
5
|
import { Alert } from '../../Shared'
|
|
6
6
|
import { DriversGroupDrivers } from '../DriversGroupDrivers'
|
|
7
7
|
import { DriversGroupCompanies } from '../DriversGroupCompanies'
|
|
8
8
|
|
|
9
9
|
import {
|
|
10
10
|
Container,
|
|
11
|
-
|
|
11
|
+
DriverManagerContainer,
|
|
12
|
+
DriverManagerWrapper,
|
|
13
|
+
Image,
|
|
14
|
+
InputWrapper,
|
|
15
|
+
ManagerInfoContainer,
|
|
16
|
+
WrapperImage
|
|
12
17
|
} from './styles'
|
|
18
|
+
import FaUserAlt from '@meronex/icons/fa/FaUserAlt'
|
|
13
19
|
|
|
14
20
|
export const DriversGroupGeneralForm = (props) => {
|
|
15
21
|
const {
|
|
@@ -21,7 +27,9 @@ export const DriversGroupGeneralForm = (props) => {
|
|
|
21
27
|
handleAddDriversGroup,
|
|
22
28
|
actionDisabled,
|
|
23
29
|
isTourOpen,
|
|
24
|
-
handleNextClick
|
|
30
|
+
handleNextClick,
|
|
31
|
+
selectedDriverManager,
|
|
32
|
+
handleSelectDriverManager
|
|
25
33
|
} = props
|
|
26
34
|
|
|
27
35
|
const [, t] = useLanguage()
|
|
@@ -34,13 +42,6 @@ export const DriversGroupGeneralForm = (props) => {
|
|
|
34
42
|
{ value: 1, content: t('DRIVER_COMPANIES', 'Driver companies') }
|
|
35
43
|
]
|
|
36
44
|
|
|
37
|
-
const driversManagersOptions = driversManagers.map(manager => {
|
|
38
|
-
return {
|
|
39
|
-
value: manager.id,
|
|
40
|
-
content: <div>{manager?.name} {manager?.lastname}</div>
|
|
41
|
-
}
|
|
42
|
-
})
|
|
43
|
-
|
|
44
45
|
const priorityOptions = [
|
|
45
46
|
{ value: -1, content: t('LOW', 'Low') },
|
|
46
47
|
{ value: 0, content: t('NORMAL', 'Normal') },
|
|
@@ -127,17 +128,34 @@ export const DriversGroupGeneralForm = (props) => {
|
|
|
127
128
|
autoComplete='off'
|
|
128
129
|
/>
|
|
129
130
|
</InputWrapper>
|
|
131
|
+
|
|
130
132
|
{user?.level !== 5 && (
|
|
131
133
|
<InputWrapper>
|
|
132
134
|
<label>{t('DRIVER_MANAGER', 'Driver manager')}</label>
|
|
133
|
-
<
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
135
|
+
<DriverManagerContainer>
|
|
136
|
+
{driversManagers.map(driverManager => (
|
|
137
|
+
<DriverManagerWrapper
|
|
138
|
+
key={driverManager.id}
|
|
139
|
+
>
|
|
140
|
+
<Checkbox
|
|
141
|
+
value={driverManager?.id}
|
|
142
|
+
checked={selectedDriverManager.includes(driverManager.id)}
|
|
143
|
+
onChange={e => handleSelectDriverManager(driverManager.id, e.target.checked)}
|
|
144
|
+
/>
|
|
145
|
+
<WrapperImage>
|
|
146
|
+
{driverManager?.photo ? (
|
|
147
|
+
<Image bgimage={driverManager?.photo} alt='driverManager' />
|
|
148
|
+
) : (
|
|
149
|
+
<FaUserAlt />
|
|
150
|
+
)}
|
|
151
|
+
</WrapperImage>
|
|
152
|
+
<ManagerInfoContainer>
|
|
153
|
+
<p>{driverManager?.name}</p>
|
|
154
|
+
<p>{driverManager?.email}</p>
|
|
155
|
+
</ManagerInfoContainer>
|
|
156
|
+
</DriverManagerWrapper>
|
|
157
|
+
))}
|
|
158
|
+
</DriverManagerContainer>
|
|
141
159
|
</InputWrapper>
|
|
142
160
|
)}
|
|
143
161
|
<InputWrapper>
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import React from 'react'
|
|
1
2
|
import styled, { css } from 'styled-components'
|
|
2
3
|
|
|
3
4
|
export const Container = styled.form`
|
|
@@ -42,3 +43,85 @@ export const InputWrapper = styled.div`
|
|
|
42
43
|
}
|
|
43
44
|
}
|
|
44
45
|
`
|
|
46
|
+
|
|
47
|
+
export const DriverManagerContainer = styled.div`
|
|
48
|
+
height: calc(100% - 130px);
|
|
49
|
+
overflow: auto;
|
|
50
|
+
max-height: 250px;
|
|
51
|
+
`
|
|
52
|
+
|
|
53
|
+
export const DriverManagerWrapper = styled.div`
|
|
54
|
+
display: flex;
|
|
55
|
+
align-items: center;
|
|
56
|
+
padding: 10px 0;
|
|
57
|
+
border-bottom: 1px solid ${props => props.theme.colors.borderColor};
|
|
58
|
+
|
|
59
|
+
p {
|
|
60
|
+
margin: 0px;
|
|
61
|
+
font-size: 12px;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
${({ isDisabed }) => isDisabed && css`
|
|
65
|
+
pointer-events: none;
|
|
66
|
+
`}
|
|
67
|
+
`
|
|
68
|
+
|
|
69
|
+
export const ManagerInfoContainer = styled.div`
|
|
70
|
+
p {
|
|
71
|
+
margin: 0px;
|
|
72
|
+
&:first-child {
|
|
73
|
+
font-weight: 500;
|
|
74
|
+
font-size: 13px;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
&:last-child {
|
|
78
|
+
font-size: 12px;
|
|
79
|
+
color: ${props => props.theme.colors.lightGray};
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
`
|
|
83
|
+
|
|
84
|
+
export const WrapperImage = styled.div`
|
|
85
|
+
max-width: 40px;
|
|
86
|
+
max-height: 40px;
|
|
87
|
+
height: 40px;
|
|
88
|
+
width: 40px;
|
|
89
|
+
${({ isSkeleton }) => !isSkeleton && css`
|
|
90
|
+
border: 1px solid #E3E3E3;
|
|
91
|
+
`}
|
|
92
|
+
border-radius: 8px;
|
|
93
|
+
|
|
94
|
+
svg {
|
|
95
|
+
width: 100%;
|
|
96
|
+
height: 100%;
|
|
97
|
+
padding: 7px;
|
|
98
|
+
box-sizing: border-box;
|
|
99
|
+
border-radius: 50%;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
margin: 0 10px;
|
|
103
|
+
`
|
|
104
|
+
|
|
105
|
+
const ImageStyled = styled.div`
|
|
106
|
+
display: flex;
|
|
107
|
+
width: 100%;
|
|
108
|
+
height: 100%;
|
|
109
|
+
box-sizing: border-box;
|
|
110
|
+
position: relative;
|
|
111
|
+
background-repeat: no-repeat, repeat;
|
|
112
|
+
background-size: cover;
|
|
113
|
+
object-fit: cover;
|
|
114
|
+
background-position: center;
|
|
115
|
+
border-radius: 8px;
|
|
116
|
+
`
|
|
117
|
+
|
|
118
|
+
export const Image = (props) => {
|
|
119
|
+
return (
|
|
120
|
+
<ImageStyled
|
|
121
|
+
{...props}
|
|
122
|
+
style={{ backgroundImage: `url(${props.bgimage})` }}
|
|
123
|
+
>
|
|
124
|
+
{props.children}
|
|
125
|
+
</ImageStyled>
|
|
126
|
+
)
|
|
127
|
+
}
|
|
@@ -92,7 +92,8 @@ export const AdvancedSettings = (props) => {
|
|
|
92
92
|
{ name: t('DESCRIPTION', 'Description'), type: 'hidden', path: 'business_view.components.products.components.product.components.description.hidden' },
|
|
93
93
|
{ name: t('IMAGE', 'Image'), type: 'hidden', path: 'business_view.components.products.components.product.components.image.hidden' },
|
|
94
94
|
{ name: t('POSITION', 'Position'), type: 'position', path: 'business_view.components.products.components.product.components.image.position' },
|
|
95
|
-
{ name: t('ADD_TO_CART_BUTTON', 'Add to cart button'), type: 'hidden', path: 'business_view.components.products.components.add_to_cart_button.hidden' }
|
|
95
|
+
{ name: t('ADD_TO_CART_BUTTON', 'Add to cart button'), type: 'hidden', path: 'business_view.components.products.components.add_to_cart_button.hidden' },
|
|
96
|
+
{ name: t('FAVORITE', 'Favorite'), type: 'hidden', path: 'business_view.components.products.components.product.components.favorite.hidden' }
|
|
96
97
|
]
|
|
97
98
|
|
|
98
99
|
const reviewsPopups = [
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React, { useState, useEffect } from 'react'
|
|
2
2
|
import { useLocation } from 'react-router-dom'
|
|
3
3
|
import { useLanguage, useSession, OrdersManage as OrdersManageController } from 'ordering-components-admin-external'
|
|
4
|
+
import { OrdersHeaderFilterGroup } from '../OrdersHeaderFilterGroup'
|
|
4
5
|
import { OrderStatusFilterBar } from '../OrderStatusFilterBar'
|
|
5
6
|
import { OrdersContentHeader } from '../OrdersContentHeader'
|
|
6
7
|
import { OrderDetails } from '../OrderDetails'
|
|
@@ -229,6 +230,11 @@ const OrdersManagerUI = (props) => {
|
|
|
229
230
|
/>
|
|
230
231
|
</DriversContainer>
|
|
231
232
|
<OrdersContainer showCompressedInfo>
|
|
233
|
+
<OrdersHeaderFilterGroup
|
|
234
|
+
driverGroupList={driverGroupList}
|
|
235
|
+
driversList={driversList}
|
|
236
|
+
handleChangeFilterValues={handleChangeFilterValues}
|
|
237
|
+
/>
|
|
232
238
|
<OrderStatusFilterBar
|
|
233
239
|
isUseQuery={isUseQuery}
|
|
234
240
|
selectedOrderStatus={ordersStatusGroup}
|
|
@@ -116,6 +116,8 @@ const DeliveriesManagerUI = (props) => {
|
|
|
116
116
|
numberOfOrdersBySubstatus={numberOfOrdersBySubstatus}
|
|
117
117
|
isUseQuery={isUseQuery}
|
|
118
118
|
franchisesList={props.franchisesList}
|
|
119
|
+
driverGroupList={driverGroupList}
|
|
120
|
+
handleChangeFilterValues={handleChangeFilterValues}
|
|
119
121
|
/>
|
|
120
122
|
</WrapItemView>
|
|
121
123
|
</OrdersContent>
|
|
@@ -2,6 +2,7 @@ import React, { useState } from 'react'
|
|
|
2
2
|
import { useConfig } from 'ordering-components-admin-external'
|
|
3
3
|
import { DeliveriesLocation } from '../DeliveriesLocation'
|
|
4
4
|
import { OrdersDashboardList } from '../OrdersDashboardList'
|
|
5
|
+
import { OrdersHeaderFilterGroup } from '../OrdersHeaderFilterGroup'
|
|
5
6
|
import { OrderStatusFilterBar } from '../OrderStatusFilterBar'
|
|
6
7
|
import { OrderStatusSubFilter } from '../OrderStatusSubFilter'
|
|
7
8
|
|
|
@@ -22,7 +23,9 @@ export const DeliveryDashboard = (props) => {
|
|
|
22
23
|
handleSelectedSubOrderStatus,
|
|
23
24
|
ordersAmountByStatus,
|
|
24
25
|
setOrdersAmountByStatus,
|
|
25
|
-
isUseQuery
|
|
26
|
+
isUseQuery,
|
|
27
|
+
driverGroupList,
|
|
28
|
+
handleChangeFilterValues
|
|
26
29
|
} = props
|
|
27
30
|
|
|
28
31
|
const ordersDashboardListProps = {
|
|
@@ -52,6 +55,11 @@ export const DeliveryDashboard = (props) => {
|
|
|
52
55
|
return (
|
|
53
56
|
<DeliveryDashboardContainer>
|
|
54
57
|
<OrdersContainer>
|
|
58
|
+
<OrdersHeaderFilterGroup
|
|
59
|
+
driverGroupList={driverGroupList}
|
|
60
|
+
driversList={driversList}
|
|
61
|
+
handleChangeFilterValues={handleChangeFilterValues}
|
|
62
|
+
/>
|
|
55
63
|
<FilterContainer>
|
|
56
64
|
<OrderStatusFilterBar
|
|
57
65
|
isUseQuery={isUseQuery}
|
|
@@ -24,16 +24,17 @@ const DriverMultiSelectorUI = (props) => {
|
|
|
24
24
|
filterValues
|
|
25
25
|
} = props
|
|
26
26
|
|
|
27
|
-
const [
|
|
27
|
+
const [{ dictionary }] = useLanguage()
|
|
28
28
|
const theme = useTheme()
|
|
29
29
|
const [driversMultiOptionList, setDriversMultiOptionList] = useState([])
|
|
30
30
|
const [searchValue, setSearchValue] = useState(null)
|
|
31
|
-
const driversLoading = [{ value: 'default', content: <Option small={small}>{
|
|
31
|
+
const driversLoading = [{ value: 'default', content: <Option small={small}>{dictionary?.LOADING ?? 'loading'}...</Option> }]
|
|
32
|
+
|
|
32
33
|
useEffect(() => {
|
|
33
34
|
const _driversOptionList = [
|
|
34
35
|
{
|
|
35
36
|
value: 'default',
|
|
36
|
-
content: <Option padding='0px'><span>{
|
|
37
|
+
content: <Option padding='0px'><span>{dictionary?.SELECT_DRIVER ?? 'Select driver'}</span></Option>,
|
|
37
38
|
color: 'primary',
|
|
38
39
|
showDisable: true
|
|
39
40
|
}
|
|
@@ -57,7 +58,7 @@ const DriverMultiSelectorUI = (props) => {
|
|
|
57
58
|
<OptionContent>
|
|
58
59
|
<DriverNameContainer className='driver-info'>
|
|
59
60
|
<DriverName small={small}>{driver.name} {driver.lastname}</DriverName>
|
|
60
|
-
<DriverText small={small}>{
|
|
61
|
+
<DriverText small={small}>{dictionary?.DRIVER ?? 'Driver'}</DriverText>
|
|
61
62
|
</DriverNameContainer>
|
|
62
63
|
</OptionContent>
|
|
63
64
|
</Option>
|
|
@@ -73,7 +74,7 @@ const DriverMultiSelectorUI = (props) => {
|
|
|
73
74
|
}
|
|
74
75
|
}, [driversList, defaultValue, searchValue])
|
|
75
76
|
|
|
76
|
-
const Placeholder = <PlaceholderTitle>{
|
|
77
|
+
const Placeholder = <PlaceholderTitle>{dictionary?.SELECT_DRIVER ?? 'Select driver'}</PlaceholderTitle>
|
|
77
78
|
|
|
78
79
|
return (
|
|
79
80
|
<>
|
|
@@ -12,7 +12,7 @@ export const DriversGroupTypeSelector = (props) => {
|
|
|
12
12
|
title
|
|
13
13
|
} = props
|
|
14
14
|
|
|
15
|
-
const [
|
|
15
|
+
const [{ dictionary }] = useLanguage()
|
|
16
16
|
|
|
17
17
|
const [searchValue, setSearchValue] = useState('')
|
|
18
18
|
|
|
@@ -22,7 +22,7 @@ export const DriversGroupTypeSelector = (props) => {
|
|
|
22
22
|
</PlaceholderTitle>
|
|
23
23
|
)
|
|
24
24
|
const [groupTypes, setGroupTypes] = useState([])
|
|
25
|
-
const groupTypesLoading = [{ value: 'default', content: <Option>{
|
|
25
|
+
const groupTypesLoading = [{ value: 'default', content: <Option>{dictionary?.GROUP_LOADING ?? 'Group loading'}...</Option> }]
|
|
26
26
|
|
|
27
27
|
useEffect(() => {
|
|
28
28
|
const _groupList = []
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
|
-
import { LogisticInformation as LogisticInformationController, useLanguage, useUtils } from 'ordering-components-admin-external'
|
|
2
|
+
import { LogisticInformation as LogisticInformationController, useLanguage, useUtils, useConfig } from 'ordering-components-admin-external'
|
|
3
3
|
import Skeleton from 'react-loading-skeleton'
|
|
4
4
|
import { Button } from '../../../styles'
|
|
5
5
|
import {
|
|
@@ -13,7 +13,8 @@ const LogisticInformationUI = (props) => {
|
|
|
13
13
|
const { logisticInformation, getLogistics } = props
|
|
14
14
|
const [, t] = useLanguage()
|
|
15
15
|
|
|
16
|
-
const [{ parseDate,
|
|
16
|
+
const [{ parseDate, parseNumber }] = useUtils()
|
|
17
|
+
const [configState] = useConfig()
|
|
17
18
|
|
|
18
19
|
const getOrderStatus = (status) => {
|
|
19
20
|
const orderStatus = [
|
|
@@ -50,6 +51,23 @@ const LogisticInformationUI = (props) => {
|
|
|
50
51
|
return objectStatus && objectStatus
|
|
51
52
|
}
|
|
52
53
|
|
|
54
|
+
const calculateDistanceParse = (distance, options = {}) => {
|
|
55
|
+
distance = parseFloat(distance) || 0
|
|
56
|
+
let unit = options?.unit || 'KM'
|
|
57
|
+
if (configState.configs.distance_unit_km?.value === '1') {
|
|
58
|
+
unit = 'KM'
|
|
59
|
+
}
|
|
60
|
+
if (configState.configs.distance_unit?.value) {
|
|
61
|
+
unit = configState.configs.distance_unit?.value
|
|
62
|
+
}
|
|
63
|
+
if (unit.toUpperCase() === 'MI') {
|
|
64
|
+
const dist = distance * 0.621371 / 1000
|
|
65
|
+
return `${parseNumber(dist, options)} ${t('MI', 'mi')}`
|
|
66
|
+
} else {
|
|
67
|
+
return `${parseNumber(distance / 1000, options)} ${t('KM', 'km')}`
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
53
71
|
return (
|
|
54
72
|
<>
|
|
55
73
|
{logisticInformation.loading ? (
|
|
@@ -77,7 +95,7 @@ const LogisticInformationUI = (props) => {
|
|
|
77
95
|
</Button>
|
|
78
96
|
<BubbleConsole>
|
|
79
97
|
<UppercaseText><strong>{t('DISTANCE_CUSTOMER_FROM_BUSINESS', 'DISTANCE FROM CUSTOMER TO BUSINESS')}</strong></UppercaseText>
|
|
80
|
-
: {
|
|
98
|
+
: {calculateDistanceParse((logisticInformation?.data?.distance_customer_from_business))}
|
|
81
99
|
</BubbleConsole>
|
|
82
100
|
<>
|
|
83
101
|
<BubbleConsole>
|