contentoh-components-library 21.3.30 → 21.3.31

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 (125) hide show
  1. package/.env.development +3 -0
  2. package/.env.production +2 -3
  3. package/dist/assets/images/generalButton/closeIcon.svg +2 -2
  4. package/dist/components/atoms/ProgressBar/index.js +36 -6
  5. package/dist/components/atoms/ProgressBar/styles.js +11 -3
  6. package/dist/components/molecules/CustomSelect/CustomSelect.stories.js +21 -22
  7. package/dist/components/molecules/CustomSelect/SelectItem.js +10 -1
  8. package/dist/components/molecules/GalleryElement/index.js +1 -1
  9. package/dist/components/molecules/HeaderTop/styles.js +1 -1
  10. package/dist/components/molecules/ProductNameHeader/index.js +6 -4
  11. package/dist/components/molecules/StatusAsignationInfo/index.js +1 -1
  12. package/dist/components/organisms/FullProductNameHeader/index.js +1 -0
  13. package/dist/components/organisms/ProductImageModal/index.js +10 -3
  14. package/dist/components/pages/ProviderProductEdition/ProviderProductEdition.stories.js +214 -30
  15. package/dist/components/pages/ProviderProductEdition/index.js +88 -66
  16. package/dist/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +73 -41
  17. package/dist/components/pages/RetailerProductEdition/index.js +20 -15
  18. package/dist/components/pages/RetailerProductEdition/utils.js +1 -1
  19. package/dist/global-files/data.js +18 -23
  20. package/dist/global-files/fonts.css +6 -0
  21. package/dist/global-files/variables.js +2 -0
  22. package/dist/index.js +267 -46
  23. package/package.json +13 -1
  24. package/src/assets/images/customSelect/starIcon.svg +14 -0
  25. package/src/assets/images/defaultImages/Spinner.gif +0 -0
  26. package/src/assets/images/defaultImages/notFound.svg +124 -0
  27. package/src/assets/images/generalButton/closeIcon.svg +2 -2
  28. package/src/assets/sounds/newMessage.mp3 +0 -0
  29. package/src/components/atoms/ButtonFileChooser/ButtonFileChooser.stories.js +47 -0
  30. package/src/components/atoms/ButtonFileChooser/index.js +68 -0
  31. package/src/components/atoms/ButtonFileChooser/styles.js +4 -0
  32. package/src/components/atoms/ButtonV2/ButtonV2.stories.js +53 -0
  33. package/src/components/atoms/ButtonV2/index.js +85 -0
  34. package/src/components/atoms/ButtonV2/styles.js +217 -0
  35. package/src/components/atoms/CustomIcon/CustomIcon.stories.js +36 -0
  36. package/src/components/atoms/CustomIcon/index.js +41 -0
  37. package/src/components/atoms/CustomIcon/styles.js +85 -0
  38. package/src/components/atoms/IconFile/IconFile.stories.js +35 -0
  39. package/src/components/atoms/IconFile/index.js +119 -0
  40. package/src/components/atoms/IconFile/styles.js +67 -0
  41. package/src/components/atoms/Image/Image.stories.js +51 -0
  42. package/src/components/atoms/Image/index.js +55 -0
  43. package/src/components/atoms/Image/styles.js +34 -0
  44. package/src/components/atoms/ImageLink/ImageLink.stories.js +43 -0
  45. package/src/components/atoms/ImageLink/index.js +57 -0
  46. package/src/components/atoms/ImageLink/styles.js +30 -0
  47. package/src/components/atoms/ImagePreview/ImagePreview.stories.js +52 -0
  48. package/src/components/atoms/ImagePreview/index.js +178 -0
  49. package/src/components/atoms/ImagePreview/styles.js +77 -0
  50. package/src/components/atoms/InputText/InputText.stories.js +39 -0
  51. package/src/components/atoms/InputText/index.js +61 -0
  52. package/src/components/atoms/InputText/styles.js +89 -0
  53. package/src/components/atoms/NotFound/NotFound.stories.js +19 -0
  54. package/src/components/atoms/NotFound/index.js +52 -0
  55. package/src/components/atoms/NotFound/styles.js +55 -0
  56. package/src/components/atoms/ProgressBar/index.js +40 -5
  57. package/src/components/atoms/ProgressBar/styles.js +24 -0
  58. package/src/components/atoms/SelectItemV2/SelectItemV2.stories.js +26 -0
  59. package/src/components/atoms/SelectItemV2/index.js +61 -0
  60. package/src/components/atoms/SelectItemV2/styles.js +90 -0
  61. package/src/components/atoms/Tooltip/Tooltip.stories.js +51 -0
  62. package/src/components/atoms/Tooltip/index.js +59 -0
  63. package/src/components/atoms/Tooltip/styles.js +42 -0
  64. package/src/components/molecules/ButtonDownloadFile/DownloadFile.stories.js +54 -0
  65. package/src/components/molecules/ButtonDownloadFile/index.js +109 -0
  66. package/src/components/molecules/ButtonDownloadFile/styles.js +66 -0
  67. package/src/components/molecules/CustomSelect/CustomSelect.stories.js +20 -12
  68. package/src/components/molecules/CustomSelect/SelectItem.js +7 -0
  69. package/src/components/molecules/Dropdown/Dropdown.stories.js +103 -0
  70. package/src/components/molecules/Dropdown/index.js +150 -0
  71. package/src/components/molecules/Dropdown/styles.js +75 -0
  72. package/src/components/molecules/GalleryElement/index.js +1 -1
  73. package/src/components/molecules/HeaderTop/styles.js +5 -2
  74. package/src/components/molecules/ImageTooltip/ImageTooltip.stories.js +68 -0
  75. package/src/components/molecules/ImageTooltip/index.js +63 -0
  76. package/src/components/molecules/ImageTooltip/styles.js +18 -0
  77. package/src/components/molecules/ProductNameHeader/index.js +7 -2
  78. package/src/components/molecules/SelectV2/SelectV2.stories.js +115 -0
  79. package/src/components/molecules/SelectV2/index.js +357 -0
  80. package/src/components/molecules/SelectV2/styles.js +105 -0
  81. package/src/components/molecules/SelectV2/test.js +60 -0
  82. package/src/components/molecules/SelectV2/test.stories.js +10 -0
  83. package/src/components/molecules/StatusAsignationInfo/index.js +11 -9
  84. package/src/components/organisms/Chat/Chat.stories.js +149 -0
  85. package/src/components/organisms/Chat/ChatLists/ChatLists.stories.js +65 -0
  86. package/src/components/organisms/Chat/ChatLists/Rotoplas.jpeg +0 -0
  87. package/src/components/organisms/Chat/ChatLists/THD.png +0 -0
  88. package/src/components/organisms/Chat/ChatLists/index.js +141 -0
  89. package/src/components/organisms/Chat/ChatLists/styles.js +162 -0
  90. package/src/components/organisms/Chat/ContainerItems/ContainerItems.stories.js +142 -0
  91. package/src/components/organisms/Chat/ContainerItems/index.js +522 -0
  92. package/src/components/organisms/Chat/ContainerItems/styles.js +348 -0
  93. package/src/components/organisms/Chat/ContentChat/ContentChat.stories.js +102 -0
  94. package/src/components/organisms/Chat/ContentChat/Rotoplas.jpeg +0 -0
  95. package/src/components/organisms/Chat/ContentChat/THD.png +0 -0
  96. package/src/components/organisms/Chat/ContentChat/index.js +922 -0
  97. package/src/components/organisms/Chat/ContentChat/styles.js +41 -0
  98. package/src/components/organisms/Chat/Footer/Footer.stories.js +22 -0
  99. package/src/components/organisms/Chat/Footer/index.js +661 -0
  100. package/src/components/organisms/Chat/Footer/styles.js +286 -0
  101. package/src/components/organisms/Chat/Header/Header.stories.js +66 -0
  102. package/src/components/organisms/Chat/Header/index.js +93 -0
  103. package/src/components/organisms/Chat/Header/styles.js +49 -0
  104. package/src/components/organisms/Chat/index.js +238 -0
  105. package/src/components/organisms/Chat/styles.js +42 -0
  106. package/src/components/organisms/FullProductNameHeader/index.js +1 -0
  107. package/src/components/organisms/Modal/Modal.stories.js +55 -0
  108. package/src/components/organisms/Modal/index.js +97 -0
  109. package/src/components/organisms/Modal/styles.js +103 -0
  110. package/src/components/organisms/ProductImageModal/index.js +6 -3
  111. package/src/components/organisms/RangeCalendar/RangeCalendar.stories.js +16 -0
  112. package/src/components/organisms/RangeCalendar/index.js +121 -0
  113. package/src/components/organisms/RangeCalendar/styles.js +883 -0
  114. package/src/components/pages/ProviderProductEdition/ProviderProductEdition.stories.js +239 -32
  115. package/src/components/pages/ProviderProductEdition/index.js +88 -67
  116. package/src/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +78 -41
  117. package/src/components/pages/RetailerProductEdition/index.js +19 -21
  118. package/src/components/pages/RetailerProductEdition/utils.js +2 -1
  119. package/src/global-files/data.js +18 -23
  120. package/src/global-files/fonts.css +6 -0
  121. package/src/global-files/handle_http.js +225 -0
  122. package/src/global-files/handle_userTech.js +7 -0
  123. package/src/global-files/utils.js +330 -0
  124. package/src/global-files/variables.js +2 -0
  125. package/src/index.js +17 -0
