contentoh-components-library 21.3.61 → 21.3.63

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 (42) hide show
  1. package/.env.development +2 -0
  2. package/dist/components/molecules/CarouselImagesLogin/index.js +1 -1
  3. package/dist/components/molecules/HeaderTop/index.js +68 -11
  4. package/dist/components/organisms/Chat/Chat.stories.js +21 -1
  5. package/dist/components/organisms/Chat/ContainerItems/index.js +19 -3
  6. package/dist/components/organisms/Chat/ContainerItems/styles.js +1 -1
  7. package/dist/components/organisms/Chat/ContentChat/index.js +343 -191
  8. package/dist/components/organisms/Chat/Footer/index.js +48 -39
  9. package/dist/components/organisms/Chat/index.js +48 -3
  10. package/dist/components/organisms/FullProductNameHeader/index.js +2 -2
  11. package/dist/components/organisms/SideModal/SideModal.stories.js +42 -0
  12. package/dist/components/organisms/SideModal/index.js +61 -0
  13. package/dist/components/organisms/SideModal/styles.js +18 -0
  14. package/dist/components/pages/ProviderProductEdition/ProviderProductEdition.stories.js +172 -127
  15. package/dist/components/pages/ProviderProductEdition/index.js +200 -134
  16. package/dist/components/pages/ProviderProductEdition/styles.js +1 -1
  17. package/dist/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +40 -28
  18. package/dist/components/pages/RetailerProductEdition/index.js +266 -273
  19. package/dist/components/pages/RetailerProductEdition/styles.js +1 -1
  20. package/dist/components/pages/RetailerProductEdition/utils.js +61 -2
  21. package/dist/index.js +13 -0
  22. package/package.json +1 -1
  23. package/src/components/molecules/CarouselImagesLogin/index.js +1 -1
  24. package/src/components/molecules/HeaderTop/index.js +52 -6
  25. package/src/components/organisms/Chat/Chat.stories.js +21 -0
  26. package/src/components/organisms/Chat/ContainerItems/index.js +18 -2
  27. package/src/components/organisms/Chat/ContainerItems/styles.js +10 -2
  28. package/src/components/organisms/Chat/ContentChat/index.js +81 -6
  29. package/src/components/organisms/Chat/Footer/index.js +11 -0
  30. package/src/components/organisms/Chat/index.js +47 -3
  31. package/src/components/organisms/FullProductNameHeader/index.js +1 -1
  32. package/src/components/organisms/SideModal/SideModal.stories.js +23 -0
  33. package/src/components/organisms/SideModal/index.js +41 -0
  34. package/src/components/organisms/SideModal/styles.js +21 -0
  35. package/src/components/pages/ProviderProductEdition/ProviderProductEdition.stories.js +177 -130
  36. package/src/components/pages/ProviderProductEdition/index.js +116 -59
  37. package/src/components/pages/ProviderProductEdition/styles.js +5 -1
  38. package/src/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +38 -26
  39. package/src/components/pages/RetailerProductEdition/index.js +110 -135
  40. package/src/components/pages/RetailerProductEdition/styles.js +4 -0
  41. package/src/components/pages/RetailerProductEdition/utils.js +37 -0
  42. package/src/index.js +1 -0
@@ -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$state, _location$state2, _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,23 +452,26 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
446
452
  validatedAll = _useState60[0],
447
453
  setValidatedAll = _useState60[1];
448
454
 
449
- var originProp = location === null || location === void 0 ? void 0 : (_location$state = location.state) === null || _location$state === void 0 ? void 0 : _location$state.origin;
450
-
451
- var _useState61 = (0, _react.useState)({
452
- "Ficha técnica": originProp,
453
- Descripción: originProp,
454
- Imágenes: originProp
455
- }),
455
+ var _useState61 = (0, _react.useState)(false),
456
456
  _useState62 = (0, _slicedToArray2.default)(_useState61, 2),
457
- origin = _useState62[0],
458
- setOrigin = _useState62[1];
457
+ showRejectModal = _useState62[0],
458
+ setShowRejectModal = _useState62[1];
459
459
 
