contentoh-components-library 21.1.11 → 21.1.14
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 +7 -3
- package/dist/components/pages/ProviderProductEdition/ProviderProductEdition.stories.js +94 -104
- package/dist/components/pages/ProviderProductEdition/index.js +45 -296
- package/dist/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +20 -20
- package/dist/components/pages/RetailerProductEdition/index.js +104 -162
- package/package.json +1 -1
- package/src/components/molecules/TableHeader/index.js +2 -0
- package/src/components/organisms/ImageDataTable/index.js +5 -1
- package/src/components/pages/ProviderProductEdition/ProviderProductEdition.stories.js +93 -106
- package/src/components/pages/ProviderProductEdition/index.js +13 -302
- package/src/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +20 -20
- package/src/components/pages/RetailerProductEdition/index.js +105 -182
|
@@ -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) {
|
|
@@ -530,13 +535,13 @@ 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;
|
|
533
|
-
|
|
534
|
-
|
|
538
|
+
retailers = product.retailers || product.retailersAvailable;
|
|
539
|
+
active = retailers === null || retailers === void 0 ? void 0 : retailers.filter(function (retailer) {
|
|
535
540
|
return parsedResponse === null || parsedResponse === void 0 ? void 0 : parsedResponse.map(function (srv) {
|
|
536
541
|
return srv.id_retailer;
|
|
537
542
|
}).includes(retailer.id);
|
|
538
543
|
})[0];
|
|
539
|
-
!activeRetailer.id && setActiveRetailer(
|
|
544
|
+
!activeRetailer.id && setActiveRetailer(active ? active : retailers[0]);
|
|
540
545
|
setServicesData(parsedResponse);
|
|
541
546
|
|
|
542
547
|
case 11:
|
|
@@ -552,24 +557,12 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
552
557
|
};
|
|
553
558
|
}();
|
|
554
559
|
|
|
555
|
-
var translateConcept = function translateConcept(concept) {
|
|
556
|
-
var translation = "";
|
|
557
|
-
|
|
558
|
-
if (concept === "datasheet") {
|
|
559
|
-
translation = "Ficha técnica";
|
|
560
|
-
} else if (concept === "description") {
|
|
561
|
-
translation = "Descripción";
|
|
562
|
-
} else if (concept === "images") {
|
|
563
|
-
translation = "Imágenes";
|
|
564
|
-
}
|
|
565
|
-
|
|
566
|
-
return translation;
|
|
567
|
-
};
|
|
568
|
-
|
|
569
560
|
var isRevision = function isRevision() {
|
|
570
561
|
if (productEdit) {
|
|
571
562
|
var concept = getConcept(activeTab);
|
|
572
|
-
|
|
563
|
+
|
|
564
|
+
var _isRetailer = user.is_retailer === 1;
|
|
565
|
+
|
|
573
566
|
var currentService = productEdit === null || productEdit === void 0 ? void 0 : productEdit.product["".concat(concept, "_status")];
|
|
574
567
|
var orgn = origin[activeTab];
|
|
575
568
|
|
|
@@ -630,43 +623,39 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
630
623
|
case 0:
|
|
631
624
|
sessionStorage.setItem("user", JSON.stringify(user));
|
|
632
625
|
loadData();
|
|
633
|
-
setActiveRetailer(active ? active : retailers[0]); // getPercentage({ data: [product] }).then((res) =>
|
|
634
|
-
// setPercentages(res)
|
|
635
|
-
// );
|
|
636
|
-
|
|
637
626
|
getCart();
|
|
638
627
|
_context5.t0 = setUserGroups;
|
|
639
|
-
_context5.next =
|
|
628
|
+
_context5.next = 6;
|
|
640
629
|
return (0, _data2.fetchUsers)(token);
|
|
641
630
|
|
|
642
|
-
case
|
|
631
|
+
case 6:
|
|
643
632
|
_context5.t1 = _context5.sent;
|
|
644
633
|
(0, _context5.t0)(_context5.t1);
|
|
645
634
|
arr = [];
|
|
646
635
|
_context5.t2 = user.id_role;
|
|
647
|
-
_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;
|
|
648
637
|
break;
|
|
649
638
|
|
|
650
|
-
case
|
|
639
|
+
case 12:
|
|
651
640
|
arr = ["IN_PROGRESS", "RF", "RA"];
|
|
652
|
-
return _context5.abrupt("break",
|
|
641
|
+
return _context5.abrupt("break", 20);
|
|
653
642
|
|
|
654
|
-
case
|
|
643
|
+
case 14:
|
|
655
644
|
arr = ["RF", "AF", "AA", "AP", "AC"];
|
|
656
|
-
return _context5.abrupt("break",
|
|
645
|
+
return _context5.abrupt("break", 20);
|
|
657
646
|
|
|
658
|
-
case
|
|
647
|
+
case 16:
|
|
659
648
|
arr = ["RP", "RC", "AF"];
|
|
660
|
-
return _context5.abrupt("break",
|
|
649
|
+
return _context5.abrupt("break", 20);
|
|
661
650
|
|
|
662
|
-
case
|
|
651
|
+
case 18:
|
|
663
652
|
arr = [];
|
|
664
|
-
return _context5.abrupt("break",
|
|
653
|
+
return _context5.abrupt("break", 20);
|
|
665
654
|
|
|
666
|
-
case
|
|
655
|
+
case 20:
|
|
667
656
|
setStatusArray(arr);
|
|
668
657
|
|
|
669
|
-
case
|
|
658
|
+
case 21:
|
|
670
659
|
case "end":
|
|
671
660
|
return _context5.stop();
|
|
672
661
|
}
|
|
@@ -696,7 +685,8 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
696
685
|
setProduct(productTemp);
|
|
697
686
|
setActivePercentage((_retailers$ = retailers[0]) === null || _retailers$ === void 0 ? void 0 : _retailers$.percentage);
|
|
698
687
|
}, [percentages]);
|
|
699
|
-
|
|
688
|
+
|
|
689
|
+
var loadInputs = function loadInputs() {
|
|
700
690
|
if (services.length > 0) {
|
|
701
691
|
var _services$0$activeRet, _services$2, _services$3;
|
|
702
692
|
|
|
@@ -712,7 +702,11 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
712
702
|
setDatasheets([datagroups, inputs]);
|
|
713
703
|
setDescriptions(_descriptions);
|
|
714
704
|
}
|
|
715
|
-
}
|
|
705
|
+
};
|
|
706
|
+
|
|
707
|
+
(0, _react.useEffect)(function () {
|
|
708
|
+
loadInputs();
|
|
709
|
+
}, [servicesData, activeRetailer, services]);
|
|
716
710
|
|
|
717
711
|
var thumbs = function thumbs() {
|
|
718
712
|
var _images$imageType, _images$imagePackagin, _images$values;
|
|
@@ -1033,41 +1027,6 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
1033
1027
|
}, _callee9, null, [[2, 10]]);
|
|
1034
1028
|
})), [dataImages, imagesUploaded]);
|
|
1035
1029
|
|
|
1036
|
-
var evaluationFinished = function evaluationFinished(userId, tab, statusArray) {// const srv = servicesData.filter((serv) => serv.service === getConcept(tab));
|
|
1037
|
-
// const [srvActive] = srv.filter(
|
|
1038
|
-
// (serv) => serv.id_retailer === activeRetailer?.id
|
|
1039
|
-
// );
|
|
1040
|
-
// const unvalidated =
|
|
1041
|
-
// product[`${getConcept(tab)}_status`] === "QF" ||
|
|
1042
|
-
// product[`${getConcept(tab)}_status`] === "IN_PROGRESS";
|
|
1043
|
-
// switch (userId) {
|
|
1044
|
-
// case 7:
|
|
1045
|
-
// case 8:
|
|
1046
|
-
// return (
|
|
1047
|
-
// (["RA", "RF"].includes(product?.status) &&
|
|
1048
|
-
// statusArray.includes(srvActive?.status)) ||
|
|
1049
|
-
// (statusArray.includes(product.status) &&
|
|
1050
|
-
// srv.filter((serv) => statusArray.includes(serv.status)).length ===
|
|
1051
|
-
// srv.length)
|
|
1052
|
-
// );
|
|
1053
|
-
// case 4:
|
|
1054
|
-
// case 5:
|
|
1055
|
-
// return (
|
|
1056
|
-
// unvalidated &&
|
|
1057
|
-
// ["IN_PROGRESS", "QF"].includes(product.status) &&
|
|
1058
|
-
// srv.filter((serv) => statusArray.includes(serv.status)).length ===
|
|
1059
|
-
// srv.length
|
|
1060
|
-
// );
|
|
1061
|
-
// case 6:
|
|
1062
|
-
// return (
|
|
1063
|
-
// statusArray.includes(product.status) &&
|
|
1064
|
-
// servicesData.every((serv) => ["RA", "AA"].includes(serv.status))
|
|
1065
|
-
// );
|
|
1066
|
-
// default:
|
|
1067
|
-
// break;
|
|
1068
|
-
// }
|
|
1069
|
-
};
|
|
1070
|
-
|
|
1071
1030
|
var getConcept = function getConcept(tab) {
|
|
1072
1031
|
switch (tab) {
|
|
1073
1032
|
case "Descripción":
|
|
@@ -1079,24 +1038,7 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
1079
1038
|
case "Imágenes":
|
|
1080
1039
|
return "images";
|
|
1081
1040
|
}
|
|
1082
|
-
};
|
|
1083
|
-
// let concept = getConcept(activeTab);
|
|
1084
|
-
// concept = action ? action : concept;
|
|
1085
|
-
// const [retailerStatus] = servicesData.filter(
|
|
1086
|
-
// (srv) => srv.id_retailer === activeRetailer?.id && srv.service === concept
|
|
1087
|
-
// );
|
|
1088
|
-
// return (
|
|
1089
|
-
// (retailerStatus?.status === "QF" &&
|
|
1090
|
-
// (user.id_role === 1 || user.id_role === 4 || user.id_role === 5)) ||
|
|
1091
|
-
// (retailerStatus?.status === "AF" && //sessionStorage product
|
|
1092
|
-
// (user.id_role === 1 || user.id_role === 6)) ||
|
|
1093
|
-
// (retailerStatus?.status === "RP" &&
|
|
1094
|
-
// (user.id_role === 1 || user.id_role === 6)) ||
|
|
1095
|
-
// (retailerStatus?.status === "RC" &&
|
|
1096
|
-
// (user.id_role === 1 || user.id_role === 6))
|
|
1097
|
-
// );
|
|
1098
|
-
// };
|
|
1099
|
-
|
|
1041
|
+
};
|
|
1100
1042
|
|
|
1101
1043
|
var getSectionIcon = function getSectionIcon() {
|
|
1102
1044
|
switch (activeTab) {
|
|
@@ -1115,131 +1057,6 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
1115
1057
|
default:
|
|
1116
1058
|
break;
|
|
1117
1059
|
}
|
|
1118
|
-
}; // const sendToFacilitator = async (result) => {
|
|
1119
|
-
// setLoading(true);
|
|
1120
|
-
// try {
|
|
1121
|
-
// let concept = getConcept(activeTab);
|
|
1122
|
-
// let productTemp = { ...product };
|
|
1123
|
-
// let evalStatus = product[`${concept}_status`];
|
|
1124
|
-
// let data = {};
|
|
1125
|
-
// if (result) {
|
|
1126
|
-
// //updateCompaniesList(evalStatus, result, activeRetailer.id, concept);
|
|
1127
|
-
// data = {
|
|
1128
|
-
// articleId: product.id_article,
|
|
1129
|
-
// orderId: product.orderId,
|
|
1130
|
-
// concept: concept,
|
|
1131
|
-
// result: result,
|
|
1132
|
-
// evalStatus: evalStatus,
|
|
1133
|
-
// retailerId: activeRetailer.id,
|
|
1134
|
-
// };
|
|
1135
|
-
// await axios.put(`${process.env.REACT_APP_EVALUATION_ENDPOINT}`, data, {
|
|
1136
|
-
// headers: {
|
|
1137
|
-
// Authorization: token,
|
|
1138
|
-
// },
|
|
1139
|
-
// });
|
|
1140
|
-
// getServices();
|
|
1141
|
-
// } else {
|
|
1142
|
-
// const specialistDone =
|
|
1143
|
-
// evalStatus === "RF" ||
|
|
1144
|
-
// evalStatus === "RA" ||
|
|
1145
|
-
// evalStatus === "IN_PROGRESS";
|
|
1146
|
-
// if (specialistDone) {
|
|
1147
|
-
// setMessage(`${activeTab} enviada a facilitador`);
|
|
1148
|
-
// getSectionIcon();
|
|
1149
|
-
// } else if (evalStatus === "QF") {
|
|
1150
|
-
// setMessage("Evaluación enviada");
|
|
1151
|
-
// getSectionIcon();
|
|
1152
|
-
// } else if (evalStatus === "AF") {
|
|
1153
|
-
// setMessage("Evaluación enviada");
|
|
1154
|
-
// getSectionIcon();
|
|
1155
|
-
// } else if (evalStatus === "RP") {
|
|
1156
|
-
// setMessage("Evaluación enviada");
|
|
1157
|
-
// getSectionIcon();
|
|
1158
|
-
// } else if (evalStatus === "RC") {
|
|
1159
|
-
// setMessage("Evaluación enviada");
|
|
1160
|
-
// getSectionIcon();
|
|
1161
|
-
// }
|
|
1162
|
-
// let statusArr = [];
|
|
1163
|
-
// servicesData.forEach((srv) => {
|
|
1164
|
-
// srv.service === concept && statusArr.push(srv.status);
|
|
1165
|
-
// });
|
|
1166
|
-
// productTemp[`${concept}_status`] = getNewStatus(statusArr);
|
|
1167
|
-
// let newStatus = getNewStatus([
|
|
1168
|
-
// productTemp.datasheet_status,
|
|
1169
|
-
// productTemp.description_status,
|
|
1170
|
-
// productTemp.images_status,
|
|
1171
|
-
// ]);
|
|
1172
|
-
// productTemp.status = newStatus;
|
|
1173
|
-
// data = {
|
|
1174
|
-
// articleId: product.id_article,
|
|
1175
|
-
// orderId: product.orderId,
|
|
1176
|
-
// concept: concept,
|
|
1177
|
-
// evalStatus: evalStatus,
|
|
1178
|
-
// retailerId: activeRetailer.id,
|
|
1179
|
-
// };
|
|
1180
|
-
// switch (user.id_role) {
|
|
1181
|
-
// case 7:
|
|
1182
|
-
// case 8:
|
|
1183
|
-
// data.especialist = true;
|
|
1184
|
-
// break;
|
|
1185
|
-
// case 4:
|
|
1186
|
-
// case 5:
|
|
1187
|
-
// data.facilitator = true;
|
|
1188
|
-
// break;
|
|
1189
|
-
// default:
|
|
1190
|
-
// break;
|
|
1191
|
-
// }
|
|
1192
|
-
// await axios.put(`${process.env.REACT_APP_SEND_EVAL}`, data, {
|
|
1193
|
-
// headers: {
|
|
1194
|
-
// Authorization: token,
|
|
1195
|
-
// },
|
|
1196
|
-
// });
|
|
1197
|
-
// getServices();
|
|
1198
|
-
// }
|
|
1199
|
-
// sessionStorage.setItem("productSelected", JSON.stringify(productTemp));
|
|
1200
|
-
// setProduct(productTemp);
|
|
1201
|
-
// } catch (error) {
|
|
1202
|
-
// console.log(error);
|
|
1203
|
-
// }
|
|
1204
|
-
// setLoading(false);
|
|
1205
|
-
// };
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
var userAssigned = function userAssigned(tab, rol) {
|
|
1209
|
-
var concept = "";
|
|
1210
|
-
|
|
1211
|
-
switch (tab) {
|
|
1212
|
-
case "Ficha técnica":
|
|
1213
|
-
concept = "datasheet";
|
|
1214
|
-
break;
|
|
1215
|
-
|
|
1216
|
-
case "Imágenes":
|
|
1217
|
-
concept = "images";
|
|
1218
|
-
break;
|
|
1219
|
-
|
|
1220
|
-
default:
|
|
1221
|
-
concept = "description";
|
|
1222
|
-
break;
|
|
1223
|
-
}
|
|
1224
|
-
|
|
1225
|
-
var allowedRoles = [1, 4, 5, 6, 7, 8];
|
|
1226
|
-
var validUser = allowedRoles.indexOf(user === null || user === void 0 ? void 0 : user.id_role) !== -1;
|
|
1227
|
-
|
|
1228
|
-
if (!rol) {
|
|
1229
|
-
switch (user.id_role) {
|
|
1230
|
-
case 4:
|
|
1231
|
-
case 5:
|
|
1232
|
-
rol = "facilitator";
|
|
1233
|
-
break;
|
|
1234
|
-
|
|
1235
|
-
case 7:
|
|
1236
|
-
case 8:
|
|
1237
|
-
rol = "especialist";
|
|
1238
|
-
break;
|
|
1239
|
-
}
|
|
1240
|
-
}
|
|
1241
|
-
|
|
1242
|
-
return true;
|
|
1243
1060
|
};
|
|
1244
1061
|
|
|
1245
1062
|
var createComment = /*#__PURE__*/function () {
|
|
@@ -1294,64 +1111,6 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
1294
1111
|
};
|
|
1295
1112
|
}();
|
|
1296
1113
|
|
|
1297
|
-
var getRequired = function getRequired(services) {
|
|
1298
|
-
var _services$4, _services$4$retailerM, _services$5, _services$5$inputs;
|
|
1299
|
-
|
|
1300
|
-
var objetcTemp = {};
|
|
1301
|
-
var datasheetServicesArray = Object.values(services[0]);
|
|
1302
|
-
var dsInputs = datasheetServicesArray.pop();
|
|
1303
|
-
var descriptionsServicesArray = services[1];
|
|
1304
|
-
var dsInputsRequired = [];
|
|
1305
|
-
var desInputsRequired = 0;
|
|
1306
|
-
datasheetServicesArray.forEach(function (datasheet) {
|
|
1307
|
-
var _servicesData$filter = servicesData.filter(function (srv) {
|
|
1308
|
-
return srv.id_retailer === datasheet.retailer.id && srv.service === getConcept(activeTab);
|
|
1309
|
-
}),
|
|
1310
|
-
_servicesData$filter2 = (0, _slicedToArray2.default)(_servicesData$filter, 1),
|
|
1311
|
-
requested = _servicesData$filter2[0];
|
|
1312
|
-
|
|
1313
|
-
requested && Object.values(datasheet === null || datasheet === void 0 ? void 0 : datasheet.data).forEach(function (dataGroup) {
|
|
1314
|
-
return dsInputsRequired.push.apply(dsInputsRequired, (0, _toConsumableArray2.default)(dataGroup.inputs.filter(function (input) {
|
|
1315
|
-
return dsInputs[input].required && (dsInputs[input].value === undefined || !dsInputs[input].value);
|
|
1316
|
-
})));
|
|
1317
|
-
});
|
|
1318
|
-
});
|
|
1319
|
-
objetcTemp["Ficha técnica"] = dsInputsRequired.length;
|
|
1320
|
-
descriptionsServicesArray.forEach(function (description) {
|
|
1321
|
-
var _servicesData$filter3 = servicesData.filter(function (srv) {
|
|
1322
|
-
return srv.id_retailer === description.id && srv.service === getConcept(activeTab);
|
|
1323
|
-
}),
|
|
1324
|
-
_servicesData$filter4 = (0, _slicedToArray2.default)(_servicesData$filter3, 1),
|
|
1325
|
-
requested = _servicesData$filter4[0];
|
|
1326
|
-
|
|
1327
|
-
requested && description.inputs.forEach(function (input) {
|
|
1328
|
-
return input.required && (!input.value || input.value.replace(/(<\/?p>)|(<\/?strong>)|(<br>)/gm, "") === "") && desInputsRequired++;
|
|
1329
|
-
});
|
|
1330
|
-
});
|
|
1331
|
-
objetcTemp["Descripción"] = desInputsRequired;
|
|
1332
|
-
var retailersRequested = [];
|
|
1333
|
-
(_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) {
|
|
1334
|
-
return retMan.forEach(function (rm) {
|
|
1335
|
-
return retailersRequested.push(rm);
|
|
1336
|
-
});
|
|
1337
|
-
});
|
|
1338
|
-
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) {
|
|
1339
|
-
return e.required === 1 && retailersRequested.filter(function (ret) {
|
|
1340
|
-
return ret.id_image === e.id && servicesData.filter(function (srv) {
|
|
1341
|
-
return srv.id_retailer === ret.id_retailer;
|
|
1342
|
-
}).length > 0;
|
|
1343
|
-
}).length > 0;
|
|
1344
|
-
});
|
|
1345
|
-
var requiredCounter = 0;
|
|
1346
|
-
requiredImages === null || requiredImages === void 0 ? void 0 : requiredImages.forEach(function (req) {
|
|
1347
|
-
return services[2].values.filter(function (img) {
|
|
1348
|
-
return img.image_id === req.id;
|
|
1349
|
-
}).length === 0 && requiredCounter++;
|
|
1350
|
-
});
|
|
1351
|
-
objetcTemp["Imágenes"] = requiredCounter;
|
|
1352
|
-
setRequiredNull(objetcTemp);
|
|
1353
|
-
};
|
|
1354
|
-
|
|
1355
1114
|
(0, _react.useEffect)(function () {
|
|
1356
1115
|
setComment(comments[activeTab]);
|
|
1357
1116
|
}, [activeTab]);
|
|
@@ -1556,25 +1315,7 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
1556
1315
|
}
|
|
1557
1316
|
|
|
1558
1317
|
return product["".concat(concept, "_status")] === "IN_PROGRESS" || product["".concat(concept, "_status")] === "RF" || product["".concat(concept, "_status")] === "RA";
|
|
1559
|
-
};
|
|
1560
|
-
// const arr = servicesData?.slice();
|
|
1561
|
-
// let concept = getConcept(tab);
|
|
1562
|
-
// let retailerService = {};
|
|
1563
|
-
// [retailerService] = arr?.filter(
|
|
1564
|
-
// (service) =>
|
|
1565
|
-
// service.id_retailer === activeRetailer?.id &&
|
|
1566
|
-
// service.service === concept
|
|
1567
|
-
// );
|
|
1568
|
-
// return retailerService ? retailerService.status : "NA";
|
|
1569
|
-
// };
|
|
1570
|
-
// useEffect(() => {
|
|
1571
|
-
// let status = getRetailerStatus(servicesData, activeTab);
|
|
1572
|
-
// setRetailerStatus(status);
|
|
1573
|
-
// }, [activeTab, servicesData, activeRetailer]);
|
|
1574
|
-
// useEffect(() => {
|
|
1575
|
-
// services.length > 0 && getRequired(services);
|
|
1576
|
-
// }, [services, servicesData, activeTab]);
|
|
1577
|
-
|
|
1318
|
+
};
|
|
1578
1319
|
|
|
1579
1320
|
var confirmStatusComplete = function confirmStatusComplete() {
|
|
1580
1321
|
var datasheet_status = product.datasheet_status,
|
|
@@ -1969,7 +1710,15 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
1969
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."
|
|
1970
1711
|
})
|
|
1971
1712
|
}), inCart ? /*#__PURE__*/(0, _jsxRuntime.jsx)("button", {
|
|
1972
|
-
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
|
+
})
|
|
1973
1722
|
}) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_GeneralButton.Button, {
|
|
1974
1723
|
onClick: function onClick() {
|
|
1975
1724
|
setShowContentohRequestModal && setShowContentohRequestModal(true);
|
|
@@ -31,7 +31,7 @@ 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,
|
|
@@ -41,13 +41,13 @@ RetailerProductEditionDefault.args = {
|
|
|
41
41
|
descriptions: 0,
|
|
42
42
|
images: 1
|
|
43
43
|
},
|
|
44
|
-
orderId:
|
|
45
|
-
status: "
|
|
46
|
-
datasheet_status:
|
|
44
|
+
orderId: 69,
|
|
45
|
+
status: "IN_PROGRESS",
|
|
46
|
+
datasheet_status: null,
|
|
47
47
|
prio: "none",
|
|
48
|
-
version:
|
|
49
|
-
description_status:
|
|
50
|
-
images_status:
|
|
48
|
+
version: 12,
|
|
49
|
+
description_status: null,
|
|
50
|
+
images_status: null,
|
|
51
51
|
article: {
|
|
52
52
|
id_article: 55109,
|
|
53
53
|
id_category: "2999",
|
|
@@ -60,13 +60,13 @@ RetailerProductEditionDefault.args = {
|
|
|
60
60
|
company_id: 834,
|
|
61
61
|
company_name: "THD Resize Proveedor",
|
|
62
62
|
country: null,
|
|
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:
|
|
63
|
+
id_order: 69,
|
|
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
72
|
category: "RESIZING|RESIZING|RESIZING",
|
|
@@ -103,22 +103,22 @@ RetailerProductEditionDefault.args = {
|
|
|
103
103
|
}
|
|
104
104
|
},
|
|
105
105
|
user: {
|
|
106
|
-
id_user:
|
|
107
|
-
name: "
|
|
106
|
+
id_user: 51,
|
|
107
|
+
name: "ADMIN PRUEBA",
|
|
108
108
|
last_name: "",
|
|
109
|
-
email: "
|
|
109
|
+
email: "etc@contentoh.com",
|
|
110
110
|
position: null,
|
|
111
111
|
telephone: null,
|
|
112
112
|
country: null,
|
|
113
113
|
id_company: 2,
|
|
114
|
-
id_cognito: "
|
|
114
|
+
id_cognito: "a6c4d3d6-24a4-41d4-ad0f-d087438ab5b6",
|
|
115
115
|
birth_Date: null,
|
|
116
116
|
about_me: null,
|
|
117
117
|
zip_code: null,
|
|
118
118
|
address: null,
|
|
119
119
|
job: null,
|
|
120
120
|
id_stripe: null,
|
|
121
|
-
id_role:
|
|
121
|
+
id_role: 1,
|
|
122
122
|
active: 1,
|
|
123
123
|
is_retailer: 0,
|
|
124
124
|
membership: {
|
|
@@ -132,6 +132,6 @@ RetailerProductEditionDefault.args = {
|
|
|
132
132
|
products_limit: "3",
|
|
133
133
|
type: "PyMES"
|
|
134
134
|
},
|
|
135
|
-
src: "https://content-management-profile.s3.amazonaws.com/id-
|
|
135
|
+
src: "https://content-management-profile.s3.amazonaws.com/id-51/51.png?1655754126500"
|
|
136
136
|
}
|
|
137
137
|
};
|