@@ -212,7 +212,7 @@ var myBucket = new _awsSdk.default.S3({
212
212
  });
213
213
 
214
214
  var ProviderProductEdition = function ProviderProductEdition(_ref) {
215
- var _product$retailers, _product$retailersAva, _location$state, _datasheets$, _datasheets$$data;
215
+ var _product$retailers, _product$retailersAva, _location$state, _location$state2, _datasheets$, _datasheets$$data;
216
216
 
217
217
  var tabsSections = _ref.tabsSections,
218
218
  _ref$productSelected = _ref.productSelected,
@@ -227,7 +227,8 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
227
227
  revision = _ref$revision === void 0 ? false : _ref$revision,
228
228
  setShowContentohRequestModal = _ref.setShowContentohRequestModal,
229
229
  showSurvey = _ref.showSurvey,
230
- company = _ref.company;
230
+ company = _ref.company,
231
+ withChat = _ref.withChat;
231
232
 
232
233
  var _useState = (0, _react.useState)("Descripción"),
233
234
  _useState2 = (0, _slicedToArray2.default)(_useState, 2),
@@ -536,6 +537,11 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
536
537
  (0, _react.useEffect)(function () {
537
538
  checkAll && setSelectedImages(images.values);
538
539
  }, [checkAll]);
540
+ (0, _react.useEffect)(function () {
541
+ if (showModal) {
542
+ setActiveTab("Imágenes");
543
+ }
544
+ }, [showModal]);
539
545
 
540
546
  var loadData = /*#__PURE__*/function () {
541
547
  var _ref3 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2() {
@@ -565,7 +571,7 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
565
571
  (0, _data.getPercentage)({
566
572
  data: [product]
567
573
  }).then(function (res) {
568
- return setPercentages(res);
574
+ return setPercentages(res[0]);
569
575
  });
570
576
  setLoading(false);
571
577
 
@@ -720,17 +726,19 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
720
726
  loadAssignations(product);
721
727
  }, [userGroups]);
722
728
  (0, _react.useEffect)(function () {
723
- var _retailers$;
729
+ var _Object$keys, _percentages$productT, _retailers$;
724
730
 
725
731
  var productTemp = product;
726
732
  var retailers = (productTemp === null || productTemp === void 0 ? void 0 : productTemp.retailersAvailable) || (productTemp === null || productTemp === void 0 ? void 0 : productTemp.retailers);
727
- retailers === null || retailers === void 0 ? void 0 : retailers.forEach(function (retailer) {
728
- var _percentages$find;
729
733
 
730
- retailer["percentage"] = percentages === null || percentages === void 0 ? void 0 : (_percentages$find = percentages.find(function (percent) {
731
- return (retailer === null || retailer === void 0 ? void 0 : retailer.id) === (percent === null || percent === void 0 ? void 0 : percent.id_retailer);
732
- })) === null || _percentages$find === void 0 ? void 0 : _percentages$find.percentage;
733
- });
734
+ if (((_Object$keys = Object.keys((_percentages$productT = percentages[productTemp.id_article]) !== null && _percentages$productT !== void 0 ? _percentages$productT : {})) === null || _Object$keys === void 0 ? void 0 : _Object$keys.length) > 0) {
735
+ retailers === null || retailers === void 0 ? void 0 : retailers.forEach(function (retailer, index) {
736
+ var _percentages$productT2;
737
+
738
+ retailer["percentage"] = Number((_percentages$productT2 = percentages[productTemp.id_article][retailer.id]) === null || _percentages$productT2 === void 0 ? void 0 : _percentages$productT2.percentageRequired);
739
+ });
740
+ }
741
+
734
742
  setProduct(productTemp);
735
743
  setActivePercentage((_retailers$ = retailers[0]) === null || _retailers$ === void 0 ? void 0 : _retailers$.percentage);
736
744
  }, [percentages]);
@@ -1677,10 +1685,74 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
1677
1685
  title: "Bienvenido al modo Content-oh!",
1678
1686
  description: "Finalmente elige la forma de pago que más te guste, procede con el pago y listo."
1679
1687
  }];