460
- var _useState63 = (0, _react.useState)(false),
460
+ var _useState63 = (0, _react.useState)({
461
+ "Ficha técnica": null,
462
+ Descripción: null,
463
+ Imágenes: null
464
+ }),
461
465
  _useState64 = (0, _slicedToArray2.default)(_useState63, 2),
462
- inCart = _useState64[0],
463
- setInCart = _useState64[1];
466
+ origin = _useState64[0],
467
+ setOrigin = _useState64[1];
464
468
 
465
- var _useState65 = (0, _react.useState)({
469
+ var _useState65 = (0, _react.useState)(false),
470
+ _useState66 = (0, _slicedToArray2.default)(_useState65, 2),
471
+ inCart = _useState66[0],
472
+ setInCart = _useState66[1];
473
+
474
+ var _useState67 = (0, _react.useState)({
466
475
  message: "¿Estás seguro de continuar?",
467
476
  detail: " ".concat(user.is_retailer ? "Asegurate de haber revisado las tres secciones" : "Envíar el producto a la cadena"),
468
477
  button1: {
@@ -477,34 +486,34 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
477
486
  },
478
487
  img: _defaultProfileImage.default
479
488
  }),
480
- _useState66 = (0, _slicedToArray2.default)(_useState65, 2),
481
- dataGenericModal = _useState66[0],
482
- setDataGenericModal = _useState66[1];
483
-
484
- var _useState67 = (0, _react.useState)(null),
485
489
  _useState68 = (0, _slicedToArray2.default)(_useState67, 2),
486
- socketType = _useState68[0],
487
- setSocketType = _useState68[1];
490
+ dataGenericModal = _useState68[0],
491
+ setDataGenericModal = _useState68[1];
488
492
 
489
- var _useState69 = (0, _react.useState)(loading),
493
+ var _useState69 = (0, _react.useState)(null),
490
494
  _useState70 = (0, _slicedToArray2.default)(_useState69, 2),
491
- saving = _useState70[0],
492
- setSaving = _useState70[1];
495
+ socketType = _useState70[0],
496
+ setSocketType = _useState70[1];
493
497
 
494
- var _useState71 = (0, _react.useState)(product.statusByRetailer),
498
+ var _useState71 = (0, _react.useState)(loading),
495
499
  _useState72 = (0, _slicedToArray2.default)(_useState71, 2),
496
- retailerStatus = _useState72[0],
497
- 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];
498
507
 
499
508
  var _useCloseModal = (0, _customHooks.useCloseModal)("version-selector"),
500
509
  _useCloseModal2 = (0, _slicedToArray2.default)(_useCloseModal, 2),
501
510
  showVersionSelector = _useCloseModal2[0],
502
511
  setShowVersionSelector = _useCloseModal2[1];
503
512
 
504
- var _useState73 = (0, _react.useState)(),
505
- _useState74 = (0, _slicedToArray2.default)(_useState73, 2),
506
- globalModal = _useState74[0],
507
- setGlobalModal = _useState74[1];
513
+ var _useState75 = (0, _react.useState)(),
514
+ _useState76 = (0, _slicedToArray2.default)(_useState75, 2),
515
+ globalModal = _useState76[0],
516
+ setGlobalModal = _useState76[1];
508
517
 
509
518
  var updateAuditStatus = /*#__PURE__*/function () {
510
519
  var _ref3 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2(status) {
@@ -676,30 +685,6 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
676
685
  });
677
686
 
678
687
  switch (type) {
679
- case "error":
680
- setGlobalModal({
681
- message: "".concat(activeTab, " rechazada"),
682
- detail: "Agrega tu comentarios para enviar el rechazo",
683
- img: _errorModal.default,
684
- textArea: true,
685
- button1: {
686
- name: "Enviar",
687
- action: function action(e) {
688
- var textArea = document.querySelector("#area");
689
-
690
- if (textArea.value) {
691
- textArea.style.border = "none";
692
- createComment(e, textArea.value);
693
- showGlobalModal("commentsSent");
694
- validatedAll ? validateAll("R") : sendEvaluation("R");
695
- } else {
696
- textArea.style.border = "2px solid red";
697
- }
698
- }
699
- }
700
- });
701
- break;
702
-
703
688
  case "generic":
704
689
  setGlobalModal(dataGenericModal);
705
690
  break;
@@ -881,6 +866,15 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
881
866
  setActiveTab("Imágenes");
882
867
  }
883
868
  }, [showModal]);
