contentoh-components-library 21.4.52 → 21.4.53
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.
|
@@ -231,7 +231,7 @@ var Dashboard = function Dashboard(_ref) {
|
|
|
231
231
|
|
|
232
232
|
var loadProductsByStatus = /*#__PURE__*/function () {
|
|
233
233
|
var _ref4 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3(orderByStatus) {
|
|
234
|
-
var isRetailer, isProvider, isCollaborator, _ref5, ordersBydate, ordersByStatus, _ordersByStatus$total, total, _ordersByStatus$R, R, _ordersByStatus$PA, PA, _ordersByStatus$Ex, Ex, _ordersByStatus$ACA, ACA, productsFinished, inProcess, metricsArray;
|
|
234
|
+
var isRetailer, isProvider, isCollaborator, _ref5, ordersBydate, ordersByStatus, ordersByActive, _ordersByStatus$total, total, _ordersByStatus$R, R, _ordersByStatus$PA, PA, _ordersByStatus$Ex, Ex, _ordersByStatus$ACA, ACA, productsFinished, inProcess, registeredProducts, metricsArray;
|
|
235
235
|
|
|
236
236
|
return _regenerator.default.wrap(function _callee3$(_context3) {
|
|
237
237
|
while (1) {
|
|
@@ -257,6 +257,7 @@ var Dashboard = function Dashboard(_ref) {
|
|
|
257
257
|
_ref5 = _context3.t0;
|
|
258
258
|
ordersBydate = _ref5.ordersBydate;
|
|
259
259
|
ordersByStatus = _ref5.ordersByStatus;
|
|
260
|
+
ordersByActive = _ref5.ordersByActive;
|
|
260
261
|
_ordersByStatus$total = ordersByStatus.total, total = _ordersByStatus$total === void 0 ? 0 : _ordersByStatus$total, _ordersByStatus$R = ordersByStatus.R, R = _ordersByStatus$R === void 0 ? 0 : _ordersByStatus$R, _ordersByStatus$PA = ordersByStatus.PA, PA = _ordersByStatus$PA === void 0 ? 0 : _ordersByStatus$PA, _ordersByStatus$Ex = ordersByStatus.Ex, Ex = _ordersByStatus$Ex === void 0 ? 0 : _ordersByStatus$Ex, _ordersByStatus$ACA = ordersByStatus.ACA, ACA = _ordersByStatus$ACA === void 0 ? 0 : _ordersByStatus$ACA;
|
|
261
262
|
productsFinished = 0;
|
|
262
263
|
if (isRetailer) productsFinished = Ex;
|
|
@@ -265,11 +266,16 @@ var Dashboard = function Dashboard(_ref) {
|
|
|
265
266
|
inProcess = Object.keys(ordersByStatus).reduce(function (prev, curr) {
|
|
266
267
|
return !["total", "PA", "R", "Ex", "ACA"].includes(curr) ? prev + ordersByStatus[curr] : prev;
|
|
267
268
|
}, 0);
|
|
269
|
+
registeredProducts = ordersByActive.registered;
|
|
268
270
|
metricsArray = [metricsData[0] ? metricsData[0] : {
|
|
269
271
|
label: "Productos totales",
|
|
270
272
|
value: total
|
|
271
273
|
}];
|
|
274
|
+
console.log(registeredProducts);
|
|
272
275
|
metricsArray.push({
|
|
276
|
+
label: "Productos activos",
|
|
277
|
+
value: registeredProducts
|
|
278
|
+
}, {
|
|
273
279
|
label: "Productos filtrados",
|
|
274
280
|
value: total
|
|
275
281
|
}, {
|
|
@@ -288,7 +294,7 @@ var Dashboard = function Dashboard(_ref) {
|
|
|
288
294
|
setRequiredProducts(ordersBydate);
|
|
289
295
|
setProductsByStatus(ordersByStatus);
|
|
290
296
|
|
|
291
|
-
case
|
|
297
|
+
case 27:
|
|
292
298
|
case "end":
|
|
293
299
|
return _context3.stop();
|
|
294
300
|
}
|
package/package.json
CHANGED
|
@@ -84,7 +84,7 @@ export const Dashboard = ({ jwt, user, company }) => {
|
|
|
84
84
|
const isRetailer = user.is_retailer && company.retailers;
|
|
85
85
|
const isProvider = !user.is_retailer && user.id_role === 0;
|
|
86
86
|
const isCollaborator = user.id_role > 0;
|
|
87
|
-
const { ordersBydate, ordersByStatus } =
|
|
87
|
+
const { ordersBydate, ordersByStatus, ordersByActive } =
|
|
88
88
|
(await loadProductVersions(orderByStatus)) || {};
|
|
89
89
|
|
|
90
90
|
const { total = 0, R = 0, PA = 0, Ex = 0, ACA = 0 } = ordersByStatus;
|
|
@@ -100,13 +100,18 @@ export const Dashboard = ({ jwt, user, company }) => {
|
|
|
100
100
|
: prev,
|
|
101
101
|
0
|
|
102
102
|
);
|
|
103
|
+
|
|
104
|
+
const registeredProducts = ordersByActive.registered;
|
|
103
105
|
let metricsArray = [
|
|
104
106
|
metricsData[0]
|
|
105
107
|
? metricsData[0]
|
|
106
108
|
: { label: "Productos totales", value: total },
|
|
107
109
|
];
|
|
108
110
|
|
|
111
|
+
console.log(registeredProducts);
|
|
112
|
+
|
|
109
113
|
metricsArray.push(
|
|
114
|
+
{ label: "Productos activos", value: registeredProducts },
|
|
110
115
|
{ label: "Productos filtrados", value: total },
|
|
111
116
|
{ label: "Productos sin asignar", value: PA + R },
|
|
112
117
|
{ label: "Productos en proceso", value: inProcess },
|