contentoh-components-library 21.3.85 → 21.3.87

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 (65) hide show
  1. package/.env.development +5 -0
  2. package/.env.production +3 -0
  3. package/dist/components/atoms/ButtonV2/styles.js +1 -1
  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 +4 -2
  7. package/dist/components/atoms/InputFormatter/styles.js +1 -1
  8. package/dist/components/atoms/TabSection/styles.js +1 -1
  9. package/dist/components/molecules/CarouselImagesLogin/index.js +1 -1
  10. package/dist/components/molecules/HeaderTop/index.js +68 -11
  11. package/dist/components/molecules/TagAndInput/index.js +2 -2
  12. package/dist/components/organisms/Chat/Chat.stories.js +27 -8
  13. package/dist/components/organisms/Chat/ContainerItems/index.js +19 -3
  14. package/dist/components/organisms/Chat/ContainerItems/styles.js +1 -1
  15. package/dist/components/organisms/Chat/ContentChat/index.js +350 -197
  16. package/dist/components/organisms/Chat/Footer/index.js +48 -39
  17. package/dist/components/organisms/Chat/index.js +49 -4
  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 +171 -96
  21. package/dist/components/pages/ProviderProductEdition/index.js +188 -175
  22. package/dist/components/pages/ProviderProductEdition/styles.js +1 -1
  23. package/dist/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +40 -28
  24. package/dist/components/pages/RetailerProductEdition/index.js +265 -273
  25. package/dist/components/pages/RetailerProductEdition/styles.js +1 -1
  26. package/dist/components/pages/RetailerProductEdition/utils.js +61 -2
  27. package/dist/index.js +51 -12
  28. package/package.json +3 -1
  29. package/src/components/atoms/ButtonV2/styles.js +1 -1
  30. package/src/components/atoms/Card/index.js +35 -2
  31. package/src/components/atoms/Card/styles.js +41 -5
  32. package/src/components/atoms/CheckBox/index.js +2 -0
  33. package/src/components/atoms/InputFormatter/styles.js +2 -1
  34. package/src/components/atoms/TabSection/styles.js +0 -1
  35. package/src/components/molecules/CarouselImagesLogin/index.js +1 -1
  36. package/src/components/molecules/HeaderTop/index.js +52 -6
  37. package/src/components/molecules/StripeCardForm/StripeCardForm.stories.js +13 -0
  38. package/src/components/molecules/StripeCardForm/index.js +42 -0
  39. package/src/components/molecules/StripeCardForm/paymentForm.js +124 -0
  40. package/src/components/molecules/StripeCardForm/styles.js +73 -0
  41. package/src/components/molecules/StripeCardSelector/CardSelector.stories.js +12 -0
  42. package/src/components/molecules/StripeCardSelector/index.js +44 -0
  43. package/src/components/molecules/StripeCardSelector/styles.js +4 -0
  44. package/src/components/molecules/StripeCardSelector/utils.js +17 -0
  45. package/src/components/molecules/TagAndInput/index.js +10 -8
  46. package/src/components/organisms/Chat/Chat.stories.js +27 -7
  47. package/src/components/organisms/Chat/ContainerItems/index.js +18 -2
  48. package/src/components/organisms/Chat/ContainerItems/styles.js +10 -2
  49. package/src/components/organisms/Chat/ContentChat/index.js +88 -12
  50. package/src/components/organisms/Chat/Footer/index.js +11 -0
  51. package/src/components/organisms/Chat/index.js +46 -4
  52. package/src/components/organisms/FullProductNameHeader/index.js +1 -1
  53. package/src/components/organisms/Modal/styles.js +4 -1
  54. package/src/components/organisms/SideModal/SideModal.stories.js +23 -0
  55. package/src/components/organisms/SideModal/index.js +50 -0
  56. package/src/components/organisms/SideModal/styles.js +30 -0
  57. package/src/components/pages/ProviderProductEdition/ProviderProductEdition.stories.js +181 -98
  58. package/src/components/pages/ProviderProductEdition/index.js +132 -129
  59. package/src/components/pages/ProviderProductEdition/styles.js +5 -1
  60. package/src/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +38 -26
  61. package/src/components/pages/RetailerProductEdition/index.js +109 -135
  62. package/src/components/pages/RetailerProductEdition/styles.js +4 -0
  63. package/src/components/pages/RetailerProductEdition/utils.js +37 -0
  64. package/src/index.js +3 -0
  65. 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() {
@@ -1466,45 +1453,33 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
1466
1453
  };