869
+ (0, _react.useEffect)(function () {
870
+ var _location$state, _location$state2, _location$state3;
871
+
872
+ setOrigin({
873
+ "Ficha técnica": location === null || location === void 0 ? void 0 : (_location$state = location.state) === null || _location$state === void 0 ? void 0 : _location$state.origin,
874
+ Descripción: location === null || location === void 0 ? void 0 : (_location$state2 = location.state) === null || _location$state2 === void 0 ? void 0 : _location$state2.origin,
875
+ Imágenes: location === null || location === void 0 ? void 0 : (_location$state3 = location.state) === null || _location$state3 === void 0 ? void 0 : _location$state3.origin
876
+ });
877
+ }, [location === null || location === void 0 ? void 0 : (_location$state4 = location.state) === null || _location$state4 === void 0 ? void 0 : _location$state4.origin]);
884
878
 
885
879
  var loadData = /*#__PURE__*/function () {
886
880
  var _ref6 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee8() {
@@ -962,7 +956,7 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
962
956
  setServicesData(parsedResponse);
963
957
 
964
958
  case 12:
965
- !activeRetailer.id && setActiveRetailer(active ? active : retailers[0]);
959
+ retailers && !activeRetailer.id && setActiveRetailer(active ? active : retailers[0]);
966
960
 
967
961
  case 13:
968
962
  case "end":
@@ -1080,7 +1074,7 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
1080
1074
  }
1081
1075
 
1082
1076
  setProduct(productTemp);
1083
- 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);
1084
1078
  }, [percentages]);
1085
1079
 
1086
1080
  var loadInputs = function loadInputs() {
@@ -1459,45 +1453,33 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
1459
1453
  };
1460
1454
 
1461
1455
  var createComment = /*#__PURE__*/function () {
1462
- var _ref13 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee15(e, body, tab) {
1463
- 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;
1464
1461
  return _regenerator.default.wrap(function _callee15$(_context15) {
1465
1462
  while (1) {
1466
1463
  switch (_context15.prev = _context15.next) {
1467
1464
  case 0:
1468
- concept = "";
1469
- _context15.t0 = activeTab;
1470
- _context15.next = _context15.t0 === "Ficha técnica" ? 4 : _context15.t0 === "Imágenes" ? 6 : 8;
1471
- break;
1472
-
1473
- case 4:
1474
- concept = "datasheet";
1475
- return _context15.abrupt("break", 10);
1476
-
1477
- case 6:
1478
- concept = "images";
1479
- return _context15.abrupt("break", 10);
1480
-
1481
- case 8:
1482
- concept = "description";
1483
- return _context15.abrupt("break", 10);
1484
-
1485
- case 10:
1465
+ messages = _args15.length > 0 && _args15[0] !== undefined ? _args15[0] : [];
1466
+ retailerId = _args15.length > 1 ? _args15[1] : undefined;
1486
1467
  data = {
1487
- articleId: product === null || product === void 0 ? void 0 : product.id_article,
1488
- orderId: product === null || product === void 0 ? void 0 : product.orderId,
1489
- message: body,
1490
- concept: concept,
1491
- version: version
1492
- };
1493
- _context15.next = 13;
1494
- return _axios.default.post("".concat(process.env.REACT_APP_COMMENTS_ENDPOINT), data, {
1495
- 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: {
1496
1476
  Authorization: token
1497
1477
  }
1498
- });
1478
+ };
1479
+ setMessage("");
1480
+ return _context15.abrupt("return", (0, _utils.sendMessage)(data));
1499
1481
 
1500
- case 13:
1482
+ case 5:
1501
1483
  case "end":
1502
1484
  return _context15.stop();
1503
1485
  }
@@ -1505,7 +1487,7 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
1505
1487
  }, _callee15);
1506
1488
  }));
