contentoh-components-library 21.4.9 → 21.4.11

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 (110) hide show
  1. package/.env.development +5 -1
  2. package/.env.production +3 -1
  3. package/dist/components/atoms/Avatar/index.js +3 -2
  4. package/dist/components/atoms/Card/index.js +46 -5
  5. package/dist/components/atoms/Card/styles.js +3 -1
  6. package/dist/components/atoms/CheckBox/index.js +7 -2
  7. package/dist/components/atoms/CheckBox/styles.js +1 -1
  8. package/dist/components/atoms/InputFormatter/styles.js +1 -1
  9. package/dist/components/atoms/UserCatalog/index.js +2 -2
  10. package/dist/components/molecules/CarouselImagesLogin/index.js +1 -1
  11. package/dist/components/molecules/GridItem/styles.js +1 -1
  12. package/dist/components/molecules/HeaderTop/index.js +68 -11
  13. package/dist/components/molecules/TagAndInput/index.js +1 -1
  14. package/dist/components/organisms/Chat/Chat.stories.js +27 -8
  15. package/dist/components/organisms/Chat/ContainerItems/index.js +19 -3
  16. package/dist/components/organisms/Chat/ContainerItems/styles.js +1 -1
  17. package/dist/components/organisms/Chat/ContentChat/index.js +350 -197
  18. package/dist/components/organisms/Chat/Footer/index.js +48 -39
  19. package/dist/components/organisms/Chat/index.js +49 -4
  20. package/dist/components/organisms/FullProductNameHeader/index.js +2 -2
  21. package/dist/components/organisms/Modal/styles.js +1 -1
  22. package/dist/components/pages/ProviderProductEdition/ProviderProductEdition.stories.js +37 -4
  23. package/dist/components/pages/ProviderProductEdition/index.js +188 -175
  24. package/dist/components/pages/ProviderProductEdition/styles.js +1 -1
  25. package/dist/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +7 -3
  26. package/dist/components/pages/RetailerProductEdition/index.js +288 -273
  27. package/dist/components/pages/RetailerProductEdition/styles.js +1 -1
  28. package/dist/components/pages/RetailerProductEdition/utils.js +61 -2
  29. package/dist/index.js +234 -52
  30. package/package.json +4 -1
  31. package/src/components/atoms/Avatar/index.js +8 -2
  32. package/src/components/atoms/Card/index.js +35 -2
  33. package/src/components/atoms/Card/styles.js +41 -5
  34. package/src/components/atoms/CheckBox/index.js +4 -1
  35. package/src/components/atoms/CheckBox/styles.js +2 -0
  36. package/src/components/atoms/ImageCarousel/ImgeSlider.stories.js +76 -0
  37. package/src/components/atoms/ImageCarousel/index.js +103 -0
  38. package/src/components/atoms/ImageCarousel/styles.js +79 -0
  39. package/src/components/atoms/InputFormatter/styles.js +2 -1
  40. package/src/components/atoms/PercentTag/PercentTag.stories.js +7 -0
  41. package/src/components/atoms/PercentTag/index.js +9 -0
  42. package/src/components/atoms/PercentTag/styles.js +69 -0
  43. package/src/components/atoms/RatingStars/RatingStars.stories.js +10 -0
  44. package/src/components/atoms/RatingStars/index.js +31 -0
  45. package/src/components/atoms/RatingStars/styles.js +28 -0
  46. package/src/components/atoms/RetailerCatalog/RetailerCatalog.stories.js +36 -0
  47. package/src/components/atoms/RetailerCatalog/index.js +49 -0
  48. package/src/components/atoms/RetailerCatalog/styles.js +30 -0
  49. package/src/components/atoms/RetailerOption/RetailerOption.stories.js +15 -0
  50. package/src/components/atoms/RetailerOption/index.js +53 -0
  51. package/src/components/atoms/RetailerOption/styles.js +41 -0
  52. package/src/components/atoms/RetailersList/RetailersList.stories.js +33 -0
  53. package/src/components/atoms/RetailersList/index.js +20 -0
  54. package/src/components/atoms/RetailersList/styles.js +19 -0
  55. package/src/components/atoms/UserCatalog/UserCatalog.stories.js +67 -0
  56. package/src/components/atoms/UserCatalog/index.js +100 -0
  57. package/src/components/atoms/UserCatalog/styles.js +24 -0
  58. package/src/components/atoms/UserOption/UserOption.stories.js +25 -0
  59. package/src/components/atoms/UserOption/index.js +95 -0
  60. package/src/components/atoms/UserOption/styles.js +61 -0
  61. package/src/components/atoms/UserSelector/UserSelector.stories.js +25 -0
  62. package/src/components/atoms/UserSelector/index.js +86 -0
  63. package/src/components/atoms/UserSelector/styles.js +55 -0
  64. package/src/components/molecules/CarouselImagesLogin/index.js +1 -1
  65. package/src/components/molecules/GridItem/GridItem.stories.js +126 -0
  66. package/src/components/molecules/GridItem/index.js +97 -0
  67. package/src/components/molecules/GridItem/styles.js +104 -0
  68. package/src/components/molecules/HeaderItem/ColumnItem.js +9 -0
  69. package/src/components/molecules/HeaderItem/HeaderItem.stories.js +24 -0
  70. package/src/components/molecules/HeaderItem/index.js +26 -0
  71. package/src/components/molecules/HeaderItem/styles.js +27 -0
  72. package/src/components/molecules/HeaderTop/index.js +52 -6
  73. package/src/components/molecules/RowItem/ColumnItem.js +9 -0
  74. package/src/components/molecules/RowItem/RowItem.stories.js +5660 -0
  75. package/src/components/molecules/RowItem/index.js +45 -0
  76. package/src/components/molecules/RowItem/styles.js +40 -0
  77. package/src/components/molecules/StripeCardForm/StripeCardForm.stories.js +13 -0
  78. package/src/components/molecules/StripeCardForm/index.js +42 -0
  79. package/src/components/molecules/StripeCardForm/paymentForm.js +124 -0
  80. package/src/components/molecules/StripeCardForm/styles.js +73 -0
  81. package/src/components/molecules/StripeCardSelector/CardSelector.stories.js +12 -0
  82. package/src/components/molecules/StripeCardSelector/index.js +44 -0
  83. package/src/components/molecules/StripeCardSelector/styles.js +4 -0
  84. package/src/components/molecules/StripeCardSelector/utils.js +17 -0
  85. package/src/components/molecules/TagAndInput/index.js +10 -8
  86. package/src/components/organisms/Chat/Chat.stories.js +27 -7
  87. package/src/components/organisms/Chat/ContainerItems/index.js +18 -2
  88. package/src/components/organisms/Chat/ContainerItems/styles.js +10 -2
  89. package/src/components/organisms/Chat/ContentChat/index.js +88 -12
  90. package/src/components/organisms/Chat/Footer/index.js +11 -0
  91. package/src/components/organisms/Chat/index.js +46 -4
  92. package/src/components/organisms/FullProductNameHeader/index.js +1 -1
  93. package/src/components/organisms/GridProducts/GridProducts.stories.js +5485 -0
  94. package/src/components/organisms/GridProducts/index.js +50 -0
  95. package/src/components/organisms/GridProducts/styles.js +14 -0
  96. package/src/components/organisms/GridProducts/utils.js +111 -0
  97. package/src/components/organisms/Modal/styles.js +4 -1
  98. package/src/components/organisms/OrderDetail/utils/Table/utils.js +6 -16
  99. package/src/components/organisms/SideModal/SideModal.stories.js +23 -0
  100. package/src/components/organisms/SideModal/index.js +50 -0
  101. package/src/components/organisms/SideModal/styles.js +30 -0
  102. package/src/components/pages/ProviderProductEdition/ProviderProductEdition.stories.js +40 -1
  103. package/src/components/pages/ProviderProductEdition/index.js +132 -129
  104. package/src/components/pages/ProviderProductEdition/styles.js +5 -1
  105. package/src/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +6 -2
  106. package/src/components/pages/RetailerProductEdition/index.js +121 -135
  107. package/src/components/pages/RetailerProductEdition/styles.js +4 -0
  108. package/src/components/pages/RetailerProductEdition/utils.js +37 -0
  109. package/src/index.js +15 -0
  110. package/dist/assets/fonts/roboto/LICENSE.txt +0 -202