1467
1454
 
1468
1455
  var createComment = /*#__PURE__*/function () {
1469
- var _ref13 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee15(e, body, tab) {
1470
- var concept, data;
1456
+ var _ref13 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee15() {
1457
+ var messages,
1458
+ retailerId,
1459
+ data,
1460
+ _args15 = arguments;
1471
1461
  return _regenerator.default.wrap(function _callee15$(_context15) {
1472
1462
  while (1) {
1473
1463
  switch (_context15.prev = _context15.next) {
1474
1464
  case 0:
1475
- concept = "";
1476
- _context15.t0 = activeTab;
1477
- _context15.next = _context15.t0 === "Ficha técnica" ? 4 : _context15.t0 === "Imágenes" ? 6 : 8;
1478
- break;
1479
-
1480
- case 4:
1481
- concept = "datasheet";
1482
- return _context15.abrupt("break", 10);
1483
-
1484
- case 6:
1485
- concept = "images";
1486
- return _context15.abrupt("break", 10);
1487
-
1488
- case 8:
1489
- concept = "description";
1490
- return _context15.abrupt("break", 10);
1491
-
1492
- case 10:
1465
+ messages = _args15.length > 0 && _args15[0] !== undefined ? _args15[0] : [];
1466
+ retailerId = _args15.length > 1 ? _args15[1] : undefined;
1493
1467
  data = {
1494
- articleId: product === null || product === void 0 ? void 0 : product.id_article,
1495
- orderId: product === null || product === void 0 ? void 0 : product.orderId,
1496
- message: body,
1497
- concept: concept,
1498
- version: version
1499
- };
1500
- _context15.next = 13;
1501
- return _axios.default.post("".concat(process.env.REACT_APP_COMMENTS_ENDPOINT), data, {
1502
- headers: {
1468
+ paramsBody: {
1469
+ id: product.article.id_article || productEdit.ArticleId,
1470
+ version: version,
1471
+ items: messages,
1472
+ retailerId: retailerId,
1473
+ status: product.status || productEdit.product.status
1474
+ },
1475
+ paramsHeader: {
1503
1476
  Authorization: token
1504
1477
  }
1505
- });
1478
+ };
1479
+ setMessage("");
1480
+ return _context15.abrupt("return", (0, _utils.sendMessage)(data));
1506
1481
 
1507
- case 13:
1482
+ case 5:
1508
1483
  case "end":
1509
1484
  return _context15.stop();
1510
1485
  }
@@ -1512,7 +1487,7 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
1512
1487
  }, _callee15);
1513
1488
  }));
1514
1489
 
1515
- return function createComment(_x4, _x5, _x6) {
1490
+ return function createComment() {
1516
1491
  return _ref13.apply(this, arguments);
1517
1492
  };
1518
1493
  }();
@@ -1611,7 +1586,7 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
1611
1586
  }, _callee17);
1612
1587
  }));
1613
1588
 
1614
- return function setAssignation(_x7, _x8) {
1589
+ return function setAssignation(_x4, _x5) {
1615
1590
  return _ref15.apply(this, arguments);
1616
1591
  };
1617
1592
  }();