1507
1489
 
1508
- return function createComment(_x4, _x5, _x6) {
1490
+ return function createComment() {
1509
1491
  return _ref13.apply(this, arguments);
1510
1492
  };
1511
1493
  }();
@@ -1604,7 +1586,7 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
1604
1586
  }, _callee17);
1605
1587
  }));
1606
1588
 
1607
- return function setAssignation(_x7, _x8) {
1589
+ return function setAssignation(_x4, _x5) {
1608
1590
  return _ref15.apply(this, arguments);
1609
1591
  };
1610
1592
  }();
@@ -1692,7 +1674,7 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
1692
1674
  var _ref16 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee18(result) {
1693
1675
  var _productTemp$id_order2;
1694
1676
 
1695
- 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;
1696
1678
 
1697
1679
  return _regenerator.default.wrap(function _callee18$(_context18) {
1698
1680
  while (1) {
@@ -1754,53 +1736,77 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
1754
1736
  res = _context18.sent;
1755
1737
 
1756
1738
  case 30:
1757
- if (res.data.statusCode === 200) {
1758
- _JSON$parse = JSON.parse(res.data.body), newArticleStatus = _JSON$parse.newArticleStatus, newServiceStatus = _JSON$parse.newServiceStatus, newStatus = _JSON$parse.newStatus;
1759
- if (newArticleStatus) productTemp.status = newArticleStatus[articleId];
1760
- retailerStatusCopy = (0, _objectSpread3.default)({}, retailerStatus);
1761
- retailerStatusCopy[activeRetailer.id][concept] = newStatus;
1762
- setRetailerStatus(retailerStatusCopy);
1763
- productTemp.statusByRetailer = retailerStatusCopy;
1764
-
1765
- if (newServiceStatus) {
1766
- status = newServiceStatus[articleId]["".concat(concept, "Status")];
1767
- 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
1768
1759
  }
1760
+ };
1761
+ _context18.next = 36;
1762
+ return (0, _utils.sendMessage)(messageData);
1769
1763
 
1770
- setProduct(productTemp);
1771
- sessionStorage.setItem("productSelected", JSON.stringify(productTemp));
1772
- setOrigin(function (prev) {
1773
- return (0, _objectSpread3.default)((0, _objectSpread3.default)({}, prev), {}, (0, _defineProperty2.default)({}, concept, status));
1774
- });
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;
1775
1774
  }
1776
1775
 
1777
- _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;
1778
1784
  break;
1779
1785
 
1780
- case 33:
1781
- _context18.prev = 33;
1786
+ case 47:
1787
+ _context18.prev = 47;
1782
1788
  _context18.t0 = _context18["catch"](9);
1783
1789
  console.log(_context18.t0);
1784
1790
 
1785
- case 36:
1791
+ case 50:
1786
1792
  loadData();
1787
1793
 
1788
- case 37:
1794
+ case 51:
1789
1795
  case "end":
1790
1796
  return _context18.stop();
1791
1797
  }
1792
1798
  }
1793
- }, _callee18, null, [[9, 33]]);
1799
+ }, _callee18, null, [[9, 47]]);
1794
1800
  }));
1795
1801
 
1796
- return function sendEvaluation(_x9) {
1802
+ return function sendEvaluation(_x6) {
1797
1803
  return _ref16.apply(this, arguments);
1798
1804
  };
1799
1805
  }();
1800
1806
 
