ordering-ui-admin-external 1.43.2 → 1.43.4

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.
@@ -34,7 +34,7 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
34
34
  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; } }
35
35
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
36
36
  var OrdersCards = exports.OrdersCards = function OrdersCards(props) {
37
- var _configState$configs, _franchisesList$franc, _orderList$orders;
37
+ var _configState$configs, _franchisesList$franc, _configState$configs2, _orderList$orders;
38
38
  var isMessagesView = props.isMessagesView,
39
39
  orderList = props.orderList,
40
40
  pagination = props.pagination,
@@ -78,6 +78,13 @@ var OrdersCards = exports.OrdersCards = function OrdersCards(props) {
78
78
  imageKeys[franchise.id] = franchise.logo;
79
79
  return imageKeys;
80
80
  }, {}));
81
+ var filterOptions = (configState === null || configState === void 0 || (_configState$configs2 = configState.configs) === null || _configState$configs2 === void 0 || (_configState$configs2 = _configState$configs2.filter_order_options) === null || _configState$configs2 === void 0 ? void 0 : _configState$configs2.value.split('|').map(function (value) {
82
+ return value;
83
+ })) || [];
84
+ var optionsToCheck = ['external_id', 'driver', 'driver_group_general'];
85
+ var matchingFilterOptions = filterOptions.filter(function (option) {
86
+ return optionsToCheck.includes(option);
87
+ }).length;
81
88
  var handleChangePage = function handleChangePage(page) {
82
89
  getPageOrders(pagination.pageSize, page);
83
90
  };
@@ -180,8 +187,8 @@ var OrdersCards = exports.OrdersCards = function OrdersCards(props) {
180
187
  }
181
188
  }, [orderList === null || orderList === void 0 ? void 0 : orderList.orders]);