@@ -93,6 +93,12 @@ 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
+
96
102
  var _jsxRuntime = require("react/jsx-runtime");
97
103
 
98
104
  var reducerImages = function reducerImages(state, action) {
@@ -206,7 +212,7 @@ var myBucket = new _awsSdk.default.S3({
206
212
  });
207
213
 
208
214
  var ProviderProductEdition = function ProviderProductEdition(_ref) {
209
- var _product$retailers, _product$retailersAva, _location$state4, _location$state5, _datasheets$, _datasheets$$data;
215
+ var _product$retailers, _product$retailersAva, _location$state4, _location$state5, _location$state6, _datasheets$, _datasheets$$data;
210
216
 
211
217
  var tabsSections = _ref.tabsSections,
212
218
  _ref$productSelected = _ref.productSelected,
@@ -446,21 +452,26 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
446
452
  validatedAll = _useState60[0],
447
453
  setValidatedAll = _useState60[1];
448
454
 
449
- var _useState61 = (0, _react.useState)({
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)({
450
461
  "Ficha técnica": null,
451
462
  Descripción: null,
452
463
  Imágenes: null
453
464
  }),
454
- _useState62 = (0, _slicedToArray2.default)(_useState61, 2),
455
- origin = _useState62[0],
456
- setOrigin = _useState62[1];
457
-
458
- var _useState63 = (0, _react.useState)(false),
459
465
  _useState64 = (0, _slicedToArray2.default)(_useState63, 2),
460
- inCart = _useState64[0],
461
- setInCart = _useState64[1];
466
+ origin = _useState64[0],
467
+ setOrigin = _useState64[1];
468
+
469
+ var _useState65 = (0, _react.useState)(false),
470
+ _useState66 = (0, _slicedToArray2.default)(_useState65, 2),
471
+ inCart = _useState66[0],
472
+ setInCart = _useState66[1];
462
473
 
463
- var _useState65 = (0, _react.useState)({
474
+ var _useState67 = (0, _react.useState)({
464
475
  message: "¿Estás seguro de continuar?",
465
476
  detail: " ".concat(user.is_retailer ? "Asegurate de haber revisado las tres secciones" : "Envíar el producto a la cadena"),
466
477
  button1: {
@@ -475,34 +486,34 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
475
486
  },
476
487
  img: _defaultProfileImage.default
477
488
  }),
478
- _useState66 = (0, _slicedToArray2.default)(_useState65, 2),
479
- dataGenericModal = _useState66[0],
480
- setDataGenericModal = _useState66[1];
481
-
482
- var _useState67 = (0, _react.useState)(null),
483
489
  _useState68 = (0, _slicedToArray2.default)(_useState67, 2),
484
- socketType = _useState68[0],
485
- setSocketType = _useState68[1];
490
+ dataGenericModal = _useState68[0],
491
+ setDataGenericModal = _useState68[1];
486
492
 
487
- var _useState69 = (0, _react.useState)(loading),
493
+ var _useState69 = (0, _react.useState)(null),
488
494
  _useState70 = (0, _slicedToArray2.default)(_useState69, 2),
489
- saving = _useState70[0],
490
- setSaving = _useState70[1];
495
+ socketType = _useState70[0],
496
+ setSocketType = _useState70[1];
491
497
 
492
- var _useState71 = (0, _react.useState)(product.statusByRetailer),
498
+ var _useState71 = (0, _react.useState)(loading),
493
499
  _useState72 = (0, _slicedToArray2.default)(_useState71, 2),
494
- retailerStatus = _useState72[0],
495
- setRetailerStatus = _useState72[1];
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];
496
507
 
497
508
  var _useCloseModal = (0, _customHooks.useCloseModal)("version-selector"),
498
509
  _useCloseModal2 = (0, _slicedToArray2.default)(_useCloseModal, 2),
499
510
  showVersionSelector = _useCloseModal2[0],
500
511
  setShowVersionSelector = _useCloseModal2[1];
501
512
 
502
- var _useState73 = (0, _react.useState)(),
503
- _useState74 = (0, _slicedToArray2.default)(_useState73, 2),
504
- globalModal = _useState74[0],
505
- setGlobalModal = _useState74[1];
513
+ var _useState75 = (0, _react.useState)(),
514
+ _useState76 = (0, _slicedToArray2.default)(_useState75, 2),
515
+ globalModal = _useState76[0],
516
+ setGlobalModal = _useState76[1];
506
517
 
507
518
  var updateAuditStatus = /*#__PURE__*/function () {
508
519
  var _ref3 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2(status) {
@@ -674,30 +685,6 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
674
685
  });
675
686
 
676
687
  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
-
701
688
  case "generic":
702
689
  setGlobalModal(dataGenericModal);
703
690
  break;
@@ -969,7 +956,7 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
969
956
  setServicesData(parsedResponse);
970
957
 
971
958
  case 12:
972
- !activeRetailer.id && setActiveRetailer(active ? active : retailers[0]);
959
+ retailers && !activeRetailer.id && setActiveRetailer(active ? active : retailers[0]);
973
960
 
974
961
  case 13:
975
962
  case "end":
@@ -1087,7 +1074,7 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
1087
1074
  }
1088
1075
 
1089
1076
  setProduct(productTemp);
1090
- setActivePercentage((_retailers$ = retailers[0]) === null || _retailers$ === void 0 ? void 0 : _retailers$.percentage);
1077
+ retailers && setActivePercentage((_retailers$ = retailers[0]) === null || _retailers$ === void 0 ? void 0 : _retailers$.percentage);
1091
1078
  }, [percentages]);
1092
1079
 
1093
1080
  var loadInputs = function loadInputs() {
@@ -1469,45 +1456,33 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
1469
1456
  };
1470
1457
 
1471
1458
  var createComment = /*#__PURE__*/function () {
1472
- var _ref13 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee15(e, body, tab) {
1473
- var concept, data;
1459
+ var _ref13 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee15() {
1460
+ var messages,
1461
+ retailerId,
1462
+ data,
1463
+ _args15 = arguments;
1474
1464
  return _regenerator.default.wrap(function _callee15$(_context15) {
1475
1465
  while (1) {
1476
1466
  switch (_context15.prev = _context15.next) {
1477
1467
  case 0:
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:
1468
+ messages = _args15.length > 0 && _args15[0] !== undefined ? _args15[0] : [];
1469
+ retailerId = _args15.length > 1 ? _args15[1] : undefined;
1496
1470
  data = {
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: {
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: {
1506
1479
  Authorization: token
1507
1480
  }
1508
- });
1481
+ };
1482
+ setMessage("");
1483
+ return _context15.abrupt("return", (0, _utils.sendMessage)(data));
1509
1484
 
1510
- case 13:
1485
+ case 5:
1511
1486
  case "end":
1512
1487
  return _context15.stop();
1513
1488
  }
@@ -1515,7 +1490,7 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
1515
1490
  }, _callee15);
1516
1491
  }));
1517
1492
 
1518
- return function createComment(_x4, _x5, _x6) {
1493
+ return function createComment() {
1519
1494
  return _ref13.apply(this, arguments);
1520
1495
  };
1521
1496
  }();
@@ -1614,7 +1589,7 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
1614
1589
  }, _callee17);