1801
1807
  var validateAll = /*#__PURE__*/function () {
1802
1808
  var _ref17 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee19(result) {
1803
- var _product$id_order2, evaluationArray, conceptArray, dataGeneral, userType, productTemp, status, retailerStatusCopy;
1809
+ var _product$id_order2, evaluationArray, conceptArray, dataGeneral, messages, userType, productTemp, status, retailerStatusCopy;
1804
1810
 
1805
1811
  return _regenerator.default.wrap(function _callee19$(_context19) {
1806
1812
  while (1) {
@@ -1816,6 +1822,7 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
1816
1822
  result: result,
1817
1823
  isAproved: result === "A"
1818
1824
  };
1825
+ messages = [];
1819
1826
  servicesData === null || servicesData === void 0 ? void 0 : servicesData.forEach(function (ret) {
1820
1827
  var service = ret.service,
1821
1828
  id_retailer = ret.id_retailer;
@@ -1830,11 +1837,20 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
1830
1837
  Authorization: token
1831
1838
  }
1832
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
+ }
1833
1849
  });
1834
- _context19.next = 8;
1850
+ _context19.next = 9;
1835
1851
  return Promise.all(evaluationArray);
1836
1852
 
1837
- case 8:
1853
+ case 9:
1838
1854
  userType = user.is_retailer === 1 ? "CA" : "P";
1839
1855
  productTemp = product;
1840
1856
  status = "".concat(result).concat(userType);
@@ -1864,27 +1880,31 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
1864
1880
  idCategory: productTemp.article.id_category,
1865
1881
  product: productTemp
1866
1882
  }));
1867
- _context19.next = 25;
1883
+ _context19.next = 26;
1884
+ return Promise.all(messages);
1885
+
1886
+ case 26:
1887
+ _context19.next = 28;
1868
1888
  return loadData();
1869
1889
 
1870
- case 25:
1871
- _context19.next = 30;
1890
+ case 28:
1891
+ _context19.next = 33;
1872
1892
  break;
1873
1893
 
1874
- case 27:
1875
- _context19.prev = 27;
1894
+ case 30:
1895
+ _context19.prev = 30;
1876
1896
  _context19.t0 = _context19["catch"](0);
1877
1897
  console.log(_context19.t0);
1878
1898
 
1879
- case 30:
1899
+ case 33:
1880
1900
  case "end":
1881
1901
  return _context19.stop();
1882
1902
  }
1883
1903
  }
1884
- }, _callee19, null, [[0, 27]]);
1904
+ }, _callee19, null, [[0, 30]]);
1885
1905
  }));
1886
1906
 
1887
- return function validateAll(_x10) {
1907
+ return function validateAll(_x7) {
1888
1908
  return _ref17.apply(this, arguments);
1889
1909
  };
1890
1910
  }();
@@ -1931,7 +1951,7 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
1931
1951
  }, _callee20);
1932
1952
  }));
1933
1953
 
1934
- return function evaluationToRetailer(_x11) {
1954
+ return function evaluationToRetailer(_x8) {
1935
1955
  return _ref18.apply(this, arguments);
1936
1956
  };
1937
1957
  }();
@@ -2015,8 +2035,7 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
2015
2035
  return;
