contentoh-components-library 21.2.3 → 21.2.6

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.
@@ -22,6 +22,7 @@ var MetricSelect = function MetricSelect(_ref) {
22
22
  onChange: onChange,
23
23
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("option", {
24
24
  value: "",
25
+ disabled: true,
25
26
  children: label
26
27
  }), options === null || options === void 0 ? void 0 : options.map(function (option) {
27
28
  return /*#__PURE__*/(0, _jsxRuntime.jsx)("option", {
@@ -43,14 +43,13 @@ var DashboardMetric = function DashboardMetric(_ref) {
43
43
  displayScale = _ref$displayScale === void 0 ? false : _ref$displayScale,
44
44
  _ref$retailers = _ref.retailers,
45
45
  retailers = _ref$retailers === void 0 ? [] : _ref$retailers,
46
- setQueryObject = _ref.setQueryObject;
46
+ setQueryObject = _ref.setQueryObject,
47
+ queryObject = _ref.queryObject;
47
48
 
48
49
  var onChangeRetailer = function onChangeRetailer(e) {
49
- setQueryObject(function (current) {
50
- return (0, _objectSpread2.default)((0, _objectSpread2.default)({}, current), {}, {
51
- retailerId: e.target.value
52
- });
53
- });
50
+ setQueryObject((0, _objectSpread2.default)((0, _objectSpread2.default)({}, queryObject), {}, {
51
+ retailerId: e.target.value
52
+ }));
54
53
  };
55
54
 
56
55
  var _useState = (0, _react.useState)(new Date()),
@@ -79,12 +78,10 @@ var DashboardMetric = function DashboardMetric(_ref) {
79
78
 
80
79
  setStartDate(start);
81
80
  setEndDate(end);
82
- if (end) setQueryObject(function (current) {
83
- return (0, _objectSpread2.default)((0, _objectSpread2.default)({}, current), {}, {
84
- startDate: "".concat(start.getFullYear(), "-").concat(start.getMonth() + 1, "-").concat(start.getDate()),
85
- endDate: "".concat(end.getFullYear(), "-").concat(end.getMonth() + 1, "-").concat(end.getDate())
86
- });
87
- });
81
+ if (end) setQueryObject((0, _objectSpread2.default)((0, _objectSpread2.default)({}, queryObject), {}, {
82
+ startDate: "".concat(start.getFullYear(), "-").concat(start.getMonth() + 1, "-").concat(start.getDate()),
83
+ endDate: "".concat(end.getFullYear(), "-").concat(end.getMonth() + 1, "-").concat(end.getDate())
84
+ }));
88
85
  };
89
86
 
90
87
  var labels = Object.keys(dataObject);
@@ -72,44 +72,52 @@ var Dashboard = function Dashboard() {
72
72
  setLoading = _useState14[1];
73
73
 
74
74
  var loadProductVersions = /*#__PURE__*/function () {
75
- var _ref = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(byStatus, queryObject) {
76
- var retailerId, startDate, endDate, fullData, query, response, versionList;
75
+ var _ref = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(queryObject) {
76
+ var byStatus,
77
+ retailerId,
78
+ startDate,
79
+ endDate,
80
+ query,
81
+ endpoint,
82
+ response,
83
+ _args = arguments;
77
84
  return _regenerator.default.wrap(function _callee$(_context) {
78
85
  while (1) {
79
86
  switch (_context.prev = _context.next) {
80
87
  case 0:
81
- retailerId = queryObject.retailerId, startDate = queryObject.startDate, endDate = queryObject.endDate, fullData = queryObject.fullData;
82
- query = fullData ? "fullData=true" : "retailerId=".concat(retailerId, "&startDate=").concat(startDate, "&endDate=").concat(endDate);
83
- _context.prev = 2;
84
- _context.next = 5;
85
- return _axios.default.get(byStatus ? "".concat(process.env.REACT_APP_READ_ORDERS_BY_STATUS, "?").concat(query) : "".concat(process.env.REACT_APP_READ_REQUIRED_ORDERS, "?retailerId=").concat(retailerId, "&startDate=").concat(startDate, "&endDate=").concat(endDate));
88
+ byStatus = _args.length > 1 && _args[1] !== undefined ? _args[1] : false;
89
+ retailerId = queryObject.retailerId, startDate = queryObject.startDate, endDate = queryObject.endDate;
90
+ query = "retailerId=".concat(retailerId, "&startDate=").concat(startDate, "&endDate=").concat(endDate);
91
+ endpoint = byStatus ? process.env.REACT_APP_READ_ORDERS_BY_STATUS : process.env.REACT_APP_READ_REQUIRED_ORDERS;
92
+ _context.prev = 4;
93
+ _context.next = 7;
94
+ return _axios.default.get("".concat(endpoint, "?").concat(query));
86
95
 
87
- case 5:
96
+ case 7:
88
97
  response = _context.sent;
89
- versionList = JSON.parse(response.data.body);
90
- return _context.abrupt("return", versionList);
98
+ return _context.abrupt("return", JSON.parse(response.data.body));
91
99
 
92
- case 10:
93
- _context.prev = 10;
94
- _context.t0 = _context["catch"](2);
100
+ case 11:
101
+ _context.prev = 11;
102
+ _context.t0 = _context["catch"](4);
95
103
  console.log(_context.t0);
96
104
 
97
- case 13:
105
+ case 14:
98
106
  case "end":
99
107
  return _context.stop();
100
108
  }
101
109
  }
102
- }, _callee, null, [[2, 10]]);
110
+ }, _callee, null, [[4, 11]]);
103
111
  }));
104
112
 
105
- return function loadProductVersions(_x, _x2) {
113
+ return function loadProductVersions(_x) {
106
114
  return _ref.apply(this, arguments);
107
115
  };
108
116
  }();
109
117
 
110
118
  var getRetailers = /*#__PURE__*/function () {
111
119
  var _ref2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2() {
112
- var retailersResponse;
120
+ var retailersResponse, parsed, retailers;
113
121
  return _regenerator.default.wrap(function _callee2$(_context2) {
114
122
  while (1) {
115
123
  switch (_context2.prev = _context2.next) {
@@ -123,9 +131,15 @@ var Dashboard = function Dashboard() {
123
131
 
124
132
  case 2:
125
133
  retailersResponse = _context2.sent;
126
- setRetailers(JSON.parse(retailersResponse.data.body).data);
134
+ parsed = JSON.parse(retailersResponse.data.body).data;
135
+ retailers = Object.keys(parsed).map(function (key) {
136
+ if (key.includes('The Home Depot')) return parsed[key];
137
+ }).filter(function (f) {
138
+ return f;
139
+ });
140
+ setRetailers(retailers);
127
141
 
128
- case 4:
142
+ case 6:
129
143
  case "end":
130
144
  return _context2.stop();
131
145
  }
@@ -140,35 +154,39 @@ var Dashboard = function Dashboard() {
140
154
 
141
155
  var loadProductsByStatus = /*#__PURE__*/function () {
142
156
  var _ref3 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3(orderByStatus) {
143
- var _yield$loadProductVer, orders, fullData;
157
+ var _yield$loadProductVer, orders, fullData, total, R, ACA, PA, inProcess;
144
158
 
145
159
  return _regenerator.default.wrap(function _callee3$(_context3) {
146
160
  while (1) {
147
161
  switch (_context3.prev = _context3.next) {
148
162
  case 0:
149
163
  _context3.next = 2;
150
- return loadProductVersions(true, orderByStatus);
164
+ return loadProductVersions(orderByStatus, true);
151
165
 
152
166
  case 2:
153
167
  _yield$loadProductVer = _context3.sent;
154
168
  orders = _yield$loadProductVer.orders;
155
169
  fullData = _yield$loadProductVer.fullData;
170
+ total = fullData.total, R = fullData.R, ACA = fullData.ACA, PA = fullData.PA;
171
+ inProcess = Object.keys(fullData).reduce(function (prev, curr) {
172
+ return !['total', 'ACA', 'PA', 'R'].includes(curr) ? prev + fullData[curr] : prev;
173
+ }, 0);
156
174
  setMetricsData([{
157
175
  label: "Productos totales",
158
- value: fullData === null || fullData === void 0 ? void 0 : fullData.total
176
+ value: total
159
177
  }, {
160
178
  label: "Productos sin asignar",
161
- value: fullData === null || fullData === void 0 ? void 0 : fullData.PA
179
+ value: PA + R
162
180
  }, {
163
181
  label: "Productos en proceso",
164
- value: fullData === null || fullData === void 0 ? void 0 : fullData.CA
182
+ value: inProcess
165
183
  }, {
166
184
  label: "Productos terminados",
167
- value: fullData === null || fullData === void 0 ? void 0 : fullData.AP
185
+ value: ACA
168
186
  }]);
169
187
  setProductsByStatus(orders);
170
188
 
171
- case 7:
189
+ case 9:
172
190
  case "end":
173
191
  return _context3.stop();
174
192
  }
@@ -176,7 +194,7 @@ var Dashboard = function Dashboard() {
176
194
  }, _callee3);
177
195
  }));
178
196
 
179
- return function loadProductsByStatus(_x3) {
197
+ return function loadProductsByStatus(_x2) {
180
198
  return _ref3.apply(this, arguments);
181
199
  };
182
200
  }();
@@ -190,7 +208,7 @@ var Dashboard = function Dashboard() {
190
208
  switch (_context4.prev = _context4.next) {
191
209
  case 0:
192
210
  _context4.next = 2;
193
- return loadProductVersions(false, orderByRequired);
211
+ return loadProductVersions(orderByRequired);
194
212
 
195
213
  case 2:
196
214
  _yield$loadProductVer2 = _context4.sent;
@@ -205,7 +223,7 @@ var Dashboard = function Dashboard() {
205
223
  }, _callee4);
206
224
  }));
207
225
 
208
- return function loadRequiredProducts(_x4) {
226
+ return function loadRequiredProducts(_x3) {
209
227
  return _ref4.apply(this, arguments);
210
228
  };
211
229
  }();
@@ -223,13 +241,9 @@ var Dashboard = function Dashboard() {
223
241
  setOrderByStatus(queryObject);
224
242
  setOrderByRequired(queryObject);
225
243
  getRetailers();
244
+ loadProductsByStatus(queryObject);
245
+ loadRequiredProducts(queryObject);
226
246
  }, []);
227
- (0, _react.useEffect)(function () {
228
- loadProductsByStatus(orderByStatus);
229
- }, [orderByStatus]);
230
- (0, _react.useEffect)(function () {
231
- loadRequiredProducts(orderByRequired);
232
- }, [orderByRequired]);
233
247
  (0, _react.useEffect)(function () {
234
248
  (orderByRequired === null || orderByRequired === void 0 ? void 0 : orderByRequired.retailerId) && (orderByStatus === null || orderByStatus === void 0 ? void 0 : orderByStatus.retailerId) && metricsData.length > 0 && setLoading(false);
235
249
  }, [orderByRequired, orderByStatus, metricsData]);
@@ -251,7 +265,10 @@ var Dashboard = function Dashboard() {
251
265
  retailerSelected: orderByStatus.retailerId,
252
266
  retailers: retailers,
253
267
  queryObject: orderByStatus,
254
- setQueryObject: setOrderByStatus
268
+ setQueryObject: function setQueryObject(evt) {
269
+ loadProductsByStatus(evt);
270
+ setOrderByStatus(evt);
271
+ }
255
272
  }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_DashboardMetric.DashboardMetric, {
256
273
  label: "Productos solicitados",
257
274
  description: "Filtra los productos solicitados por fecha y alcance para revisar rápidamente el flujo de trabajo.",
@@ -263,7 +280,10 @@ var Dashboard = function Dashboard() {
263
280
  retailers: retailers,
264
281
  retailerSelected: orderByRequired.retailerId,
265
282
  queryObject: orderByRequired,
266
- setQueryObject: setOrderByRequired
283
+ setQueryObject: function setQueryObject(evt) {
284
+ loadRequiredProducts(evt);
285
+ setOrderByRequired(evt);
286
+ }
267
287
  })]
268
288
  })]
269
289
  });
@@ -33,231 +33,57 @@ RetailerProductEditionDefault.args = {
33
33
  },
34
34
  token: "eyJraWQiOiJEV3owZnNieXg2MXNFcVduN3RCXC81bVhod3ZNbFZIOTgwUnZcL3RjT0lKdEk9IiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiIwYjY2YTRhOS03NzkwLTQwMzQtYTMwYS1jMDA4MDg5NjI4NjciLCJjb2duaXRvOmdyb3VwcyI6WyJjb2xhYm9yYWRvcmVzX2NvbnRlbnRvaCJdLCJlbWFpbF92ZXJpZmllZCI6dHJ1ZSwiaXNzIjoiaHR0cHM6XC9cL2NvZ25pdG8taWRwLnVzLWVhc3QtMS5hbWF6b25hd3MuY29tXC91cy1lYXN0LTFfbFN6UVo0WjdSIiwiY29nbml0bzp1c2VybmFtZSI6IjBiNjZhNGE5LTc3OTAtNDAzNC1hMzBhLWMwMDgwODk2Mjg2NyIsImF1ZCI6IjUyZDlza2tkY2c4cWpwODhvb2sxdXNlNm1rIiwiZXZlbnRfaWQiOiIzNmIxMmUwMy0xOWJhLTRiMDktYWJiYS1kZjk3ZTFkNThjZTQiLCJ0b2tlbl91c2UiOiJpZCIsImF1dGhfdGltZSI6MTY2MDE4MjgzNywibmFtZSI6IkNvbGFib3JhZG9yIiwicGhvbmVfbnVtYmVyIjoiKzUyMTExMSIsImV4cCI6MTY2MDE4NjQzNywiaWF0IjoxNjYwMTgyODM3LCJlbWFpbCI6ImJheWFkaTE1MzhAbW5xbG0uY29tIn0.MM9nIHkrRIS2o8_s4BR6VTLgyw3ryvPrr-mf6RtnQ4smng2Q3fmtK07zInNcvcrv8EXO5J9z47_NZ5MOJDo1Pz1CV2cOYM7PT5tEn3F-W4SitqDbBw3KxfkqSMxdZUIHLWECGL-u2ATCYU2J4KRVQi8XSP1qbfv1hu9dh-vID8Fq641ccQwEqUDC13pshDPlR08legg7AAPJqoilV7wuvxqTYAK6fGqMS5jcdW2iDmU0ti9gkydXkYRIC-jg446VOmRCpwzKsk4UAPwlrGeodQ0LV1bfWn_-KVspWCRQd6U5WbFxHn0umYe3CvvPpyVmHzD3F_EMxaVyqV5aW5IoIQ",
35
35
  productSelected: {
36
- services: {
37
- datasheets: 1,
38
- descriptions: 1,
39
- images: 1
36
+ "services": {
37
+ "datasheets": 1,
38
+ "descriptions": 1,
39
+ "images": 1
40
40
  },
41
- orderId: 2296,
42
- status: "AP",
43
- datasheet_status: "AP",
44
- prio: "none",
45
- version: 8,
46
- description_status: "ACA",
47
- images_status: "AP",
48
- article: {
49
- id_article: 14701,
50
- id_category: "684",
51
- name: "Pasta Dental Colgate Total 12 Clean Mint de 100 ml",
52
- upc: "7501035911369",
53
- timestamp: "2021-10-09T16:33:17.000Z",
54
- id_user: 203,
55
- status: "Ex",
56
- active: 1,
57
- company_id: 226,
58
- SKU: null,
59
- Descripcion: null,
60
- Proveedor: null,
61
- id_proveedor: 0,
62
- company_name: "Prueba Test S.A de C.V.",
63
- country: "null",
64
- id_order: 2296,
65
- id_datasheet_especialist: 405,
66
- id_datasheet_facilitator: 158,
67
- id_description_especialist: 405,
68
- id_description_facilitator: 158,
69
- id_images_especialist: 366,
70
- id_images_facilitator: 160,
71
- id_auditor: 9,
72
- id_recepcionist: null,
73
- category: "Salud y Belleza|Cuidado Bucal|Pastas Dentales y Aseo Bucal",
74
- missingAttributes: -1,
75
- missingDescriptions: 3,
76
- missingImages: -9
41
+ "orderId": 1810,
42
+ "status": "RP",
43
+ "datasheet_status": "RP",
44
+ "prio": "none",
45
+ "version": 2,
46
+ "description_status": "RP",
47
+ "images_status": "RP",
48
+ "article": {
49
+ "id_article": 68934,
50
+ "id_category": "2290",
51
+ "name": "SCOTCHBLUE  3PACK MASKING TAPE 24MMX55M",
52
+ "upc": "167907",
53
+ "timestamp": "2022-06-22T15:44:57.000Z",
54
+ "id_user": 704,
55
+ "status": "NULL",
56
+ "active": 1,
57
+ "company_id": 437,
58
+ "SKU": null,
59
+ "Descripcion": null,
60
+ "Proveedor": null,
61
+ "id_proveedor": 0,
62
+ "company_name": "",
63
+ "country": null,
64
+ "id_order": 1810,
65
+ "id_datasheet_especialist": 1248,
66
+ "id_datasheet_facilitator": 1252,
67
+ "id_description_especialist": 1248,
68
+ "id_description_facilitator": 1252,
69
+ "id_images_especialist": 1251,
70
+ "id_images_facilitator": 1286,
71
+ "id_auditor": 514,
72
+ "id_recepcionist": null,
73
+ "category": "Pinturas|Herramientas y accesorios para pintar|Cintas",
74
+ "missingAttributes": null,
75
+ "missingDescriptions": null,
76
+ "missingImages": null
77
77
  },
78
- retailers: [{
79
- id: 4,
80
- name: "Walmart Super y Superama",
81
- country: "México",
82
- id_region: 1,
83
- active: 1,
84
- percentage: 97.61904761904763,
85
- image: "https://content-management-images.s3.amazonaws.com/retailers/4.png",
86
- services: ["NA", "NA", "NA"]
87
- }, {
88
- id: 5,
89
- name: "Chedraui",
90
- country: "México",
91
- id_region: 1,
92
- active: 1,
93
- percentage: 100,
94
- image: "https://content-management-images.s3.amazonaws.com/retailers/5.png",
95
- services: ["NA", "NA", "NA"]
96
- }, {
97
- id: 6,
98
- name: "HEB",
99
- country: "México",
100
- id_region: 1,
101
- active: 1,
102
- percentage: 100,
103
- image: "https://content-management-images.s3.amazonaws.com/retailers/6.png",
104
- services: ["AP", "ACA", "AP"]
105
- }, {
106
- id: 7,
107
- name: "Mega",
108
- country: "México",
109
- id_region: 1,
110
- active: 1,
111
- percentage: 100,
112
- image: "https://content-management-images.s3.amazonaws.com/retailers/7.png",
113
- services: ["NA", "NA", "NA"]
114
- }, {
115
- id: 8,
116
- name: "Fragua",
117
- country: "México",
118
- id_region: 1,
119
- active: 1,
120
- percentage: null,
121
- image: "https://content-management-images.s3.amazonaws.com/retailers/8.png",
122
- services: ["NA", "NA", "NA"]
123
- }, {
124
- id: 9,
125
- name: "Amazon",
126
- country: "México",
127
- id_region: 1,
128
- active: 1,
129
- percentage: 85.18518518518518,
130
- image: "https://content-management-images.s3.amazonaws.com/retailers/9.png",
131
- services: ["NA", "NA", "NA"]
132
- }, {
133
- id: 12,
134
- name: "La Comer",
135
- country: "México",
136
- id_region: 1,
137
- active: 1,
138
- percentage: 100,
139
- image: "https://content-management-images.s3.amazonaws.com/retailers/12.png",
140
- services: ["NA", "NA", "NA"]
141
- }, {
142
- id: 13,
143
- name: "Soriana",
144
- country: "México",
145
- id_region: 1,
146
- active: 1,
147
- percentage: 100,
148
- image: "https://content-management-images.s3.amazonaws.com/retailers/13.png",
149
- services: ["NA", "NA", "NA"]
150
- }, {
151
- id: 16,
152
- name: "Rappi",
153
- country: "México",
154
- id_region: 1,
155
- active: 1,
156
- percentage: 93.33333333333333,
157
- image: "https://content-management-images.s3.amazonaws.com/retailers/16.png",
158
- services: ["NA", "NA", "NA"]
159
- }, {
160
- id: 17,
161
- name: "Genérico",
162
- country: "México",
163
- id_region: 1,
164
- active: 1,
165
- percentage: 100,
166
- image: "https://content-management-images.s3.amazonaws.com/retailers/17.png",
167
- services: ["NA", "NA", "NA"]
168
- }, {
169
- id: 18,
170
- name: "Google",
171
- country: "México",
172
- id_region: 1,
173
- active: 1,
174
- percentage: 96.66666666666667,
175
- image: "https://content-management-images.s3.amazonaws.com/retailers/18.png",
176
- services: ["NA", "NA", "NA"]
177
- }, {
178
- id: 20,
179
- name: "Cornershop",
180
- country: "México",
181
- id_region: 1,
182
- active: 1,
183
- percentage: 91.66666666666667,
184
- image: "https://content-management-images.s3.amazonaws.com/retailers/20.png",
185
- services: ["NA", "NA", "NA"]
186
- }, {
187
- id: 24,
188
- name: "Alsuper",
189
- country: "México",
190
- id_region: 1,
191
- active: 1,
192
- percentage: 95.83333333333333,
193
- image: "https://content-management-images.s3.amazonaws.com/retailers/24.png",
194
- services: ["NA", "NA", "NA"]
195
- }, {
196
- id: 27,
197
- name: "IMPIRA México",
198
- country: "México",
199
- id_region: 1,
200
- active: 1,
201
- percentage: 100,
202
- image: "https://content-management-images.s3.amazonaws.com/retailers/27.png",
203
- services: ["NA", "NA", "NA"]
204
- }, {
205
- id: 29,
206
- name: "Farmacias del Ahorro",
207
- country: "México",
208
- id_region: 1,
209
- active: 1,
210
- percentage: 81.48148148148148,
211
- image: "https://content-management-images.s3.amazonaws.com/retailers/29.png",
212
- services: ["NA", "NA", "NA"]
213
- }, {
214
- id: 33,
215
- name: "Merza",
216
- country: "México",
217
- id_region: 1,
218
- active: 1,
219
- percentage: 66.66666666666667,
220
- image: "https://content-management-images.s3.amazonaws.com/retailers/33.png",
221
- services: ["NA", "NA", "NA"]
222
- }, {
223
- id: 34,
224
- name: "San Pablo",
225
- country: "México",
226
- id_region: 1,
227
- active: 1,
228
- percentage: 95.16666666666667,
229
- image: "https://content-management-images.s3.amazonaws.com/retailers/34.png",
230
- services: ["NA", "NA", "NA"]
231
- }, {
232
- id: 38,
233
- name: "Del Sol",
234
- country: "México",
235
- id_region: 1,
236
- active: 1,
237
- percentage: 100,
238
- image: "https://content-management-images.s3.amazonaws.com/retailers/38.png",
239
- services: ["NA", "NA", "NA"]
240
- }, {
241
- id: 39,
242
- name: "Justo",
243
- country: "México",
244
- id_region: 1,
245
- active: 1,
246
- percentage: 94.73684210526316,
247
- image: "https://content-management-images.s3.amazonaws.com/retailers/39.png",
248
- services: ["NA", "NA", "NA"]
249
- }, {
250
- id: 62,
251
- name: "Sanborns Café",
252
- country: "México",
253
- id_region: 1,
254
- active: 1,
255
- percentage: 100,
256
- image: "https://content-management-images.s3.amazonaws.com/retailers/62.png",
257
- services: ["NA", "NA", "NA"]
78
+ "retailers": [{
79
+ "id": 58,
80
+ "name": "The Home Depot Golden",
81
+ "country": "México",
82
+ "id_region": 1,
83
+ "active": 1
258
84
  }],
259
- country: "null",
260
- upc: "7501035911369"
85
+ "country": null,
86
+ "upc": "167907"
261
87
  },
262
88
  location: {
263
89
  product: {
@@ -266,7 +92,7 @@ RetailerProductEditionDefault.args = {
266
92
  }
267
93
  },
268
94
  user: {
269
- id_user: 423,
95
+ id_user: 1248,
270
96
  name: "Facilitador Textos",
271
97
  last_name: " ",
272
98
  email: "bayadi1538@mnqlm.com",
@@ -281,7 +107,7 @@ RetailerProductEditionDefault.args = {
281
107
  address: null,
282
108
  job: null,
283
109
  id_stripe: null,
284
- id_role: 1,
110
+ id_role: 7,
285
111
  active: 1,
286
112
  is_retailer: 0,
287
113
  email_notify: null,
@@ -1101,7 +1101,7 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
1101
1101
  return statusArray.includes(srvActive) && (["RA", "RC"].includes(product === null || product === void 0 ? void 0 : product.status) || srv.filter(function (serv) {
1102
1102
  var _serv$status;
1103
1103
 
1104
- return statusArray.includes((_serv$status = serv.status) === null || _serv$status === void 0 ? void 0 : _serv$status.replace(/.*\//, ""));
1104
+ return ["CA"].includes((_serv$status = serv.status) === null || _serv$status === void 0 ? void 0 : _serv$status.replace(/.*\//, ""));
1105
1105
  }).length === srv.length);
1106
1106
 
1107
1107
  case 4:
@@ -1897,7 +1897,7 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
1897
1897
  headerType: "input-name-header"
1898
1898
  }))]
1899
1899
  })
1900
- }), (userAssigned(activeTab) || auditorAssigned()) && product["".concat(getConcept(activeTab), "_status")] !== "NS" && /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
1900
+ }), console.log(userAssigned(activeTab), auditorAssigned()), (userAssigned(activeTab) || auditorAssigned()) && product["".concat(getConcept(activeTab), "_status")] !== "NS" && /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
1901
1901
  className: "commentary-box",
1902
1902
  children: [!comment ? /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
1903
1903
  className: "commentary",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "contentoh-components-library",
3
- "version": "21.2.3",
3
+ "version": "21.2.6",
4
4
  "dependencies": {
5
5
  "@aws-amplify/auth": "^4.5.3",
6
6
  "@aws-amplify/datastore": "^3.11.0",
@@ -22,6 +22,7 @@
22
22
  "prop-types": "^15.7.2",
23
23
  "react": "^17.0.2",
24
24
  "react-chartjs-2": "^4.0.1",
25
+ "react-datepicker": "^4.8.0",
25
26
  "react-dom": "^17.0.2",
26
27
  "react-draft-wysiwyg": "^1.14.7",
27
28
  "react-dropzone": "^12.0.4",
@@ -10,7 +10,7 @@ export const MetricSelect = ({
10
10
  return (
11
11
  <Container className={className}>
12
12
  <select value={optionSelected} onChange={onChange}>
13
- <option value="">{label}</option>
13
+ <option value="" disabled>{label}</option>
14
14
  {options?.map((option) => (
15
15
  <option key={option.name} value={option.id}>
16
16
  {option.name}
@@ -15,9 +15,11 @@ export const DashboardMetric = ({
15
15
  displayScale = false,
16
16
  retailers = [],
17
17
  setQueryObject,
18
+ queryObject
18
19
  }) => {
20
+
19
21
  const onChangeRetailer = (e) => {
20
- setQueryObject((current) => ({ ...current, retailerId: e.target.value }));
22
+ setQueryObject({ ...queryObject, retailerId: e.target.value });
21
23
  };
22
24
 
23
25
  const [startDate, setStartDate] = useState(new Date());
@@ -39,13 +41,13 @@ export const DashboardMetric = ({
39
41
  setStartDate(start);
40
42
  setEndDate(end);
41
43
  if (end)
42
- setQueryObject((current) => ({
43
- ...current,
44
+ setQueryObject({
45
+ ...queryObject,
44
46
  startDate: `${start.getFullYear()}-${
45
47
  start.getMonth() + 1
46
48
  }-${start.getDate()}`,
47
49
  endDate: `${end.getFullYear()}-${end.getMonth() + 1}-${end.getDate()}`,
48
- }));
50
+ });
49
51
  };
50
52
 
51
53
  const labels = Object.keys(dataObject);