ordering-ui-admin-external 1.21.0 → 1.21.2

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.
@@ -54,7 +54,8 @@ var OrdersListing = function OrdersListing(props) {
54
54
  allowColumns = props.allowColumns,
55
55
  setAllowColumns = props.setAllowColumns,
56
56
  handleDrop = props.handleDrop,
57
- isDelivery = props.isDelivery;
57
+ isDelivery = props.isDelivery,
58
+ saveUserSettings = props.saveUserSettings;
58
59
  var theme = (0, _styledComponents.useTheme)();
59
60
  var _useLanguage = (0, _orderingComponentsAdminExternal.useLanguage)(),
60
61
  _useLanguage2 = _slicedToArray(_useLanguage, 2),
@@ -118,7 +119,8 @@ var OrdersListing = function OrdersListing(props) {
118
119
  groupStatus: groupStatus,
119
120
  allowColumns: allowColumns,
120
121
  setAllowColumns: setAllowColumns,
121
- handleDrop: handleDrop
122
+ handleDrop: handleDrop,
123
+ saveUserSettings: saveUserSettings
122
124
  }) : /*#__PURE__*/_react.default.createElement(_OrdersCards.OrdersCards, {
123
125
  isMessagesView: isMessagesView,
124
126
  orderList: orderList,
@@ -52,7 +52,8 @@ var OrdersTable = function OrdersTable(props) {
52
52
  groupStatus = props.groupStatus,
53
53
  allowColumns = props.allowColumns,
54
54
  setAllowColumns = props.setAllowColumns,
55
- handleDrop = props.handleDrop;
55
+ handleDrop = props.handleDrop,
56
+ saveUserSettings = props.saveUserSettings;
56
57
  var _useLanguage = (0, _orderingComponentsAdminExternal.useLanguage)(),
57
58
  _useLanguage2 = _slicedToArray(_useLanguage, 2),
58
59
  t = _useLanguage2[1];
@@ -273,11 +274,14 @@ var OrdersTable = function OrdersTable(props) {
273
274
  return objectStatus && objectStatus;
274
275
  };
275
276
  var handleChangeAllowColumns = function handleChangeAllowColumns(type) {
276
- console.log(type, 'type', allowColumns);
277
277
  var _column = allowColumns[type];
278
- setAllowColumns(_objectSpread(_objectSpread({}, allowColumns), {}, _defineProperty({}, type, _objectSpread(_objectSpread({}, _column), {}, {
278
+ var updatedAllowColumns = _objectSpread(_objectSpread({}, allowColumns), {}, _defineProperty({}, type, _objectSpread(_objectSpread({}, _column), {}, {
279
279
  visable: !(_column !== null && _column !== void 0 && _column.visable)
280
- }))));
280
+ })));
281
+ setAllowColumns(updatedAllowColumns);
282
+ if (type === 'externalId') {
283
+ saveUserSettings(JSON.parse(JSON.stringify(updatedAllowColumns)));
284
+ }
281
285
  };
282
286
  var handleClickOrder = function handleClickOrder(order, e) {
283
287
  var inValid = !isSelectedOrders && (e.target.closest('.orderCheckBox') || e.target.closest('.driverInfo') || e.target.closest('.orderStatusTitle'));
@@ -45,7 +45,7 @@ var Table = _styledComponents.default.table(_templateObject5 || (_templateObject
45
45
  return (_props$theme$colors4 = props.theme.colors) === null || _props$theme$colors4 === void 0 ? void 0 : _props$theme$colors4.headingColor;
46
46
  });
47
47
  exports.Table = Table;
48
- var OrderTbody = _styledComponents.default.tbody(_templateObject9 || (_templateObject9 = _taggedTemplateLiteral(["\n border-bottom: 1px solid ", ";\n cursor: pointer;\n\n &[data-status=\"delayed\"] {\n background-color: ", ";\n td {\n border-top: 1px solid ", " !important;\n border-bottom: 1px solid ", " !important;\n }\n }\n &[data-status=\"at_risk\"] {\n background-color: ", ";\n td {\n border-top: 1px solid ", " !important;\n border-bottom: 1px solid ", " !important;\n }\n }\n &:hover {\n background-color: ", ";\n }\n &.active {\n background-color: ", ";\n td {\n border-top: 1px solid ", " !important;\n border-bottom: 1px solid ", " !important;\n }\n }\n"])), function (props) {
48
+ var OrderTbody = _styledComponents.default.tbody(_templateObject9 || (_templateObject9 = _taggedTemplateLiteral(["\n border-bottom: 1px solid ", ";\n cursor: pointer;\n\n /* &[data-status=\"delayed\"] {\n background-color: ", ";\n td {\n border-top: 1px solid ", " !important;\n border-bottom: 1px solid ", " !important;\n }\n }\n &[data-status=\"at_risk\"] {\n background-color: ", ";\n td {\n border-top: 1px solid ", " !important;\n border-bottom: 1px solid ", " !important;\n }\n } */\n &:hover {\n background-color: ", ";\n }\n &.active {\n background-color: ", ";\n td {\n border-top: 1px solid ", " !important;\n border-bottom: 1px solid ", " !important;\n }\n }\n"])), function (props) {
49
49
  return props.theme.colors.borderColor;
50
50
  }, function (props) {
51
51
  return props.theme.colors.danger100;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ordering-ui-admin-external",
3
- "version": "1.21.0",
3
+ "version": "1.21.2",
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.21.0",
86
+ "ordering-components-admin-external": "1.21.1",
87
87
  "polished": "^3.6.7",
88
88
  "prop-types": "^15.7.2",
89
89
  "react-big-calendar": "^1.4.2",
@@ -47,7 +47,8 @@ export const OrdersListing = (props) => {
47
47
  allowColumns,
48
48
  setAllowColumns,
49
49
  handleDrop,
50
- isDelivery
50
+ isDelivery,
51
+ saveUserSettings
51
52
  } = props
52
53
 
53
54
  const theme = useTheme()
@@ -130,6 +131,7 @@ export const OrdersListing = (props) => {
130
131
  allowColumns={allowColumns}
131
132
  setAllowColumns={setAllowColumns}
132
133
  handleDrop={handleDrop}
134
+ saveUserSettings={saveUserSettings}
133
135
  />
134
136
  ) : (
135
137
  <OrdersCards
@@ -53,7 +53,8 @@ export const OrdersTable = (props) => {
53
53
  groupStatus,
54
54
  allowColumns,
55
55
  setAllowColumns,
56
- handleDrop
56
+ handleDrop,
57
+ saveUserSettings
57
58
  } = props
58
59
  const [, t] = useLanguage()
59
60
  const theme = useTheme()
@@ -232,12 +233,15 @@ export const OrdersTable = (props) => {
232
233
  }
233
234
 
234
235
  const handleChangeAllowColumns = (type) => {
235
- console.log(type, 'type', allowColumns)
236
236
  const _column = allowColumns[type]
237
- setAllowColumns({
237
+ const updatedAllowColumns = {
238
238
  ...allowColumns,
239
239
  [type]: { ..._column, visable: !_column?.visable }
240
- })
240
+ }
241
+ setAllowColumns(updatedAllowColumns)
242
+ if (type === 'externalId') {
243
+ saveUserSettings(JSON.parse(JSON.stringify(updatedAllowColumns)))
244
+ }
241
245
  }
242
246
 
243
247
  const handleClickOrder = (order, e) => {
@@ -102,7 +102,7 @@ export const OrderTbody = styled.tbody`
102
102
  border-bottom: 1px solid ${props => props.theme.colors.borderColor};
103
103
  cursor: pointer;
104
104
 
105
- &[data-status="delayed"] {
105
+ /* &[data-status="delayed"] {
106
106
  background-color: ${props => props.theme.colors.danger100};
107
107
  td {
108
108
  border-top: 1px solid ${props => props.theme.colors.danger} !important;
@@ -115,7 +115,7 @@ export const OrderTbody = styled.tbody`
115
115
  border-top: 1px solid ${props => props.theme.colors.warning} !important;
116
116
  border-bottom: 1px solid ${props => props.theme.colors.warning} !important;
117
117
  }
118
- }
118
+ } */
119
119
  &:hover {
120
120
  background-color: ${props => props.theme.colors.lightPrimary};
121
121
  }