2016
2036
  } else if (user.is_retailer) {
2017
2037
  if (product.id_order || product.orderId) {
2018
- setValidatedAll(true);
2019
- showGlobalModal("error");
2038
+ sendEvaluation("R");
2020
2039
  } else {
2021
2040
  setDataGenericModal(function (prev) {
2022
2041
  return (0, _objectSpread3.default)((0, _objectSpread3.default)({}, prev), {}, {
@@ -2031,8 +2050,7 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
2031
2050
  showGlobalModal("generic");
2032
2051
  }
2033
2052
  } else {
2034
- setValidatedAll(true);
2035
- showGlobalModal("error");
2053
+ sendEvaluation("R");
2036
2054
  }
2037
2055
  }
2038
2056
  };
@@ -2041,7 +2059,8 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
2041
2059
  headerTop: headerTop,
2042
2060
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_HeaderTop.HeaderTop, {
2043
2061
  setHeaderTop: setHeaderTop,
2044
- withChat: location === null || location === void 0 ? void 0 : (_location$state2 = location.state) === null || _location$state2 === void 0 ? void 0 : _location$state2.withChat,
2062
+ withChat: location === null || location === void 0 ? void 0 : (_location$state5 = location.state) === null || _location$state5 === void 0 ? void 0 : _location$state5.withChat,
2063
+ chatType: location === null || location === void 0 ? void 0 : (_location$state6 = location.state) === null || _location$state6 === void 0 ? void 0 : _location$state6.chatType,
2045
2064
  productSelected: productSelected,
2046
2065
  token: token,
2047
2066
  activeRetailer: activeRetailer
@@ -2120,7 +2139,7 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
2120
2139
  } else if (user.is_retailer) {
2121
2140
  if (product.id_order || product.orderId) {
2122
2141
  setValidatedAll(true);
2123
- showGlobalModal("error");
2142
+ setShowRejectModal(true);
2124
2143
  } else {
2125
2144
  setDataGenericModal(function (prev) {
2126
2145
  return (0, _objectSpread3.default)((0, _objectSpread3.default)({}, prev), {}, {
@@ -2135,15 +2154,15 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
2135
2154
  showGlobalModal("generic");
2136
2155
  }
2137
2156
  } else {
2157
+ setShowRejectModal(true);
2138
2158
  setValidatedAll(true);
2139
- showGlobalModal("error");
2140
2159
  }
2141
2160
  },
2142
2161
  approve: function approve() {
2143
2162
  return sendToEvaluation("A");
2144
2163
  },
2145
2164
  reject: function reject() {
2146
- return sendToEvaluation("R");
2165
+ setShowRejectModal(true);
2147
2166
  }
2148
2167
  }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_FullTabsMenu.FullTabsMenu, {
2149
2168
  tabsSections: tabsSections,
@@ -2328,6 +2347,53 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
2328
2347
  currentVersion: version,
2329
2348
  setShowVersionSelector: setShowVersionSelector,
2330
2349
  jwt: token
2350
+ }), showRejectModal && /*#__PURE__*/(0, _jsxRuntime.jsx)(_Modal.Modal, {
2351
+ title: "Agregar mensaje de rechazo",
2352
+ show: showRejectModal,
2353
+ customComponent: /*#__PURE__*/(0, _jsxRuntime.jsx)(_index.TagAndInput, {
2354
+ label: "Caja de Comentario",
2355
+ inputType: "textarea",
2356
+ inputId: "modal-message-box",
2357
+ index: 0,
2358
+ color: "white"
2359
+ }),
2360
+ buttons: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_ButtonV.ButtonV2, {
2361
+ type: "white",
2362
+ label: "Cancelar",
2363
+ size: 12,
2364
+ onClick: function onClick() {
2365
+ setShowRejectModal(false);
2366
+ }
2367
+ }, "btn-Cancelar"), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ButtonV.ButtonV2, {
2368
+ type: "pink",
2369
+ label: "Aceptar",
2370
+ size: 12,
2371
+ onClick: /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee22() {
2372
+ var body, messages;
2373
+ return _regenerator.default.wrap(function _callee22$(_context22) {
2374
+ while (1) {
2375
+ switch (_context22.prev = _context22.next) {
2376
+ case 0:
2377
+ body = document.querySelector("#modal-message-box .ql-container .ql-editor > p").innerHTML;
2378
+ messages = [{
2379
+ type: "message",
2380
+ value: body === null || body === void 0 ? void 0 : body.replace(/<.*?\/?>/gm, "")
2381
+ }];
2382
+ _context22.next = 4;
2383
+ return createComment(messages, activeRetailer.id);
2384
+
2385
+ case 4:
2386
+ validatedAll ? validateAll("R") : sendToEvaluation("R");
2387
+ setShowRejectModal(false);
2388
+
2389
+ case 6:
2390
+ case "end":
2391
+ return _context22.stop();
2392
+ }
2393
+ }
2394
+ }, _callee22);
2395
+ }))
2396
+ }, "btn-Aceptar")]
2331
2397
  })]
2332
2398
  });
2333
2399
  };
@@ -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,26 +31,41 @@ RetailerProductEditionDefault.args = {
31
31
  "Ficha técnica": false,
32
32
  Imágenes: false
33
33
  },
