contentoh-components-library 21.6.38 → 21.6.39
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.
|
@@ -176,7 +176,7 @@ function _regenerateVideoThumbnails() {
|
|
|
176
176
|
|
|
177
177
|
case 2:
|
|
178
178
|
return _context18.abrupt("return", Promise.all(values.map( /*#__PURE__*/function () {
|
|
179
|
-
var
|
|
179
|
+
var _ref22 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee17(value) {
|
|
180
180
|
var base64, videoSrc, thumbnail;
|
|
181
181
|
return _regenerator.default.wrap(function _callee17$(_context17) {
|
|
182
182
|
while (1) {
|
|
@@ -221,7 +221,7 @@ function _regenerateVideoThumbnails() {
|
|
|
221
221
|
}));
|
|
222
222
|
|
|
223
223
|
return function (_x10) {
|
|
224
|
-
return
|
|
224
|
+
return _ref22.apply(this, arguments);
|
|
225
225
|
};
|
|
226
226
|
}())));
|
|
227
227
|
|
|
@@ -1073,26 +1073,35 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
|
|
|
1073
1073
|
|
|
1074
1074
|
return ((_state$product5 = state.product) === null || _state$product5 === void 0 ? void 0 : _state$product5.id_auditor) === (user === null || user === void 0 ? void 0 : user.id_user);
|
|
1075
1075
|
};
|
|
1076
|
+
/**
|
|
1077
|
+
* ¿Ocupo este slot EN ESTE producto?
|
|
1078
|
+
*
|
|
1079
|
+
* La calidad en la que actúas sale de la ASIGNACIÓN, no del rol. Con la
|
|
1080
|
+
* estructura nueva de Creators, quien produce un servicio también lo valida:
|
|
1081
|
+
* un especialista de textos puede ser el auditor del mismo producto y tiene
|
|
1082
|
+
* que recorrer las dos fases, AS -> AC como especialista y AC -> AA como QA.
|
|
1083
|
+
*/
|
|
1076
1084
|
|
|
1077
|
-
|
|
1085
|
+
|
|
1086
|
+
var isAssignedAs = function isAssignedAs(rol, concept) {
|
|
1078
1087
|
var _state$product6;
|
|
1079
1088
|
|
|
1089
|
+
var assigned = (_state$product6 = state.product) === null || _state$product6 === void 0 ? void 0 : _state$product6["id_".concat(concept, "_").concat(rol)];
|
|
1090
|
+
return !!assigned && assigned === (user === null || user === void 0 ? void 0 : user.id_user);
|
|
1091
|
+
};
|
|
1092
|
+
|
|
1093
|
+
var isUserAssignedToService = function isUserAssignedToService(tab, rol) {
|
|
1080
1094
|
var concept = (0, _utils.getConceptByTab)(state.active_tab);
|
|
1081
1095
|
var allowedRoles = [1, 4, 5, 6, 7, 8];
|
|
1082
|
-
var validUser = allowedRoles.includes(user === null || user === void 0 ? void 0 : user.id_role);
|
|
1083
|
-
|
|
1084
|
-
if (!rol) {
|
|
1085
|
-
if (user.id_role === 4 || user.id_role === 5) {
|
|
1086
|
-
rol = "facilitator";
|
|
1087
|
-
} else if (user.id_role === 7 || user.id_role === 8) {
|
|
1088
|
-
rol = "especialist";
|
|
1089
|
-
}
|
|
1090
|
-
}
|
|
1091
|
-
|
|
1096
|
+
var validUser = allowedRoles.includes(user === null || user === void 0 ? void 0 : user.id_role);
|
|
1092
1097
|
var isAdmin = user.id_role === 1;
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1098
|
+
if (isAdmin) return true; // Sin `rol` explícito se prueba por asignación, no por rol. Antes se
|
|
1099
|
+
// infería del `id_role`: un rol 6 caía en `id_<concept>_undefined` —columna
|
|
1100
|
+
// inexistente, siempre falso— y un rol 7 solo podía ser especialista, nunca
|
|
1101
|
+
// auditor. Es el mismo defecto que se corrigió en el backend.
|
|
1102
|
+
|
|
1103
|
+
var isAssigned = rol ? isAssignedAs(rol, concept) : isAssignedAs("especialist", concept) || isAssignedAs("facilitator", concept);
|
|
1104
|
+
return isAssigned && validUser;
|
|
1096
1105
|
};
|
|
1097
1106
|
|
|
1098
1107
|
var canShowSingleEvaluationButtons = function canShowSingleEvaluationButtons(action) {
|
|
@@ -1103,10 +1112,13 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
|
|
|
1103
1112
|
var _state$active_retaile2;
|
|
1104
1113
|
|
|
1105
1114
|
return srv.id_retailer === ((_state$active_retaile2 = state.active_retailer) === null || _state$active_retaile2 === void 0 ? void 0 : _state$active_retaile2.id_retailer) && srv.service === concept;
|
|
1106
|
-
})) === null || _state$services_data$ === void 0 ? void 0 : (_state$services_data$2 = _state$services_data$.status) === null || _state$services_data$2 === void 0 ? void 0 : _state$services_data$2.replace(/.*\//, "");
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1115
|
+
})) === null || _state$services_data$ === void 0 ? void 0 : (_state$services_data$2 = _state$services_data$.status) === null || _state$services_data$2 === void 0 ? void 0 : _state$services_data$2.replace(/.*\//, ""); // Se SUMA la vía por asignación a la que ya había por rol; no la
|
|
1116
|
+
// reemplaza. Así los coordinadores y el administrador conservan su acceso
|
|
1117
|
+
// tal cual, y el especialista que además es auditor alcanza la segunda fase.
|
|
1118
|
+
|
|
1119
|
+
var canEvaluateAsFacilitator = retailerStatus === "IE" && ([1, 4, 5].includes(user.id_role) || isAssignedAs("facilitator", concept));
|
|
1120
|
+
var canEvaluateAsAuditor = ["AC", "RP", "RCA", "SAC"].includes(retailerStatus) && ([1, 6].includes(user.id_role) || isAuditorAssigned());
|
|
1121
|
+
return canEvaluateAsFacilitator || canEvaluateAsAuditor;
|
|
1110
1122
|
};
|
|
1111
1123
|
|
|
1112
1124
|
var canShowBulkEvaluationButtons = function canShowBulkEvaluationButtons() {
|
|
@@ -1115,17 +1127,20 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
|
|
|
1115
1127
|
var service = _ref7.service;
|
|
1116
1128
|
return concepts.includes(service);
|
|
1117
1129
|
});
|
|
1118
|
-
var
|
|
1130
|
+
var canEvaluateAsFacilitator = services.every(function (srv) {
|
|
1119
1131
|
var _srv$status;
|
|
1120
1132
|
|
|
1121
1133
|
return (srv === null || srv === void 0 ? void 0 : (_srv$status = srv.status) === null || _srv$status === void 0 ? void 0 : _srv$status.replace(/.*\//, "")) === "IE";
|
|
1122
|
-
}) && [1, 4, 5].includes(user.id_role)
|
|
1123
|
-
|
|
1134
|
+
}) && ([1, 4, 5].includes(user.id_role) || services.some(function (_ref8) {
|
|
1135
|
+
var service = _ref8.service;
|
|
1136
|
+
return isAssignedAs("facilitator", service);
|
|
1137
|
+
}));
|
|
1138
|
+
var canEvaluateAsAuditor = state.services_data.every(function (srv) {
|
|
1124
1139
|
var _srv$status2;
|
|
1125
1140
|
|
|
1126
1141
|
return ["AC", "RP", "RCA"].includes(srv === null || srv === void 0 ? void 0 : (_srv$status2 = srv.status) === null || _srv$status2 === void 0 ? void 0 : _srv$status2.replace(/.*\//, ""));
|
|
1127
|
-
}) && [1, 6].includes(user.id_role);
|
|
1128
|
-
return
|
|
1142
|
+
}) && ([1, 6].includes(user.id_role) || isAuditorAssigned());
|
|
1143
|
+
return canEvaluateAsFacilitator || canEvaluateAsAuditor;
|
|
1129
1144
|
};
|
|
1130
1145
|
|
|
1131
1146
|
var getStatusByCurrentServiceAndRetailer = function getStatusByCurrentServiceAndRetailer() {
|
|
@@ -1156,7 +1171,7 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
|
|
|
1156
1171
|
|
|
1157
1172
|
|
|
1158
1173
|
var loadFamily = /*#__PURE__*/function () {
|
|
1159
|
-
var
|
|
1174
|
+
var _ref9 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee5() {
|
|
1160
1175
|
var forzar,
|
|
1161
1176
|
_state$product8,
|
|
1162
1177
|
res,
|
|
@@ -1213,7 +1228,7 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
|
|
|
1213
1228
|
}));
|
|
1214
1229
|
|
|
1215
1230
|
return function loadFamily() {
|
|
1216
|
-
return
|
|
1231
|
+
return _ref9.apply(this, arguments);
|
|
1217
1232
|
};
|
|
1218
1233
|
}();
|
|
1219
1234
|
/*
|
|
@@ -1321,8 +1336,8 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
|
|
|
1321
1336
|
};
|
|
1322
1337
|
|
|
1323
1338
|
var openFamilyMember = /*#__PURE__*/function () {
|
|
1324
|
-
var
|
|
1325
|
-
var _readPayload, res,
|
|
1339
|
+
var _ref10 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee6(articleId) {
|
|
1340
|
+
var _readPayload, res, _ref11, data, encontrado;
|
|
1326
1341
|
|
|
1327
1342
|
return _regenerator.default.wrap(function _callee6$(_context6) {
|
|
1328
1343
|
while (1) {
|
|
@@ -1347,7 +1362,7 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
|
|
|
1347
1362
|
// read-order-services responde { total, data: [...] }. La vista trae una
|
|
1348
1363
|
// fila por orden, así que puede haber varias del mismo artículo; llegan
|
|
1349
1364
|
// ordenadas por order_id DESC y la primera es la orden más reciente.
|
|
1350
|
-
|
|
1365
|
+
_ref11 = (_readPayload = (0, _api.readPayload)(res)) !== null && _readPayload !== void 0 ? _readPayload : {}, data = _ref11.data;
|
|
1351
1366
|
encontrado = (data !== null && data !== void 0 ? data : []).find(function (item) {
|
|
1352
1367
|
var _item$article;
|
|
1353
1368
|
|
|
@@ -1394,7 +1409,7 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
|
|
|
1394
1409
|
}));
|
|
1395
1410
|
|
|
1396
1411
|
return function openFamilyMember(_x3) {
|
|
1397
|
-
return
|
|
1412
|
+
return _ref10.apply(this, arguments);
|
|
1398
1413
|
};
|
|
1399
1414
|
}();
|
|
1400
1415
|
/*
|
|
@@ -1483,7 +1498,7 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
|
|
|
1483
1498
|
|
|
1484
1499
|
|
|
1485
1500
|
var handleOnRestoreInheritance = /*#__PURE__*/function () {
|
|
1486
|
-
var
|
|
1501
|
+
var _ref12 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee7(attributeId) {
|
|
1487
1502
|
var _state$product14;
|
|
1488
1503
|
|
|
1489
1504
|
var kind,
|
|
@@ -1569,7 +1584,7 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
|
|
|
1569
1584
|
}));
|
|
1570
1585
|
|
|
1571
1586
|
return function handleOnRestoreInheritance(_x4) {
|
|
1572
|
-
return
|
|
1587
|
+
return _ref12.apply(this, arguments);
|
|
1573
1588
|
};
|
|
1574
1589
|
}();
|
|
1575
1590
|
/*
|
|
@@ -1596,7 +1611,7 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
|
|
|
1596
1611
|
};
|
|
1597
1612
|
|
|
1598
1613
|
var handleOnClickSave = /*#__PURE__*/function () {
|
|
1599
|
-
var
|
|
1614
|
+
var _ref13 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee8() {
|
|
1600
1615
|
var _familia$variants, cambios, familia, hijos;
|
|
1601
1616
|
|
|
1602
1617
|
return _regenerator.default.wrap(function _callee8$(_context8) {
|
|
@@ -1751,7 +1766,7 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
|
|
|
1751
1766
|
}));
|
|
1752
1767
|
|
|
1753
1768
|
return function handleOnClickSave() {
|
|
1754
|
-
return
|
|
1769
|
+
return _ref13.apply(this, arguments);
|
|
1755
1770
|
};
|
|
1756
1771
|
}();
|
|
1757
1772
|
|
|
@@ -1819,7 +1834,7 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
|
|
|
1819
1834
|
};
|
|
1820
1835
|
|
|
1821
1836
|
var handleOnApproveSingleService = /*#__PURE__*/function () {
|
|
1822
|
-
var
|
|
1837
|
+
var _ref14 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee9() {
|
|
1823
1838
|
return _regenerator.default.wrap(function _callee9$(_context9) {
|
|
1824
1839
|
while (1) {
|
|
1825
1840
|
switch (_context9.prev = _context9.next) {
|
|
@@ -1836,7 +1851,7 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
|
|
|
1836
1851
|
}));
|
|
1837
1852
|
|
|
1838
1853
|
return function handleOnApproveSingleService() {
|
|
1839
|
-
return
|
|
1854
|
+
return _ref14.apply(this, arguments);
|
|
1840
1855
|
};
|
|
1841
1856
|
}();
|
|
1842
1857
|
|
|
@@ -1845,7 +1860,7 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
|
|
|
1845
1860
|
};
|
|
1846
1861
|
|
|
1847
1862
|
var sendSingleEvaluation = /*#__PURE__*/function () {
|
|
1848
|
-
var
|
|
1863
|
+
var _ref15 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee10(result) {
|
|
1849
1864
|
var _state$product$id_ord, _state$active_retaile4;
|
|
1850
1865
|
|
|
1851
1866
|
var concept, articleId, orderId, sectionStatusKey, evalStatus, retailerId, data, res, message, icon, activeTab, newStatuses, serviceStatus, articleStatus, updatedStatusByRetailer, updatedProduct, specialistDone, _objectSpread2, _state$services_data2, _JSON$parse2, newStatus, newOrderStatus, newArticleStatus, _articleStatus, updatedStatusByRetailerForSend, _updatedProduct, updatedServicesData, sessionProduct, _objectSpread3, productInSession, updatedProductInSession;
|
|
@@ -2071,12 +2086,12 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
|
|
|
2071
2086
|
}));
|
|
2072
2087
|
|
|
2073
2088
|
return function sendSingleEvaluation(_x5) {
|
|
2074
|
-
return
|
|
2089
|
+
return _ref15.apply(this, arguments);
|
|
2075
2090
|
};
|
|
2076
2091
|
}();
|
|
2077
2092
|
|
|
2078
2093
|
var handleOnApproveAllServices = /*#__PURE__*/function () {
|
|
2079
|
-
var
|
|
2094
|
+
var _ref16 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee11() {
|
|
2080
2095
|
return _regenerator.default.wrap(function _callee11$(_context11) {
|
|
2081
2096
|
while (1) {
|
|
2082
2097
|
switch (_context11.prev = _context11.next) {
|
|
@@ -2093,7 +2108,7 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
|
|
|
2093
2108
|
}));
|
|
2094
2109
|
|
|
2095
2110
|
return function handleOnApproveAllServices() {
|
|
2096
|
-
return
|
|
2111
|
+
return _ref16.apply(this, arguments);
|
|
2097
2112
|
};
|
|
2098
2113
|
}();
|
|
2099
2114
|
|
|
@@ -2103,7 +2118,7 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
|
|
|
2103
2118
|
};
|
|
2104
2119
|
|
|
2105
2120
|
var sendBulkEvaluation = /*#__PURE__*/function () {
|
|
2106
|
-
var
|
|
2121
|
+
var _ref17 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee12(result) {
|
|
2107
2122
|
var _state$services_data3, evaluationArray, conceptArray, status, updatedStatusByRetailer, updatedProduct, updatedServicesData;
|
|
2108
2123
|
|
|
2109
2124
|
return _regenerator.default.wrap(function _callee12$(_context12) {
|
|
@@ -2219,12 +2234,12 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
|
|
|
2219
2234
|
}));
|
|
2220
2235
|
|
|
2221
2236
|
return function sendBulkEvaluation(_x6) {
|
|
2222
|
-
return
|
|
2237
|
+
return _ref17.apply(this, arguments);
|
|
2223
2238
|
};
|
|
2224
2239
|
}();
|
|
2225
2240
|
|
|
2226
2241
|
var handleOnChangeAssignations = /*#__PURE__*/function () {
|
|
2227
|
-
var
|
|
2242
|
+
var _ref18 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee13(assignationType, assignationId) {
|
|
2228
2243
|
var concept, data, updatedProduct;
|
|
2229
2244
|
return _regenerator.default.wrap(function _callee13$(_context13) {
|
|
2230
2245
|
while (1) {
|
|
@@ -2265,7 +2280,7 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
|
|
|
2265
2280
|
}));
|
|
2266
2281
|
|
|
2267
2282
|
return function handleOnChangeAssignations(_x7, _x8) {
|
|
2268
|
-
return
|
|
2283
|
+
return _ref18.apply(this, arguments);
|
|
2269
2284
|
};
|
|
2270
2285
|
}();
|
|
2271
2286
|
|
|
@@ -2300,7 +2315,7 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
|
|
|
2300
2315
|
};
|
|
2301
2316
|
|
|
2302
2317
|
var handleOnSubmitComment = /*#__PURE__*/function () {
|
|
2303
|
-
var
|
|
2318
|
+
var _ref19 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee14(e) {
|
|
2304
2319
|
var commentText;
|
|
2305
2320
|
return _regenerator.default.wrap(function _callee14$(_context14) {
|
|
2306
2321
|
while (1) {
|
|
@@ -2348,7 +2363,7 @@ var RetailerProductEditionView = function RetailerProductEditionView(_ref) {
|
|
|
2348
2363
|
}));
|
|
2349
2364
|
|
|
2350
2365
|
return function handleOnSubmitComment(_x9) {
|
|
2351
|
-
return
|
|
2366
|
+
return _ref19.apply(this, arguments);
|
|
2352
2367
|
};
|
|
2353
2368
|
}();
|
|
2354
2369
|
|
package/package.json
CHANGED
|
@@ -707,26 +707,38 @@ const RetailerProductEditionView = ({
|
|
|
707
707
|
return state.product?.id_auditor === user?.id_user;
|
|
708
708
|
};
|
|
709
709
|
|
|
710
|
+
/**
|
|
711
|
+
* ¿Ocupo este slot EN ESTE producto?
|
|
712
|
+
*
|
|
713
|
+
* La calidad en la que actúas sale de la ASIGNACIÓN, no del rol. Con la
|
|
714
|
+
* estructura nueva de Creators, quien produce un servicio también lo valida:
|
|
715
|
+
* un especialista de textos puede ser el auditor del mismo producto y tiene
|
|
716
|
+
* que recorrer las dos fases, AS -> AC como especialista y AC -> AA como QA.
|
|
717
|
+
*/
|
|
718
|
+
const isAssignedAs = (rol, concept) => {
|
|
719
|
+
const assigned = state.product?.[`id_${concept}_${rol}`];
|
|
720
|
+
return !!assigned && assigned === user?.id_user;
|
|
721
|
+
};
|
|
722
|
+
|
|
710
723
|
const isUserAssignedToService = (tab, rol) => {
|
|
711
724
|
const concept = getConceptByTab(state.active_tab);
|
|
712
725
|
|
|
713
726
|
const allowedRoles = [1, 4, 5, 6, 7, 8];
|
|
714
727
|
const validUser = allowedRoles.includes(user?.id_role);
|
|
715
728
|
|
|
716
|
-
// Determinar rol por defecto si no se pasa
|
|
717
|
-
if (!rol) {
|
|
718
|
-
if (user.id_role === 4 || user.id_role === 5) {
|
|
719
|
-
rol = "facilitator";
|
|
720
|
-
} else if (user.id_role === 7 || user.id_role === 8) {
|
|
721
|
-
rol = "especialist";
|
|
722
|
-
}
|
|
723
|
-
}
|
|
724
|
-
|
|
725
729
|
const isAdmin = user.id_role === 1;
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
+
if (isAdmin) return true;
|
|
731
|
+
|
|
732
|
+
// Sin `rol` explícito se prueba por asignación, no por rol. Antes se
|
|
733
|
+
// infería del `id_role`: un rol 6 caía en `id_<concept>_undefined` —columna
|
|
734
|
+
// inexistente, siempre falso— y un rol 7 solo podía ser especialista, nunca
|
|
735
|
+
// auditor. Es el mismo defecto que se corrigió en el backend.
|
|
736
|
+
const isAssigned = rol
|
|
737
|
+
? isAssignedAs(rol, concept)
|
|
738
|
+
: isAssignedAs("especialist", concept) ||
|
|
739
|
+
isAssignedAs("facilitator", concept);
|
|
740
|
+
|
|
741
|
+
return isAssigned && validUser;
|
|
730
742
|
};
|
|
731
743
|
|
|
732
744
|
const canShowSingleEvaluationButtons = (action) => {
|
|
@@ -740,13 +752,19 @@ const RetailerProductEditionView = ({
|
|
|
740
752
|
)
|
|
741
753
|
?.status?.replace(/.*\//, "");
|
|
742
754
|
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
755
|
+
// Se SUMA la vía por asignación a la que ya había por rol; no la
|
|
756
|
+
// reemplaza. Así los coordinadores y el administrador conservan su acceso
|
|
757
|
+
// tal cual, y el especialista que además es auditor alcanza la segunda fase.
|
|
758
|
+
const canEvaluateAsFacilitator =
|
|
759
|
+
retailerStatus === "IE" &&
|
|
760
|
+
([1, 4, 5].includes(user.id_role) ||
|
|
761
|
+
isAssignedAs("facilitator", concept));
|
|
762
|
+
|
|
763
|
+
const canEvaluateAsAuditor =
|
|
746
764
|
["AC", "RP", "RCA", "SAC"].includes(retailerStatus) &&
|
|
747
|
-
[1, 6].includes(user.id_role);
|
|
765
|
+
([1, 6].includes(user.id_role) || isAuditorAssigned());
|
|
748
766
|
|
|
749
|
-
return
|
|
767
|
+
return canEvaluateAsFacilitator || canEvaluateAsAuditor;
|
|
750
768
|
};
|
|
751
769
|
|
|
752
770
|
const canShowBulkEvaluationButtons = () => {
|
|
@@ -756,15 +774,17 @@ const RetailerProductEditionView = ({
|
|
|
756
774
|
concepts.includes(service),
|
|
757
775
|
);
|
|
758
776
|
|
|
759
|
-
const
|
|
777
|
+
const canEvaluateAsFacilitator =
|
|
760
778
|
services.every((srv) => srv?.status?.replace(/.*\//, "") === "IE") &&
|
|
761
|
-
[1, 4, 5].includes(user.id_role)
|
|
779
|
+
([1, 4, 5].includes(user.id_role) ||
|
|
780
|
+
services.some(({ service }) => isAssignedAs("facilitator", service)));
|
|
762
781
|
|
|
763
|
-
const
|
|
782
|
+
const canEvaluateAsAuditor =
|
|
764
783
|
state.services_data.every((srv) =>
|
|
765
784
|
["AC", "RP", "RCA"].includes(srv?.status?.replace(/.*\//, "")),
|
|
766
|
-
) && [1, 6].includes(user.id_role);
|
|
767
|
-
|
|
785
|
+
) && ([1, 6].includes(user.id_role) || isAuditorAssigned());
|
|
786
|
+
|
|
787
|
+
return canEvaluateAsFacilitator || canEvaluateAsAuditor;
|
|
768
788
|
};
|
|
769
789
|
|
|
770
790
|
const getStatusByCurrentServiceAndRetailer = () => {
|