1615
1590
  }));
1616
1591
 
1617
- return function setAssignation(_x7, _x8) {
1592
+ return function setAssignation(_x4, _x5) {
1618
1593
  return _ref15.apply(this, arguments);
1619
1594
  };
1620
1595
  }();
@@ -1702,7 +1677,7 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
1702
1677
  var _ref16 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee18(result) {
1703
1678
  var _productTemp$id_order2;
1704
1679
 
1705
- var concept, productTemp, articleId, orderId, sectionStatusKey, evalStatus, data, retailerId, res, newStatuses, orderStatus, serviceStatus, newProductEdit, showSurveyByProvider, showSurveyByRetailer, _JSON$parse, newArticleStatus, newServiceStatus, newStatus, retailerStatusCopy, status;
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;
1706
1681
 
1707
1682
  return _regenerator.default.wrap(function _callee18$(_context18) {
1708
1683
  while (1) {
@@ -1764,53 +1739,77 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
1764
1739
  res = _context18.sent;
1765
1740
 
1766
1741
  case 30:
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;
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
1778
1762
  }
1763
+ };
1764
+ _context18.next = 36;
1765
+ return (0, _utils.sendMessage)(messageData);
1779
1766
 
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
- });
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
+ productTemp["".concat(concept, "_status")] = status;
1785
1777
  }