182
189
  (0, _react.useEffect)(function () {
183
- var _configState$configs2;
184
- var slaSettings = (configState === null || configState === void 0 || (_configState$configs2 = configState.configs) === null || _configState$configs2 === void 0 || (_configState$configs2 = _configState$configs2.order_deadlines_enabled) === null || _configState$configs2 === void 0 ? void 0 : _configState$configs2.value) === '1';
190
+ var _configState$configs3;
191
+ var slaSettings = (configState === null || configState === void 0 || (_configState$configs3 = configState.configs) === null || _configState$configs3 === void 0 || (_configState$configs3 = _configState$configs3.order_deadlines_enabled) === null || _configState$configs3 === void 0 ? void 0 : _configState$configs3.value) === '1';
185
192
  setAllowColumns(_objectSpread(_objectSpread({}, allowColumns), {}, {
186
193
  timer: slaSettings,
187
194
  slaBar: slaSettings
@@ -194,7 +201,9 @@ var OrdersCards = exports.OrdersCards = function OrdersCards(props) {
194
201
  pageSize: pagination.pageSize
195
202
  });
196
203
  }, [pagination === null || pagination === void 0 ? void 0 : pagination.currentPage, pagination === null || pagination === void 0 ? void 0 : pagination.pageSize, pagination === null || pagination === void 0 ? void 0 : pagination.total]);
197
- return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_styles.OrdersListContainer, null, orderList.loading ? _toConsumableArray(Array(10).keys()).map(function (i) {
204
+ return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_styles.OrdersListContainer, {
205
+ matchingFilterOptions: matchingFilterOptions
206
+ }, orderList.loading ? _toConsumableArray(Array(10).keys()).map(function (i) {
198
207
  return /*#__PURE__*/_react.default.createElement(_styles.OrderCard, {
199
208
  key: i
200
209
  }, /*#__PURE__*/_react.default.createElement(_styles.OrderHeader, null, /*#__PURE__*/_react.default.createElement(_reactLoadingSkeleton.default, {
@@ -1,6 +1,5 @@
1
1
  "use strict";
2
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
3
  Object.defineProperty(exports, "__esModule", {
5
4
  value: true
6
5
  });
@@ -9,8 +8,35 @@ var _styledComponents = _interopRequireWildcard(require("styled-components"));
9
8
  var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10, _templateObject11, _templateObject12, _templateObject13, _templateObject14, _templateObject15, _templateObject16, _templateObject17, _templateObject18, _templateObject19, _templateObject20, _templateObject21, _templateObject22, _templateObject23, _templateObject24;
10
9
  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
10
  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; }
11
+ 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); }
12
12
  function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
13
- var OrdersListContainer = exports.OrdersListContainer = _styledComponents.default.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n height: calc(100% - 200px);\n padding: 0 12px 15px 12px;\n box-sizing: border-box;\n overflow-x: hidden;\n\n @media (min-width: 1024px) and (max-width: 1300px) {\n height: calc(100% - 230px);\n }\n"])));
13
+ 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; }
14
+ 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; }
15
+ 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; }
16
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
17
+ 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); }
18
+ var calculateHeight = function calculateHeight(matchingFilterOptions, customMappings) {
19
+ var defaultMapping = {
20
+ 3: 'calc(100% - 380px)',
21
+ 2: 'calc(100% - 320px)',
22
+ 1: 'calc(100% - 250px)',
23
+ default: 'calc(100% - 200px)'
24
+ };
25
+ var mappings = _objectSpread(_objectSpread({}, defaultMapping), customMappings);
26
+ return mappings[matchingFilterOptions] || mappings.default;
27
+ };
28
+ var OrdersListContainer = exports.OrdersListContainer = _styledComponents.default.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n height: ", ";\n padding: 0 12px 15px 12px;\n box-sizing: border-box;\n overflow-x: hidden;\n\n @media (min-width: 1024px) and (max-width: 1300px) {\n height: ", ";\n }\n"])), function (_ref) {
29
+ var matchingFilterOptions = _ref.matchingFilterOptions;
30
+ return calculateHeight(matchingFilterOptions);
31
+ }, function (_ref2) {
32
+ var matchingFilterOptions = _ref2.matchingFilterOptions;
33
+ return calculateHeight(matchingFilterOptions, {
34
+ 3: 'calc(100% - 400px)',
35
+ 2: 'calc(100% - 340px)',
36
+ 1: 'calc(100% - 270px)',
37
+ default: 'calc(100% - 230px)'
38
+ });
39
+ });
14
40
  var OrderNunberContainer = exports.OrderNunberContainer = _styledComponents.default.div(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n\n"])));
15
41
  var OrderCard = exports.OrderCard = _styledComponents.default.div(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n position: relative;\n cursor: pointer;\n border-radius: 8px;\n border: 1px solid ", ";\n margin-bottom: 20px;\n padding: 15px 20px;\n padding-left: 25px;\n\n ", "\n \n\n &:hover {\n background-color: ", ";\n }\n\n ", "\n\n p,\n h2 {\n color: ", ";\n margin: 0px;\n }\n \n h2 {\n font-size: 16px;\n font-weight: 600;\n }\n"])), function (props) {
16
42
  var _props$theme$colors;
@@ -20,8 +46,8 @@ var OrderCard = exports.OrderCard = _styledComponents.default.div(_templateObjec
20
46
  return ((_props$theme = props.theme) === null || _props$theme === void 0 ? void 0 : _props$theme.rtl) && (0, _styledComponents.css)(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n padding-left: 0px;\n padding-right: 25px;\n "])));
21
47
  }, function (props) {
22
48
  return props.theme.colors.lightPrimary;
23
- }, function (_ref) {
24
- var active = _ref.active;
49
+ }, function (_ref3) {
50
+ var active = _ref3.active;
25
51
  return active && (0, _styledComponents.css)(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n background-color: ", ";\n border: 1px solid ", ";\n "])), function (props) {
26
52
  return props.theme.colors.lightPrimary;
27
53
  }, function (props) {
@@ -45,8 +71,8 @@ var InfoItemContainer = exports.InfoItemContainer = _styledComponents.default.di
45
71
  var _props$theme$colors2;
46
72
  return (_props$theme$colors2 = props.theme.colors) === null || _props$theme$colors2 === void 0 ? void 0 : _props$theme$colors2.headingColor;
47
73
  });
48
- var WrapperImage = exports.WrapperImage = _styledComponents.default.div(_templateObject13 || (_templateObject13 = _taggedTemplateLiteral(["\n max-width: 45px;\n max-height: 45px;\n height: 45px;\n width: 45px;\n ", "\n\n img {\n width: 100%;\n height: 100%;\n border-radius: 7.6px;\n object-fit: cover;\n }\n\n svg {\n width: 100%;\n height: 100%;\n padding: 7px;\n box-sizing: border-box;\n border-radius: 50%;\n }\n"])), function (_ref2) {
49
- var isSkeleton = _ref2.isSkeleton;
74
+ var WrapperImage = exports.WrapperImage = _styledComponents.default.div(_templateObject13 || (_templateObject13 = _taggedTemplateLiteral(["\n max-width: 45px;\n max-height: 45px;\n height: 45px;\n width: 45px;\n ", "\n\n img {\n width: 100%;\n height: 100%;\n border-radius: 7.6px;\n object-fit: cover;\n }\n\n svg {\n width: 100%;\n height: 100%;\n padding: 7px;\n box-sizing: border-box;\n border-radius: 50%;\n }\n"])), function (_ref4) {
75
+ var isSkeleton = _ref4.isSkeleton;
50
76
  return !isSkeleton && (0, _styledComponents.css)(_templateObject14 || (_templateObject14 = _taggedTemplateLiteral(["\n border: 1px solid #E3E3E3;\n border-radius: 10px;\n "])));
51
77
  });
52
78
  var CardContent = exports.CardContent = _styledComponents.default.div(_templateObject15 || (_templateObject15 = _taggedTemplateLiteral(["\n display: flex;\n flex-direction: column;\n\n @media (min-width: 1300px) {\n flex-direction: row;\n }\n"])));
@@ -62,13 +88,13 @@ var UnreadMessageCounter = exports.UnreadMessageCounter = _styledComponents.defa
62
88
  var Timestatus = exports.Timestatus = _styledComponents.default.div(_templateObject20 || (_templateObject20 = _taggedTemplateLiteral(["\n position: absolute;\n width: 4px;\n height: 130px;\n border-radius: 20px;\n left: 10px;\n top: 17px;\n ", "\n ", "\n ", "\n ", "\n"])), function (props) {
63
89
  var _props$theme4;
64
90
  return ((_props$theme4 = props.theme) === null || _props$theme4 === void 0 ? void 0 : _props$theme4.rtl) && (0, _styledComponents.css)(_templateObject21 || (_templateObject21 = _taggedTemplateLiteral(["\n left: unset;\n right: 10px;\n "])));
65
- }, function (_ref3) {
66
- var timeState = _ref3.timeState;
67
- return timeState === 'in_time' && (0, _styledComponents.css)(_templateObject22 || (_templateObject22 = _taggedTemplateLiteral(["\n background-color: #00D27A;\n "])));
68
- }, function (_ref4) {
69
- var timeState = _ref4.timeState;
70
- return timeState === 'at_risk' && (0, _styledComponents.css)(_templateObject23 || (_templateObject23 = _taggedTemplateLiteral(["\n background-color: #FFC700;\n "])));
71
91
  }, function (_ref5) {
72
92
  var timeState = _ref5.timeState;
93
+ return timeState === 'in_time' && (0, _styledComponents.css)(_templateObject22 || (_templateObject22 = _taggedTemplateLiteral(["\n background-color: #00D27A;\n "])));
94
+ }, function (_ref6) {
95
+ var timeState = _ref6.timeState;
96
+ return timeState === 'at_risk' && (0, _styledComponents.css)(_templateObject23 || (_templateObject23 = _taggedTemplateLiteral(["\n background-color: #FFC700;\n "])));
97
+ }, function (_ref7) {
98
+ var timeState = _ref7.timeState;
73
99
  return timeState === 'delayed' && (0, _styledComponents.css)(_templateObject24 || (_templateObject24 = _taggedTemplateLiteral(["\n background-color: #E63757;\n "])));
74
100
  });
@@ -38,39 +38,49 @@ var OrdersHeaderFilterGroupUI = function OrdersHeaderFilterGroupUI(props) {
38
38
  var _useLanguage = (0, _orderingComponentsAdminExternal.useLanguage)(),
39
39
  _useLanguage2 = _slicedToArray(_useLanguage, 1),
40
40
  dictionary = _useLanguage2[0].dictionary;
41
- var _useState = (0, _react.useState)(false),
42
- _useState2 = _slicedToArray(_useState, 2),
43
- isShow = _useState2[0],
44
- setIsShow = _useState2[1];
45
- var metafieldRef = (0, _react.useRef)();
41
+ var wrapperRef = (0, _react.useRef)(null);
46
42
  var _useConfig = (0, _orderingComponentsAdminExternal.useConfig)(),
47
43
  _useConfig2 = _slicedToArray(_useConfig, 1),
48
44
  _useConfig2$ = _useConfig2[0],
49
45
  configs = _useConfig2$.configs,
50
46
  loading = _useConfig2$.loading;
47
+ var _useState = (0, _react.useState)({
48
+ width: null,
49
+ height: null
50
+ }),
51
+ _useState2 = _slicedToArray(_useState, 2),
52
+ wrapperSize = _useState2[0],
53
+ setWrapperSize = _useState2[1];
51
54
  var configFilter = (configs === null || configs === void 0 || (_configs$filter_order = configs.filter_order_options) === null || _configs$filter_order === void 0 ? void 0 : _configs$filter_order.value.split('|').map(function (value) {
52
55
  return value;
53
56
  })) || [];
54
- var handleClickOutside = function handleClickOutside(e) {
55
- var _metafieldRef$current;
56
- if (!isShow) return;
57
- var outsideCalendar = !((_metafieldRef$current = metafieldRef.current) !== null && _metafieldRef$current !== void 0 && _metafieldRef$current.contains(e.target));
58
- if (outsideCalendar) {
59
- setIsShow(false);
60
- }
61
- };
62
57
  (0, _react.useEffect)(function () {
63
- window.addEventListener('mouseup', handleClickOutside);
58
+ var handleResize = function handleResize() {
59
+ if (wrapperRef !== null && wrapperRef !== void 0 && wrapperRef.current) {
60
+ var _wrapperRef$current, _wrapperRef$current2;
61
+ var divWidth = wrapperRef === null || wrapperRef === void 0 || (_wrapperRef$current = wrapperRef.current) === null || _wrapperRef$current === void 0 ? void 0 : _wrapperRef$current.offsetWidth;
62
+ var divHeight = wrapperRef === null || wrapperRef === void 0 || (_wrapperRef$current2 = wrapperRef.current) === null || _wrapperRef$current2 === void 0 ? void 0 : _wrapperRef$current2.offsetHeight;
63
+ setWrapperSize({
64
+ width: divWidth,
65
+ height: divHeight
66
+ });
67
+ }
68
+ };
69
+ window.addEventListener('resize', handleResize);
70
+ handleResize();
64
71
  return function () {
65
- return window.removeEventListener('mouseup', handleClickOutside);
72
+ return window.removeEventListener('resize', handleResize);
66
73
  };
67
- }, [isShow]);
74
+ }, []);
68
75
  (0, _react.useEffect)(function () {
69
76
  if (Object.keys(filterValues).length > 0) {
70
77
  handleChangeFilterValues(filterValues);
71
78
  }
72
79
  }, [filterValues]);
73
- return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_styles2.WrapperRow, null, !loading && configFilter.includes('external_id') && /*#__PURE__*/_react.default.createElement(_Shared.SearchBar, {
80
+ return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_styles2.WrapperRow, {
81
+ ref: wrapperRef,
82
+ wrapperWidth: wrapperSize.width
83
+ }, !loading && configFilter.includes('external_id') && /*#__PURE__*/_react.default.createElement(_Shared.SearchBar, {
74
84
  placeholder: (_dictionary$EXTERNAL_ = dictionary === null || dictionary === void 0 ? void 0 : dictionary.EXTERNAL_ID) !== null && _dictionary$EXTERNAL_ !== void 0 ? _dictionary$EXTERNAL_ : 'External Id',
75
85
  onChange: handleChangeExternalId,
76
86
  search: (filterValues === null || filterValues === void 0 ? void 0 : filterValues.externalId) || '',
@@ -84,7 +94,8 @@ var OrdersHeaderFilterGroupUI = function OrdersHeaderFilterGroupUI(props) {
84
94
  value: value
85
95
  }
86
96
  });
87
- }
97
+ },
98
+ customClass: "external_id"
88
99
  }), !loading && configFilter.includes('driver') && /*#__PURE__*/_react.default.createElement(_DriverMultiSelector.DriverMultiSelector, {
89
100
  drivers: driversList.drivers,
90
101
  filterValues: filterValues,
@@ -6,15 +6,18 @@ Object.defineProperty(exports, "__esModule", {
6
6
  });
7
7
  exports.WrapperRow = exports.Option = void 0;
8
8
  var _styledComponents = _interopRequireWildcard(require("styled-components"));
9
- var _templateObject, _templateObject2;
9
+ var _templateObject, _templateObject2, _templateObject3;
10
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
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
12
  function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
13
- var WrapperRow = exports.WrapperRow = _styledComponents.default.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: flex;\n width: 100% !important;\n flex-direction: column;\n justify-content: space-between;\n padding-top: 10px;\n padding-bottom: 0px;\n\n & > div {\n width: 100%;\n height: 47px;\n margin-bottom: 20px;\n background-color: ", ";\n border: none;\n font-size: 14px;\n border-radius: 8px;\n > div:first-child {\n height: 100%;\n }\n }\n\n .order-status-multi-select {\n p {\n padding: 0;\n color: ", " !important;\n }\n }\n\n .date-filter-container {\n z-index: 100;\n }\n\n input {\n width: 100%;\n height: 47px;\n padding: 10px 25px;\n box-sizing: border-box;\n &::-webkit-outer-spin-button,\n &::-webkit-inner-spin-button {\n -webkit-appearance: none;\n margin: 0;\n }\n -moz-appearance: textfield;\n }\n\n @media (min-width: 992px) {\n flex-direction: row;\n & > div {\n width: 48%;\n }\n\n > input {\n width: 48%;\n }\n }\n"])), function (props) {
13
+ var WrapperRow = exports.WrapperRow = _styledComponents.default.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: flex;\n width: 100% !important;\n flex-direction: column;\n justify-content: flex-start;\n padding-top: 10px;\n padding-bottom: 0px;\n\n & > div {\n width: 100%;\n height: 47px;\n max-width: 1000px;\n margin-right: 10px;\n margin-bottom: 20px;\n background-color: ", ";\n border: none;\n font-size: 14px;\n border-radius: 8px;\n > div:first-child {\n height: 100%;\n }\n }\n\n .order-status-multi-select {\n p {\n padding: 0;\n color: ", " !important;\n }\n }\n\n .date-filter-container {\n z-index: 100;\n }\n\n input {\n width: 100%;\n height: 47px;\n padding: 10px 25px;\n box-sizing: border-box;\n &::-webkit-outer-spin-button,\n &::-webkit-inner-spin-button {\n -webkit-appearance: none;\n margin: 0;\n }\n -moz-appearance: textfield;\n }\n\n .close {\n right: 8px;\n }\n\n .external_id {\n @media (max-width: 1200px) {\n flex: auto;\n }\n\n }\n\n @media (min-width: 992px) {\n flex-direction: row;\n }\n\n ", "\n"])), function (props) {
14
14
  return props.theme.colors.secundary;
15
15
  }, function (props) {
16
16
  return props.theme.colors.headingColor;
17
+ }, function (_ref) {
18
+ var wrapperWidth = _ref.wrapperWidth;
19
+ return wrapperWidth < 992 && (0, _styledComponents.css)(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n flex-direction: column !important;\n "])));
17
20
  });
18
- var Option = exports.Option = _styledComponents.default.div(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n font-weight: 400;\n font-size: 14px;\n line-height: 24px;\n color: ", ";\n display: flex;\n align-items: center;\n padding: 5px;\n"])), function (props) {
21
+ var Option = exports.Option = _styledComponents.default.div(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n font-weight: 400;\n font-size: 14px;\n line-height: 24px;\n color: ", ";\n display: flex;\n align-items: center;\n padding: 5px;\n"])), function (props) {
19
22
  return props.theme.colors.secundaryContrast;
20
23
  });
@@ -113,6 +113,12 @@ var BusinessInformationUI = function BusinessInformationUI(props) {
113
113
  padding: "0px"
114
114
  }, /*#__PURE__*/_react.default.createElement("span", null, disableReasonDictionary.EXCESS_ORDERS)),
115
115
  color: 'primary'
116
+ }, {
117
+ value: disableReasonDictionary.OVEN_FAILURE,
118
+ content: /*#__PURE__*/_react.default.createElement(_styles2.Option, {
119
+ padding: "0px"
120
+ }, /*#__PURE__*/_react.default.createElement("span", null, disableReasonDictionary.OVEN_FAILURE)),
121
+ color: 'primary'
116
122
  }, {
117
123
  value: disableReasonDictionary.NO_ELECTRIC_POWER,
118
124
  content: /*#__PURE__*/_react.default.createElement(_styles2.Option, {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ordering-ui-admin-external",
3
- "version": "1.43.2",
3
+ "version": "1.43.4",
4
4
  "description": "Ordering UI Admin Components",
5
5
  "main": "./_modules/index.js",
6
6
  "exports": {
@@ -55,11 +55,11 @@ export const DeliveryDashboard = (props) => {
55
55
  return (
56
56
  <DeliveryDashboardContainer>
57
57
  <OrdersContainer>
58
- <OrdersHeaderFilterGroup
59
- driverGroupList={driverGroupList}
60
- driversList={driversList}
61
- handleChangeFilterValues={handleChangeFilterValues}
62
- />
58
+ <OrdersHeaderFilterGroup
59
+ driverGroupList={driverGroupList}
60
+ driversList={driversList}
61
+ handleChangeFilterValues={handleChangeFilterValues}
62
+ />
63
63
  <FilterContainer>
64
64
  <OrderStatusFilterBar
65
65
  isUseQuery={isUseQuery}
@@ -56,6 +56,11 @@ export const OrdersCards = (props) => {
56
56
  return imageKeys
57
57
  }, {})
58
58
 
59
+ const filterOptions = (configState?.configs?.filter_order_options?.value.split('|').map(value => value) || [])
60
+ const optionsToCheck = ['external_id', 'driver', 'driver_group_general']
61
+
62
+ const matchingFilterOptions = filterOptions.filter(option => optionsToCheck.includes(option)).length
63
+
59
64
  const handleChangePage = (page) => {
60
65
  getPageOrders(pagination.pageSize, page)
61
66
  }
@@ -180,7 +185,7 @@ export const OrdersCards = (props) => {
180
185
 
181
186
  return (
182
187
  <>
183
- <OrdersListContainer>
188
+ <OrdersListContainer matchingFilterOptions={matchingFilterOptions}>
184
189
  {orderList.loading ? (
185
190
  [...Array(10).keys()].map(i => (
186
191
  <OrderCard key={i}>
@@ -1,13 +1,33 @@
1
1
  import styled, { css } from 'styled-components'
2
2
 
3
+ const calculateHeight = (matchingFilterOptions, customMappings) => {
4
+ const defaultMapping = {
5
+ 3: 'calc(100% - 380px)',
6
+ 2: 'calc(100% - 320px)',
7
+ 1: 'calc(100% - 250px)',
8
+ default: 'calc(100% - 200px)'
9
+ }
10
+
11
+ const mappings = { ...defaultMapping, ...customMappings }
12
+
13
+ return mappings[matchingFilterOptions] || mappings.default
14
+ }
15
+
3
16
  export const OrdersListContainer = styled.div`
4
- height: calc(100% - 200px);
17
+ height: ${({ matchingFilterOptions }) => calculateHeight(matchingFilterOptions)};
5
18
  padding: 0 12px 15px 12px;
6
19
  box-sizing: border-box;
7
20
  overflow-x: hidden;
8
21
 
9
22
  @media (min-width: 1024px) and (max-width: 1300px) {
10
- height: calc(100% - 230px);
23
+ height: ${({ matchingFilterOptions }) =>
24
+ calculateHeight(matchingFilterOptions, {
25
+ 3: 'calc(100% - 400px)',
26
+ 2: 'calc(100% - 340px)',
27
+ 1: 'calc(100% - 270px)',
28
+ default: 'calc(100% - 230px)'
29
+ }
30
+ )};
11
31
  }
12
32
  `
13
33
  export const OrderNunberContainer = styled.div`
@@ -106,32 +106,32 @@ export const OrdersContentHeader = memo((props) => {
106
106
  />
107
107
  </SLAControlsWrapper>
108
108
  )}
109
- <WrapperSearchAndFilter
110
- fullWidth={isDisableTitle}
111
- >
112
- {isShowSearchFilters && (
113
- <SearchBar
114
- isCustomLayout
115
- lazyLoad
116
- onSearch={handleChangeSearch}
117
- search={searchValue}
118
- placeholder={t('SEARCH', 'Search')}
119
- />
120
- )}
121
- <OrdersFilterGroup
122
- isLateralBar={isLateralBar}
123
- filterModalOpen={filterModalOpen}
124
- setFilterModalOpen={setFilterModalOpen}
125
- driverGroupList={driverGroupList}
126
- driversList={driversList}
127
- paymethodsList={paymethodsList}
128
- businessesList={businessesList}
129
- citiesList={citiesList}
130
- handleChangeFilterValues={handleChangeFilterValues}
131
- searchValue={searchValue}
132
- handleChangeSearch={handleChangeSearch}
109
+ <WrapperSearchAndFilter
110
+ fullWidth={isDisableTitle}
111
+ >
112
+ {isShowSearchFilters && (
113
+ <SearchBar
114
+ isCustomLayout
115
+ lazyLoad
116
+ onSearch={handleChangeSearch}
117
+ search={searchValue}
118
+ placeholder={t('SEARCH', 'Search')}
133
119
  />
134
- </WrapperSearchAndFilter>
120
+ )}
121
+ <OrdersFilterGroup
122
+ isLateralBar={isLateralBar}
123
+ filterModalOpen={filterModalOpen}
124
+ setFilterModalOpen={setFilterModalOpen}
125
+ driverGroupList={driverGroupList}
126
+ driversList={driversList}
127
+ paymethodsList={paymethodsList}
128
+ businessesList={businessesList}
129
+ citiesList={citiesList}
130
+ handleChangeFilterValues={handleChangeFilterValues}
131
+ searchValue={searchValue}
132
+ handleChangeSearch={handleChangeSearch}
133
+ />
134
+ </WrapperSearchAndFilter>
135
135
  </TopRightSection>
136
136
  </OrderContentHeaderContainer>
137
137
  </>
@@ -21,23 +21,27 @@ const OrdersHeaderFilterGroupUI = (props) => {
21
21
  } = props
22
22
 
23
23
  const [{ dictionary }] = useLanguage()
24
- const [isShow, setIsShow] = useState(false)
25
- const metafieldRef = useRef()
24
+ const wrapperRef = useRef(null)
26
25
  const [{ configs, loading }] = useConfig()
26
+ const [wrapperSize, setWrapperSize] = useState({ width: null, height: null })
27
+
27
28
  const configFilter = configs?.filter_order_options?.value.split('|').map(value => (value)) || []
28
29
 
29
- const handleClickOutside = (e) => {
30
- if (!isShow) return
31
- const outsideCalendar = !metafieldRef.current?.contains(e.target)
32
- if (outsideCalendar) {
33
- setIsShow(false)
30
+ useEffect(() => {
31
+ const handleResize = () => {
32
+ if (wrapperRef?.current) {
33
+ const divWidth = wrapperRef?.current?.offsetWidth
34
+ const divHeight = wrapperRef?.current?.offsetHeight
35
+ setWrapperSize({ width: divWidth, height: divHeight })
36
+ }
34
37
  }
35
- }
36
38
 
37
- useEffect(() => {
38
- window.addEventListener('mouseup', handleClickOutside)
39
- return () => window.removeEventListener('mouseup', handleClickOutside)
40
- }, [isShow])
39
+ window.addEventListener('resize', handleResize)
40
+
41
+ handleResize()
42
+
43
+ return () => (window.removeEventListener('resize', handleResize))
44
+ }, [])
41
45
 
42
46
  useEffect(() => {
43
47
  if (Object.keys(filterValues).length > 0) {
@@ -47,7 +51,7 @@ const OrdersHeaderFilterGroupUI = (props) => {
47
51
 
48
52
  return (
49
53
  <>
50
- <WrapperRow>
54
+ <WrapperRow ref={wrapperRef} wrapperWidth={wrapperSize.width}>
51
55
  {!loading && configFilter.includes('external_id') && (
52
56
  <SearchBar
53
57
  placeholder={dictionary?.EXTERNAL_ID ?? 'External Id'}
@@ -58,6 +62,7 @@ const OrdersHeaderFilterGroupUI = (props) => {
58
62
  lazyLoad
59
63
  CustomInput={Input}
60
64
  onSearch={(value) => handleChangeExternalId({ target: { value } })}
65
+ customClass='external_id'
61
66
  />
62
67
  )}
63
68
  {!loading && configFilter.includes('driver') && (
@@ -4,13 +4,15 @@ export const WrapperRow = styled.div`
4
4
  display: flex;
5
5
  width: 100% !important;
6
6
  flex-direction: column;
7
- justify-content: space-between;
7
+ justify-content: flex-start;
8
8
  padding-top: 10px;
9
9
  padding-bottom: 0px;
10
10
 
11
11
  & > div {
12
12
  width: 100%;
13
13
  height: 47px;
14
+ max-width: 1000px;
15
+ margin-right: 10px;
14
16
  margin-bottom: 20px;
15
17
  background-color: ${props => props.theme.colors.secundary};
16
18
  border: none;
@@ -45,16 +47,24 @@ export const WrapperRow = styled.div`
45
47
  -moz-appearance: textfield;
46
48
  }
47
49
 
50
+ .close {
51
+ right: 8px;
52
+ }
53
+
54
+ .external_id {
55
+ @media (max-width: 1200px) {
56
+ flex: auto;
57
+ }
58
+
59
+ }
60
+
48
61
  @media (min-width: 992px) {
49
62
  flex-direction: row;
50
- & > div {
51
- width: 48%;
52
- }
53
-
54
- > input {
55
- width: 48%;
56
- }
57
63
  }
64
+
65
+ ${({ wrapperWidth }) => wrapperWidth < 992 && css`
66
+ flex-direction: column !important;
67
+ `}
58
68
  `
59
69
  export const Option = styled.div`
60
70
  font-weight: 400;
@@ -93,6 +93,11 @@ const BusinessInformationUI = (props) => {
93
93
  content: <Option padding='0px'><span>{disableReasonDictionary.EXCESS_ORDERS}</span></Option>,
94
94
  color: 'primary'
95
95
  },
96
+ {
97
+ value: disableReasonDictionary.OVEN_FAILURE,
98
+ content: <Option padding='0px'><span>{disableReasonDictionary.OVEN_FAILURE}</span></Option>,
99
+ color: 'primary'
100
+ },
96
101
  {
97
102
  value: disableReasonDictionary.NO_ELECTRIC_POWER,
98
103
  content: <Option padding='0px'><span>{disableReasonDictionary.NO_ELECTRIC_POWER}</span></Option>,