contentoh-components-library 21.4.8 → 21.4.9

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.
Files changed (107) hide show
  1. package/.env.development +1 -5
  2. package/.env.production +1 -3
  3. package/dist/components/atoms/Avatar/index.js +2 -3
  4. package/dist/components/atoms/Card/index.js +5 -46
  5. package/dist/components/atoms/Card/styles.js +1 -3
  6. package/dist/components/atoms/CheckBox/index.js +2 -7
  7. package/dist/components/atoms/CheckBox/styles.js +1 -1
  8. package/dist/components/atoms/InputFormatter/styles.js +1 -1
  9. package/dist/components/molecules/CarouselImagesLogin/index.js +1 -1
  10. package/dist/components/molecules/HeaderTop/index.js +11 -68
  11. package/dist/components/molecules/TagAndInput/index.js +1 -1
  12. package/dist/components/organisms/Chat/Chat.stories.js +8 -27
  13. package/dist/components/organisms/Chat/ContainerItems/index.js +3 -19
  14. package/dist/components/organisms/Chat/ContainerItems/styles.js +1 -1
  15. package/dist/components/organisms/Chat/ContentChat/index.js +197 -350
  16. package/dist/components/organisms/Chat/Footer/index.js +39 -48
  17. package/dist/components/organisms/Chat/index.js +4 -49
  18. package/dist/components/organisms/FullProductNameHeader/index.js +2 -2
  19. package/dist/components/organisms/Modal/styles.js +1 -1
  20. package/dist/components/pages/ProviderProductEdition/ProviderProductEdition.stories.js +4 -37
  21. package/dist/components/pages/ProviderProductEdition/index.js +175 -188
  22. package/dist/components/pages/ProviderProductEdition/styles.js +1 -1
  23. package/dist/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +3 -7
  24. package/dist/components/pages/RetailerProductEdition/index.js +273 -288
  25. package/dist/components/pages/RetailerProductEdition/styles.js +1 -1
  26. package/dist/components/pages/RetailerProductEdition/utils.js +2 -61
  27. package/dist/index.js +52 -234
  28. package/package.json +1 -4
  29. package/src/components/atoms/Avatar/index.js +2 -8
  30. package/src/components/atoms/Card/index.js +2 -35
  31. package/src/components/atoms/Card/styles.js +5 -41
  32. package/src/components/atoms/CheckBox/index.js +1 -4
  33. package/src/components/atoms/CheckBox/styles.js +0 -2
  34. package/src/components/atoms/InputFormatter/styles.js +1 -2
  35. package/src/components/molecules/CarouselImagesLogin/index.js +1 -1
  36. package/src/components/molecules/HeaderTop/index.js +6 -52
  37. package/src/components/molecules/TagAndInput/index.js +8 -10
  38. package/src/components/organisms/Chat/Chat.stories.js +7 -27
  39. package/src/components/organisms/Chat/ContainerItems/index.js +2 -18
  40. package/src/components/organisms/Chat/ContainerItems/styles.js +2 -10
  41. package/src/components/organisms/Chat/ContentChat/index.js +12 -88
  42. package/src/components/organisms/Chat/Footer/index.js +0 -11
  43. package/src/components/organisms/Chat/index.js +4 -46
  44. package/src/components/organisms/FullProductNameHeader/index.js +1 -1
  45. package/src/components/organisms/Modal/styles.js +1 -4
  46. package/src/components/organisms/OrderDetail/utils/Table/utils.js +16 -6
  47. package/src/components/pages/ProviderProductEdition/ProviderProductEdition.stories.js +1 -40
  48. package/src/components/pages/ProviderProductEdition/index.js +129 -132
  49. package/src/components/pages/ProviderProductEdition/styles.js +1 -5
  50. package/src/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +2 -6
  51. package/src/components/pages/RetailerProductEdition/index.js +135 -121
  52. package/src/components/pages/RetailerProductEdition/styles.js +0 -4
  53. package/src/components/pages/RetailerProductEdition/utils.js +0 -37
  54. package/src/index.js +0 -15
  55. package/src/components/atoms/ImageCarousel/ImgeSlider.stories.js +0 -76
  56. package/src/components/atoms/ImageCarousel/index.js +0 -103
  57. package/src/components/atoms/ImageCarousel/styles.js +0 -79
  58. package/src/components/atoms/PercentTag/PercentTag.stories.js +0 -7
  59. package/src/components/atoms/PercentTag/index.js +0 -9
  60. package/src/components/atoms/PercentTag/styles.js +0 -69
  61. package/src/components/atoms/RatingStars/RatingStars.stories.js +0 -10
  62. package/src/components/atoms/RatingStars/index.js +0 -31
  63. package/src/components/atoms/RatingStars/styles.js +0 -28
  64. package/src/components/atoms/RetailerCatalog/RetailerCatalog.stories.js +0 -36
  65. package/src/components/atoms/RetailerCatalog/index.js +0 -49
  66. package/src/components/atoms/RetailerCatalog/styles.js +0 -30
  67. package/src/components/atoms/RetailerOption/RetailerOption.stories.js +0 -15
  68. package/src/components/atoms/RetailerOption/index.js +0 -53
  69. package/src/components/atoms/RetailerOption/styles.js +0 -41
  70. package/src/components/atoms/RetailersList/RetailersList.stories.js +0 -33
  71. package/src/components/atoms/RetailersList/index.js +0 -20
  72. package/src/components/atoms/RetailersList/styles.js +0 -19
  73. package/src/components/atoms/UserCatalog/UserCatalog.stories.js +0 -67
  74. package/src/components/atoms/UserCatalog/index.js +0 -96
  75. package/src/components/atoms/UserCatalog/styles.js +0 -24
  76. package/src/components/atoms/UserOption/UserOption.stories.js +0 -25
  77. package/src/components/atoms/UserOption/index.js +0 -95
  78. package/src/components/atoms/UserOption/styles.js +0 -61
  79. package/src/components/atoms/UserSelector/UserSelector.stories.js +0 -25
  80. package/src/components/atoms/UserSelector/index.js +0 -86
  81. package/src/components/atoms/UserSelector/styles.js +0 -55
  82. package/src/components/molecules/GridItem/GridItem.stories.js +0 -126
  83. package/src/components/molecules/GridItem/index.js +0 -97
  84. package/src/components/molecules/GridItem/styles.js +0 -104
  85. package/src/components/molecules/HeaderItem/ColumnItem.js +0 -9
  86. package/src/components/molecules/HeaderItem/HeaderItem.stories.js +0 -24
  87. package/src/components/molecules/HeaderItem/index.js +0 -26
  88. package/src/components/molecules/HeaderItem/styles.js +0 -27
  89. package/src/components/molecules/RowItem/ColumnItem.js +0 -9
  90. package/src/components/molecules/RowItem/RowItem.stories.js +0 -5660
  91. package/src/components/molecules/RowItem/index.js +0 -45
  92. package/src/components/molecules/RowItem/styles.js +0 -40
  93. package/src/components/molecules/StripeCardForm/StripeCardForm.stories.js +0 -13
  94. package/src/components/molecules/StripeCardForm/index.js +0 -42
  95. package/src/components/molecules/StripeCardForm/paymentForm.js +0 -124
  96. package/src/components/molecules/StripeCardForm/styles.js +0 -73
  97. package/src/components/molecules/StripeCardSelector/CardSelector.stories.js +0 -12
  98. package/src/components/molecules/StripeCardSelector/index.js +0 -44
  99. package/src/components/molecules/StripeCardSelector/styles.js +0 -4
  100. package/src/components/molecules/StripeCardSelector/utils.js +0 -17
  101. package/src/components/organisms/GridProducts/GridProducts.stories.js +0 -5485
  102. package/src/components/organisms/GridProducts/index.js +0 -50
  103. package/src/components/organisms/GridProducts/styles.js +0 -14
  104. package/src/components/organisms/GridProducts/utils.js +0 -111
  105. package/src/components/organisms/SideModal/SideModal.stories.js +0 -23
  106. package/src/components/organisms/SideModal/index.js +0 -50
  107. 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, _location$state6, _datasheets$, _datasheets$$data;
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)(false),
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
- _useState64 = (0, _slicedToArray2.default)(_useState63, 2),
466
- origin = _useState64[0],
467
- setOrigin = _useState64[1];
454
+ _useState62 = (0, _slicedToArray2.default)(_useState61, 2),
455
+ origin = _useState62[0],
456
+ setOrigin = _useState62[1];
468
457
 
