contentoh-components-library 21.4.19 → 21.4.20
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/.env.development +2 -5
- package/.env.production +1 -3
- package/dist/components/atoms/Avatar/index.js +2 -3
- package/dist/components/atoms/Card/index.js +5 -46
- package/dist/components/atoms/Card/styles.js +1 -3
- package/dist/components/atoms/CheckBox/index.js +2 -7
- package/dist/components/atoms/CheckBox/styles.js +1 -1
- package/dist/components/atoms/InputFormatter/styles.js +1 -1
- package/dist/components/atoms/SliderToolTip/styles.js +1 -1
- package/dist/components/molecules/CarouselImagesLogin/index.js +1 -1
- package/dist/components/molecules/HeaderTop/index.js +11 -68
- package/dist/components/molecules/TagAndInput/index.js +1 -1
- package/dist/components/organisms/Chat/Chat.stories.js +8 -27
- package/dist/components/organisms/Chat/ContainerItems/index.js +3 -19
- package/dist/components/organisms/Chat/ContainerItems/styles.js +1 -1
- package/dist/components/organisms/Chat/ContentChat/index.js +197 -350
- package/dist/components/organisms/Chat/Footer/index.js +39 -48
- package/dist/components/organisms/Chat/index.js +4 -49
- package/dist/components/organisms/FullProductNameHeader/index.js +2 -2
- package/dist/components/organisms/Modal/styles.js +1 -1
- package/dist/components/pages/ProviderProductEdition/ProviderProductEdition.stories.js +116 -60
- package/dist/components/pages/ProviderProductEdition/index.js +207 -213
- package/dist/components/pages/ProviderProductEdition/styles.js +1 -1
- package/dist/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +4 -8
- package/dist/components/pages/RetailerProductEdition/index.js +308 -316
- package/dist/components/pages/RetailerProductEdition/styles.js +1 -1
- package/dist/components/pages/RetailerProductEdition/utils.js +2 -61
- package/dist/index.js +52 -247
- package/package.json +1 -4
- package/src/components/atoms/Avatar/index.js +2 -8
- package/src/components/atoms/Card/index.js +2 -35
- package/src/components/atoms/Card/styles.js +5 -41
- package/src/components/atoms/CheckBox/index.js +1 -4
- package/src/components/atoms/CheckBox/styles.js +0 -2
- package/src/components/atoms/InputFormatter/styles.js +1 -2
- package/src/components/atoms/SliderToolTip/styles.js +1 -1
- package/src/components/molecules/CarouselImagesLogin/index.js +1 -1
- package/src/components/molecules/HeaderTop/index.js +6 -52
- package/src/components/molecules/TagAndInput/index.js +8 -10
- package/src/components/organisms/Chat/Chat.stories.js +7 -27
- package/src/components/organisms/Chat/ContainerItems/index.js +2 -18
- package/src/components/organisms/Chat/ContainerItems/styles.js +2 -10
- package/src/components/organisms/Chat/ContentChat/index.js +12 -88
- package/src/components/organisms/Chat/Footer/index.js +0 -11
- package/src/components/organisms/Chat/index.js +4 -46
- package/src/components/organisms/FullProductNameHeader/index.js +1 -1
- package/src/components/organisms/Modal/styles.js +1 -4
- package/src/components/organisms/OrderDetail/utils/Table/utils.js +16 -6
- package/src/components/pages/ProviderProductEdition/ProviderProductEdition.stories.js +116 -66
- package/src/components/pages/ProviderProductEdition/index.js +185 -177
- package/src/components/pages/ProviderProductEdition/styles.js +1 -5
- package/src/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +3 -7
- package/src/components/pages/RetailerProductEdition/index.js +184 -158
- package/src/components/pages/RetailerProductEdition/styles.js +0 -4
- package/src/components/pages/RetailerProductEdition/utils.js +0 -37
- package/src/index.js +0 -16
- package/dist/assets/fonts/roboto/LICENSE.txt +0 -202
- package/dist/components/organisms/PanelLayout/PanelLayout.stories.js +0 -87
- package/dist/components/organisms/PanelLayout/index.js +0 -29
- package/dist/components/organisms/PanelLayout/styles.js +0 -32
- package/src/components/atoms/ImageCarousel/ImgeSlider.stories.js +0 -76
- package/src/components/atoms/ImageCarousel/index.js +0 -103
- package/src/components/atoms/ImageCarousel/styles.js +0 -79
- package/src/components/atoms/PercentTag/PercentTag.stories.js +0 -7
- package/src/components/atoms/PercentTag/index.js +0 -9
- package/src/components/atoms/PercentTag/styles.js +0 -69
- package/src/components/atoms/RatingStars/RatingStars.stories.js +0 -10
- package/src/components/atoms/RatingStars/index.js +0 -31
- package/src/components/atoms/RatingStars/styles.js +0 -28
- package/src/components/atoms/RetailerCatalog/RetailerCatalog.stories.js +0 -36
- package/src/components/atoms/RetailerCatalog/index.js +0 -49
- package/src/components/atoms/RetailerCatalog/styles.js +0 -30
- package/src/components/atoms/RetailerOption/RetailerOption.stories.js +0 -15
- package/src/components/atoms/RetailerOption/index.js +0 -53
- package/src/components/atoms/RetailerOption/styles.js +0 -41
- package/src/components/atoms/RetailersList/RetailersList.stories.js +0 -33
- package/src/components/atoms/RetailersList/index.js +0 -20
- package/src/components/atoms/RetailersList/styles.js +0 -19
- package/src/components/atoms/UserCatalog/UserCatalog.stories.js +0 -67
- package/src/components/atoms/UserCatalog/index.js +0 -100
- package/src/components/atoms/UserCatalog/styles.js +0 -24
- package/src/components/atoms/UserOption/UserOption.stories.js +0 -25
- package/src/components/atoms/UserOption/index.js +0 -95
- package/src/components/atoms/UserOption/styles.js +0 -61
- package/src/components/atoms/UserSelector/UserSelector.stories.js +0 -25
- package/src/components/atoms/UserSelector/index.js +0 -86
- package/src/components/atoms/UserSelector/styles.js +0 -55
- package/src/components/molecules/GridItem/GridItem.stories.js +0 -126
- package/src/components/molecules/GridItem/index.js +0 -105
- package/src/components/molecules/GridItem/styles.js +0 -104
- package/src/components/molecules/HeaderItem/ColumnItem.js +0 -9
- package/src/components/molecules/HeaderItem/HeaderItem.stories.js +0 -24
- package/src/components/molecules/HeaderItem/index.js +0 -26
- package/src/components/molecules/HeaderItem/styles.js +0 -27
- package/src/components/molecules/RowItem/ColumnItem.js +0 -9
- package/src/components/molecules/RowItem/RowItem.stories.js +0 -5660
- package/src/components/molecules/RowItem/index.js +0 -45
- package/src/components/molecules/RowItem/styles.js +0 -40
- package/src/components/molecules/StripeCardForm/StripeCardForm.stories.js +0 -13
- package/src/components/molecules/StripeCardForm/index.js +0 -42
- package/src/components/molecules/StripeCardForm/paymentForm.js +0 -124
- package/src/components/molecules/StripeCardForm/styles.js +0 -73
- package/src/components/molecules/StripeCardSelector/CardSelector.stories.js +0 -12
- package/src/components/molecules/StripeCardSelector/index.js +0 -44
- package/src/components/molecules/StripeCardSelector/styles.js +0 -4
- package/src/components/molecules/StripeCardSelector/utils.js +0 -17
- package/src/components/organisms/GridProducts/GridProducts.stories.js +0 -5485
- package/src/components/organisms/GridProducts/index.js +0 -50
- package/src/components/organisms/GridProducts/styles.js +0 -14
- package/src/components/organisms/GridProducts/utils.js +0 -111
- package/src/components/organisms/PanelLayout/PanelLayout.stories.js +0 -63
- package/src/components/organisms/PanelLayout/index.js +0 -11
- package/src/components/organisms/PanelLayout/styles.js +0 -39
- package/src/components/organisms/SideModal/SideModal.stories.js +0 -23
- package/src/components/organisms/SideModal/index.js +0 -50
- package/src/components/organisms/SideModal/styles.js +0 -30
|
@@ -93,12 +93,6 @@ var _VersionSelector = require("../../organisms/VersionSelector");
|
|
|
93
93
|
|
|
94
94
|
var _customHooks = require("../../../global-files/customHooks");
|
|
95
95
|
|
|
96
|
-
var _utils = require("../RetailerProductEdition/utils");
|
|
97
|
-
|
|
98
|
-
var _Modal = require("../../organisms/Modal");
|
|
99
|
-
|
|
100
|
-
var _ButtonV = require("../../atoms/ButtonV2");
|
|
101
|
-
|
|
102
96
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
103
97
|
|
|
104
98
|
var reducerImages = function reducerImages(state, action) {
|
|
@@ -212,7 +206,7 @@ var myBucket = new _awsSdk.default.S3({
|
|
|
212
206
|
});
|
|
213
207
|
|
|
214
208
|
var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
215
|
-
var _product$retailers, _product$retailersAva, _location$state4, _location$state5,
|
|
209
|
+
var _product$retailers, _product$retailersAva, _location$state4, _location$state5, _datasheets$, _datasheets$$data;
|
|
216
210
|
|
|
217
211
|
var tabsSections = _ref.tabsSections,
|
|
218
212
|
_ref$productSelected = _ref.productSelected,
|
|
@@ -452,26 +446,21 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
452
446
|
validatedAll = _useState60[0],
|
|
453
447
|
setValidatedAll = _useState60[1];
|
|
454
448
|
|
|
455
|
-
var _useState61 = (0, _react.useState)(
|
|
456
|
-
_useState62 = (0, _slicedToArray2.default)(_useState61, 2),
|
|
457
|
-
showRejectModal = _useState62[0],
|
|
458
|
-
setShowRejectModal = _useState62[1];
|
|
459
|
-
|
|
460
|
-
var _useState63 = (0, _react.useState)({
|
|
449
|
+
var _useState61 = (0, _react.useState)({
|
|
461
450
|
"Ficha técnica": null,
|
|
462
451
|
Descripción: null,
|
|
463
452
|
Imágenes: null
|
|
464
453
|
}),
|
|
465
|
-
|
|
466
|
-
origin =
|
|
467
|
-
setOrigin =
|
|
454
|
+
_useState62 = (0, _slicedToArray2.default)(_useState61, 2),
|
|
455
|
+
origin = _useState62[0],
|
|
456
|
+
setOrigin = _useState62[1];
|
|
468
457
|
|
|
469
|
-
var
|
|
470
|
-
|
|
471
|
-
inCart =
|
|
472
|
-
setInCart =
|
|
458
|
+
var _useState63 = (0, _react.useState)(false),
|
|
459
|
+
_useState64 = (0, _slicedToArray2.default)(_useState63, 2),
|
|
460
|
+
inCart = _useState64[0],
|
|
461
|
+
setInCart = _useState64[1];
|
|
473
462
|
|
|
474
|
-
var
|
|
463
|
+
var _useState65 = (0, _react.useState)({
|
|
475
464
|
message: "¿Estás seguro de continuar?",
|
|
476
465
|
detail: " ".concat(user.is_retailer ? "Asegurate de haber revisado las tres secciones" : "Envíar el producto a la cadena"),
|
|
477
466
|
button1: {
|
|
@@ -486,34 +475,34 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
486
475
|
},
|
|
487
476
|
img: _defaultProfileImage.default
|
|
488
477
|
}),
|
|
478
|
+
_useState66 = (0, _slicedToArray2.default)(_useState65, 2),
|
|
479
|
+
dataGenericModal = _useState66[0],
|
|
480
|
+
setDataGenericModal = _useState66[1];
|
|
481
|
+
|
|
482
|
+
var _useState67 = (0, _react.useState)(null),
|
|
489
483
|
_useState68 = (0, _slicedToArray2.default)(_useState67, 2),
|
|
490
|
-
|
|
491
|
-
|
|
484
|
+
socketType = _useState68[0],
|
|
485
|
+
setSocketType = _useState68[1];
|
|
492
486
|
|
|
493
|
-
var _useState69 = (0, _react.useState)(
|
|
487
|
+
var _useState69 = (0, _react.useState)(loading),
|
|
494
488
|
_useState70 = (0, _slicedToArray2.default)(_useState69, 2),
|
|
495
|
-
|
|
496
|
-
|
|
489
|
+
saving = _useState70[0],
|
|
490
|
+
setSaving = _useState70[1];
|
|
497
491
|
|
|
498
|
-
var _useState71 = (0, _react.useState)(
|
|
492
|
+
var _useState71 = (0, _react.useState)(product.statusByRetailer),
|
|
499
493
|
_useState72 = (0, _slicedToArray2.default)(_useState71, 2),
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
var _useState73 = (0, _react.useState)(product.statusByRetailer),
|
|
504
|
-
_useState74 = (0, _slicedToArray2.default)(_useState73, 2),
|
|
505
|
-
retailerStatus = _useState74[0],
|
|
506
|
-
setRetailerStatus = _useState74[1];
|
|
494
|
+
retailerStatus = _useState72[0],
|
|
495
|
+
setRetailerStatus = _useState72[1];
|
|
507
496
|
|
|
508
497
|
var _useCloseModal = (0, _customHooks.useCloseModal)("version-selector"),
|
|
509
498
|
_useCloseModal2 = (0, _slicedToArray2.default)(_useCloseModal, 2),
|
|
510
499
|
showVersionSelector = _useCloseModal2[0],
|
|
511
500
|
setShowVersionSelector = _useCloseModal2[1];
|
|
512
501
|
|
|
513
|
-
var
|
|
514
|
-
|
|
515
|
-
globalModal =
|
|
516
|
-
setGlobalModal =
|
|
502
|
+
var _useState73 = (0, _react.useState)(),
|
|
503
|
+
_useState74 = (0, _slicedToArray2.default)(_useState73, 2),
|
|
504
|
+
globalModal = _useState74[0],
|
|
505
|
+
setGlobalModal = _useState74[1];
|
|
517
506
|
|
|
518
507
|
var updateAuditStatus = /*#__PURE__*/function () {
|
|
519
508
|
var _ref3 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2(status) {
|
|
@@ -685,6 +674,30 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
685
674
|
});
|
|
686
675
|
|
|
687
676
|
switch (type) {
|
|
677
|
+
case "error":
|
|
678
|
+
setGlobalModal({
|
|
679
|
+
message: "".concat(activeTab, " rechazada"),
|
|
680
|
+
detail: "Agrega tu comentarios para enviar el rechazo",
|
|
681
|
+
img: _errorModal.default,
|
|
682
|
+
textArea: true,
|
|
683
|
+
button1: {
|
|
684
|
+
name: "Enviar",
|
|
685
|
+
action: function action(e) {
|
|
686
|
+
var textArea = document.querySelector("#area");
|
|
687
|
+
|
|
688
|
+
if (textArea.value) {
|
|
689
|
+
textArea.style.border = "none";
|
|
690
|
+
createComment(e, textArea.value);
|
|
691
|
+
showGlobalModal("commentsSent");
|
|
692
|
+
validatedAll ? validateAll("R") : sendEvaluation("R");
|
|
693
|
+
} else {
|
|
694
|
+
textArea.style.border = "2px solid red";
|
|
695
|
+
}
|
|
696
|
+
}
|
|
697
|
+
}
|
|
698
|
+
});
|
|
699
|
+
break;
|
|
700
|
+
|
|
688
701
|
case "generic":
|
|
689
702
|
setGlobalModal(dataGenericModal);
|
|
690
703
|
break;
|
|
@@ -956,7 +969,7 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
956
969
|
setServicesData(parsedResponse);
|
|
957
970
|
|
|
958
971
|
case 12:
|
|
959
|
-
|
|
972
|
+
!activeRetailer.id && setActiveRetailer(active ? active : retailers[0]);
|
|
960
973
|
|
|
961
974
|
case 13:
|
|
962
975
|
case "end":
|
|
@@ -1074,7 +1087,7 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
1074
1087
|
}
|
|
1075
1088
|
|
|
1076
1089
|
setProduct(productTemp);
|
|
1077
|
-
|
|
1090
|
+
setActivePercentage((_retailers$ = retailers[0]) === null || _retailers$ === void 0 ? void 0 : _retailers$.percentage);
|
|
1078
1091
|
}, [percentages]);
|
|
1079
1092
|
|
|
1080
1093
|
var loadInputs = function loadInputs() {
|
|
@@ -1456,33 +1469,45 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
1456
1469
|
};
|
|
1457
1470
|
|
|
1458
1471
|
var createComment = /*#__PURE__*/function () {
|
|
1459
|
-
var _ref13 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee15() {
|
|
1460
|
-
var
|
|
1461
|
-
retailerId,
|
|
1462
|
-
data,
|
|
1463
|
-
_args15 = arguments;
|
|
1472
|
+
var _ref13 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee15(e, body, tab) {
|
|
1473
|
+
var concept, data;
|
|
1464
1474
|
return _regenerator.default.wrap(function _callee15$(_context15) {
|
|
1465
1475
|
while (1) {
|
|
1466
1476
|
switch (_context15.prev = _context15.next) {
|
|
1467
1477
|
case 0:
|
|
1468
|
-
|
|
1469
|
-
|
|
1478
|
+
concept = "";
|
|
1479
|
+
_context15.t0 = activeTab;
|
|
1480
|
+
_context15.next = _context15.t0 === "Ficha técnica" ? 4 : _context15.t0 === "Imágenes" ? 6 : 8;
|
|
1481
|
+
break;
|
|
1482
|
+
|
|
1483
|
+
case 4:
|
|
1484
|
+
concept = "datasheet";
|
|
1485
|
+
return _context15.abrupt("break", 10);
|
|
1486
|
+
|
|
1487
|
+
case 6:
|
|
1488
|
+
concept = "images";
|
|
1489
|
+
return _context15.abrupt("break", 10);
|
|
1490
|
+
|
|
1491
|
+
case 8:
|
|
1492
|
+
concept = "description";
|
|
1493
|
+
return _context15.abrupt("break", 10);
|
|
1494
|
+
|
|
1495
|
+
case 10:
|
|
1470
1496
|
data = {
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
|
|
1497
|
+
articleId: product === null || product === void 0 ? void 0 : product.id_article,
|
|
1498
|
+
orderId: product === null || product === void 0 ? void 0 : product.orderId,
|
|
1499
|
+
message: body,
|
|
1500
|
+
concept: concept,
|
|
1501
|
+
version: version
|
|
1502
|
+
};
|
|
1503
|
+
_context15.next = 13;
|
|
1504
|
+
return _axios.default.post("".concat(process.env.REACT_APP_COMMENTS_ENDPOINT), data, {
|
|
1505
|
+
headers: {
|
|
1479
1506
|
Authorization: token
|
|
1480
1507
|
}
|
|
1481
|
-
};
|
|
1482
|
-
setMessage("");
|
|
1483
|
-
return _context15.abrupt("return", (0, _utils.sendMessage)(data));
|
|
1508
|
+
});
|
|
1484
1509
|
|
|
1485
|
-
case
|
|
1510
|
+
case 13:
|
|
1486
1511
|
case "end":
|
|
1487
1512
|
return _context15.stop();
|
|
1488
1513
|
}
|
|
@@ -1490,7 +1515,7 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
1490
1515
|
}, _callee15);
|
|
1491
1516
|
}));
|
|
1492
1517
|
|
|
1493
|
-
return function createComment() {
|
|
1518
|
+
return function createComment(_x4, _x5, _x6) {
|
|
1494
1519
|
return _ref13.apply(this, arguments);
|
|
1495
1520
|
};
|
|
1496
1521
|
}();
|
|
@@ -1589,7 +1614,7 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
1589
1614
|
}, _callee17);
|
|
1590
1615
|
}));
|
|
1591
1616
|
|
|
1592
|
-
return function setAssignation(
|
|
1617
|
+
return function setAssignation(_x7, _x8) {
|
|
1593
1618
|
return _ref15.apply(this, arguments);
|
|
1594
1619
|
};
|
|
1595
1620
|
}();
|
|
@@ -1677,7 +1702,7 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
1677
1702
|
var _ref16 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee18(result) {
|
|
1678
1703
|
var _productTemp$id_order2;
|
|
1679
1704
|
|
|
1680
|
-
var concept, productTemp, articleId, orderId, sectionStatusKey, evalStatus, data, retailerId, res, newStatuses, orderStatus, serviceStatus, newProductEdit, showSurveyByProvider, showSurveyByRetailer, _JSON$
|
|
1705
|
+
var concept, productTemp, articleId, orderId, sectionStatusKey, evalStatus, data, retailerId, res, body, _JSON$parse, response, newStatuses, statusObject, orderStatus, serviceStatus, newProductEdit, showSurveyByProvider, showSurveyByRetailer, _JSON$parse2, _response, _statusObject, retailerStatusCopy, status;
|
|
1681
1706
|
|
|
1682
1707
|
return _regenerator.default.wrap(function _callee18$(_context18) {
|
|
1683
1708
|
while (1) {
|
|
@@ -1698,16 +1723,24 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
1698
1723
|
};
|
|
1699
1724
|
retailerId = activeRetailer === null || activeRetailer === void 0 ? void 0 : activeRetailer.id;
|
|
1700
1725
|
_context18.prev = 9;
|
|
1726
|
+
body = {
|
|
1727
|
+
orderArticleRetailers: [{
|
|
1728
|
+
orderId: orderId,
|
|
1729
|
+
articleId: articleId,
|
|
1730
|
+
retailersIds: [activeRetailer.id]
|
|
1731
|
+
}],
|
|
1732
|
+
isAproved: false,
|
|
1733
|
+
service: concept
|
|
1734
|
+
};
|
|
1701
1735
|
|
|
1702
1736
|
if (!result) {
|
|
1703
|
-
_context18.next =
|
|
1737
|
+
_context18.next = 29;
|
|
1704
1738
|
break;
|
|
1705
1739
|
}
|
|
1706
1740
|
|
|
1707
|
-
|
|
1708
|
-
data.retailerId = retailerId;
|
|
1741
|
+
body.isAproved = result === "A";
|
|
1709
1742
|
_context18.next = 15;
|
|
1710
|
-
return _axios.default.
|
|
1743
|
+
return _axios.default.post("".concat(process.env.REACT_APP_EVALUATION_REFACTOR), body, {
|
|
1711
1744
|
headers: {
|
|
1712
1745
|
Authorization: token
|
|
1713
1746
|
}
|
|
@@ -1715,101 +1748,76 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
1715
1748
|
|
|
1716
1749
|
case 15:
|
|
1717
1750
|
res = _context18.sent;
|
|
1718
|
-
|
|
1719
|
-
|
|
1720
|
-
|
|
1751
|
+
response = (_JSON$parse = JSON.parse(res.data.body)) === null || _JSON$parse === void 0 ? void 0 : _JSON$parse.successfulData;
|
|
1752
|
+
newStatuses = response;
|
|
1753
|
+
statusObject = response["".concat(orderId, "-").concat(articleId, "-").concat(activeRetailer.id)];
|
|
1754
|
+
orderStatus = statusObject["generalStatus"];
|
|
1755
|
+
serviceStatus = newStatuses["".concat(getConcept(activeTab), "Status")];
|
|
1721
1756
|
newProductEdit = productEdit;
|
|
1722
1757
|
newProductEdit.product[sectionStatusKey] = serviceStatus;
|
|
1723
1758
|
setProductEdit(newProductEdit);
|
|
1724
|
-
showSurveyByProvider = !user.is_retailer && orderStatus
|
|
1725
|
-
showSurveyByRetailer = user.is_retailer && orderStatus
|
|
1759
|
+
showSurveyByProvider = !user.is_retailer && orderStatus === "AP";
|
|
1760
|
+
showSurveyByRetailer = user.is_retailer && orderStatus === "ACA";
|
|
1726
1761
|
showSurvey && showSurvey(showSurveyByProvider || showSurveyByRetailer);
|
|
1727
|
-
_context18.next =
|
|
1762
|
+
_context18.next = 32;
|
|
1728
1763
|
break;
|
|
1729
1764
|
|
|
1730
|
-
case
|
|
1731
|
-
_context18.next =
|
|
1732
|
-
return _axios.default.
|
|
1765
|
+
case 29:
|
|
1766
|
+
_context18.next = 31;
|
|
1767
|
+
return _axios.default.post("".concat(process.env.REACT_APP_EVALUATION_REFACTOR), body, {
|
|
1733
1768
|
headers: {
|
|
1734
1769
|
Authorization: token
|
|
1735
1770
|
}
|
|
1736
1771
|
});
|
|
1737
1772
|
|
|
1738
|
-
case
|
|
1773
|
+
case 31:
|
|
1739
1774
|
res = _context18.sent;
|
|
1740
1775
|
|
|
1741
|
-
case
|
|
1742
|
-
if (
|
|
1743
|
-
|
|
1744
|
-
|
|
1745
|
-
|
|
1746
|
-
|
|
1747
|
-
|
|
1748
|
-
|
|
1749
|
-
|
|
1750
|
-
|
|
1751
|
-
id: product.article.id_article || productEdit.ArticleId,
|
|
1752
|
-
version: version,
|
|
1753
|
-
items: [{
|
|
1754
|
-
type: "status",
|
|
1755
|
-
value: _message
|
|
1756
|
-
}],
|
|
1757
|
-
retailerId: activeRetailer.id,
|
|
1758
|
-
status: product.status || productEdit.product.status
|
|
1759
|
-
},
|
|
1760
|
-
paramsHeader: {
|
|
1761
|
-
Authorization: token
|
|
1762
|
-
}
|
|
1763
|
-
};
|
|
1764
|
-
_context18.next = 36;
|
|
1765
|
-
return (0, _utils.sendMessage)(messageData);
|
|
1766
|
-
|
|
1767
|
-
case 36:
|
|
1768
|
-
if (newArticleStatus) productTemp.status = newArticleStatus[articleId];
|
|
1769
|
-
retailerStatusCopy = (0, _objectSpread3.default)({}, retailerStatus);
|
|
1770
|
-
retailerStatusCopy[activeRetailer.id][concept] = newStatus;
|
|
1771
|
-
setRetailerStatus(retailerStatusCopy);
|
|
1772
|
-
productTemp.statusByRetailer = retailerStatusCopy;
|
|
1773
|
-
|
|
1774
|
-
if (newServiceStatus) {
|
|
1775
|
-
status = newServiceStatus[articleId]["".concat(concept, "Status")];
|
|
1776
|
+
case 32:
|
|
1777
|
+
if (res.data.statusCode === 200) {
|
|
1778
|
+
_response = (_JSON$parse2 = JSON.parse(res.data.body)) === null || _JSON$parse2 === void 0 ? void 0 : _JSON$parse2.successfulData;
|
|
1779
|
+
_statusObject = _response["".concat(orderId, "-").concat(articleId, "-").concat(activeRetailer.id)];
|
|
1780
|
+
productTemp.status = _statusObject["generalStatus"];
|
|
1781
|
+
retailerStatusCopy = (0, _objectSpread3.default)({}, retailerStatus);
|
|
1782
|
+
retailerStatusCopy[activeRetailer.id][concept] = _statusObject["".concat(concept, "Status")];
|
|
1783
|
+
setRetailerStatus(retailerStatusCopy);
|
|
1784
|
+
productTemp.statusByRetailer = retailerStatusCopy;
|
|
1785
|
+
status = _statusObject["".concat(concept, "Status")];
|
|
1776
1786
|
productTemp["".concat(concept, "_status")] = status;
|
|
1787
|
+
setProduct(productTemp);
|
|
1788
|
+
sessionStorage.setItem("productSelected", JSON.stringify(productTemp));
|
|
1789
|
+
setOrigin(function (prev) {
|
|
1790
|
+
return (0, _objectSpread3.default)((0, _objectSpread3.default)({}, prev), {}, (0, _defineProperty2.default)({}, concept, status));
|
|
1791
|
+
});
|
|
1777
1792
|
}
|
|
1778
1793
|
|
|
1779
|
-
|
|
1780
|
-
sessionStorage.setItem("productSelected", JSON.stringify(productTemp));
|
|
1781
|
-
setOrigin(function (prev) {
|
|
1782
|
-
return (0, _objectSpread3.default)((0, _objectSpread3.default)({}, prev), {}, (0, _defineProperty2.default)({}, concept, status));
|
|
1783
|
-
});
|
|
1784
|
-
|
|
1785
|
-
case 45:
|
|
1786
|
-
_context18.next = 50;
|
|
1794
|
+
_context18.next = 38;
|
|
1787
1795
|
break;
|
|
1788
1796
|
|
|
1789
|
-
case
|
|
1790
|
-
_context18.prev =
|
|
1797
|
+
case 35:
|
|
1798
|
+
_context18.prev = 35;
|
|
1791
1799
|
_context18.t0 = _context18["catch"](9);
|
|
1792
1800
|
console.log(_context18.t0);
|
|
1793
1801
|
|
|
1794
|
-
case
|
|
1802
|
+
case 38:
|
|
1795
1803
|
loadData();
|
|
1796
1804
|
|
|
1797
|
-
case
|
|
1805
|
+
case 39:
|
|
1798
1806
|
case "end":
|
|
1799
1807
|
return _context18.stop();
|
|
1800
1808
|
}
|
|
1801
1809
|
}
|
|
1802
|
-
}, _callee18, null, [[9,
|
|
1810
|
+
}, _callee18, null, [[9, 35]]);
|
|
1803
1811
|
}));
|
|
1804
1812
|
|
|
1805
|
-
return function sendEvaluation(
|
|
1813
|
+
return function sendEvaluation(_x9) {
|
|
1806
1814
|
return _ref16.apply(this, arguments);
|
|
1807
1815
|
};
|
|
1808
1816
|
}();
|
|
1809
1817
|
|
|
1810
1818
|
var validateAll = /*#__PURE__*/function () {
|
|
1811
1819
|
var _ref17 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee19(result) {
|
|
1812
|
-
var _product$id_order2, evaluationArray, conceptArray,
|
|
1820
|
+
var _product$id_order2, evaluationArray, conceptArray, isAproved, retailersIds, body, userType, productTemp, status, retailerStatusCopy;
|
|
1813
1821
|
|
|
1814
1822
|
return _regenerator.default.wrap(function _callee19$(_context19) {
|
|
1815
1823
|
while (1) {
|
|
@@ -1819,45 +1827,35 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
1819
1827
|
setLoading(true);
|
|
1820
1828
|
evaluationArray = [];
|
|
1821
1829
|
conceptArray = ["description", "datasheet", "images"];
|
|
1822
|
-
|
|
1823
|
-
|
|
1824
|
-
orderId: (_product$id_order2 = product.id_order) !== null && _product$id_order2 !== void 0 ? _product$id_order2 : product.orderId,
|
|
1825
|
-
result: result,
|
|
1826
|
-
isAproved: result === "A"
|
|
1827
|
-
};
|
|
1828
|
-
messages = [];
|
|
1830
|
+
isAproved = result === "A";
|
|
1831
|
+
retailersIds = [];
|
|
1829
1832
|
servicesData === null || servicesData === void 0 ? void 0 : servicesData.forEach(function (ret) {
|
|
1830
|
-
|
|
1831
|
-
|
|
1832
|
-
|
|
1833
|
-
|
|
1834
|
-
|
|
1835
|
-
|
|
1836
|
-
|
|
1837
|
-
}
|
|
1838
|
-
|
|
1833
|
+
if (!retailersIds.includes(ret.id_retailer)) retailersIds.push(ret.id_retailer);
|
|
1834
|
+
});
|
|
1835
|
+
body = {
|
|
1836
|
+
orderArticleRetailers: [{
|
|
1837
|
+
orderId: (_product$id_order2 = product.id_order) !== null && _product$id_order2 !== void 0 ? _product$id_order2 : product.orderId,
|
|
1838
|
+
articleId: product.article.id_article,
|
|
1839
|
+
retailersIds: retailersIds
|
|
1840
|
+
}],
|
|
1841
|
+
isAproved: isAproved
|
|
1842
|
+
};
|
|
1843
|
+
conceptArray.forEach(function (concept) {
|
|
1844
|
+
body.service = concept;
|
|
1845
|
+
evaluationArray.push(_axios.default.post("".concat(process.env.REACT_APP_EVALUATION_REFACTOR), body, {
|
|
1839
1846
|
headers: {
|
|
1840
1847
|
Authorization: token
|
|
1841
1848
|
}
|
|
1842
1849
|
}));
|
|
1843
|
-
|
|
1844
|
-
if (product["".concat(ret.service, "_status")] !== "NS") {
|
|
1845
|
-
var _message2 = (0, _utils.createMessage)(product.retailers, ret.id_retailer, product["".concat(ret.service, "_status")], "".concat(result, "A"), ret.service);
|
|
1846
|
-
|
|
1847
|
-
messages.push(createComment([{
|
|
1848
|
-
type: "status",
|
|
1849
|
-
value: _message2
|
|
1850
|
-
}], ret.id_retailer));
|
|
1851
|
-
}
|
|
1852
1850
|
});
|
|
1853
|
-
_context19.next =
|
|
1851
|
+
_context19.next = 11;
|
|
1854
1852
|
return Promise.all(evaluationArray);
|
|
1855
1853
|
|
|
1856
|
-
case
|
|
1854
|
+
case 11:
|
|
1857
1855
|
userType = user.is_retailer === 1 ? "CA" : "P";
|
|
1858
1856
|
productTemp = product;
|
|
1859
1857
|
status = "".concat(result).concat(userType);
|
|
1860
|
-
productTemp.
|
|
1858
|
+
productTemp.status = status;
|
|
1861
1859
|
productTemp.datasheet_status = productTemp.datasheet_status === "NA" ? "NA" : status;
|
|
1862
1860
|
productTemp.description_status = productTemp.description_status === "NA" ? "NA" : status;
|
|
1863
1861
|
productTemp.images_status = productTemp.images_status === "NA" ? "NA" : status;
|
|
@@ -1883,10 +1881,6 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
1883
1881
|
idCategory: productTemp.article.id_category,
|
|
1884
1882
|
product: productTemp
|
|
1885
1883
|
}));
|
|
1886
|
-
_context19.next = 26;
|
|
1887
|
-
return Promise.all(messages);
|
|
1888
|
-
|
|
1889
|
-
case 26:
|
|
1890
1884
|
_context19.next = 28;
|
|
1891
1885
|
return loadData();
|
|
1892
1886
|
|
|
@@ -1907,7 +1901,7 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
1907
1901
|
}, _callee19, null, [[0, 30]]);
|
|
1908
1902
|
}));
|
|
1909
1903
|
|
|
1910
|
-
return function validateAll(
|
|
1904
|
+
return function validateAll(_x10) {
|
|
1911
1905
|
return _ref17.apply(this, arguments);
|
|
1912
1906
|
};
|
|
1913
1907
|
}();
|
|
@@ -1954,7 +1948,7 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
1954
1948
|
}, _callee20);
|
|
1955
1949
|
}));
|
|
1956
1950
|
|
|
1957
|
-
return function evaluationToRetailer(
|
|
1951
|
+
return function evaluationToRetailer(_x11) {
|
|
1958
1952
|
return _ref18.apply(this, arguments);
|
|
1959
1953
|
};
|
|
1960
1954
|
}();
|
|
@@ -2042,7 +2036,8 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
2042
2036
|
return;
|
|
2043
2037
|
} else if (user.is_retailer) {
|
|
2044
2038
|
if (product.id_order || product.orderId) {
|
|
2045
|
-
|
|
2039
|
+
setValidatedAll(true);
|
|
2040
|
+
showGlobalModal("error");
|
|
2046
2041
|
} else {
|
|
2047
2042
|
setDataGenericModal(function (prev) {
|
|
2048
2043
|
return (0, _objectSpread3.default)((0, _objectSpread3.default)({}, prev), {}, {
|
|
@@ -2057,7 +2052,8 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
2057
2052
|
showGlobalModal("generic");
|
|
2058
2053
|
}
|
|
2059
2054
|
} else {
|
|
2060
|
-
|
|
2055
|
+
setValidatedAll(true);
|
|
2056
|
+
showGlobalModal("error");
|
|
2061
2057
|
}
|
|
2062
2058
|
}
|
|
2063
2059
|
};
|
|
@@ -2067,7 +2063,6 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
2067
2063
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_HeaderTop.HeaderTop, {
|
|
2068
2064
|
setHeaderTop: setHeaderTop,
|
|
2069
2065
|
withChat: location === null || location === void 0 ? void 0 : (_location$state5 = location.state) === null || _location$state5 === void 0 ? void 0 : _location$state5.withChat,
|
|
2070
|
-
chatType: location === null || location === void 0 ? void 0 : (_location$state6 = location.state) === null || _location$state6 === void 0 ? void 0 : _location$state6.chatType,
|
|
2071
2066
|
productSelected: productSelected,
|
|
2072
2067
|
token: token,
|
|
2073
2068
|
activeRetailer: activeRetailer
|
|
@@ -2146,7 +2141,7 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
2146
2141
|
} else if (user.is_retailer) {
|
|
2147
2142
|
if (product.id_order || product.orderId) {
|
|
2148
2143
|
setValidatedAll(true);
|
|
2149
|
-
|
|
2144
|
+
showGlobalModal("error");
|
|
2150
2145
|
} else {
|
|
2151
2146
|
setDataGenericModal(function (prev) {
|
|
2152
2147
|
return (0, _objectSpread3.default)((0, _objectSpread3.default)({}, prev), {}, {
|
|
@@ -2161,15 +2156,15 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
2161
2156
|
showGlobalModal("generic");
|
|
2162
2157
|
}
|
|
2163
2158
|
} else {
|
|
2164
|
-
setShowRejectModal(true);
|
|
2165
2159
|
setValidatedAll(true);
|
|
2160
|
+
showGlobalModal("error");
|
|
2166
2161
|
}
|
|
2167
2162
|
},
|
|
2168
2163
|
approve: function approve() {
|
|
2169
2164
|
return sendToEvaluation("A");
|
|
2170
2165
|
},
|
|
2171
2166
|
reject: function reject() {
|
|
2172
|
-
|
|
2167
|
+
return sendToEvaluation("R");
|
|
2173
2168
|
}
|
|
2174
2169
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_FullTabsMenu.FullTabsMenu, {
|
|
2175
2170
|
tabsSections: tabsSections,
|
|
@@ -2257,7 +2252,52 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
2257
2252
|
headerType: "input-name-header"
|
|
2258
2253
|
}))]
|
|
2259
2254
|
})
|
|
2260
|
-
}),
|
|
2255
|
+
}), isRevision() && getSectionStatus() ? /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
2256
|
+
className: "commentary-box",
|
|
2257
|
+
children: !comment ? /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
2258
|
+
className: "commentary",
|
|
2259
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_index.TagAndInput, {
|
|
2260
|
+
label: "Caja de Comentario",
|
|
2261
|
+
inputType: "textarea",
|
|
2262
|
+
inputCols: 80,
|
|
2263
|
+
inputRows: 4,
|
|
2264
|
+
inputId: "commentary-box",
|
|
2265
|
+
index: 0
|
|
2266
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
2267
|
+
className: "buttons-box",
|
|
2268
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_GeneralButton.Button, {
|
|
2269
|
+
buttonType: "general-transparent-button",
|
|
2270
|
+
label: "Enviar comentario",
|
|
2271
|
+
onClick: function onClick(e) {
|
|
2272
|
+
return createComment(e, document.querySelector("#description-commentary-box-0 .ql-container .ql-editor > p").innerHTML, activeTab);
|
|
2273
|
+
}
|
|
2274
|
+
})
|
|
2275
|
+
})]
|
|
2276
|
+
}) : /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
2277
|
+
className: "feedback-box",
|
|
2278
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_Commentary.Commentary, {
|
|
2279
|
+
comment: comment.message,
|
|
2280
|
+
reviewed: crossComment
|
|
2281
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_GeneralButton.Button, {
|
|
2282
|
+
buttonType: "circular-button accept-button",
|
|
2283
|
+
onClick: /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee21() {
|
|
2284
|
+
return _regenerator.default.wrap(function _callee21$(_context21) {
|
|
2285
|
+
while (1) {
|
|
2286
|
+
switch (_context21.prev = _context21.next) {
|
|
2287
|
+
case 0:
|
|
2288
|
+
setCrossComment(true);
|
|
2289
|
+
commentRevised();
|
|
2290
|
+
|
|
2291
|
+
case 2:
|
|
2292
|
+
case "end":
|
|
2293
|
+
return _context21.stop();
|
|
2294
|
+
}
|
|
2295
|
+
}
|
|
2296
|
+
}, _callee21);
|
|
2297
|
+
}))
|
|
2298
|
+
})]
|
|
2299
|
+
})
|
|
2300
|
+
}) : !revision && /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
2261
2301
|
className: "required-inputs-message",
|
|
2262
2302
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
2263
2303
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("p", {
|
|
@@ -2317,52 +2357,6 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
2317
2357
|
currentVersion: version,
|
|
2318
2358
|
setShowVersionSelector: setShowVersionSelector,
|
|
2319
2359
|
jwt: token
|
|
2320
|
-
}), showRejectModal && /*#__PURE__*/(0, _jsxRuntime.jsx)(_Modal.Modal, {
|
|
2321
|
-
title: "Agregar mensaje de rechazo",
|
|
2322
|
-
show: showRejectModal,
|
|
2323
|
-
customComponent: /*#__PURE__*/(0, _jsxRuntime.jsx)(_index.TagAndInput, {
|
|
2324
|
-
inputType: "textarea",
|
|
2325
|
-
inputId: "modal-message-box",
|
|
2326
|
-
index: 0,
|
|
2327
|
-
color: "white"
|
|
2328
|
-
}),
|
|
2329
|
-
buttons: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_ButtonV.ButtonV2, {
|
|
2330
|
-
type: "white",
|
|
2331
|
-
label: "Cancelar",
|
|
2332
|
-
size: 12,
|
|
2333
|
-
onClick: function onClick() {
|
|
2334
|
-
setShowRejectModal(false);
|
|
2335
|
-
}
|
|
2336
|
-
}, "btn-Cancelar"), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ButtonV.ButtonV2, {
|
|
2337
|
-
type: "pink",
|
|
2338
|
-
label: "Aceptar",
|
|
2339
|
-
size: 12,
|
|
2340
|
-
onClick: /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee21() {
|
|
2341
|
-
var body, messages;
|
|
2342
|
-
return _regenerator.default.wrap(function _callee21$(_context21) {
|
|
2343
|
-
while (1) {
|
|
2344
|
-
switch (_context21.prev = _context21.next) {
|
|
2345
|
-
case 0:
|
|
2346
|
-
body = document.querySelector("#modal-message-box .ql-container .ql-editor > p").innerHTML;
|
|
2347
|
-
messages = [{
|
|
2348
|
-
type: "message",
|
|
2349
|
-
value: body === null || body === void 0 ? void 0 : body.replace(/<.*?\/?>/gm, "")
|
|
2350
|
-
}];
|
|
2351
|
-
_context21.next = 4;
|
|
2352
|
-
return createComment(messages, activeRetailer.id);
|
|
2353
|
-
|
|
2354
|
-
case 4:
|
|
2355
|
-
validatedAll ? validateAll("R") : sendToEvaluation("R");
|
|
2356
|
-
setShowRejectModal(false);
|
|
2357
|
-
|
|
2358
|
-
case 6:
|
|
2359
|
-
case "end":
|
|
2360
|
-
return _context21.stop();
|
|
2361
|
-
}
|
|
2362
|
-
}
|
|
2363
|
-
}, _callee21);
|
|
2364
|
-
}))
|
|
2365
|
-
}, "btn-Aceptar")]
|
|
2366
2360
|
})]
|
|
2367
2361
|
});
|
|
2368
2362
|
};
|