@@ -1699,7 +1674,7 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
1699
1674
  var _ref16 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee18(result) {
1700
1675
  var _productTemp$id_order2;
1701
1676
 
1702
- var concept, productTemp, articleId, orderId, sectionStatusKey, evalStatus, data, retailerId, res, newStatuses, orderStatus, serviceStatus, newProductEdit, showSurveyByProvider, showSurveyByRetailer, _JSON$parse, newArticleStatus, newServiceStatus, newStatus, retailerStatusCopy, status;
1677
+ 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;
1703
1678
 
1704
1679
  return _regenerator.default.wrap(function _callee18$(_context18) {
1705
1680
  while (1) {
@@ -1761,53 +1736,77 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
1761
1736
  res = _context18.sent;
1762
1737
 
1763
1738
  case 30:
1764
- if (res.data.statusCode === 200) {
1765
- _JSON$parse = JSON.parse(res.data.body), newArticleStatus = _JSON$parse.newArticleStatus, newServiceStatus = _JSON$parse.newServiceStatus, newStatus = _JSON$parse.newStatus;
1766
- if (newArticleStatus) productTemp.status = newArticleStatus[articleId];
1767
- retailerStatusCopy = (0, _objectSpread3.default)({}, retailerStatus);
1768
- retailerStatusCopy[activeRetailer.id][concept] = newStatus;
1769
- setRetailerStatus(retailerStatusCopy);
1770
- productTemp.statusByRetailer = retailerStatusCopy;
1771
-
1772
- if (newServiceStatus) {
1773
- status = newServiceStatus[articleId]["".concat(concept, "Status")];
1774
- productTemp["".concat(concept, "_status")] = status;
1739
+ if (!(res.data.statusCode === 200)) {
1740
+ _context18.next = 45;
1741
+ break;
1742
+ }
1743
+
1744
+ _JSON$parse = JSON.parse(res.data.body), newArticleStatus = _JSON$parse.newArticleStatus, newServiceStatus = _JSON$parse.newServiceStatus, newStatus = _JSON$parse.newStatus;
1745
+ _message = (0, _utils.createMessage)(product.retailers || product.retailersAvailable, activeRetailer.id, product[sectionStatusKey], newStatus, activeTab);
1746
+ messageData = {
1747
+ paramsBody: {
1748
+ id: product.article.id_article || productEdit.ArticleId,
1749
+ version: version,
1750
+ items: [{
1751
+ type: "status",
1752
+ value: _message
1753
+ }],
1754
+ retailerId: activeRetailer.id,
1755
+ status: product.status || productEdit.product.status
1756
+ },
1757
+ paramsHeader: {
1758
+ Authorization: token
1775
1759
  }
1760
+ };
1761
+ _context18.next = 36;
1762
+ return (0, _utils.sendMessage)(messageData);
1776
1763
 
1777
- setProduct(productTemp);
1778
- sessionStorage.setItem("productSelected", JSON.stringify(productTemp));
1779
- setOrigin(function (prev) {
1780
- return (0, _objectSpread3.default)((0, _objectSpread3.default)({}, prev), {}, (0, _defineProperty2.default)({}, concept, status));
1781
- });
1764
+ case 36:
1765
+ if (newArticleStatus) productTemp.status = newArticleStatus[articleId];
1766
+ retailerStatusCopy = (0, _objectSpread3.default)({}, retailerStatus);
1767
+ retailerStatusCopy[activeRetailer.id][concept] = newStatus;
1768
+ setRetailerStatus(retailerStatusCopy);
1769
+ productTemp.statusByRetailer = retailerStatusCopy;
1770
+
1771
+ if (newServiceStatus) {
1772
+ status = newServiceStatus[articleId]["".concat(concept, "Status")];
1773
+ productTemp["".concat(concept, "_status")] = status;
1782
1774
  }
1783
1775
 
1784
- _context18.next = 36;
1776
+ setProduct(productTemp);
1777
+ sessionStorage.setItem("productSelected", JSON.stringify(productTemp));
1778
+ setOrigin(function (prev) {
1779
+ return (0, _objectSpread3.default)((0, _objectSpread3.default)({}, prev), {}, (0, _defineProperty2.default)({}, concept, status));
1780
+ });
1781
+
1782
+ case 45:
1783
+ _context18.next = 50;
1785
1784
  break;
1786
1785
 
1787
- case 33:
1788
- _context18.prev = 33;
1786
+ case 47:
1787
+ _context18.prev = 47;
1789
1788
  _context18.t0 = _context18["catch"](9);
1790
1789
  console.log(_context18.t0);
1791
1790
 
1792
- case 36:
1791
+ case 50:
1793
1792
  loadData();
1794
1793
 
1795
- case 37:
1794
+ case 51:
1796
1795
  case "end":
1797
1796
  return _context18.stop();
1798
1797
  }
1799
1798
  }
1800
- }, _callee18, null, [[9, 33]]);
1799
+ }, _callee18, null, [[9, 47]]);
1801
1800
  }));