469
- var _useState65 = (0, _react.useState)(false),
470
- _useState66 = (0, _slicedToArray2.default)(_useState65, 2),
471
- inCart = _useState66[0],
472
- setInCart = _useState66[1];
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 _useState67 = (0, _react.useState)({
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
- dataGenericModal = _useState68[0],
491
- setDataGenericModal = _useState68[1];
484
+ socketType = _useState68[0],
485
+ setSocketType = _useState68[1];
492
486
 
493
- var _useState69 = (0, _react.useState)(null),
487
+ var _useState69 = (0, _react.useState)(loading),
494
488
  _useState70 = (0, _slicedToArray2.default)(_useState69, 2),
495
- socketType = _useState70[0],
496
- setSocketType = _useState70[1];
489
+ saving = _useState70[0],
490
+ setSaving = _useState70[1];
497
491
 
498
- var _useState71 = (0, _react.useState)(loading),
492
+ var _useState71 = (0, _react.useState)(product.statusByRetailer),
499
493
  _useState72 = (0, _slicedToArray2.default)(_useState71, 2),
500
- saving = _useState72[0],
501
- setSaving = _useState72[1];
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 _useState75 = (0, _react.useState)(),
514
- _useState76 = (0, _slicedToArray2.default)(_useState75, 2),
515
- globalModal = _useState76[0],
516
- setGlobalModal = _useState76[1];
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
- retailers && !activeRetailer.id && setActiveRetailer(active ? active : retailers[0]);
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
- retailers && setActivePercentage((_retailers$ = retailers[0]) === null || _retailers$ === void 0 ? void 0 : _retailers$.percentage);
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 messages,
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
- messages = _args15.length > 0 && _args15[0] !== undefined ? _args15[0] : [];
1469
- retailerId = _args15.length > 1 ? _args15[1] : undefined;
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
- paramsBody: {
1472
- id: product.article.id_article || productEdit.ArticleId,
1473
- version: version,
1474
- items: messages,
1475
- retailerId: retailerId,
1476
- status: product.status || productEdit.product.status
1477
- },
1478
- paramsHeader: {
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 5:
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(_x4, _x5) {
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$parse, newArticleStatus, newServiceStatus, newStatus, _message, messageData, retailerStatusCopy, status;
1705
+ var concept, productTemp, articleId, orderId, sectionStatusKey, evalStatus, data, retailerId, res, newStatuses, orderStatus, serviceStatus, newProductEdit, showSurveyByProvider, showSurveyByRetailer, _JSON$parse, newArticleStatus, newServiceStatus, newStatus, retailerStatusCopy, status;
1681
1706
 
1682
1707
  return _regenerator.default.wrap(function _callee18$(_context18) {
1683
1708
  while (1) {
@@ -1739,77 +1764,53 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
1739
1764
  res = _context18.sent;
1740
1765
 
1741
1766
  case 30:
1742
- if (!(res.data.statusCode === 200)) {
1743
- _context18.next = 45;
1744
- break;
1745
- }
1746
-
1747
- _JSON$parse = JSON.parse(res.data.body), newArticleStatus = _JSON$parse.newArticleStatus, newServiceStatus = _JSON$parse.newServiceStatus, newStatus = _JSON$parse.newStatus;
1748
- _message = (0, _utils.createMessage)(product.retailers || product.retailersAvailable, activeRetailer.id, product[sectionStatusKey], newStatus, activeTab);
1749
- messageData = {
1750
- paramsBody: {
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
1767
+ if (res.data.statusCode === 200) {
1768
+ _JSON$parse = JSON.parse(res.data.body), newArticleStatus = _JSON$parse.newArticleStatus, newServiceStatus = _JSON$parse.newServiceStatus, newStatus = _JSON$parse.newStatus;
1769
+ if (newArticleStatus) productTemp.status = newArticleStatus[articleId];
1770
+ retailerStatusCopy = (0, _objectSpread3.default)({}, retailerStatus);
1771
+ retailerStatusCopy[activeRetailer.id][concept] = newStatus;
1772
+ setRetailerStatus(retailerStatusCopy);
1773
+ productTemp.statusByRetailer = retailerStatusCopy;
1774
+
1775
+ if (newServiceStatus) {
1776
+ status = newServiceStatus[articleId]["".concat(concept, "Status")];
1777
+ productTemp["".concat(concept, "_status")] = status;
1762
1778
  }
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
1779
 
1774
- if (newServiceStatus) {
1775
- status = newServiceStatus[articleId]["".concat(concept, "Status")];
1776
- productTemp["".concat(concept, "_status")] = status;
1780
+ setProduct(productTemp);
1781
+ sessionStorage.setItem("productSelected", JSON.stringify(productTemp));
1782
+ setOrigin(function (prev) {
1783
+ return (0, _objectSpread3.default)((0, _objectSpread3.default)({}, prev), {}, (0, _defineProperty2.default)({}, concept, status));
1784
+ });
1777
1785
  }
1778
1786
 
1779
- setProduct(productTemp);
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;
1787
+ _context18.next = 36;
1787
1788
  break;
1788
1789
 
1789
- case 47:
1790
- _context18.prev = 47;
1790
+ case 33:
1791
+ _context18.prev = 33;
1791
1792
  _context18.t0 = _context18["catch"](9);
1792
1793
  console.log(_context18.t0);
1793
1794
 
1794
- case 50:
1795
+ case 36:
1795
1796
  loadData();
1796
1797
 
1797
- case 51:
1798
+ case 37:
1798
1799
  case "end":
1799
1800
  return _context18.stop();
1800
1801
  }
1801
1802
  }
1802
- }, _callee18, null, [[9, 47]]);
1803
+ }, _callee18, null, [[9, 33]]);
1803
1804
  }));
1804
1805
 
1805
- return function sendEvaluation(_x6) {
1806
+ return function sendEvaluation(_x9) {
1806
1807
  return _ref16.apply(this, arguments);
1807
1808
  };
1808
1809
  }();
1809
1810
 
1810
1811
  var validateAll = /*#__PURE__*/function () {
1811
1812
  var _ref17 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee19(result) {
1812
- var _product$id_order2, evaluationArray, conceptArray, dataGeneral, messages, userType, productTemp, status, retailerStatusCopy;
1813
+ var _product$id_order2, evaluationArray, conceptArray, dataGeneral, userType, productTemp, status, retailerStatusCopy;
1813
1814
 
1814
1815
  return _regenerator.default.wrap(function _callee19$(_context19) {
1815
1816
  while (1) {
@@ -1825,7 +1826,6 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
1825
1826
  result: result,
1826
1827
  isAproved: result === "A"
1827
1828
  };
1828
- messages = [];
1829
1829
  servicesData === null || servicesData === void 0 ? void 0 : servicesData.forEach(function (ret) {
1830
1830
  var service = ret.service,
1831
1831
  id_retailer = ret.id_retailer;
@@ -1840,20 +1840,11 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
1840
1840
  Authorization: token
1841
1841
  }
1842
1842
  }));
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
1843
  });
1853
- _context19.next = 9;
1844
+ _context19.next = 8;
1854
1845
  return Promise.all(evaluationArray);
1855
1846
 
1856
- case 9:
1847
+ case 8:
1857
1848
  userType = user.is_retailer === 1 ? "CA" : "P";
1858
1849
  productTemp = product;
1859
1850
  status = "".concat(result).concat(userType);
@@ -1883,31 +1874,27 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
1883
1874
  idCategory: productTemp.article.id_category,
1884
1875
  product: productTemp
1885
1876
  }));