1786
1778
 
1787
- _context18.next = 36;
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;
1788
1787
  break;
1789
1788
 
1790
- case 33:
1791
- _context18.prev = 33;
1789
+ case 47:
1790
+ _context18.prev = 47;
1792
1791
  _context18.t0 = _context18["catch"](9);
1793
1792
  console.log(_context18.t0);
1794
1793
 
1795
- case 36:
1794
+ case 50:
1796
1795
  loadData();
1797
1796
 
1798
- case 37:
1797
+ case 51:
1799
1798
  case "end":
1800
1799
  return _context18.stop();
1801
1800
  }
1802
1801
  }
1803
- }, _callee18, null, [[9, 33]]);
1802
+ }, _callee18, null, [[9, 47]]);
1804
1803
  }));
1805
1804
 
1806
- return function sendEvaluation(_x9) {
1805
+ return function sendEvaluation(_x6) {
1807
1806
  return _ref16.apply(this, arguments);
1808
1807
  };
1809
1808
  }();
1810
1809
 
1811
1810
  var validateAll = /*#__PURE__*/function () {
1812
1811
  var _ref17 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee19(result) {
1813
- var _product$id_order2, evaluationArray, conceptArray, dataGeneral, userType, productTemp, status, retailerStatusCopy;
1812
+ var _product$id_order2, evaluationArray, conceptArray, dataGeneral, messages, userType, productTemp, status, retailerStatusCopy;
1814
1813
 
1815
1814
  return _regenerator.default.wrap(function _callee19$(_context19) {
1816
1815
  while (1) {
@@ -1826,6 +1825,7 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
1826
1825
  result: result,
1827
1826
  isAproved: result === "A"
1828
1827
  };
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,11 +1840,20 @@ 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
+ }
1843
1852
  });
1844
- _context19.next = 8;
1853
+ _context19.next = 9;
1845
1854
  return Promise.all(evaluationArray);
1846
1855
 
1847
- case 8:
1856
+ case 9:
1848
1857
  userType = user.is_retailer === 1 ? "CA" : "P";
1849
1858
  productTemp = product;
1850
1859
  status = "".concat(result).concat(userType);
@@ -1874,27 +1883,31 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
1874
1883
  idCategory: productTemp.article.id_category,
1875
1884
  product: productTemp
1876
1885
  }));