1688
+
1689
+ var sendToEvaluation = function sendToEvaluation(result) {
1690
+ if (result === "A") {
1691
+ if (origin[activeTab] === "RequestWithoutContentoh" && !user.is_retailer && (!product.id_order || !product.orderId)) {
1692
+ setDataGenericModal(function (prev) {
1693
+ return (0, _objectSpread3.default)((0, _objectSpread3.default)({}, prev), {}, {
1694
+ button2: {
1695
+ name: "Continuar",
1696
+ action: function action() {
1697
+ return evaluationToRetailer("A");
1698
+ }
1699
+ }
1700
+ });
1701
+ });
1702
+ setShowGenericModal(true);
1703
+ } else if (user.is_retailer) {
1704
+ if (product.id_order || product.orderId) {
1705
+ sendEvaluation("A");
1706
+ } else {
1707
+ setDataGenericModal(function (prev) {
1708
+ return (0, _objectSpread3.default)((0, _objectSpread3.default)({}, prev), {}, {
1709
+ button2: {
1710
+ name: "Continuar",
1711
+ action: function action() {
1712
+ return evaluationToRetailer("A");
1713
+ }
1714
+ }
1715
+ });
1716
+ });
1717
+ setShowGenericModal(true);
1718
+ }
1719
+ } else {
1720
+ sendEvaluation("A");
1721
+ }
1722
+ } else {
1723
+ if (originProp === "RequestWithoutContentoh" && !user.is_retailer && (!product.id_order || !product.orderId)) {
1724
+ return;
1725
+ } else if (user.is_retailer) {
1726
+ if (product.id_order || product.orderId) {
1727
+ setValidatedAll(true);
1728
+ setModalViewError(true);
1729
+ } else {
1730
+ setDataGenericModal(function (prev) {
1731
+ return (0, _objectSpread3.default)((0, _objectSpread3.default)({}, prev), {}, {
1732
+ button2: {
1733
+ name: "Continuar",
1734
+ action: function action() {
1735
+ return evaluationToRetailer("R");
1736
+ }
1737
+ }
1738
+ });
1739
+ });
1740
+ setShowGenericModal(true);
1741
+ }
1742
+ } else {
1743
+ setValidatedAll(true);
1744
+ setModalViewError(true);
1745
+ }
1746
+ }
1747
+ };
1748
+
1680
1749
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_styles.Container, {
1681
1750
  headerTop: headerTop,
1682
1751
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_HeaderTop.HeaderTop, {
1683
- setHeaderTop: setHeaderTop
1752
+ setHeaderTop: setHeaderTop,
1753
+ withChat: location === null || location === void 0 ? void 0 : (_location$state2 = location.state) === null || _location$state2 === void 0 ? void 0 : _location$state2.withChat,
1754
+ productSelected: productSelected,
1755
+ token: token
1684
1756
  }), /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