1886
- _context19.next = 26;
1887
- return Promise.all(messages);
1888
-
1889
- case 26:
1890
- _context19.next = 28;
1877
+ _context19.next = 25;
1891
1878
  return loadData();
1892
1879
 
1893
- case 28:
1894
- _context19.next = 33;
1880
+ case 25:
1881
+ _context19.next = 30;
1895
1882
  break;
1896
1883
 
1897
- case 30:
1898
- _context19.prev = 30;
1884
+ case 27:
1885
+ _context19.prev = 27;
1899
1886
  _context19.t0 = _context19["catch"](0);
1900
1887
  console.log(_context19.t0);
1901
1888
 
1902
- case 33:
1889
+ case 30:
1903
1890
  case "end":
1904
1891
  return _context19.stop();
1905
1892
  }
1906
1893
  }
1907
- }, _callee19, null, [[0, 30]]);
1894
+ }, _callee19, null, [[0, 27]]);
1908
1895
  }));
1909
1896
 
1910
- return function validateAll(_x7) {
1897
+ return function validateAll(_x10) {
1911
1898
  return _ref17.apply(this, arguments);
1912
1899
  };
1913
1900
  }();
@@ -1954,7 +1941,7 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
1954
1941
  }, _callee20);
1955
1942
  }));
1956
1943
 