1877
- _context19.next = 25;
1886
+ _context19.next = 26;
1887
+ return Promise.all(messages);
1888
+
1889
+ case 26:
1890
+ _context19.next = 28;
1878
1891
  return loadData();
1879
1892
 
1880
- case 25:
1881
- _context19.next = 30;
1893
+ case 28:
1894
+ _context19.next = 33;
1882
1895
  break;
1883
1896
 
1884
- case 27:
1885
- _context19.prev = 27;
1897
+ case 30:
1898
+ _context19.prev = 30;
1886
1899
  _context19.t0 = _context19["catch"](0);
1887
1900
  console.log(_context19.t0);
1888
1901
 
1889
- case 30:
1902
+ case 33:
1890
1903
  case "end":
1891
1904
  return _context19.stop();
1892
1905
  }
1893
1906
  }
1894
- }, _callee19, null, [[0, 27]]);
1907
+ }, _callee19, null, [[0, 30]]);
1895
1908
  }));
1896
1909
 
1897
- return function validateAll(_x10) {
1910
+ return function validateAll(_x7) {
1898
1911
  return _ref17.apply(this, arguments);
1899
1912
  };
1900
1913
  }();
@@ -1941,7 +1954,7 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
1941
1954
  }, _callee20);
1942
1955
  }));
1943
1956
 
1944
- return function evaluationToRetailer(_x11) {
1957
+ return function evaluationToRetailer(_x8) {
1945
1958
  return _ref18.apply(this, arguments);
1946
1959
  };
1947
1960
  }();