34
- token: "eyJraWQiOiJkQWJkZCtlclwvTlwveVRQUWNvUlVyOCtrNUd2M1hMM2N1MWUzQ09zWExVRnc9IiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiJhNmM0ZDNkNi0yNGE0LTQxZDQtYWQwZi1kMDg3NDM4YWI1YjYiLCJjb2duaXRvOmdyb3VwcyI6WyJjb2xhYm9yYWRvcmVzX2NvbnRlbnRvaCJdLCJlbWFpbF92ZXJpZmllZCI6dHJ1ZSwiaXNzIjoiaHR0cHM6XC9cL2NvZ25pdG8taWRwLnVzLWVhc3QtMS5hbWF6b25hd3MuY29tXC91cy1lYXN0LTFfWE1aUWRxa0dqIiwiY29nbml0bzp1c2VybmFtZSI6ImE2YzRkM2Q2LTI0YTQtNDFkNC1hZDBmLWQwODc0MzhhYjViNiIsImNvZ25pdG86cm9sZXMiOlsiYXJuOmF3czppYW06Ojg5ODY3MDIzMjgwNzpyb2xlXC9jb250ZW50b2gtZGV2LXVzLWVhc3QtMS1sYW1iZGFSb2xlIl0sImF1ZCI6IjVhYzh0cGdzNmdic3ExM2ZydnJwaWVlcDQwIiwiZXZlbnRfaWQiOiIyYjU3MjZlMy04MjM2LTRmYzMtODBkMi05NWVmYmU4ODdjOTYiLCJ0b2tlbl91c2UiOiJpZCIsImF1dGhfdGltZSI6MTY4MjAxNjI5MSwibmFtZSI6IkNvbGFib3JhZG9yIiwicGhvbmVfbnVtYmVyIjoiKzUyMTExMSIsImV4cCI6MTY4MjAxOTg5MSwiaWF0IjoxNjgyMDE2MjkxLCJlbWFpbCI6ImV0Y0Bjb250ZW50b2guY29tIn0.SCj_yp1NkGCED59JHoDSdFAOakIOvZVeC0yLwt9z0BtenDXlU0m5cUofQQonnWPM8Q70yMFEkyMGI9kQs_fz1gxrmrSc2FGefn3B_1Vymq3pQ_S1JrY_syYf88m_GtJKOywEnE6--Ef9lZhFBFKGtqRJ4H8JBa9Xb96uCjAKyEMCSURDlw37pk2RQdULlZPj17Zb6Xrqi2lwrhpI1ByptX3__UoTiZklnTXwIxM4JdU7yuhXLznaEH8NOSd2Jw-CV6FCUbYBHlnRYBQg7B5mwyVKtDQm6QpRgBTBPCvljJJpFjRKUcnon8WZiFXx1qVbkWPt2vCT1TZqqoSLdlP6lA",
34
+ token: "eyJraWQiOiJkQWJkZCtlclwvTlwveVRQUWNvUlVyOCtrNUd2M1hMM2N1MWUzQ09zWExVRnc9IiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiI5YTIxMzEyOC02NDgyLTRjMTYtYTRiNi02ZTY0ZjIyNWIxYmQiLCJjb2duaXRvOmdyb3VwcyI6WyJjb2xhYm9yYWRvcmVzX2NvbnRlbnRvaCJdLCJlbWFpbF92ZXJpZmllZCI6dHJ1ZSwiaXNzIjoiaHR0cHM6XC9cL2NvZ25pdG8taWRwLnVzLWVhc3QtMS5hbWF6b25hd3MuY29tXC91cy1lYXN0LTFfWE1aUWRxa0dqIiwiY29nbml0bzp1c2VybmFtZSI6IjlhMjEzMTI4LTY0ODItNGMxNi1hNGI2LTZlNjRmMjI1YjFiZCIsImNvZ25pdG86cm9sZXMiOlsiYXJuOmF3czppYW06Ojg5ODY3MDIzMjgwNzpyb2xlXC9jb250ZW50b2gtZGV2LXVzLWVhc3QtMS1sYW1iZGFSb2xlIl0sImF1ZCI6IjVhYzh0cGdzNmdic3ExM2ZydnJwaWVlcDQwIiwiZXZlbnRfaWQiOiI5OGE0NzYxMy04ZGIyLTRlZjUtYjA0Mi01ZDU3MWRkZjIwMWIiLCJ0b2tlbl91c2UiOiJpZCIsImF1dGhfdGltZSI6MTY4Mzg3NTIyNiwibmFtZSI6IkNvbGFib3JhZG9yIiwicGhvbmVfbnVtYmVyIjoiKzUyMTExMSIsImV4cCI6MTY4Mzg3ODgyNiwiaWF0IjoxNjgzODc1MjI2LCJlbWFpbCI6ImlzbWFlbDk3bG9wZXpAZ21haWwuY29tIn0.EtgmT_THMx-Zy_zB5yZK4gz6TXNTVVJEKFt5X0JK2UkGVrp_q_92YCEuejS4n976fyTez0jkwOee6IkVHLV71uZWRBDFt-3Yw4ZxfsZYPNJWhoHXGNxhMU8MCkSntfu597esBTk-VsUpstT5R7L-WJfN8viE7R-qVo-42RlPTG0TFrWA9q0oTcqjv8vbxLpOBUjiEpjmqRhg4blJZwgkGNta6MOlw1vfmisOVbo9wMvqwnCZ9xx9KMKoH9U4uNObK_JomjbvPmTmkcUXsE-wGSD7XcoSwtuhBngLC7-jiu1u8MvL_ff5Z0Qp70sSpLdUglcSS8d1Xf7j_fcZuJ5jKA",
35
35
  productSelected: {
36
- orderId: 15160,
37
- status: "SAC",
38
- datasheet_status: "SAC",
36
+ orderId: 14606,
37
+ status: "RA",
38
+ datasheet_status: "RA",
39
39
  prio: "none",
40
- version: 7,
41
- description_status: "SAC",
42
- images_status: "SAC",
43
- brand: null,
44
- retailerOrder: 1,
45
- missing: {
46
- datasheet: null,
47
- descriptions: null,
48
- images: null
49
- },
50
- services: {
51
- datasheets: 1,
52
- descriptions: 1,
53
- images: 1
40
+ version: 3,
41
+ description_status: "RA",
42
+ images_status: "RA",
43
+ statusByRetailer: {
44
+ 4: {
45
+ datasheet: "RA/AC",
46
+ description: "RA/AC",
47
+ images: "RA/AC"
48
+ },
49
+ 5: {
50
+ datasheet: "RA/AC",
51
+ description: "RA/AC",
52
+ images: "RA/AC"
53
+ },
54
+ 6: {
55
+ description: "RA/AC",
56
+ images: "RA/AC",
57
+ datasheet: "RA/AC"
58
+ },
59
+ 12: {
60
+ datasheet: "RA/AC",
61
+ description: "RA/AC",
62
+ images: "RA/AC"
63
+ },
64
+ 17: {
65
+ datasheet: "RA/AC",
66
+ description: "RA/AC",
67
+ images: "RA/AC"
68
+ }
54
69
  },
55
70
  article: {
56
71
  category: "Puertas y Ventanas|Molduras|Molduras Madera Blanda",
@@ -76,19 +91,16 @@ RetailerProductEditionDefault.args = {
76
91
  }, {
77
92
  id: 68,
78
93
  name: "The Home Depot Merchants"
79
- }],
80
- statusByRetailer: {
81
- 58: {
82
- datasheet: "SAC",
83
- description: "SAC",
84
- images: "SAC"
85
- }
86
- }
94
+ }]
87
95
  },
88
96
  location: {
89
97
  product: {
90
- articleId: 39290,
91
- versionId: 7
98
+ articleId: 354,
99
+ versionId: 3
100
+ },
101
+ state: {
102
+ withChat: true,
103
+ chatType: "product_status"
92
104
  }
93
105
  },
94
106
  user: {