1957
- return function evaluationToRetailer(_x8) {
1944
+ return function evaluationToRetailer(_x11) {
1958
1945
  return _ref18.apply(this, arguments);
1959
1946
  };
1960
1947
  }();
@@ -2042,7 +2029,8 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
2042
2029
  return;
2043
2030
  } else if (user.is_retailer) {
2044
2031
  if (product.id_order || product.orderId) {
2045
- sendEvaluation("R");
2032
+ setValidatedAll(true);
2033
+ showGlobalModal("error");
2046
2034
  } else {
2047
2035
  setDataGenericModal(function (prev) {
2048
2036
  return (0, _objectSpread3.default)((0, _objectSpread3.default)({}, prev), {}, {
@@ -2057,7 +2045,8 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
2057
2045
  showGlobalModal("generic");
2058
2046
  }
2059
2047
  } else {
2060
- sendEvaluation("R");
2048
+ setValidatedAll(true);
2049
+ showGlobalModal("error");
2061
2050
  }
2062
2051
  }
2063
2052
  };
@@ -2067,7 +2056,6 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
2067
2056
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_HeaderTop.HeaderTop, {
2068
2057
  setHeaderTop: setHeaderTop,
2069
2058
  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
2059
  productSelected: productSelected,
2072
2060
  token: token,
2073
2061
  activeRetailer: activeRetailer
@@ -2146,7 +2134,7 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
2146
2134
  } else if (user.is_retailer) {
2147
2135
  if (product.id_order || product.orderId) {
2148
2136
  setValidatedAll(true);
2149
- setShowRejectModal(true);
2137
+ showGlobalModal("error");
2150
2138
  } else {
2151
2139
  setDataGenericModal(function (prev) {
2152
2140
  return (0, _objectSpread3.default)((0, _objectSpread3.default)({}, prev), {}, {
@@ -2161,15 +2149,15 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
2161
2149
  showGlobalModal("generic");
2162
2150
  }
2163
2151
  } else {
2164
- setShowRejectModal(true);
2165
2152
  setValidatedAll(true);
2153
+ showGlobalModal("error");
2166
2154
  }
2167
2155
  },
2168
2156
  approve: function approve() {
2169
2157
  return sendToEvaluation("A");
2170
2158
  },
2171
2159
  reject: function reject() {
2172
- setShowRejectModal(true);
2160
+ return sendToEvaluation("R");
2173
2161
  }
2174
2162
  }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_FullTabsMenu.FullTabsMenu, {
2175
2163
  tabsSections: tabsSections,
@@ -2257,7 +2245,52 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
2257
2245
  headerType: "input-name-header"
2258
2246
  }))]
2259
2247
  })