1802
1801
 
1803
- return function sendEvaluation(_x9) {
1802
+ return function sendEvaluation(_x6) {
1804
1803
  return _ref16.apply(this, arguments);
1805
1804
  };
1806
1805
  }();
1807
1806
 
1808
1807
  var validateAll = /*#__PURE__*/function () {
1809
1808
  var _ref17 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee19(result) {
1810
- var _product$id_order2, evaluationArray, conceptArray, dataGeneral, userType, productTemp, status, retailerStatusCopy;
1809
+ var _product$id_order2, evaluationArray, conceptArray, dataGeneral, messages, userType, productTemp, status, retailerStatusCopy;
1811
1810
 
1812
1811
  return _regenerator.default.wrap(function _callee19$(_context19) {
1813
1812
  while (1) {
@@ -1823,6 +1822,7 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
1823
1822
  result: result,
1824
1823
  isAproved: result === "A"
1825
1824
  };
1825
+ messages = [];
1826
1826
  servicesData === null || servicesData === void 0 ? void 0 : servicesData.forEach(function (ret) {
1827
1827
  var service = ret.service,
1828
1828
  id_retailer = ret.id_retailer;
@@ -1837,11 +1837,20 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
1837
1837
  Authorization: token
1838
1838
  }
1839
1839
  }));
1840
+
1841
+ if (product["".concat(ret.service, "_status")] !== "NS") {
1842
+ var _message2 = (0, _utils.createMessage)(product.retailers, ret.id_retailer, product["".concat(ret.service, "_status")], "".concat(result, "A"), ret.service);
1843
+
1844
+ messages.push(createComment([{
1845
+ type: "status",
1846
+ value: _message2
1847
+ }], ret.id_retailer));
1848
+ }
1840
1849
  });
1841
- _context19.next = 8;
1850
+ _context19.next = 9;
1842
1851
  return Promise.all(evaluationArray);
1843
1852
 
1844
- case 8:
1853
+ case 9:
1845
1854
  userType = user.is_retailer === 1 ? "CA" : "P";
1846
1855
  productTemp = product;
1847
1856
  status = "".concat(result).concat(userType);
@@ -1871,27 +1880,31 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
1871
1880
  idCategory: productTemp.article.id_category,
1872
1881
  product: productTemp
1873
1882
  }));
1874
- _context19.next = 25;
1883
+ _context19.next = 26;
1884
+ return Promise.all(messages);
1885
+
1886
+ case 26:
1887
+ _context19.next = 28;
1875
1888
  return loadData();
1876
1889
 
1877
- case 25:
1878
- _context19.next = 30;
1890
+ case 28:
1891
+ _context19.next = 33;
1879
1892
  break;
1880
1893
 
1881
- case 27:
1882
- _context19.prev = 27;
1894
+ case 30:
1895
+ _context19.prev = 30;
1883
1896
  _context19.t0 = _context19["catch"](0);
1884
1897
  console.log(_context19.t0);