1685
1757
  className: "data-container",
1686
1758
  children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
@@ -1776,62 +1848,10 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
1776
1848
  }
1777
1849
  },
1778
1850
  approve: function approve() {
1779
- if (origin[activeTab] === "RequestWithoutContentoh" && !user.is_retailer && (!product.id_order || !product.orderId)) {
1780
- setDataGenericModal(function (prev) {
1781
- return (0, _objectSpread3.default)((0, _objectSpread3.default)({}, prev), {}, {
1782
- button2: {
1783
- name: "Continuar",
1784
- action: function action() {
1785
- return evaluationToRetailer("A");
1786
- }
1787
- }
1788
- });
1789
- });
1790
- setShowGenericModal(true);
1791
- } else if (user.is_retailer) {
1792
- if (product.id_order || product.orderId) {
1793
- sendEvaluation("A");
1794
- } else {
1795
- setDataGenericModal(function (prev) {
1796
- return (0, _objectSpread3.default)((0, _objectSpread3.default)({}, prev), {}, {
1797
- button2: {
1798
- name: "Continuar",
1799
- action: function action() {
1800
- return evaluationToRetailer("A");
1801
- }
1802
- }
1803
- });
1804
- });
1805
- setShowGenericModal(true);
1806
- }
1807
- } else {
1808
- sendEvaluation("A");
1809
- }
1851
+ return sendToEvaluation("A");
1810
1852
  },
1811
1853
  reject: function reject() {
1812
- if (origin[activeTab] === "RequestWithoutContentoh" && !user.is_retailer && (!product.id_order || !product.orderId)) {
1813
- return;
1814
- } else if (user.is_retailer) {
1815
- if (product.id_order || product.orderId) {
1816
- setValidatedAll(false);
1817
- setModalViewError(true);
1818
- } else {
1819
- setDataGenericModal(function (prev) {
1820
- return (0, _objectSpread3.default)((0, _objectSpread3.default)({}, prev), {}, {
1821
- button2: {
1822
- name: "Continuar",
1823
- action: function action() {
1824
- return evaluationToRetailer("R");
1825
- }
1826
- }
1827
- });
1828
- });
1829
- setShowGenericModal(true);
1830
- }
1831
- } else {
1832
- setValidatedAll(false);
1833
- setModalViewError(true);
1834
- }
1854
+ return sendToEvaluation("R");
1835
1855
  }
1836
1856
  }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_FullTabsMenu.FullTabsMenu, {
1837
1857
  tabsSections: tabsSections,
@@ -1990,7 +2010,9 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
1990
2010
  })]