2260
- }), !(isRevision() && getSectionStatus()) && !revision && /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
2248
+ }), isRevision() && getSectionStatus() ? /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
2249
+ className: "commentary-box",
2250
+ children: !comment ? /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
2251
+ className: "commentary",
2252
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_index.TagAndInput, {
2253
+ label: "Caja de Comentario",
2254
+ inputType: "textarea",
2255
+ inputCols: 80,
2256
+ inputRows: 4,
2257
+ inputId: "commentary-box",
2258
+ index: 0
2259
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
2260
+ className: "buttons-box",
2261
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_GeneralButton.Button, {
2262
+ buttonType: "general-transparent-button",
2263
+ label: "Enviar comentario",
2264
+ onClick: function onClick(e) {
2265
+ return createComment(e, document.querySelector("#description-commentary-box-0 .ql-container .ql-editor > p").innerHTML, activeTab);
2266
+ }
2267
+ })
2268
+ })]
2269
+ }) : /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
2270
+ className: "feedback-box",
2271
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_Commentary.Commentary, {
2272
+ comment: comment.message,
2273
+ reviewed: crossComment
2274
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_GeneralButton.Button, {
2275
+ buttonType: "circular-button accept-button",
2276
+ onClick: /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee21() {
2277
+ return _regenerator.default.wrap(function _callee21$(_context21) {
2278
+ while (1) {
2279
+ switch (_context21.prev = _context21.next) {
2280
+ case 0:
2281
+ setCrossComment(true);
2282
+ commentRevised();
2283
+
2284
+ case 2:
2285
+ case "end":
2286
+ return _context21.stop();
2287
+ }
2288
+ }
2289
+ }, _callee21);
2290
+ }))
2291
+ })]
2292
+ })
2293
+ }) : !revision && /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
2261
2294
  className: "required-inputs-message",
