contentoh-components-library 21.2.2 → 21.2.5

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
  });
@@ -31,59 +31,233 @@ RetailerProductEditionDefault.args = {
31
31
  "Ficha técnica": false,
32
32
  Imágenes: false
33
33
  },
34
- token: "eyJraWQiOiJEV3owZnNieXg2MXNFcVduN3RCXC81bVhod3ZNbFZIOTgwUnZcL3RjT0lKdEk9IiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiIwYjY2YTRhOS03NzkwLTQwMzQtYTMwYS1jMDA4MDg5NjI4NjciLCJjb2duaXRvOmdyb3VwcyI6WyJjb2xhYm9yYWRvcmVzX2NvbnRlbnRvaCJdLCJlbWFpbF92ZXJpZmllZCI6dHJ1ZSwiaXNzIjoiaHR0cHM6XC9cL2NvZ25pdG8taWRwLnVzLWVhc3QtMS5hbWF6b25hd3MuY29tXC91cy1lYXN0LTFfbFN6UVo0WjdSIiwiY29nbml0bzp1c2VybmFtZSI6IjBiNjZhNGE5LTc3OTAtNDAzNC1hMzBhLWMwMDgwODk2Mjg2NyIsImF1ZCI6IjUyZDlza2tkY2c4cWpwODhvb2sxdXNlNm1rIiwiZXZlbnRfaWQiOiI4ZjA2YmU0NC04ZWEzLTQ5OWMtOGFjZC0xMDlmMDZiZWI1MjAiLCJ0b2tlbl91c2UiOiJpZCIsImF1dGhfdGltZSI6MTY2MDA3NjQ5MywibmFtZSI6IkNvbGFib3JhZG9yIiwicGhvbmVfbnVtYmVyIjoiKzUyMTExMSIsImV4cCI6MTY2MDA4MDA5MywiaWF0IjoxNjYwMDc2NDkzLCJlbWFpbCI6ImJheWFkaTE1MzhAbW5xbG0uY29tIn0.aw_x1A8WR2MCp_Kz-T2Jcg0ZtuKwyzQ23yT_OoKr-aGJmEjSPihmksWgLZr9hJXyfvU0JndaVMM_3DRly1TdtJ264zwH4dZ7Cp9gF4TSXG16HQxIIPUA4NnwdpOnlBdE9E27mCXs4XYnCZ7dRMXnkjpRL4PVbrGji9qbEEJR6TxCJafR-zes1o4HC1KfQ5QF4s5I_LYQYbD-Ot0A1zDiJg34HR9tTILu5f4uc_2Nj8bqqYJsEdKg982WWO9ac2uKRPXQqNL6CsdltnSeQQcnS6Wj5DJTRRoc-lRdE6ekpAvDGPo0Dyj1Q8GYH3uxvM-pVu8J1Z_JOtO5j5mPN9krpA",
34
+ token: "eyJraWQiOiJEV3owZnNieXg2MXNFcVduN3RCXC81bVhod3ZNbFZIOTgwUnZcL3RjT0lKdEk9IiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiIwYjY2YTRhOS03NzkwLTQwMzQtYTMwYS1jMDA4MDg5NjI4NjciLCJjb2duaXRvOmdyb3VwcyI6WyJjb2xhYm9yYWRvcmVzX2NvbnRlbnRvaCJdLCJlbWFpbF92ZXJpZmllZCI6dHJ1ZSwiaXNzIjoiaHR0cHM6XC9cL2NvZ25pdG8taWRwLnVzLWVhc3QtMS5hbWF6b25hd3MuY29tXC91cy1lYXN0LTFfbFN6UVo0WjdSIiwiY29nbml0bzp1c2VybmFtZSI6IjBiNjZhNGE5LTc3OTAtNDAzNC1hMzBhLWMwMDgwODk2Mjg2NyIsImF1ZCI6IjUyZDlza2tkY2c4cWpwODhvb2sxdXNlNm1rIiwiZXZlbnRfaWQiOiIzNmIxMmUwMy0xOWJhLTRiMDktYWJiYS1kZjk3ZTFkNThjZTQiLCJ0b2tlbl91c2UiOiJpZCIsImF1dGhfdGltZSI6MTY2MDE4MjgzNywibmFtZSI6IkNvbGFib3JhZG9yIiwicGhvbmVfbnVtYmVyIjoiKzUyMTExMSIsImV4cCI6MTY2MDE4NjQzNywiaWF0IjoxNjYwMTgyODM3LCJlbWFpbCI6ImJheWFkaTE1MzhAbW5xbG0uY29tIn0.MM9nIHkrRIS2o8_s4BR6VTLgyw3ryvPrr-mf6RtnQ4smng2Q3fmtK07zInNcvcrv8EXO5J9z47_NZ5MOJDo1Pz1CV2cOYM7PT5tEn3F-W4SitqDbBw3KxfkqSMxdZUIHLWECGL-u2ATCYU2J4KRVQi8XSP1qbfv1hu9dh-vID8Fq641ccQwEqUDC13pshDPlR08legg7AAPJqoilV7wuvxqTYAK6fGqMS5jcdW2iDmU0ti9gkydXkYRIC-jg446VOmRCpwzKsk4UAPwlrGeodQ0LV1bfWn_-KVspWCRQd6U5WbFxHn0umYe3CvvPpyVmHzD3F_EMxaVyqV5aW5IoIQ",
35
35
  productSelected: {
36
36
  services: {
37
- datasheets: 0,
38
- descriptions: 0,
37
+ datasheets: 1,
38
+ descriptions: 1,
39
39
  images: 1
40
40
  },
41
- orderId: 1789,
42
- status: "ACA",
43
- datasheet_status: "NS",
41
+ orderId: 2296,
42
+ status: "AP",
43
+ datasheet_status: "AP",
44
44
  prio: "none",
45
- version: 2,
46
- description_status: "NS",
47
- images_status: "ACA",
45
+ version: 8,
46
+ description_status: "ACA",
47
+ images_status: "AP",
48
48
  article: {
49
- id_article: 68865,
50
- id_category: "2999",
51
- name: "RESIZE",
52
- upc: "169955",
53
- timestamp: "2022-06-21T16:03:10.000Z",
54
- id_user: 1238,
55
- status: "NULL",
56
- active: 0,
57
- company_id: 819,
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
58
  SKU: null,
59
59
  Descripcion: null,
60
60
  Proveedor: null,
61
61
  id_proveedor: 0,
62
- company_name: "The Home Depot Resize",
63
- country: "México",
64
- id_order: 1789,
65
- id_datasheet_especialist: null,
66
- id_datasheet_facilitator: null,
67
- id_description_especialist: null,
68
- id_description_facilitator: null,
69
- id_images_especialist: 1250,
70
- id_images_facilitator: 424,
71
- id_auditor: null,
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
72
  id_recepcionist: null,
73
- category: "Resizing|Resizing|Resizing",
74
- missingAttributes: null,
75
- missingDescriptions: null,
76
- missingImages: null
73
+ category: "Salud y Belleza|Cuidado Bucal|Pastas Dentales y Aseo Bucal",
74
+ missingAttributes: -1,
75
+ missingDescriptions: 3,
76
+ missingImages: -9
77
77
  },
78
78
  retailers: [{
79
- id: 60,
80
- name: "The Home Depot Resizing",
79
+ id: 4,
80
+ name: "Walmart Super y Superama",
81
81
  country: "México",
82
82
  id_region: 1,
83
- active: 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"]
84
258
  }],
85
- country: "México",
86
- upc: "169955"
259
+ country: "null",
260
+ upc: "7501035911369"
87
261
  },