@@ -2029,8 +2042,7 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
2029
2042
  return;
2030
2043
  } else if (user.is_retailer) {
2031
2044
  if (product.id_order || product.orderId) {
2032
- setValidatedAll(true);
2033
- showGlobalModal("error");
2045
+ sendEvaluation("R");
2034
2046
  } else {
2035
2047
  setDataGenericModal(function (prev) {
2036
2048
  return (0, _objectSpread3.default)((0, _objectSpread3.default)({}, prev), {}, {
@@ -2045,8 +2057,7 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
2045
2057
  showGlobalModal("generic");
2046
2058
  }
2047
2059
  } else {
2048
- setValidatedAll(true);
2049
- showGlobalModal("error");
2060
+ sendEvaluation("R");
2050
2061
  }
2051
2062
  }
2052
2063
  };
@@ -2056,6 +2067,7 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
2056
2067
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_HeaderTop.HeaderTop, {
2057
2068
  setHeaderTop: setHeaderTop,
2058
2069
  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,
2059
2071
  productSelected: productSelected,
2060
2072
  token: token,
2061
2073
  activeRetailer: activeRetailer
@@ -2134,7 +2146,7 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
2134
2146
  } else if (user.is_retailer) {
2135
2147
  if (product.id_order || product.orderId) {
2136
2148
  setValidatedAll(true);
2137
- showGlobalModal("error");
2149
+ setShowRejectModal(true);
2138
2150
  } else {
2139
2151
  setDataGenericModal(function (prev) {
2140
2152
  return (0, _objectSpread3.default)((0, _objectSpread3.default)({}, prev), {}, {
@@ -2149,15 +2161,15 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
2149
2161
  showGlobalModal("generic");
2150
2162
  }
2151
2163
  } else {
2164
+ setShowRejectModal(true);
2152
2165
  setValidatedAll(true);
2153
- showGlobalModal("error");
2154
2166
  }
2155
2167
  },
2156
2168
  approve: function approve() {
2157
2169
  return sendToEvaluation("A");
2158
2170
  },
2159
2171
  reject: function reject() {
2160
- return sendToEvaluation("R");
2172
+ setShowRejectModal(true);
2161
2173
  }
2162
2174
  }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_FullTabsMenu.FullTabsMenu, {
2163
2175
  tabsSections: tabsSections,
@@ -2245,52 +2257,7 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
2245
2257
  headerType: "input-name-header"
2246
2258
  }))]
2247
2259
  })
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", {
2260
+ }), !(isRevision() && getSectionStatus()) && !revision && /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
2294
2261
  className: "required-inputs-message",
2295
2262
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
2296
2263
  children: /*#__PURE__*/(0, _jsxRuntime.jsx)("p", {
@@ -2350,6 +2317,52 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
2350
2317
  currentVersion: version,
2351
2318
  setShowVersionSelector: setShowVersionSelector,
2352
2319
  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")]
2353
2366
  })]
2354
2367
  });
2355
2368
  };
@@ -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 .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 #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) {
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: "eyJraWQiOiJkQWJkZCtlclwvTlwveVRQUWNvUlVyOCtrNUd2M1hMM2N1MWUzQ09zWExVRnc9IiwiYWxnIjoiUlMy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8viE7R-qVo-42RlPTG0TFrWA9q0oTcqjv8vbxLpOBUjiEpjmqRhg4blJZwgkGNta6MOlw1vfmisOVbo9wMvqwnCZ9xx9KMKoH9U4uNObK_JomjbvPmTmkcUXsE-wGSD7XcoSwtuhBngLC7-jiu1u8MvL_ff5Z0Qp70sSpLdUglcSS8d1Xf7j_fcZuJ5jKA",
35
35
  productSelected: {
36
36
  services: {
37
37
  datasheets: 1,
@@ -87,8 +87,12 @@ RetailerProductEditionDefault.args = {
87
87
  },
88
88
  location: {
89
89
  product: {
90
- articleId: 39290,
91
- versionId: 7
90
+ articleId: 354,
91
+ versionId: 3
92
+ },
93
+ state: {
94
+ withChat: true,
95
+ chatType: "product_status"
92
96
  }
93
97
  },
94
98
  user: {