contentoh-components-library 21.1.10 → 21.1.13
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.
- package/dist/components/molecules/TableHeader/index.js +4 -2
- package/dist/components/organisms/ImageDataTable/index.js +3 -1
- package/dist/components/pages/ProviderProductEdition/ProviderProductEdition.stories.js +77 -87
- package/dist/components/pages/ProviderProductEdition/index.js +52 -302
- package/dist/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +49 -43
- package/dist/components/pages/RetailerProductEdition/index.js +99 -160
- package/package.json +1 -1
- package/src/components/molecules/TableHeader/index.js +2 -0
- package/src/components/organisms/ImageDataTable/index.js +2 -0
- package/src/components/pages/ProviderProductEdition/ProviderProductEdition.stories.js +75 -90
- package/src/components/pages/ProviderProductEdition/index.js +18 -306
- package/src/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +50 -43
- package/src/components/pages/RetailerProductEdition/index.js +99 -181
|
@@ -479,7 +479,12 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
479
479
|
services = _context2.sent;
|
|
480
480
|
//Converts the data inside the datasheets object to array
|
|
481
481
|
setServices(services);
|
|
482
|
-
getServices();
|
|
482
|
+
getServices();
|
|
483
|
+
|
|
484
|
+
if (!originProp) {
|
|
485
|
+
setActiveRetailer(product.retailers[0] || product.availableRetailers[0]);
|
|
486
|
+
} //setActiveRetailer(product?.retailers[0]);
|
|
487
|
+
|
|
483
488
|
|
|
484
489
|
setImages({
|
|
485
490
|
action: "init",
|
|
@@ -493,7 +498,7 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
493
498
|
});
|
|
494
499
|
setLoading(false);
|
|
495
500
|
|
|
496
|
-
case
|
|
501
|
+
case 10:
|
|
497
502
|
case "end":
|
|
498
503
|
return _context2.stop();
|
|
499
504
|
}
|
|
@@ -510,7 +515,7 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
510
515
|
var _ref4 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3() {
|
|
511
516
|
var _product$article3;
|
|
512
517
|
|
|
513
|
-
var productInOrder, idArticle, _product$id_order, _servicesResponse$dat, servicesResponse, parsedResponse;
|
|
518
|
+
var productInOrder, idArticle, _product$id_order, _servicesResponse$dat, servicesResponse, parsedResponse, retailers, active;
|
|
514
519
|
|
|
515
520
|
return _regenerator.default.wrap(function _callee3$(_context3) {
|
|
516
521
|
while (1) {
|
|
@@ -520,7 +525,7 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
520
525
|
idArticle = (product === null || product === void 0 ? void 0 : product.id_article) || (product === null || product === void 0 ? void 0 : (_product$article3 = product.article) === null || _product$article3 === void 0 ? void 0 : _product$article3.id_article);
|
|
521
526
|
|
|
522
527
|
if (!(isRevision() || productInOrder)) {
|
|
523
|
-
_context3.next =
|
|
528
|
+
_context3.next = 11;
|
|
524
529
|
break;
|
|
525
530
|
}
|
|
526
531
|
|
|
@@ -530,9 +535,16 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
530
535
|
case 5:
|
|
531
536
|
servicesResponse = _context3.sent;
|
|
532
537
|
parsedResponse = JSON.parse(servicesResponse === null || servicesResponse === void 0 ? void 0 : (_servicesResponse$dat = servicesResponse.data) === null || _servicesResponse$dat === void 0 ? void 0 : _servicesResponse$dat.body).data;
|
|
538
|
+
retailers = product.retailers || product.retailersAvailable;
|
|
539
|
+
active = retailers === null || retailers === void 0 ? void 0 : retailers.filter(function (retailer) {
|
|
540
|
+
return parsedResponse === null || parsedResponse === void 0 ? void 0 : parsedResponse.map(function (srv) {
|
|
541
|
+
return srv.id_retailer;
|
|
542
|
+
}).includes(retailer.id);
|
|
543
|
+
})[0];
|
|
544
|
+
!activeRetailer.id && setActiveRetailer(active ? active : retailers[0]);
|
|
533
545
|
setServicesData(parsedResponse);
|
|
534
546
|
|
|
535
|
-
case
|
|
547
|
+
case 11:
|
|
536
548
|
case "end":
|
|
537
549
|
return _context3.stop();
|
|
538
550
|
}
|
|
@@ -545,24 +557,12 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
545
557
|
};
|
|
546
558
|
}();
|
|
547
559
|
|
|
548
|
-
var translateConcept = function translateConcept(concept) {
|
|
549
|
-
var translation = "";
|
|
550
|
-
|
|
551
|
-
if (concept === "datasheet") {
|
|
552
|
-
translation = "Ficha técnica";
|
|
553
|
-
} else if (concept === "description") {
|
|
554
|
-
translation = "Descripción";
|
|
555
|
-
} else if (concept === "images") {
|
|
556
|
-
translation = "Imágenes";
|
|
557
|
-
}
|
|
558
|
-
|
|
559
|
-
return translation;
|
|
560
|
-
};
|
|
561
|
-
|
|
562
560
|
var isRevision = function isRevision() {
|
|
563
561
|
if (productEdit) {
|
|
564
562
|
var concept = getConcept(activeTab);
|
|
565
|
-
|
|
563
|
+
|
|
564
|
+
var _isRetailer = user.is_retailer === 1;
|
|
565
|
+
|
|
566
566
|
var currentService = productEdit === null || productEdit === void 0 ? void 0 : productEdit.product["".concat(concept, "_status")];
|
|
567
567
|
var orgn = origin[activeTab];
|
|
568
568
|
|
|
@@ -616,56 +616,46 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
616
616
|
}();
|
|
617
617
|
|
|
618
618
|
(0, _react.useEffect)( /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee5() {
|
|
619
|
-
var
|
|
619
|
+
var arr;
|
|
620
620
|
return _regenerator.default.wrap(function _callee5$(_context5) {
|
|
621
621
|
while (1) {
|
|
622
622
|
switch (_context5.prev = _context5.next) {
|
|
623
623
|
case 0:
|
|
624
624
|
sessionStorage.setItem("user", JSON.stringify(user));
|
|
625
625
|
loadData();
|
|
626
|
-
retailers = product.retailers || product.retailersAvailable;
|
|
627
|
-
active = retailers === null || retailers === void 0 ? void 0 : retailers.filter(function (retailer) {
|
|
628
|
-
return servicesData === null || servicesData === void 0 ? void 0 : servicesData.map(function (srv) {
|
|
629
|
-
return srv.id_retailer;
|
|
630
|
-
}).includes(retailer.id);
|
|
631
|
-
})[0];
|
|
632
|
-
setActiveRetailer(active ? active : retailers[0]); // getPercentage({ data: [product] }).then((res) =>
|
|
633
|
-
// setPercentages(res)
|
|
634
|
-
// );
|
|
635
|
-
|
|
636
626
|
getCart();
|
|
637
627
|
_context5.t0 = setUserGroups;
|
|
638
|
-
_context5.next =
|
|
628
|
+
_context5.next = 6;
|
|
639
629
|
return (0, _data2.fetchUsers)(token);
|
|
640
630
|
|
|
641
|
-
case
|
|
631
|
+
case 6:
|
|
642
632
|
_context5.t1 = _context5.sent;
|
|
643
633
|
(0, _context5.t0)(_context5.t1);
|
|
644
634
|
arr = [];
|
|
645
635
|
_context5.t2 = user.id_role;
|
|
646
|
-
_context5.next = _context5.t2 === 7 ?
|
|
636
|
+
_context5.next = _context5.t2 === 7 ? 12 : _context5.t2 === 8 ? 12 : _context5.t2 === 4 ? 14 : _context5.t2 === 5 ? 14 : _context5.t2 === 6 ? 16 : 18;
|
|
647
637
|
break;
|
|
648
638
|
|
|
649
|
-
case
|
|
639
|
+
case 12:
|
|
650
640
|
arr = ["IN_PROGRESS", "RF", "RA"];
|
|
651
|
-
return _context5.abrupt("break",
|
|
641
|
+
return _context5.abrupt("break", 20);
|
|
652
642
|
|
|
653
|
-
case
|
|
643
|
+
case 14:
|
|
654
644
|
arr = ["RF", "AF", "AA", "AP", "AC"];
|
|
655
|
-
return _context5.abrupt("break",
|
|
645
|
+
return _context5.abrupt("break", 20);
|
|
656
646
|
|
|
657
|
-
case
|
|
647
|
+
case 16:
|
|
658
648
|
arr = ["RP", "RC", "AF"];
|
|
659
|
-
return _context5.abrupt("break",
|
|
649
|
+
return _context5.abrupt("break", 20);
|
|
660
650
|
|
|
661
|
-
case
|
|
651
|
+
case 18:
|
|
662
652
|
arr = [];
|
|
663
|
-
return _context5.abrupt("break",
|
|
653
|
+
return _context5.abrupt("break", 20);
|
|
664
654
|
|
|
665
|
-
case
|
|
655
|
+
case 20:
|
|
666
656
|
setStatusArray(arr);
|
|
667
657
|
|
|
668
|
-
case
|
|
658
|
+
case 21:
|
|
669
659
|
case "end":
|
|
670
660
|
return _context5.stop();
|
|
671
661
|
}
|
|
@@ -695,7 +685,8 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
695
685
|
setProduct(productTemp);
|
|
696
686
|
setActivePercentage((_retailers$ = retailers[0]) === null || _retailers$ === void 0 ? void 0 : _retailers$.percentage);
|
|
697
687
|
}, [percentages]);
|
|
698
|
-
|
|
688
|
+
|
|
689
|
+
var loadInputs = function loadInputs() {
|
|
699
690
|
if (services.length > 0) {
|
|
700
691
|
var _services$0$activeRet, _services$2, _services$3;
|
|
701
692
|
|
|
@@ -711,7 +702,11 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
711
702
|
setDatasheets([datagroups, inputs]);
|
|
712
703
|
setDescriptions(_descriptions);
|
|
713
704
|
}
|
|
714
|
-
}
|
|
705
|
+
};
|
|
706
|
+
|
|
707
|
+
(0, _react.useEffect)(function () {
|
|
708
|
+
loadInputs();
|
|
709
|
+
}, [servicesData, activeRetailer, services]);
|
|
715
710
|
|
|
716
711
|
var thumbs = function thumbs() {
|
|
717
712
|
var _images$imageType, _images$imagePackagin, _images$values;
|
|
@@ -1032,41 +1027,6 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
1032
1027
|
}, _callee9, null, [[2, 10]]);
|
|
1033
1028
|
})), [dataImages, imagesUploaded]);
|
|
1034
1029
|
|
|
1035
|
-
var evaluationFinished = function evaluationFinished(userId, tab, statusArray) {// const srv = servicesData.filter((serv) => serv.service === getConcept(tab));
|
|
1036
|
-
// const [srvActive] = srv.filter(
|
|
1037
|
-
// (serv) => serv.id_retailer === activeRetailer?.id
|
|
1038
|
-
// );
|
|
1039
|
-
// const unvalidated =
|
|
1040
|
-
// product[`${getConcept(tab)}_status`] === "QF" ||
|
|
1041
|
-
// product[`${getConcept(tab)}_status`] === "IN_PROGRESS";
|
|
1042
|
-
// switch (userId) {
|
|
1043
|
-
// case 7:
|
|
1044
|
-
// case 8:
|
|
1045
|
-
// return (
|
|
1046
|
-
// (["RA", "RF"].includes(product?.status) &&
|
|
1047
|
-
// statusArray.includes(srvActive?.status)) ||
|
|
1048
|
-
// (statusArray.includes(product.status) &&
|
|
1049
|
-
// srv.filter((serv) => statusArray.includes(serv.status)).length ===
|
|
1050
|
-
// srv.length)
|
|
1051
|
-
// );
|
|
1052
|
-
// case 4:
|
|
1053
|
-
// case 5:
|
|
1054
|
-
// return (
|
|
1055
|
-
// unvalidated &&
|
|
1056
|
-
// ["IN_PROGRESS", "QF"].includes(product.status) &&
|
|
1057
|
-
// srv.filter((serv) => statusArray.includes(serv.status)).length ===
|
|
1058
|
-
// srv.length
|
|
1059
|
-
// );
|
|
1060
|
-
// case 6:
|
|
1061
|
-
// return (
|
|
1062
|
-
// statusArray.includes(product.status) &&
|
|
1063
|
-
// servicesData.every((serv) => ["RA", "AA"].includes(serv.status))
|
|
1064
|
-
// );
|
|
1065
|
-
// default:
|
|
1066
|
-
// break;
|
|
1067
|
-
// }
|
|
1068
|
-
};
|
|
1069
|
-
|
|
1070
1030
|
var getConcept = function getConcept(tab) {
|
|
1071
1031
|
switch (tab) {
|
|
1072
1032
|
case "Descripción":
|
|
@@ -1078,24 +1038,7 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
1078
1038
|
case "Imágenes":
|
|
1079
1039
|
return "images";
|
|
1080
1040
|
}
|
|
1081
|
-
};
|
|
1082
|
-
// let concept = getConcept(activeTab);
|
|
1083
|
-
// concept = action ? action : concept;
|
|
1084
|
-
// const [retailerStatus] = servicesData.filter(
|
|
1085
|
-
// (srv) => srv.id_retailer === activeRetailer?.id && srv.service === concept
|
|
1086
|
-
// );
|
|
1087
|
-
// return (
|
|
1088
|
-
// (retailerStatus?.status === "QF" &&
|
|
1089
|
-
// (user.id_role === 1 || user.id_role === 4 || user.id_role === 5)) ||
|
|
1090
|
-
// (retailerStatus?.status === "AF" && //sessionStorage product
|
|
1091
|
-
// (user.id_role === 1 || user.id_role === 6)) ||
|
|
1092
|
-
// (retailerStatus?.status === "RP" &&
|
|
1093
|
-
// (user.id_role === 1 || user.id_role === 6)) ||
|
|
1094
|
-
// (retailerStatus?.status === "RC" &&
|
|
1095
|
-
// (user.id_role === 1 || user.id_role === 6))
|
|
1096
|
-
// );
|
|
1097
|
-
// };
|
|
1098
|
-
|
|
1041
|
+
};
|
|
1099
1042
|
|
|
1100
1043
|
var getSectionIcon = function getSectionIcon() {
|
|
1101
1044
|
switch (activeTab) {
|
|
@@ -1114,131 +1057,6 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
1114
1057
|
default:
|
|
1115
1058
|
break;
|
|
1116
1059
|
}
|
|
1117
|
-
}; // const sendToFacilitator = async (result) => {
|
|
1118
|
-
// setLoading(true);
|
|
1119
|
-
// try {
|
|
1120
|
-
// let concept = getConcept(activeTab);
|
|
1121
|
-
// let productTemp = { ...product };
|
|
1122
|
-
// let evalStatus = product[`${concept}_status`];
|
|
1123
|
-
// let data = {};
|
|
1124
|
-
// if (result) {
|
|
1125
|
-
// //updateCompaniesList(evalStatus, result, activeRetailer.id, concept);
|
|
1126
|
-
// data = {
|
|
1127
|
-
// articleId: product.id_article,
|
|
1128
|
-
// orderId: product.orderId,
|
|
1129
|
-
// concept: concept,
|
|
1130
|
-
// result: result,
|
|
1131
|
-
// evalStatus: evalStatus,
|
|
1132
|
-
// retailerId: activeRetailer.id,
|
|
1133
|
-
// };
|
|
1134
|
-
// await axios.put(`${process.env.REACT_APP_EVALUATION_ENDPOINT}`, data, {
|
|
1135
|
-
// headers: {
|
|
1136
|
-
// Authorization: token,
|
|
1137
|
-
// },
|
|
1138
|
-
// });
|
|
1139
|
-
// getServices();
|
|
1140
|
-
// } else {
|
|
1141
|
-
// const specialistDone =
|
|
1142
|
-
// evalStatus === "RF" ||
|
|
1143
|
-
// evalStatus === "RA" ||
|
|
1144
|
-
// evalStatus === "IN_PROGRESS";
|
|
1145
|
-
// if (specialistDone) {
|
|
1146
|
-
// setMessage(`${activeTab} enviada a facilitador`);
|
|
1147
|
-
// getSectionIcon();
|
|
1148
|
-
// } else if (evalStatus === "QF") {
|
|
1149
|
-
// setMessage("Evaluación enviada");
|
|
1150
|
-
// getSectionIcon();
|
|
1151
|
-
// } else if (evalStatus === "AF") {
|
|
1152
|
-
// setMessage("Evaluación enviada");
|
|
1153
|
-
// getSectionIcon();
|
|
1154
|
-
// } else if (evalStatus === "RP") {
|
|
1155
|
-
// setMessage("Evaluación enviada");
|
|
1156
|
-
// getSectionIcon();
|
|
1157
|
-
// } else if (evalStatus === "RC") {
|
|
1158
|
-
// setMessage("Evaluación enviada");
|
|
1159
|
-
// getSectionIcon();
|
|
1160
|
-
// }
|
|
1161
|
-
// let statusArr = [];
|
|
1162
|
-
// servicesData.forEach((srv) => {
|
|
1163
|
-
// srv.service === concept && statusArr.push(srv.status);
|
|
1164
|
-
// });
|
|
1165
|
-
// productTemp[`${concept}_status`] = getNewStatus(statusArr);
|
|
1166
|
-
// let newStatus = getNewStatus([
|
|
1167
|
-
// productTemp.datasheet_status,
|
|
1168
|
-
// productTemp.description_status,
|
|
1169
|
-
// productTemp.images_status,
|
|
1170
|
-
// ]);
|
|
1171
|
-
// productTemp.status = newStatus;
|
|
1172
|
-
// data = {
|
|
1173
|
-
// articleId: product.id_article,
|
|
1174
|
-
// orderId: product.orderId,
|
|
1175
|
-
// concept: concept,
|
|
1176
|
-
// evalStatus: evalStatus,
|
|
1177
|
-
// retailerId: activeRetailer.id,
|
|
1178
|
-
// };
|
|
1179
|
-
// switch (user.id_role) {
|
|
1180
|
-
// case 7:
|
|
1181
|
-
// case 8:
|
|
1182
|
-
// data.especialist = true;
|
|
1183
|
-
// break;
|
|
1184
|
-
// case 4:
|
|
1185
|
-
// case 5:
|
|
1186
|
-
// data.facilitator = true;
|
|
1187
|
-
// break;
|
|
1188
|
-
// default:
|
|
1189
|
-
// break;
|
|
1190
|
-
// }
|
|
1191
|
-
// await axios.put(`${process.env.REACT_APP_SEND_EVAL}`, data, {
|
|
1192
|
-
// headers: {
|
|
1193
|
-
// Authorization: token,
|
|
1194
|
-
// },
|
|
1195
|
-
// });
|
|
1196
|
-
// getServices();
|
|
1197
|
-
// }
|
|
1198
|
-
// sessionStorage.setItem("productSelected", JSON.stringify(productTemp));
|
|
1199
|
-
// setProduct(productTemp);
|
|
1200
|
-
// } catch (error) {
|
|
1201
|
-
// console.log(error);
|
|
1202
|
-
// }
|
|
1203
|
-
// setLoading(false);
|
|
1204
|
-
// };
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
var userAssigned = function userAssigned(tab, rol) {
|
|
1208
|
-
var concept = "";
|
|
1209
|
-
|
|
1210
|
-
switch (tab) {
|
|
1211
|
-
case "Ficha técnica":
|
|
1212
|
-
concept = "datasheet";
|
|
1213
|
-
break;
|
|
1214
|
-
|
|
1215
|
-
case "Imágenes":
|
|
1216
|
-
concept = "images";
|
|
1217
|
-
break;
|
|
1218
|
-
|
|
1219
|
-
default:
|
|
1220
|
-
concept = "description";
|
|
1221
|
-
break;
|
|
1222
|
-
}
|
|
1223
|
-
|
|
1224
|
-
var allowedRoles = [1, 4, 5, 6, 7, 8];
|
|
1225
|
-
var validUser = allowedRoles.indexOf(user === null || user === void 0 ? void 0 : user.id_role) !== -1;
|
|
1226
|
-
|
|
1227
|
-
if (!rol) {
|
|
1228
|
-
switch (user.id_role) {
|
|
1229
|
-
case 4:
|
|
1230
|
-
case 5:
|
|
1231
|
-
rol = "facilitator";
|
|
1232
|
-
break;
|
|
1233
|
-
|
|
1234
|
-
case 7:
|
|
1235
|
-
case 8:
|
|
1236
|
-
rol = "especialist";
|
|
1237
|
-
break;
|
|
1238
|
-
}
|
|
1239
|
-
}
|
|
1240
|
-
|
|
1241
|
-
return true;
|
|
1242
1060
|
};
|
|
1243
1061
|
|
|
1244
1062
|
var createComment = /*#__PURE__*/function () {
|
|
@@ -1293,64 +1111,6 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
1293
1111
|
};
|
|
1294
1112
|
}();
|
|
1295
1113
|
|
|
1296
|
-
var getRequired = function getRequired(services) {
|
|
1297
|
-
var _services$4, _services$4$retailerM, _services$5, _services$5$inputs;
|
|
1298
|
-
|
|
1299
|
-
var objetcTemp = {};
|
|
1300
|
-
var datasheetServicesArray = Object.values(services[0]);
|
|
1301
|
-
var dsInputs = datasheetServicesArray.pop();
|
|
1302
|
-
var descriptionsServicesArray = services[1];
|
|
1303
|
-
var dsInputsRequired = [];
|
|
1304
|
-
var desInputsRequired = 0;
|
|
1305
|
-
datasheetServicesArray.forEach(function (datasheet) {
|
|
1306
|
-
var _servicesData$filter = servicesData.filter(function (srv) {
|
|
1307
|
-
return srv.id_retailer === datasheet.retailer.id && srv.service === getConcept(activeTab);
|
|
1308
|
-
}),
|
|
1309
|
-
_servicesData$filter2 = (0, _slicedToArray2.default)(_servicesData$filter, 1),
|
|
1310
|
-
requested = _servicesData$filter2[0];
|
|
1311
|
-
|
|
1312
|
-
requested && Object.values(datasheet === null || datasheet === void 0 ? void 0 : datasheet.data).forEach(function (dataGroup) {
|
|
1313
|
-
return dsInputsRequired.push.apply(dsInputsRequired, (0, _toConsumableArray2.default)(dataGroup.inputs.filter(function (input) {
|
|
1314
|
-
return dsInputs[input].required && (dsInputs[input].value === undefined || !dsInputs[input].value);
|
|
1315
|
-
})));
|
|
1316
|
-
});
|
|
1317
|
-
});
|
|
1318
|
-
objetcTemp["Ficha técnica"] = dsInputsRequired.length;
|
|
1319
|
-
descriptionsServicesArray.forEach(function (description) {
|
|
1320
|
-
var _servicesData$filter3 = servicesData.filter(function (srv) {
|
|
1321
|
-
return srv.id_retailer === description.id && srv.service === getConcept(activeTab);
|
|
1322
|
-
}),
|
|
1323
|
-
_servicesData$filter4 = (0, _slicedToArray2.default)(_servicesData$filter3, 1),
|
|
1324
|
-
requested = _servicesData$filter4[0];
|
|
1325
|
-
|
|
1326
|
-
requested && description.inputs.forEach(function (input) {
|
|
1327
|
-
return input.required && (!input.value || input.value.replace(/(<\/?p>)|(<\/?strong>)|(<br>)/gm, "") === "") && desInputsRequired++;
|
|
1328
|
-
});
|
|
1329
|
-
});
|
|
1330
|
-
objetcTemp["Descripción"] = desInputsRequired;
|
|
1331
|
-
var retailersRequested = [];
|
|
1332
|
-
(_services$4 = services[2]) === null || _services$4 === void 0 ? void 0 : (_services$4$retailerM = _services$4.retailerMandatories) === null || _services$4$retailerM === void 0 ? void 0 : _services$4$retailerM.forEach(function (retMan) {
|
|
1333
|
-
return retMan.forEach(function (rm) {
|
|
1334
|
-
return retailersRequested.push(rm);
|
|
1335
|
-
});
|
|
1336
|
-
});
|
|
1337
|
-
var requiredImages = (_services$5 = services[2]) === null || _services$5 === void 0 ? void 0 : (_services$5$inputs = _services$5.inputs) === null || _services$5$inputs === void 0 ? void 0 : _services$5$inputs.filter(function (e) {
|
|
1338
|
-
return e.required === 1 && retailersRequested.filter(function (ret) {
|
|
1339
|
-
return ret.id_image === e.id && servicesData.filter(function (srv) {
|
|
1340
|
-
return srv.id_retailer === ret.id_retailer;
|
|
1341
|
-
}).length > 0;
|
|
1342
|
-
}).length > 0;
|
|
1343
|
-
});
|
|
1344
|
-
var requiredCounter = 0;
|
|
1345
|
-
requiredImages === null || requiredImages === void 0 ? void 0 : requiredImages.forEach(function (req) {
|
|
1346
|
-
return services[2].values.filter(function (img) {
|
|
1347
|
-
return img.image_id === req.id;
|
|
1348
|
-
}).length === 0 && requiredCounter++;
|
|
1349
|
-
});
|
|
1350
|
-
objetcTemp["Imágenes"] = requiredCounter;
|
|
1351
|
-
setRequiredNull(objetcTemp);
|
|
1352
|
-
};
|
|
1353
|
-
|
|
1354
1114
|
(0, _react.useEffect)(function () {
|
|
1355
1115
|
setComment(comments[activeTab]);
|
|
1356
1116
|
}, [activeTab]);
|
|
@@ -1555,25 +1315,7 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
1555
1315
|
}
|
|
1556
1316
|
|
|
1557
1317
|
return product["".concat(concept, "_status")] === "IN_PROGRESS" || product["".concat(concept, "_status")] === "RF" || product["".concat(concept, "_status")] === "RA";
|
|
1558
|
-
};
|
|
1559
|
-
// const arr = servicesData?.slice();
|
|
1560
|
-
// let concept = getConcept(tab);
|
|
1561
|
-
// let retailerService = {};
|
|
1562
|
-
// [retailerService] = arr?.filter(
|
|
1563
|
-
// (service) =>
|
|
1564
|
-
// service.id_retailer === activeRetailer?.id &&
|
|
1565
|
-
// service.service === concept
|
|
1566
|
-
// );
|
|
1567
|
-
// return retailerService ? retailerService.status : "NA";
|
|
1568
|
-
// };
|
|
1569
|
-
// useEffect(() => {
|
|
1570
|
-
// let status = getRetailerStatus(servicesData, activeTab);
|
|
1571
|
-
// setRetailerStatus(status);
|
|
1572
|
-
// }, [activeTab, servicesData, activeRetailer]);
|
|
1573
|
-
// useEffect(() => {
|
|
1574
|
-
// services.length > 0 && getRequired(services);
|
|
1575
|
-
// }, [services, servicesData, activeTab]);
|
|
1576
|
-
|
|
1318
|
+
};
|
|
1577
1319
|
|
|
1578
1320
|
var confirmStatusComplete = function confirmStatusComplete() {
|
|
1579
1321
|
var datasheet_status = product.datasheet_status,
|
|
@@ -1968,7 +1710,15 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
1968
1710
|
children: "Los atributos son requeridos por las plataformas de las cadenas, es muy importante completar los campos requeridos ya que pueden rechazar el producto por falta de informaci\xF3n."
|
|
1969
1711
|
})
|
|
1970
1712
|
}), inCart ? /*#__PURE__*/(0, _jsxRuntime.jsx)("button", {
|
|
1971
|
-
type: "button"
|
|
1713
|
+
type: "button",
|
|
1714
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactRouterDom.Link, {
|
|
1715
|
+
to: "/checkout",
|
|
1716
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("p", {
|
|
1717
|
+
children: "Articulo en carrito"
|
|
1718
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("p", {
|
|
1719
|
+
children: "Ir a checkout"
|
|
1720
|
+
})]
|
|
1721
|
+
})
|
|
1972
1722
|
}) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_GeneralButton.Button, {
|
|
1973
1723
|
onClick: function onClick() {
|
|
1974
1724
|
setShowContentohRequestModal && setShowContentohRequestModal(true);
|
|
@@ -31,70 +31,76 @@ RetailerProductEditionDefault.args = {
|
|
|
31
31
|
"Ficha técnica": false,
|
|
32
32
|
Imágenes: false
|
|
33
33
|
},
|
|
34
|
-
token: "eyJraWQiOiJkQWJkZCtlclwvTlwveVRQUWNvUlVyOCtrNUd2M1hMM2N1MWUzQ09zWExVRnc9IiwiYWxnIjoiUlMyNTYifQ.
|
|
34
|
+
token: "eyJraWQiOiJkQWJkZCtlclwvTlwveVRQUWNvUlVyOCtrNUd2M1hMM2N1MWUzQ09zWExVRnc9IiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiJhNmM0ZDNkNi0yNGE0LTQxZDQtYWQwZi1kMDg3NDM4YWI1YjYiLCJjb2duaXRvOmdyb3VwcyI6WyJjb2xhYm9yYWRvcmVzX2NvbnRlbnRvaCJdLCJlbWFpbF92ZXJpZmllZCI6dHJ1ZSwiaXNzIjoiaHR0cHM6XC9cL2NvZ25pdG8taWRwLnVzLWVhc3QtMS5hbWF6b25hd3MuY29tXC91cy1lYXN0LTFfWE1aUWRxa0dqIiwiY29nbml0bzp1c2VybmFtZSI6ImE2YzRkM2Q2LTI0YTQtNDFkNC1hZDBmLWQwODc0MzhhYjViNiIsImNvZ25pdG86cm9sZXMiOlsiYXJuOmF3czppYW06Ojg5ODY3MDIzMjgwNzpyb2xlXC9jb250ZW50b2gtZGV2LXVzLWVhc3QtMS1sYW1iZGFSb2xlIl0sImF1ZCI6IjVhYzh0cGdzNmdic3ExM2ZydnJwaWVlcDQwIiwiZXZlbnRfaWQiOiIxMDEyMmE5OC0wMDc1LTQxYmMtYjkxMi02NjBiNTE2MzMxMDQiLCJ0b2tlbl91c2UiOiJpZCIsImF1dGhfdGltZSI6MTY1NTc1NDEyNSwibmFtZSI6IkNvbGFib3JhZG9yIiwicGhvbmVfbnVtYmVyIjoiKzUyMTExMSIsImV4cCI6MTY1NTc1NzcyNSwiaWF0IjoxNjU1NzU0MTI1LCJlbWFpbCI6ImV0Y0Bjb250ZW50b2guY29tIn0.KFEGYLEDArzX7rXRsXo4wCc6nuSxATU6E8aL_XSCJyvYk3F2fn-cslstPX-zEgG1uybmzXfxMvSfnhjMGe1hCdxpHXXrcq4Khm6jlHcnsF62QUdIz5gPqZDoXjegctkCqQtTYhuZEhxhXmHn9Ijj3rSdk2_5-4AKYx89l9p1_G3u1EN8Vs1jH6BuE2v7u1wv45QQ9KB6h7s8DLZF_SfmivlJbQrqKmOzbwlDBpll94rRffKjHXzJtXx0YmKM--zU0E3dzAEdq-UcfEnM7GpC-SV__xMoLK7Rj7yTAq1fTHEfcMnAFBzkSoPjNAUi5xBw9GLCxt55DmZlVfvKyfzx6Q",
|
|
35
35
|
articleId: 238,
|
|
36
36
|
category: 846,
|
|
37
37
|
version: 2,
|
|
38
38
|
productSelected: {
|
|
39
39
|
services: {
|
|
40
|
-
datasheets:
|
|
41
|
-
descriptions:
|
|
40
|
+
datasheets: 1,
|
|
41
|
+
descriptions: 1,
|
|
42
42
|
images: 1
|
|
43
43
|
},
|
|
44
|
-
orderId:
|
|
45
|
-
status: "
|
|
46
|
-
datasheet_status:
|
|
44
|
+
orderId: 42,
|
|
45
|
+
status: "RECEIVED",
|
|
46
|
+
datasheet_status: null,
|
|
47
47
|
prio: "none",
|
|
48
|
-
version:
|
|
49
|
-
description_status:
|
|
50
|
-
images_status:
|
|
48
|
+
version: 2,
|
|
49
|
+
description_status: null,
|
|
50
|
+
images_status: null,
|
|
51
51
|
article: {
|
|
52
|
-
id_article:
|
|
53
|
-
id_category: "
|
|
54
|
-
name: "
|
|
55
|
-
upc: "
|
|
56
|
-
timestamp: "2022-06-
|
|
57
|
-
id_user:
|
|
52
|
+
id_article: 54413,
|
|
53
|
+
id_category: "684",
|
|
54
|
+
name: "Crema dental 120 gr",
|
|
55
|
+
upc: "456463435",
|
|
56
|
+
timestamp: "2022-06-17T16:21:59.000Z",
|
|
57
|
+
id_user: 28,
|
|
58
58
|
status: "NULL",
|
|
59
59
|
active: 1,
|
|
60
|
-
company_id:
|
|
61
|
-
company_name: "
|
|
62
|
-
country:
|
|
63
|
-
id_order:
|
|
64
|
-
id_datasheet_especialist:
|
|
65
|
-
id_datasheet_facilitator:
|
|
66
|
-
id_description_especialist:
|
|
67
|
-
id_description_facilitator:
|
|
68
|
-
id_images_especialist:
|
|
69
|
-
id_images_facilitator:
|
|
60
|
+
company_id: 1,
|
|
61
|
+
company_name: "COMPANY DEV",
|
|
62
|
+
country: "México",
|
|
63
|
+
id_order: 42,
|
|
64
|
+
id_datasheet_especialist: null,
|
|
65
|
+
id_datasheet_facilitator: null,
|
|
66
|
+
id_description_especialist: null,
|
|
67
|
+
id_description_facilitator: null,
|
|
68
|
+
id_images_especialist: null,
|
|
69
|
+
id_images_facilitator: null,
|
|
70
70
|
id_auditor: null,
|
|
71
71
|
id_recepcionist: null,
|
|
72
|
-
category: "
|
|
73
|
-
missingAttributes:
|
|
74
|
-
missingDescriptions:
|
|
75
|
-
missingImages:
|
|
72
|
+
category: "SALUD Y BELLEZA|CUIDADO BUCAL|PASTAS DENTALES Y ASEO BUCAL",
|
|
73
|
+
missingAttributes: 22,
|
|
74
|
+
missingDescriptions: 16,
|
|
75
|
+
missingImages: 4
|
|
76
76
|
},
|
|
77
77
|
retailers: [{
|
|
78
|
-
id:
|
|
79
|
-
name: "
|
|
78
|
+
id: 4,
|
|
79
|
+
name: "Walmart Super y Superama",
|
|
80
|
+
country: "México",
|
|
81
|
+
id_region: 1,
|
|
82
|
+
active: 1
|
|
83
|
+
}, {
|
|
84
|
+
id: 5,
|
|
85
|
+
name: "Chedraui",
|
|
80
86
|
country: "México",
|
|
81
87
|
id_region: 1,
|
|
82
88
|
active: 1
|
|
83
89
|
}, {
|
|
84
|
-
id:
|
|
85
|
-
name: "
|
|
90
|
+
id: 6,
|
|
91
|
+
name: "HEB",
|
|
86
92
|
country: "México",
|
|
87
93
|
id_region: 1,
|
|
88
94
|
active: 1
|
|
89
95
|
}, {
|
|
90
|
-
id:
|
|
91
|
-
name: "
|
|
96
|
+
id: 13,
|
|
97
|
+
name: "Soriana",
|
|
92
98
|
country: "México",
|
|
93
99
|
id_region: 1,
|
|
94
100
|
active: 1
|
|
95
101
|
}],
|
|
96
|
-
country:
|
|
97
|
-
upc: "
|
|
102
|
+
country: "México",
|
|
103
|
+
upc: "456463435"
|
|
98
104
|
},
|
|
99
105
|
location: {
|
|
100
106
|
product: {
|
|
@@ -103,22 +109,22 @@ RetailerProductEditionDefault.args = {
|
|
|
103
109
|
}
|
|
104
110
|
},
|
|
105
111
|
user: {
|
|
106
|
-
id_user:
|
|
107
|
-
name: "
|
|
112
|
+
id_user: 51,
|
|
113
|
+
name: "ADMIN PRUEBA",
|
|
108
114
|
last_name: "",
|
|
109
|
-
email: "
|
|
115
|
+
email: "etc@contentoh.com",
|
|
110
116
|
position: null,
|
|
111
117
|
telephone: null,
|
|
112
118
|
country: null,
|
|
113
119
|
id_company: 2,
|
|
114
|
-
id_cognito: "
|
|
120
|
+
id_cognito: "a6c4d3d6-24a4-41d4-ad0f-d087438ab5b6",
|
|
115
121
|
birth_Date: null,
|
|
116
122
|
about_me: null,
|
|
117
123
|
zip_code: null,
|
|
118
124
|
address: null,
|
|
119
125
|
job: null,
|
|
120
126
|
id_stripe: null,
|
|
121
|
-
id_role:
|
|
127
|
+
id_role: 1,
|
|
122
128
|
active: 1,
|
|
123
129
|
is_retailer: 0,
|
|
124
130
|
membership: {
|
|
@@ -132,6 +138,6 @@ RetailerProductEditionDefault.args = {
|
|
|
132
138
|
products_limit: "3",
|
|
133
139
|
type: "PyMES"
|
|
134
140
|
},
|
|
135
|
-
src: "https://content-management-profile.s3.amazonaws.com/id-
|
|
141
|
+
src: "https://content-management-profile.s3.amazonaws.com/id-51/51.png?1655754126500"
|
|
136
142
|
}
|
|
137
143
|
};
|