2262
2295
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
2263
2296
  children: /*#__PURE__*/(0, _jsxRuntime.jsx)("p", {
@@ -2317,52 +2350,6 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
2317
2350
  currentVersion: version,
2318
2351
  setShowVersionSelector: setShowVersionSelector,
2319
2352
  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
2353
  })]
2367
2354
  });
2368
2355
  };
@@ -15,7 +15,7 @@ var _variables = require("../../../global-files/variables");
15
15
 
16
16
  var _templateObject;
17
17
 
18
- var Container = _styledComponents.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n flex-direction: column;\n height: 100%;\n flex: 1;\n overflow: auto;\n\n .data-container {\n display: flex;\n flex: 0%;\n height: calc(100% - ", "px);\n .image-data-panel {\n width: 340px;\n\n & + * {\n margin-left: 10px;\n }\n }\n\n .product-information {\n width: 100%;\n display: flex;\n flex-direction: column;\n\n .services-information-container {\n height: 100%;\n overflow: auto;\n }\n\n .image-services {\n aside {\n display: grid;\n grid-template-columns: repeat(auto-fill, 179px);\n column-gap: 15px;\n row-gap: 15px;\n padding: 20px;\n }\n }\n\n .commentary-box {\n display: flex;\n justify-content: space-between;\n align-items: flex-end;\n padding: 10px;\n padding-left: 0;\n\n .commentary {\n display: flex;\n align-items: flex-end;\n\n .input-container {\n width: 500px;\n\n .quill {\n height: 100px;\n }\n\n & + * {\n margin-left: 5px;\n }\n }\n\n .buttons-box {\n display: flex;\n width: 210px;\n flex-wrap: wrap;\n\n .general-transparent-button {\n & + * {\n margin-top: 5px;\n }\n }\n\n .general-transparent-button,\n .general-green-button,\n .general-button-disabled {\n width: fit-content;\n min-width: 201px;\n height: 40px;\n }\n }\n }\n }\n\n .feedback-box {\n display: flex;\n }\n\n .required-inputs-message {\n font-family: ", ";\n font-size: 13px;\n color: ", ";\n padding: 10px;\n display: flex;\n align-items: center;\n\n p + * {\n margin-top: 10px;\n }\n\n button {\n min-width: fit-content;\n }\n }\n }\n }\n #modal-message-box {\n width: 400px;\n height: 100px;\n }\n .container {\n width: 100%;\n height: 100%;\n .dropzone {\n height: 100%;\n width: 100%;\n }\n }\n"])), function (_ref) {
18
+ var Container = _styledComponents.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n flex-direction: column;\n height: 100%;\n flex: 1;\n overflow: auto;\n\n .data-container {\n display: flex;\n flex: 0%;\n height: calc(100% - ", "px);\n .image-data-panel {\n width: 340px;\n\n & + * {\n margin-left: 10px;\n }\n }\n\n .product-information {\n width: 100%;\n display: flex;\n flex-direction: column;\n\n .services-information-container {\n height: 100%;\n overflow: auto;\n }\n\n .image-services {\n aside {\n display: grid;\n grid-template-columns: repeat(auto-fill, 179px);\n column-gap: 15px;\n row-gap: 15px;\n padding: 20px;\n }\n }\n\n .commentary-box {\n display: flex;\n justify-content: space-between;\n align-items: flex-end;\n padding: 10px;\n padding-left: 0;\n\n .commentary {\n display: flex;\n align-items: flex-end;\n\n .input-container {\n width: 500px;\n\n .quill {\n height: 100px;\n }\n\n & + * {\n margin-left: 5px;\n }\n }\n\n .buttons-box {\n display: flex;\n width: 210px;\n flex-wrap: wrap;\n\n .general-transparent-button {\n & + * {\n margin-top: 5px;\n }\n }\n\n .general-transparent-button,\n .general-green-button,\n .general-button-disabled {\n width: fit-content;\n min-width: 201px;\n height: 40px;\n }\n }\n }\n }\n\n .feedback-box {\n display: flex;\n }\n\n .required-inputs-message {\n font-family: ", ";\n font-size: 13px;\n color: ", ";\n padding: 10px;\n display: flex;\n align-items: center;\n\n p + * {\n margin-top: 10px;\n }\n\n button {\n min-width: fit-content;\n }\n }\n }\n }\n .container {\n width: 100%;\n height: 100%;\n .dropzone {\n height: 100%;\n width: 100%;\n }\n }\n"])), function (_ref) {
19
19
  var headerTop = _ref.headerTop;