88
262
  location: {
89
263
  product: {
@@ -92,15 +266,15 @@ RetailerProductEditionDefault.args = {
92
266
  }
93
267
  },
94
268
  user: {
95
- id_user: 425,
96
- name: "Auditor QA",
269
+ id_user: 423,
270
+ name: "Facilitador Textos",
97
271
  last_name: " ",
98
- email: "ladiboh785@mi166.com",
272
+ email: "bayadi1538@mnqlm.com",
99
273
  position: "Tester",
100
274
  telephone: null,
101
275
  country: null,
102
276
  id_company: 254,
103
- id_cognito: "23a3f496-4e38-4e12-9bf5-7f90b77a2f35",
277
+ id_cognito: "0b66a4a9-7790-4034-a30a-c00808962867",
104
278
  birth_Date: null,
105
279
  about_me: null,
106
280
  zip_code: null,
@@ -122,6 +296,6 @@ RetailerProductEditionDefault.args = {
122
296
  products_limit: "1000",
123
297
  type: "Enterprise"
124
298
  },
125
- src: "https://content-management-profile-prod.s3.amazonaws.com/id-425/425.png?1659649029658"
299
+ src: "https://content-management-profile-prod.s3.amazonaws.com/id-423/423.png?1660182839373"
126
300
  }
127
301
  };
@@ -118,7 +118,7 @@ var reducerImages = function reducerImages(state, action) {
118
118
 
119
119
  case "changeAttrValue":
120
120
  var index = attrForImgs.general.findIndex(function (f) {
121
- return f.id = action.id;
121
+ return f.id === action.id;
122
122
  });
123
123
 
124
124
  if (index !== -1) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "contentoh-components-library",
3
- "version": "21.2.2",
3
+ "version": "21.2.5",
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);