1885
1898
 
1886
- case 30:
1899
+ case 33:
1887
1900
  case "end":
1888
1901
  return _context19.stop();
1889
1902
  }
1890
1903
  }
1891
- }, _callee19, null, [[0, 27]]);
1904
+ }, _callee19, null, [[0, 30]]);
1892
1905
  }));
1893
1906
 
1894
- return function validateAll(_x10) {
1907
+ return function validateAll(_x7) {
1895
1908
  return _ref17.apply(this, arguments);
1896
1909
  };
1897
1910
  }();
@@ -1938,7 +1951,7 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
1938
1951
  }, _callee20);
1939
1952
  }));
1940
1953
 
1941
- return function evaluationToRetailer(_x11) {
1954
+ return function evaluationToRetailer(_x8) {
1942
1955
  return _ref18.apply(this, arguments);
1943
1956
  };
1944
1957
  }();
@@ -2026,8 +2039,7 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
2026
2039
  return;
2027
2040
  } else if (user.is_retailer) {
2028
2041
  if (product.id_order || product.orderId) {
2029
- setValidatedAll(true);
2030
- showGlobalModal("error");
2042
+ sendEvaluation("R");
2031
2043
  } else {
2032
2044
  setDataGenericModal(function (prev) {
2033
2045
  return (0, _objectSpread3.default)((0, _objectSpread3.default)({}, prev), {}, {
@@ -2042,8 +2054,7 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
2042
2054
  showGlobalModal("generic");
2043
2055
  }
2044
2056
  } else {
2045
- setValidatedAll(true);
2046
- showGlobalModal("error");
2057
+ sendEvaluation("R");
2047
2058
  }
2048
2059
  }
2049
2060
  };
@@ -2053,6 +2064,7 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
2053
2064
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_HeaderTop.HeaderTop, {
2054
2065
  setHeaderTop: setHeaderTop,
2055
2066
  withChat: location === null || location === void 0 ? void 0 : (_location$state5 = location.state) === null || _location$state5 === void 0 ? void 0 : _location$state5.withChat,
2067
+ chatType: location === null || location === void 0 ? void 0 : (_location$state6 = location.state) === null || _location$state6 === void 0 ? void 0 : _location$state6.chatType,
2056
2068
  productSelected: productSelected,
2057
2069
  token: token,
2058
2070
  activeRetailer: activeRetailer
@@ -2131,7 +2143,7 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
2131
2143
  } else if (user.is_retailer) {
2132
2144
  if (product.id_order || product.orderId) {
2133
2145
  setValidatedAll(true);
2134
- showGlobalModal("error");
2146
+ setShowRejectModal(true);
2135
2147
  } else {
2136
2148
  setDataGenericModal(function (prev) {
2137
2149
  return (0, _objectSpread3.default)((0, _objectSpread3.default)({}, prev), {}, {
@@ -2146,15 +2158,15 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
2146
2158
  showGlobalModal("generic");
2147
2159
  }
2148
2160
  } else {
2161
+ setShowRejectModal(true);
2149
2162
  setValidatedAll(true);
2150
- showGlobalModal("error");
2151
2163
  }
2152
2164
  },
2153
2165
  approve: function approve() {
2154
2166
  return sendToEvaluation("A");
2155
2167
  },
2156
2168
  reject: function reject() {
2157
- return sendToEvaluation("R");
2169
+ setShowRejectModal(true);
2158
2170
  }
2159
2171
  }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_FullTabsMenu.FullTabsMenu, {
2160
2172
  tabsSections: tabsSections,
@@ -2241,52 +2253,7 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
2241
2253
  headerType: "input-name-header"
2242
2254
  }))]
2243
2255
  })