20
20
  return headerTop;
21
21
  }, _variables.FontFamily.AvenirNext, _variables.GlobalColors.s4);
@@ -31,7 +31,7 @@ RetailerProductEditionDefault.args = {
31
31
  "Ficha técnica": false,
32
32
  Imágenes: false
33
33
  },
34
- token: "eyJraWQiOiJkQWJkZCtlclwvTlwveVRQUWNvUlVyOCtrNUd2M1hMM2N1MWUzQ09zWExVRnc9IiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiI5YTIxMzEyOC02NDgyLTRjMTYtYTRiNi02ZTY0ZjIyNWIxYmQiLCJj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XwIxM4JdU7yuhXLznaEH8NOSd2Jw-CV6FCUbYBHlnRYBQg7B5mwyVKtDQm6QpRgBTBPCvljJJpFjRKUcnon8WZiFXx1qVbkWPt2vCT1TZqqoSLdlP6lA",
35
35
  productSelected: {
36
36
  services: {
37
37
  datasheets: 1,
@@ -87,12 +87,8 @@ RetailerProductEditionDefault.args = {
87
87
  },
88
88
  location: {
89
89
  product: {
90
- articleId: 354,
91
- versionId: 3
92
- },
93
- state: {
94
- withChat: true,
95
- chatType: "product_status"
90
+ articleId: 39290,
91
+ versionId: 7
96
92
  }
97
93
  },
98
94
  user: {