1991
2011
  }), showModal && /*#__PURE__*/(0, _jsxRuntime.jsx)(_ProductImageModal.ProductImageModal, {
1992
2012
  images: images,
1993
- setShowModal: setShowModal
2013
+ setShowModal: setShowModal,
2014
+ approveRejectButtons: isRevision() && getSectionStatus(),
2015
+ sendToFacilitator: sendToEvaluation
1994
2016
  }), message.length > 0 && !showSurvey && /*#__PURE__*/(0, _jsxRuntime.jsx)(_GenericModal.GenericModal, {
1995
2017
  buttonType: componentsArray.length > 0 && "delete-product",
1996
2018
  componentsArray: componentsArray.length > 0 ? componentsArray : [/*#__PURE__*/(0, _jsxRuntime.jsx)("img", {
@@ -28,90 +28,122 @@ exports.RetailerProductEditionDefault = RetailerProductEditionDefault;
28
28
  RetailerProductEditionDefault.args = {
29
29
  tabsSections: {
30
30
  Descripción: true,
31
- "Ficha técnica": false,
32
- Imágenes: false
31
+ "Ficha técnica": true,
32
+ Imágenes: true
33
33
  },
34
- token: "eyJraWQiOiJkQWJkZCtlclwvTlwveVRQUWNvUlVyOCtrNUd2M1hMM2N1MWUzQ09zWExVRnc9IiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiJjOTRhNzMwNS05MzY1LTQ2ZmYtYTQyMy00YjRiYzNiOGIxODAiLCJjb2duaXRvOmdyb3VwcyI6WyJjb2xhYm9yYWRvcmVzX2NvbnRlbnRvaCJdLCJlbWFpbF92ZXJpZmllZCI6dHJ1ZSwiaXNzIjoiaHR0cHM6XC9cL2NvZ25pdG8taWRwLnVzLWVhc3QtMS5hbWF6b25hd3MuY29tXC91cy1lYXN0LTFfWE1aUWRxa0dqIiwicGhvbmVfbnVtYmVyX3ZlcmlmaWVkIjp0cnVlLCJjb2duaXRvOnVzZXJuYW1lIjoiYzk0YTczMDUtOTM2NS00NmZmLWE0MjMtNGI0YmMzYjhiMTgwIiwiY29nbml0bzpyb2xlcyI6WyJhcm46YXdzOmlhbTo6ODk4NjcwMjMyODA3OnJvbGVcL2NvbnRlbnRvaC1kZXYtdXMtZWFzdC0xLWxhbWJkYVJvbGUiXSwiYXVkIjoiNWFjOHRwZ3M2Z2JzcTEzZnJ2cnBpZWVwNDAiLCJldmVudF9pZCI6IjllNTRjMDc0LWFjNzktNGEwNC1iOGEzLWNhOWU2ZmQxNDE3ZiIsInRva2VuX3VzZSI6ImlkIiwiYXV0aF90aW1lIjoxNjc3NTQ1NzA2LCJuYW1lIjoiQ29sYWJvcmFkb3IiLCJwaG9uZV9udW1iZXIiOiIrNTIxMTExIiwiZXhwIjoxNjc3NTQ5MzA2LCJpYXQiOjE2Nzc1NDU3MDYsImVtYWlsIjoic2FsbWVyb24uNUBob3RtYWlsLmNvbSJ9.CS5zthG2PFlQIn5yCV64aadrBvh0ccEMlm8osN_BHTqqYARTiGJMnGUzD-FqmCB9JNeLn036eNHQ7TppqlvhBEe66-F7Aq3fSCMR2X31dWkASsg1E9kSmYS2V6NeG1G5WkfaIBOh7d7VH5Dnu6i5phne_BAu_fDbnBgsQUxQQMh-LMfv2heQ_MInJ6O2MrIzbYYMZYK7ioO5C7FvBnOCpDuk3DcgVFwuqBdVJAGkm-VYJbbnR6NYmYMnZfzrFJ8DjNE3O-L3ugVDOIfZOjuVBt2ZsfIB0-I7h_TBuIzwVE309f68AoDAujacOKvPORoN4ympPrAUSa7ZrM6ye2564g",
34
+ token: "eyJraWQiOiJkQWJkZCtlclwvTlwveVRQUWNvUlVyOCtrNUd2M1hMM2N1MWUzQ09zWExVRnc9IiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiJhNmM0ZDNkNi0yNGE0LTQxZDQtYWQwZi1kMDg3NDM4YWI1YjYiLCJjb2duaXRvOmdyb3VwcyI6WyJjb2xhYm9yYWRvcmVzX2NvbnRlbnRvaCJdLCJlbWFpbF92ZXJpZmllZCI6dHJ1ZSwiaXNzIjoiaHR0cHM6XC9cL2NvZ25pdG8taWRwLnVzLWVhc3QtMS5hbWF6b25hd3MuY29tXC91cy1lYXN0LTFfWE1aUWRxa0dqIiwiY29nbml0bzp1c2VybmFtZSI6ImE2YzRkM2Q2LTI0YTQtNDFkNC1hZDBmLWQwODc0MzhhYjViNiIsImNvZ25pdG86cm9sZXMiOlsiYXJuOmF3czppYW06Ojg5ODY3MDIzMjgwNzpyb2xlXC9jb250ZW50b2gtZGV2LXVzLWVhc3QtMS1sYW1iZGFSb2xlIl0sImF1ZCI6IjVhYzh0cGdzNmdic3ExM2ZydnJwaWVlcDQwIiwiZXZlbnRfaWQiOiJhY2FmNjhiOC00MmU1LTQ1NzAtYThiMC04YWY4NmY3MGU5YTEiLCJ0b2tlbl91c2UiOiJpZCIsImF1dGhfdGltZSI6MTY3ODQ5NDYzNiwibmFtZSI6IkNvbGFib3JhZG9yIiwicGhvbmVfbnVtYmVyIjoiKzUyMTExMSIsImV4cCI6MTY3ODQ5ODIzNiwiaWF0IjoxNjc4NDk0NjM2LCJlbWFpbCI6ImV0Y0Bjb250ZW50b2guY29tIn0.WoO3h0tAsF_Z4f_6BLIOXaL__TzHUxZyQlDAULQ2cT1HkUs0EmTZXRzRZ4oce7rV5osco9gCWfhc03rQ-C12jmU-Yt7jq3vuuoHUz4JqkLpelZPS8jHSsCAUWu_ekOIgDzvNegiyKk2R4qnd7IRPzWOAx1houg-KKT7kxCxjkTyJJGtzb7pYDLSJSV871nS8MeXGf5VZG5rQ3Smfl8ANqypLUEQQ6gSOr30Ztt1lZaHRmhF8WKo_GWwY3jNScmX_o9QGOSvKVl8hTqz4gA9xbiNJ3zpoh_5PzY-N4Sl8pE3gt_9Zw_o5ItLNHpnXuav_0NENvhXDu7p7VTLEpG8DTA",
35
35
  productSelected: {
36
36
  services: {
37
37
  datasheets: 1,
38
38
  descriptions: 1,
39
39
  images: 1
40
40
  },
41
- orderId: 130,
42
- status: "PA",
43
- datasheet_status: "PA",
41
+ orderId: 14606,
42
+ status: "AS",
43
+ datasheet_status: "CA",
44
44
  prio: "none",
45
- version: 17,
46
- description_status: "PA",
47
- images_status: "PA",
45
+ version: 3,
46
+ description_status: "CA",
47
+ images_status: "AS",
48
48
  statusByRetailer: {
49
- 58: {
50
- datasheet: "PA",
51
- description: "PA",
52
- images: "PA"
49
+ 4: {
50
+ datasheet: "AC",
51
+ description: "CA",
52
+ images: "AS"
53
+ },
54
+ 5: {
55
+ datasheet: "CA",
56
+ description: "CA",
57
+ images: "AS"
58
+ },
59
+ 6: {
60
+ description: "CA",
61
+ images: "AS",
62
+ datasheet: "CA"
63
+ },
64
+ 12: {
65
+ datasheet: "CA",
66
+ description: "CA",
67
+ images: "AS"
68
+ },
69
+ 17: {
70
+ datasheet: "CA",
71
+ description: "AC",
72
+ images: "AS"
53
73
  }
54
74
  },
55
75
  article: {
56
- id_article: 3,
57
- id_category: "2032",
58
- name: "CORTINA BLACKOUT DE POLIÉSTER CAFÉ 2.13 X 1.06 M",
59
- upc: "161157",
60
- timestamp: "2022-11-14T16:02:47.000Z",
76
+ id_article: 37317,
77
+ id_category: "157",
78
+ name: "Detergente lavatrastres líquido Axion Complete tricloro 1.1 l",
79
+ upc: "7509546078915",
80
+ timestamp: "2023-03-10T20:19:15.000Z",
61
81
  id_user: 28,
62
82
  status: "NULL",
63
83
  active: 1,
64
84
  company_id: 1,
65
85
  company_name: "GRUPO BRAHMA",
66
86
  country: "México",
67
- id_order: 130,
68
- id_datasheet_especialist: null,
69
- id_datasheet_facilitator: null,
70
- id_description_especialist: null,
71
- id_description_facilitator: null,
72
- id_images_especialist: null,
73
- id_images_facilitator: null,
74
- id_auditor: null,
87
+ id_order: 14606,
88
+ id_datasheet_especialist: 54,
89
+ id_datasheet_facilitator: 52,
90
+ id_description_especialist: 54,
91
+ id_description_facilitator: 52,
92
+ id_images_especialist: 55,
93
+ id_images_facilitator: 53,
94
+ id_auditor: 37,
75
95
  id_recepcionist: null,
76
- category: "Decoración|Cortinas y Persianas|Cortinas",
96
+ category: "Consumibles|Productos de Limpieza y Lavandería|Jabones y Lavatrastes",
77
97
  missingAttributes: 0,
78
98
  missingDescriptions: 0,
79
99
  missingImages: 0
80
100
  },
81
101
  retailers: [{
82
- id: 58,
83
- name: "The Home Depot Golden"
102
+ id: 4,
103
+ name: "Walmart Super y Superama"
104
+ }, {
105
+ id: 5,
106
+ name: "Chedraui"
107
+ }, {
108
+ id: 6,
109
+ name: "HEB"
110
+ }, {
111
+ id: 12,
112
+ name: "La Comer"
113
+ }, {
114
+ id: 17,
115
+ name: "Genérico"
84
116
  }],
85
117
  country: "México",
86
- upc: "161157"
118
+ upc: "7509546078915"
87
119
  },
88
120
  location: {
89
121
  product: {
90
- articleId: 109485,
122
+ articleId: 354,
91
123
  versionId: 3
92
124
  }
93
125
  },
94
126
  user: {
95
- id_user: 30,
96
- name: "Admin",
97
- last_name: "Ulises",
98
- email: "salmeron.5@hotmail.com",
99
- position: "Admin",
127
+ id_user: 51,
128
+ name: "ADMIN PRUEBA",
129
+ last_name: "",
130
+ email: "etc@contentoh.com",
131
+ position: "",
100
132
  telephone: "",
101
- country: "México",
133
+ country: "",
102
134
  id_company: 2,
103
- id_cognito: "c94a7305-9365-46ff-a423-4b4bc3b8b180",
135
+ id_cognito: "a6c4d3d6-24a4-41d4-ad0f-d087438ab5b6",
104
136
  birth_Date: null,
105
137
  about_me: "",
106
138
  zip_code: "",
107
139
  address: "",
108
140
  job: "",
109
141
  id_stripe: "",
110
- id_role: 6,
142
+ id_role: 1,
111
143
  active: 1,
112
144
  is_retailer: 0,
113
145
  email_notify: 1,
114
- is_user_tech: "ADMIN-AS",
146
+ is_user_tech: null,
115
147
  membership: {
116
148
  id: 2,
117
149
  start_date: "2021-11-05T02:35:12.000Z",
@@ -123,6 +155,6 @@ RetailerProductEditionDefault.args = {
123
155
  products_limit: "3",
124
156
  type: "PyMES"
125
157
  },
126
- src: "https://content-management-profile.s3.amazonaws.com/id-30/30.png?1676494961913"
158
+ src: "https://content-management-profile.s3.amazonaws.com/id-51/51.png?1678494637588"
127
159
  }
128
160
  };
@@ -320,7 +320,8 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
320
320
  })),
321
321
  _useState24 = (0, _slicedToArray2.default)(_useState23, 2),
322
322
  percentages = _useState24[0],
323
- setPercentages = _useState24[1];
323
+ setPercentages = _useState24[1]; // const [percentages, setPercentages] = useState([{ retailers: {} }]);
324
+
324
325
 
325
326
  var _useState25 = (0, _react.useState)(0),
326
327
  _useState26 = (0, _slicedToArray2.default)(_useState25, 2),
@@ -536,7 +537,9 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
536
537
  }();
537
538
 
538
539
  (0, _react.useEffect)(function () {
539
- loadAuditableData();
540
+ if (auditableVersion) {
541
+ loadAuditableData();
542
+ }
540
543
  }, [auditableVersion]);
541
544
  (0, _react.useEffect)(function () {
542
545
  checkAll && setSelectedImages(images.values);
@@ -563,8 +566,7 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
563
566
 
564
567
 
565
568
  setServices(_services);
566
- getServices(); // setActiveRetailer(product?.retailers[0]);
567
-
569
+ getServices();
568
570
  setImages({
569
571
  action: "init",
570
572
  init: _services[2]
@@ -573,7 +575,7 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
573
575
  (0, _data.getPercentage)({
574
576
  data: [product]
575
577
  }).then(function (res) {
576
- return setPercentages(res);
578
+ return setPercentages(res[0]);
577
579
  });
578
580
  setLoading(false);
579
581
  _context3.next = 16;
@@ -782,20 +784,23 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
782
784
  loadAssignations(product);
783
785
  }, [userGroups]);
784
786
  (0, _react.useEffect)(function () {
785
- var _product$retailers2, _product$retailers$;
787
+ var _Object$keys, _percentages$product$, _retailers$;
786
788
 
787
- product === null || product === void 0 ? void 0 : (_product$retailers2 = product.retailers) === null || _product$retailers2 === void 0 ? void 0 : _product$retailers2.forEach(function (retailer) {
788
- var _percentages$filter$;
789
+ var retailers = (product === null || product === void 0 ? void 0 : product.retailersAvailable) || (product === null || product === void 0 ? void 0 : product.retailers);
789
790
 
790
- retailer["percentage"] = percentages.length ? percentages === null || percentages === void 0 ? void 0 : (_percentages$filter$ = percentages.filter(function (percent) {
791
- return (retailer === null || retailer === void 0 ? void 0 : retailer.id) === (percent === null || percent === void 0 ? void 0 : percent.id_retailer);
792
- })[0]) === null || _percentages$filter$ === void 0 ? void 0 : _percentages$filter$.percentage : 0;
793
- });
794
- setActivePercentage(product === null || product === void 0 ? void 0 : (_product$retailers$ = product.retailers[0]) === null || _product$retailers$ === void 0 ? void 0 : _product$retailers$.percentage);
791
+ if (((_Object$keys = Object.keys((_percentages$product$ = percentages[product.article.id_article]) !== null && _percentages$product$ !== void 0 ? _percentages$product$ : {})) === null || _Object$keys === void 0 ? void 0 : _Object$keys.length) > 0) {
792
+ retailers === null || retailers === void 0 ? void 0 : retailers.forEach(function (retailer, index) {
793
+ var _percentages$product$2;
794
+
795
+ retailer["percentage"] = Number((_percentages$product$2 = percentages[product.article.id_article][retailer.id]) === null || _percentages$product$2 === void 0 ? void 0 : _percentages$product$2.percentageRequired);
796
+ });
797
+ }
798
+
799
+ setActivePercentage((_retailers$ = retailers[0]) === null || _retailers$ === void 0 ? void 0 : _retailers$.percentage);
795
800
  }, [percentages]);
796
801
  (0, _react.useEffect)(function () {
797
802
  (0, _utils.getInputsData)(services, activeRetailer, setDatasheets, setDescriptions);
798
- auditableVersion && (0, _utils.getInputsData)(auditServices, activeRetailer, setAuditDatasheets, setAuditDescriptions);
803
+ auditableVersion && loadAuditableData();
799
804
  setActivePercentage(Math.round(activeRetailer === null || activeRetailer === void 0 ? void 0 : activeRetailer.percentage, 0));
800
805
  (activeRetailer === null || activeRetailer === void 0 ? void 0 : activeRetailer.id) && setImages({
801
806
  action: "orderImages",
@@ -2124,7 +2129,7 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
2124
2129
  images: images,
2125
2130
  setShowModal: setShowModal,
2126
2131
  sendToFacilitator: sendToFacilitator,
2127
- approveRejectButtons: approveRejectButtons
2132
+ approveRejectButtons: approveRejectButtons()
2128
2133
  }), message.length > 0 && /*#__PURE__*/(0, _jsxRuntime.jsx)(_GenericModal.GenericModal, {
2129
2134
  buttonType: componentsArray.length > 0 && "delete-product",
2130
2135
  componentsArray: componentsArray.length > 0 ? componentsArray : [/*#__PURE__*/(0, _jsxRuntime.jsx)("img", {
@@ -31,7 +31,7 @@ var getAuditVersion = /*#__PURE__*/function () {
31
31
  auditResponse = _context.sent;
32
32
 
33
33
  if (auditResponse.status === 200) {
34
- setState(JSON.parse(auditResponse.data.body).data);
34
+ setState(JSON.parse(auditResponse.data.body).data || "{}");
35
35
  }
36
36
 
37
37
  case 4:
@@ -122,35 +122,30 @@ var getPercentage = /*#__PURE__*/function () {
122
122
 
123
123
  func = /*#__PURE__*/function () {
124
124
  var _ref3 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2() {
125
- var dataToSend, retailers;
125
+ var dataToSend, arrayRetailers, retailers;
126
126
  return _regenerator.default.wrap(function _callee2$(_context2) {
127
127
  while (1) {
128
128
  switch (_context2.prev = _context2.next) {
129
129
  case 0:
130
130
  dataToSend = [];
131
+ arrayRetailers = [];
131
132
  retailers = params.data[0].retailers || params.data[0].retailersAvailable;
132
- params.data.forEach(function (product) {
133
+ params.data.forEach(function (product, i) {
134
+ dataToSend.push(product.article ? {
135
+ id_article: product.article.id_article,
136
+ id_category: product.article.id_category,
137
+ version: product.version
138
+ } : {
139
+ id_article: product.id_article,
140
+ id_category: product.id_category,
141
+ version: product.version
142
+ });
133
143
  retailers.forEach(function (retailer) {
134
- dataToSend.push(product.article ? {
135
- id_article: product.article.id_article,
136
- id_category: product.article.id_category,
137
- id_retailer: retailer.id,
138
- version: product.version,
139
- upc: product.article.upc,
140
- name: product.article.name,
141
- retailerName: retailer.name
142
- } : {
143
- id_article: product.id_article,
144
- id_category: product.id_category,
145
- id_retailer: retailer.id,
146
- version: product.version,
147
- upc: product.upc,
148
- name: product.name,
149
- retailerName: retailer.name
150
- });
144
+ arrayRetailers.push(retailer.id);
151
145
  });
146
+ dataToSend[i].id_retailer_array = arrayRetailers;
152
147
  });
153
- _context2.next = 5;
148
+ _context2.next = 6;
154
149
  return _axios.default.post(process.env.REACT_APP_VALID_EXPORT_ENDPOINT, {
155
150
  data: dataToSend
156
151
  }, {
@@ -158,15 +153,15 @@ var getPercentage = /*#__PURE__*/function () {
158
153
  Authorization: sessionStorage.getItem("jwt")
159
154
  }
160
155
  }).then(function (response) {
161
- return response.data;
156
+ return [response.data];
162
157
  }).catch(function (err) {
163
158
  return console.log(err, "Errror");
164
159
  });
165
160
 
166
- case 5:
161
+ case 6:
167
162
  return _context2.abrupt("return", _context2.sent);
168
163
 
169
- case 6:
164
+ case 7:
170
165
  case "end":
171
166
  return _context2.stop();
172
167
  }
@@ -61,3 +61,9 @@
61
61
  src: url("../assets/fonts/roboto/Roboto-Regular.ttf");
62
62
  font-weight: 400;
63
63
  }
64
+
65
+ .prueba {
66
+ color: #9e3e26;
67
+ color: #b42983;
68
+ color: #e7e7e7;
69
+ }
@@ -32,6 +32,8 @@ var FontFamily = {
32
32
  Raleway_700: "Raleway-700",
33
33
  Raleway_800: "Raleway-800",
34
34
  Raleway_900: "Raleway-900",
35
+ RobotoMedium: "RobotoMedium",
36
+ RobotoRegular: "RobotoRegular",
35
37
  Roboto: "Roboto"
36
38
  };
37
39
  exports.FontFamily = FontFamily;