2244
- }), isRevision() && getSectionStatus() ? /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
2245
- className: "commentary-box",
2246
- children: !comment ? /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
2247
- className: "commentary",
2248
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_index.TagAndInput, {
2249
- label: "Caja de Comentario",
2250
- inputType: "textarea",
2251
- inputCols: 80,
2252
- inputRows: 4,
2253
- inputId: "commentary-box",
2254
- index: 0
2255
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
2256
- className: "buttons-box",
2257
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_GeneralButton.Button, {
2258
- buttonType: "general-transparent-button",
2259
- label: "Enviar comentario",
2260
- onClick: function onClick(e) {
2261
- return createComment(e, document.querySelector("#description-commentary-box-0 .ql-container .ql-editor > p").innerHTML, activeTab);
2262
- }
2263
- })
2264
- })]
2265
- }) : /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
2266
- className: "feedback-box",
2267
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_Commentary.Commentary, {
2268
- comment: comment.message,
2269
- reviewed: crossComment
2270
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_GeneralButton.Button, {
2271
- buttonType: "circular-button accept-button",
2272
- onClick: /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee21() {
2273
- return _regenerator.default.wrap(function _callee21$(_context21) {
2274
- while (1) {
2275
- switch (_context21.prev = _context21.next) {
2276
- case 0:
2277
- setCrossComment(true);
2278
- commentRevised();
2279
-
2280
- case 2:
2281
- case "end":
2282
- return _context21.stop();
2283
- }
2284
- }
2285
- }, _callee21);
2286
- }))
2287
- })]
2288
- })
2289
- }) : !revision && /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
2256
+ }), !(isRevision() && getSectionStatus()) && !revision && /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
2290
2257
  className: "required-inputs-message",
2291
2258
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
2292
2259
  children: /*#__PURE__*/(0, _jsxRuntime.jsx)("p", {
@@ -2346,6 +2313,52 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
2346
2313
  currentVersion: version,
2347
2314
  setShowVersionSelector: setShowVersionSelector,
2348
2315
  jwt: token
2316
+ }), showRejectModal && /*#__PURE__*/(0, _jsxRuntime.jsx)(_Modal.Modal, {
2317
+ title: "Agregar mensaje de rechazo",
2318
+ show: showRejectModal,
2319
+ customComponent: /*#__PURE__*/(0, _jsxRuntime.jsx)(_index.TagAndInput, {
2320
+ inputType: "textarea",
2321
+ inputId: "modal-message-box",
2322
+ index: 0,
2323
+ color: "white"
2324
+ }),
2325
+ buttons: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_ButtonV.ButtonV2, {
2326
+ type: "white",
2327
+ label: "Cancelar",
2328
+ size: 12,
2329
+ onClick: function onClick() {
2330
+ setShowRejectModal(false);
2331
+ }
2332
+ }, "btn-Cancelar"), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ButtonV.ButtonV2, {
2333
+ type: "pink",
2334
+ label: "Aceptar",
2335
+ size: 12,
2336
+ onClick: /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee21() {
2337
+ var body, messages;
2338
+ return _regenerator.default.wrap(function _callee21$(_context21) {
2339
+ while (1) {
2340
+ switch (_context21.prev = _context21.next) {
2341
+ case 0:
2342
+ body = document.querySelector("#modal-message-box .ql-container .ql-editor > p").innerHTML;
2343
+ messages = [{
2344
+ type: "message",
2345
+ value: body === null || body === void 0 ? void 0 : body.replace(/<.*?\/?>/gm, "")
2346
+ }];
2347
+ _context21.next = 4;
2348
+ return createComment(messages, activeRetailer.id);
2349
+
2350
+ case 4:
2351
+ validatedAll ? validateAll("R") : sendToEvaluation("R");
2352
+ setShowRejectModal(false);
2353
+
2354
+ case 6:
2355
+ case "end":
2356
+ return _context21.stop();
2357
+ }
2358
+ }
2359
+ }, _callee21);
2360
+ }))
2361
+ }, "btn-Aceptar")]
2349
2362
  })]
2350
2363
  });
2351
2364
  };
@@ -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);