contentoh-components-library 21.3.30 → 21.3.32
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.
- package/.env.development +3 -0
- package/.env.production +5 -2
- package/dist/assets/images/generalButton/closeIcon.svg +2 -2
- package/dist/components/atoms/ProgressBar/index.js +36 -6
- package/dist/components/atoms/ProgressBar/styles.js +11 -3
- package/dist/components/molecules/CustomSelect/CustomSelect.stories.js +21 -22
- package/dist/components/molecules/CustomSelect/SelectItem.js +10 -1
- package/dist/components/molecules/GalleryElement/index.js +1 -1
- package/dist/components/molecules/HeaderTop/index.js +15 -1
- package/dist/components/molecules/HeaderTop/styles.js +1 -1
- package/dist/components/molecules/ProductNameHeader/index.js +6 -4
- package/dist/components/molecules/StatusAsignationInfo/index.js +1 -1
- package/dist/components/organisms/FullProductNameHeader/index.js +1 -0
- package/dist/components/organisms/ProductImageModal/index.js +10 -3
- package/dist/components/pages/ProviderProductEdition/ProviderProductEdition.stories.js +214 -30
- package/dist/components/pages/ProviderProductEdition/index.js +86 -65
- package/dist/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +88 -52
- package/dist/components/pages/RetailerProductEdition/index.js +27 -18
- package/dist/components/pages/RetailerProductEdition/utils.js +1 -1
- package/dist/global-files/data.js +18 -23
- package/dist/global-files/fonts.css +6 -0
- package/dist/global-files/variables.js +2 -0
- package/dist/index.js +267 -46
- package/package.json +14 -1
- package/src/assets/images/customSelect/starIcon.svg +14 -0
- package/src/assets/images/defaultImages/Spinner.gif +0 -0
- package/src/assets/images/defaultImages/notFound.svg +124 -0
- package/src/assets/images/generalButton/closeIcon.svg +2 -2
- package/src/assets/sounds/newMessage.mp3 +0 -0
- package/src/components/atoms/ButtonFileChooser/ButtonFileChooser.stories.js +47 -0
- package/src/components/atoms/ButtonFileChooser/index.js +68 -0
- package/src/components/atoms/ButtonFileChooser/styles.js +4 -0
- package/src/components/atoms/ButtonV2/ButtonV2.stories.js +53 -0
- package/src/components/atoms/ButtonV2/index.js +85 -0
- package/src/components/atoms/ButtonV2/styles.js +217 -0
- package/src/components/atoms/CustomIcon/CustomIcon.stories.js +36 -0
- package/src/components/atoms/CustomIcon/index.js +41 -0
- package/src/components/atoms/CustomIcon/styles.js +85 -0
- package/src/components/atoms/IconFile/IconFile.stories.js +35 -0
- package/src/components/atoms/IconFile/index.js +119 -0
- package/src/components/atoms/IconFile/styles.js +67 -0
- package/src/components/atoms/Image/Image.stories.js +51 -0
- package/src/components/atoms/Image/index.js +55 -0
- package/src/components/atoms/Image/styles.js +34 -0
- package/src/components/atoms/ImageLink/ImageLink.stories.js +43 -0
- package/src/components/atoms/ImageLink/index.js +57 -0
- package/src/components/atoms/ImageLink/styles.js +30 -0
- package/src/components/atoms/ImagePreview/ImagePreview.stories.js +52 -0
- package/src/components/atoms/ImagePreview/index.js +178 -0
- package/src/components/atoms/ImagePreview/styles.js +77 -0
- package/src/components/atoms/InputText/InputText.stories.js +39 -0
- package/src/components/atoms/InputText/index.js +61 -0
- package/src/components/atoms/InputText/styles.js +89 -0
- package/src/components/atoms/NotFound/NotFound.stories.js +19 -0
- package/src/components/atoms/NotFound/index.js +52 -0
- package/src/components/atoms/NotFound/styles.js +55 -0
- package/src/components/atoms/ProgressBar/index.js +40 -5
- package/src/components/atoms/ProgressBar/styles.js +24 -0
- package/src/components/atoms/SelectItemV2/SelectItemV2.stories.js +26 -0
- package/src/components/atoms/SelectItemV2/index.js +61 -0
- package/src/components/atoms/SelectItemV2/styles.js +90 -0
- package/src/components/atoms/Tooltip/Tooltip.stories.js +51 -0
- package/src/components/atoms/Tooltip/index.js +59 -0
- package/src/components/atoms/Tooltip/styles.js +42 -0
- package/src/components/molecules/ButtonDownloadFile/DownloadFile.stories.js +54 -0
- package/src/components/molecules/ButtonDownloadFile/index.js +109 -0
- package/src/components/molecules/ButtonDownloadFile/styles.js +66 -0
- package/src/components/molecules/CustomSelect/CustomSelect.stories.js +20 -12
- package/src/components/molecules/CustomSelect/SelectItem.js +7 -0
- package/src/components/molecules/Dropdown/Dropdown.stories.js +103 -0
- package/src/components/molecules/Dropdown/index.js +150 -0
- package/src/components/molecules/Dropdown/styles.js +75 -0
- package/src/components/molecules/GalleryElement/index.js +1 -1
- package/src/components/molecules/HeaderTop/index.js +17 -0
- package/src/components/molecules/HeaderTop/styles.js +5 -2
- package/src/components/molecules/ImageTooltip/ImageTooltip.stories.js +68 -0
- package/src/components/molecules/ImageTooltip/index.js +63 -0
- package/src/components/molecules/ImageTooltip/styles.js +18 -0
- package/src/components/molecules/ProductNameHeader/index.js +7 -2
- package/src/components/molecules/SelectV2/SelectV2.stories.js +115 -0
- package/src/components/molecules/SelectV2/index.js +357 -0
- package/src/components/molecules/SelectV2/styles.js +105 -0
- package/src/components/molecules/SelectV2/test.js +60 -0
- package/src/components/molecules/SelectV2/test.stories.js +10 -0
- package/src/components/molecules/StatusAsignationInfo/index.js +11 -9
- package/src/components/organisms/Chat/Chat.stories.js +149 -0
- package/src/components/organisms/Chat/ChatLists/ChatLists.stories.js +65 -0
- package/src/components/organisms/Chat/ChatLists/Rotoplas.jpeg +0 -0
- package/src/components/organisms/Chat/ChatLists/THD.png +0 -0
- package/src/components/organisms/Chat/ChatLists/index.js +141 -0
- package/src/components/organisms/Chat/ChatLists/styles.js +162 -0
- package/src/components/organisms/Chat/ContainerItems/ContainerItems.stories.js +142 -0
- package/src/components/organisms/Chat/ContainerItems/index.js +522 -0
- package/src/components/organisms/Chat/ContainerItems/styles.js +348 -0
- package/src/components/organisms/Chat/ContentChat/ContentChat.stories.js +102 -0
- package/src/components/organisms/Chat/ContentChat/Rotoplas.jpeg +0 -0
- package/src/components/organisms/Chat/ContentChat/THD.png +0 -0
- package/src/components/organisms/Chat/ContentChat/index.js +922 -0
- package/src/components/organisms/Chat/ContentChat/styles.js +41 -0
- package/src/components/organisms/Chat/Footer/Footer.stories.js +22 -0
- package/src/components/organisms/Chat/Footer/index.js +661 -0
- package/src/components/organisms/Chat/Footer/styles.js +286 -0
- package/src/components/organisms/Chat/Header/Header.stories.js +66 -0
- package/src/components/organisms/Chat/Header/index.js +93 -0
- package/src/components/organisms/Chat/Header/styles.js +49 -0
- package/src/components/organisms/Chat/index.js +238 -0
- package/src/components/organisms/Chat/styles.js +42 -0
- package/src/components/organisms/FullProductNameHeader/index.js +1 -0
- package/src/components/organisms/Modal/Modal.stories.js +55 -0
- package/src/components/organisms/Modal/index.js +97 -0
- package/src/components/organisms/Modal/styles.js +103 -0
- package/src/components/organisms/ProductImageModal/index.js +6 -3
- package/src/components/organisms/RangeCalendar/RangeCalendar.stories.js +16 -0
- package/src/components/organisms/RangeCalendar/index.js +121 -0
- package/src/components/organisms/RangeCalendar/styles.js +883 -0
- package/src/components/pages/ProviderProductEdition/ProviderProductEdition.stories.js +239 -32
- package/src/components/pages/ProviderProductEdition/index.js +87 -67
- package/src/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +93 -52
- package/src/components/pages/RetailerProductEdition/index.js +23 -21
- package/src/components/pages/RetailerProductEdition/utils.js +2 -1
- package/src/global-files/data.js +18 -23
- package/src/global-files/fonts.css +6 -0
- package/src/global-files/handle_http.js +225 -0
- package/src/global-files/handle_userTech.js +7 -0
- package/src/global-files/utils.js +330 -0
- package/src/global-files/variables.js +2 -0
- package/src/index.js +17 -0
- package/src/assets/fonts/roboto/LICENSE.txt +0 -202
|
@@ -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,
|
|
@@ -536,6 +536,11 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
536
536
|
(0, _react.useEffect)(function () {
|
|
537
537
|
checkAll && setSelectedImages(images.values);
|
|
538
538
|
}, [checkAll]);
|
|
539
|
+
(0, _react.useEffect)(function () {
|
|
540
|
+
if (showModal) {
|
|
541
|
+
setActiveTab("Imágenes");
|
|
542
|
+
}
|
|
543
|
+
}, [showModal]);
|
|
539
544
|
|
|
540
545
|
var loadData = /*#__PURE__*/function () {
|
|
541
546
|
var _ref3 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2() {
|
|
@@ -565,7 +570,7 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
565
570
|
(0, _data.getPercentage)({
|
|
566
571
|
data: [product]
|
|
567
572
|
}).then(function (res) {
|
|
568
|
-
return setPercentages(res);
|
|
573
|
+
return setPercentages(res[0]);
|
|
569
574
|
});
|
|
570
575
|
setLoading(false);
|
|
571
576
|
|
|
@@ -720,17 +725,19 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
720
725
|
loadAssignations(product);
|
|
721
726
|
}, [userGroups]);
|
|
722
727
|
(0, _react.useEffect)(function () {
|
|
723
|
-
var _retailers$;
|
|
728
|
+
var _Object$keys, _percentages$productT, _retailers$;
|
|
724
729
|
|
|
725
730
|
var productTemp = product;
|
|
726
731
|
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
732
|
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
733
|
+
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) {
|
|
734
|
+
retailers === null || retailers === void 0 ? void 0 : retailers.forEach(function (retailer, index) {
|
|
735
|
+
var _percentages$productT2;
|
|
736
|
+
|
|
737
|
+
retailer["percentage"] = Number((_percentages$productT2 = percentages[productTemp.id_article][retailer.id]) === null || _percentages$productT2 === void 0 ? void 0 : _percentages$productT2.percentageRequired);
|
|
738
|
+
});
|
|
739
|
+
}
|
|
740
|
+
|
|
734
741
|
setProduct(productTemp);
|
|
735
742
|
setActivePercentage((_retailers$ = retailers[0]) === null || _retailers$ === void 0 ? void 0 : _retailers$.percentage);
|
|
736
743
|
}, [percentages]);
|
|
@@ -1677,10 +1684,74 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
1677
1684
|
title: "Bienvenido al modo Content-oh!",
|
|
1678
1685
|
description: "Finalmente elige la forma de pago que más te guste, procede con el pago y listo."
|
|
1679
1686
|
}];
|
|
1687
|
+
|
|
1688
|
+
var sendToEvaluation = function sendToEvaluation(result) {
|
|
1689
|
+
if (result === "A") {
|
|
1690
|
+
if (origin[activeTab] === "RequestWithoutContentoh" && !user.is_retailer && (!product.id_order || !product.orderId)) {
|
|
1691
|
+
setDataGenericModal(function (prev) {
|
|
1692
|
+
return (0, _objectSpread3.default)((0, _objectSpread3.default)({}, prev), {}, {
|
|
1693
|
+
button2: {
|
|
1694
|
+
name: "Continuar",
|
|
1695
|
+
action: function action() {
|
|
1696
|
+
return evaluationToRetailer("A");
|
|
1697
|
+
}
|
|
1698
|
+
}
|
|
1699
|
+
});
|
|
1700
|
+
});
|
|
1701
|
+
setShowGenericModal(true);
|
|
1702
|
+
} else if (user.is_retailer) {
|
|
1703
|
+
if (product.id_order || product.orderId) {
|
|
1704
|
+
sendEvaluation("A");
|
|
1705
|
+
} else {
|
|
1706
|
+
setDataGenericModal(function (prev) {
|
|
1707
|
+
return (0, _objectSpread3.default)((0, _objectSpread3.default)({}, prev), {}, {
|
|
1708
|
+
button2: {
|
|
1709
|
+
name: "Continuar",
|
|
1710
|
+
action: function action() {
|
|
1711
|
+
return evaluationToRetailer("A");
|
|
1712
|
+
}
|
|
1713
|
+
}
|
|
1714
|
+
});
|
|
1715
|
+
});
|
|
1716
|
+
setShowGenericModal(true);
|
|
1717
|
+
}
|
|
1718
|
+
} else {
|
|
1719
|
+
sendEvaluation("A");
|
|
1720
|
+
}
|
|
1721
|
+
} else {
|
|
1722
|
+
if (originProp === "RequestWithoutContentoh" && !user.is_retailer && (!product.id_order || !product.orderId)) {
|
|
1723
|
+
return;
|
|
1724
|
+
} else if (user.is_retailer) {
|
|
1725
|
+
if (product.id_order || product.orderId) {
|
|
1726
|
+
setValidatedAll(true);
|
|
1727
|
+
setModalViewError(true);
|
|
1728
|
+
} else {
|
|
1729
|
+
setDataGenericModal(function (prev) {
|
|
1730
|
+
return (0, _objectSpread3.default)((0, _objectSpread3.default)({}, prev), {}, {
|
|
1731
|
+
button2: {
|
|
1732
|
+
name: "Continuar",
|
|
1733
|
+
action: function action() {
|
|
1734
|
+
return evaluationToRetailer("R");
|
|
1735
|
+
}
|
|
1736
|
+
}
|
|
1737
|
+
});
|
|
1738
|
+
});
|
|
1739
|
+
setShowGenericModal(true);
|
|
1740
|
+
}
|
|
1741
|
+
} else {
|
|
1742
|
+
setValidatedAll(true);
|
|
1743
|
+
setModalViewError(true);
|
|
1744
|
+
}
|
|
1745
|
+
}
|
|
1746
|
+
};
|
|
1747
|
+
|
|
1680
1748
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_styles.Container, {
|
|
1681
1749
|
headerTop: headerTop,
|
|
1682
1750
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_HeaderTop.HeaderTop, {
|
|
1683
|
-
setHeaderTop: setHeaderTop
|
|
1751
|
+
setHeaderTop: setHeaderTop,
|
|
1752
|
+
withChat: location === null || location === void 0 ? void 0 : (_location$state2 = location.state) === null || _location$state2 === void 0 ? void 0 : _location$state2.withChat,
|
|
1753
|
+
productSelected: productSelected,
|
|
1754
|
+
token: token
|
|
1684
1755
|
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
1685
1756
|
className: "data-container",
|
|
1686
1757
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
@@ -1776,62 +1847,10 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
1776
1847
|
}
|
|
1777
1848
|
},
|
|
1778
1849
|
approve: function approve() {
|
|
1779
|
-
|
|
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
|
-
}
|
|
1850
|
+
return sendToEvaluation("A");
|
|
1810
1851
|
},
|
|
1811
1852
|
reject: function reject() {
|
|
1812
|
-
|
|
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
|
-
}
|
|
1853
|
+
return sendToEvaluation("R");
|
|
1835
1854
|
}
|
|
1836
1855
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_FullTabsMenu.FullTabsMenu, {
|
|
1837
1856
|
tabsSections: tabsSections,
|
|
@@ -1990,7 +2009,9 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
1990
2009
|
})]
|
|
1991
2010
|
}), showModal && /*#__PURE__*/(0, _jsxRuntime.jsx)(_ProductImageModal.ProductImageModal, {
|
|
1992
2011
|
images: images,
|
|
1993
|
-
setShowModal: setShowModal
|
|
2012
|
+
setShowModal: setShowModal,
|
|
2013
|
+
approveRejectButtons: isRevision() && getSectionStatus(),
|
|
2014
|
+
sendToFacilitator: sendToEvaluation
|
|
1994
2015
|
}), message.length > 0 && !showSurvey && /*#__PURE__*/(0, _jsxRuntime.jsx)(_GenericModal.GenericModal, {
|
|
1995
2016
|
buttonType: componentsArray.length > 0 && "delete-product",
|
|
1996
2017
|
componentsArray: componentsArray.length > 0 ? componentsArray : [/*#__PURE__*/(0, _jsxRuntime.jsx)("img", {
|
|
@@ -28,101 +28,137 @@ exports.RetailerProductEditionDefault = RetailerProductEditionDefault;
|
|
|
28
28
|
RetailerProductEditionDefault.args = {
|
|
29
29
|
tabsSections: {
|
|
30
30
|
Descripción: true,
|
|
31
|
-
"Ficha técnica":
|
|
32
|
-
Imágenes:
|
|
31
|
+
"Ficha técnica": true,
|
|
32
|
+
Imágenes: true
|
|
33
33
|
},
|
|
34
|
-
token: "eyJraWQiOiJkQWJkZCtlclwvTlwveVRQUWNvUlVyOCtrNUd2M1hMM2N1MWUzQ09zWExVRnc9IiwiYWxnIjoiUlMyNTYifQ.
|
|
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:
|
|
42
|
-
status: "
|
|
43
|
-
datasheet_status: "
|
|
41
|
+
orderId: 14606,
|
|
42
|
+
status: "AS",
|
|
43
|
+
datasheet_status: "CA",
|
|
44
44
|
prio: "none",
|
|
45
|
-
version:
|
|
46
|
-
description_status: "
|
|
47
|
-
images_status: "
|
|
45
|
+
version: 3,
|
|
46
|
+
description_status: "CA",
|
|
47
|
+
images_status: "AS",
|
|
48
48
|
statusByRetailer: {
|
|
49
|
-
|
|
50
|
-
datasheet: "
|
|
51
|
-
description: "
|
|
52
|
-
images: "
|
|
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:
|
|
57
|
-
id_category: "
|
|
58
|
-
name: "
|
|
59
|
-
upc: "
|
|
60
|
-
timestamp: "
|
|
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
|
-
company_id:
|
|
65
|
-
|
|
84
|
+
company_id: 1005,
|
|
85
|
+
SKU: null,
|
|
86
|
+
Descripcion: null,
|
|
87
|
+
Proveedor: null,
|
|
88
|
+
id_proveedor: 0,
|
|
89
|
+
company_name: "CRS Transformaciones",
|
|
66
90
|
country: "México",
|
|
67
|
-
id_order:
|
|
68
|
-
id_datasheet_especialist:
|
|
69
|
-
id_datasheet_facilitator:
|
|
70
|
-
id_description_especialist:
|
|
71
|
-
id_description_facilitator:
|
|
72
|
-
id_images_especialist:
|
|
73
|
-
id_images_facilitator:
|
|
74
|
-
id_auditor:
|
|
91
|
+
id_order: 14606,
|
|
92
|
+
id_datasheet_especialist: 54,
|
|
93
|
+
id_datasheet_facilitator: 52,
|
|
94
|
+
id_description_especialist: 54,
|
|
95
|
+
id_description_facilitator: 52,
|
|
96
|
+
id_images_especialist: 55,
|
|
97
|
+
id_images_facilitator: 53,
|
|
98
|
+
id_auditor: 37,
|
|
75
99
|
id_recepcionist: null,
|
|
76
|
-
category: "
|
|
100
|
+
category: "Consumibles|Productos de Limpieza y Lavandería|Jabones y Lavatrastes",
|
|
77
101
|
missingAttributes: 0,
|
|
78
102
|
missingDescriptions: 0,
|
|
79
103
|
missingImages: 0
|
|
80
104
|
},
|
|
81
105
|
retailers: [{
|
|
82
|
-
id:
|
|
83
|
-
name: "
|
|
106
|
+
id: 4,
|
|
107
|
+
name: "Walmart Super y Superama"
|
|
108
|
+
}, {
|
|
109
|
+
id: 5,
|
|
110
|
+
name: "Chedraui"
|
|
111
|
+
}, {
|
|
112
|
+
id: 6,
|
|
113
|
+
name: "HEB"
|
|
114
|
+
}, {
|
|
115
|
+
id: 12,
|
|
116
|
+
name: "La Comer"
|
|
117
|
+
}, {
|
|
118
|
+
id: 17,
|
|
119
|
+
name: "Genérico"
|
|
84
120
|
}],
|
|
85
121
|
country: "México",
|
|
86
|
-
upc: "
|
|
122
|
+
upc: "7509546078915"
|
|
87
123
|
},
|
|
88
124
|
location: {
|
|
89
125
|
product: {
|
|
90
|
-
articleId:
|
|
126
|
+
articleId: 354,
|
|
91
127
|
versionId: 3
|
|
92
128
|
}
|
|
93
129
|
},
|
|
94
130
|
user: {
|
|
95
|
-
id_user:
|
|
96
|
-
name: "
|
|
97
|
-
last_name: "
|
|
98
|
-
email: "
|
|
99
|
-
position: "
|
|
131
|
+
id_user: 51,
|
|
132
|
+
name: "ADMIN PRUEBA",
|
|
133
|
+
last_name: "",
|
|
134
|
+
email: "etc@contentoh.com",
|
|
135
|
+
position: "",
|
|
100
136
|
telephone: "",
|
|
101
|
-
country: "
|
|
137
|
+
country: "",
|
|
102
138
|
id_company: 2,
|
|
103
|
-
id_cognito: "
|
|
139
|
+
id_cognito: "a6c4d3d6-24a4-41d4-ad0f-d087438ab5b6",
|
|
104
140
|
birth_Date: null,
|
|
105
141
|
about_me: "",
|
|
106
142
|
zip_code: "",
|
|
107
143
|
address: "",
|
|
108
144
|
job: "",
|
|
109
145
|
id_stripe: "",
|
|
110
|
-
id_role:
|
|
146
|
+
id_role: 1,
|
|
111
147
|
active: 1,
|
|
112
148
|
is_retailer: 0,
|
|
113
149
|
email_notify: 1,
|
|
114
|
-
is_user_tech:
|
|
150
|
+
is_user_tech: null,
|
|
115
151
|
membership: {
|
|
116
|
-
id:
|
|
117
|
-
start_date: "
|
|
118
|
-
end_date: "
|
|
119
|
-
planID:
|
|
120
|
-
plan: "
|
|
121
|
-
name: "Plan
|
|
122
|
-
user_limit: "
|
|
123
|
-
products_limit: "
|
|
124
|
-
type: "
|
|
152
|
+
id: 750,
|
|
153
|
+
start_date: "2022-01-07T21:32:54.000Z",
|
|
154
|
+
end_date: "2023-01-07T21:32:54.000Z",
|
|
155
|
+
planID: 6,
|
|
156
|
+
plan: "prod_KvGd6YSTJyR3AP",
|
|
157
|
+
name: "Plan Small",
|
|
158
|
+
user_limit: "10",
|
|
159
|
+
products_limit: "1000",
|
|
160
|
+
type: "Enterprise"
|
|
125
161
|
},
|
|
126
|
-
src: "https://content-management-profile.s3.amazonaws.com/id-
|
|
162
|
+
src: "https://content-management-profile.s3.amazonaws.com/id-51/51.png?1678494637588"
|
|
127
163
|
}
|
|
128
164
|
};
|
|
@@ -202,14 +202,15 @@ var myBucket = new _awsSdk.default.S3({
|
|
|
202
202
|
});
|
|
203
203
|
|
|
204
204
|
var RetailerProductEdition = function RetailerProductEdition(_ref) {
|
|
205
|
-
var _product$retailers, _product$services2, _datasheets$, _datasheets$$data, _product$article18, _comment$message;
|
|
205
|
+
var _product$retailers, _location$state, _product$services2, _datasheets$, _datasheets$$data, _product$article18, _comment$message;
|
|
206
206
|
|
|
207
207
|
var tabsSections = _ref.tabsSections,
|
|
208
208
|
_ref$productSelected = _ref.productSelected,
|
|
209
209
|
productSelected = _ref$productSelected === void 0 ? {} : _ref$productSelected,
|
|
210
210
|
_ref$user = _ref.user,
|
|
211
211
|
user = _ref$user === void 0 ? {} : _ref$user,
|
|
212
|
-
token = _ref.token
|
|
212
|
+
token = _ref.token,
|
|
213
|
+
location = _ref.location;
|
|
213
214
|
|
|
214
215
|
var _useState = (0, _react.useState)("Descripción"),
|
|
215
216
|
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
@@ -320,7 +321,8 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
|
|
|
320
321
|
})),
|
|
321
322
|
_useState24 = (0, _slicedToArray2.default)(_useState23, 2),
|
|
322
323
|
percentages = _useState24[0],
|
|
323
|
-
setPercentages = _useState24[1];
|
|
324
|
+
setPercentages = _useState24[1]; // const [percentages, setPercentages] = useState([{ retailers: {} }]);
|
|
325
|
+
|
|
324
326
|
|
|
325
327
|
var _useState25 = (0, _react.useState)(0),
|
|
326
328
|
_useState26 = (0, _slicedToArray2.default)(_useState25, 2),
|
|
@@ -536,7 +538,9 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
|
|
|
536
538
|
}();
|
|
537
539
|
|
|
538
540
|
(0, _react.useEffect)(function () {
|
|
539
|
-
|
|
541
|
+
if (auditableVersion) {
|
|
542
|
+
loadAuditableData();
|
|
543
|
+
}
|
|
540
544
|
}, [auditableVersion]);
|
|
541
545
|
(0, _react.useEffect)(function () {
|
|
542
546
|
checkAll && setSelectedImages(images.values);
|
|
@@ -563,8 +567,7 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
|
|
|
563
567
|
|
|
564
568
|
|
|
565
569
|
setServices(_services);
|
|
566
|
-
getServices();
|
|
567
|
-
|
|
570
|
+
getServices();
|
|
568
571
|
setImages({
|
|
569
572
|
action: "init",
|
|
570
573
|
init: _services[2]
|
|
@@ -573,7 +576,7 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
|
|
|
573
576
|
(0, _data.getPercentage)({
|
|
574
577
|
data: [product]
|
|
575
578
|
}).then(function (res) {
|
|
576
|
-
return setPercentages(res);
|
|
579
|
+
return setPercentages(res[0]);
|
|
577
580
|
});
|
|
578
581
|
setLoading(false);
|
|
579
582
|
_context3.next = 16;
|
|
@@ -782,20 +785,23 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
|
|
|
782
785
|
loadAssignations(product);
|
|
783
786
|
}, [userGroups]);
|
|
784
787
|
(0, _react.useEffect)(function () {
|
|
785
|
-
var
|
|
788
|
+
var _Object$keys, _percentages$product$, _retailers$;
|
|
786
789
|
|
|
787
|
-
product === null || product === void 0 ? void 0 :
|
|
788
|
-
var _percentages$filter$;
|
|
790
|
+
var retailers = (product === null || product === void 0 ? void 0 : product.retailersAvailable) || (product === null || product === void 0 ? void 0 : product.retailers);
|
|
789
791
|
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
792
|
+
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) {
|
|
793
|
+
retailers === null || retailers === void 0 ? void 0 : retailers.forEach(function (retailer, index) {
|
|
794
|
+
var _percentages$product$2;
|
|
795
|
+
|
|
796
|
+
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);
|
|
797
|
+
});
|
|
798
|
+
}
|
|
799
|
+
|
|
800
|
+
setActivePercentage((_retailers$ = retailers[0]) === null || _retailers$ === void 0 ? void 0 : _retailers$.percentage);
|
|
795
801
|
}, [percentages]);
|
|
796
802
|
(0, _react.useEffect)(function () {
|
|
797
803
|
(0, _utils.getInputsData)(services, activeRetailer, setDatasheets, setDescriptions);
|
|
798
|
-
auditableVersion && (
|
|
804
|
+
auditableVersion && loadAuditableData();
|
|
799
805
|
setActivePercentage(Math.round(activeRetailer === null || activeRetailer === void 0 ? void 0 : activeRetailer.percentage, 0));
|
|
800
806
|
(activeRetailer === null || activeRetailer === void 0 ? void 0 : activeRetailer.id) && setImages({
|
|
801
807
|
action: "orderImages",
|
|
@@ -1892,7 +1898,10 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
|
|
|
1892
1898
|
setHeaderTop: setHeaderTop,
|
|
1893
1899
|
auditableVersion: auditableVersion,
|
|
1894
1900
|
setCompare: setCompare,
|
|
1895
|
-
isAuditor: [1, 6].includes(user.id_role)
|
|
1901
|
+
isAuditor: [1, 6].includes(user.id_role),
|
|
1902
|
+
withChat: location === null || location === void 0 ? void 0 : (_location$state = location.state) === null || _location$state === void 0 ? void 0 : _location$state.withChat,
|
|
1903
|
+
productSelected: productSelected,
|
|
1904
|
+
token: token
|
|
1896
1905
|
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
1897
1906
|
className: "data-container",
|
|
1898
1907
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
@@ -2124,7 +2133,7 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
|
|
|
2124
2133
|
images: images,
|
|
2125
2134
|
setShowModal: setShowModal,
|
|
2126
2135
|
sendToFacilitator: sendToFacilitator,
|
|
2127
|
-
approveRejectButtons: approveRejectButtons
|
|
2136
|
+
approveRejectButtons: approveRejectButtons()
|
|
2128
2137
|
}), message.length > 0 && /*#__PURE__*/(0, _jsxRuntime.jsx)(_GenericModal.GenericModal, {
|
|
2129
2138
|
buttonType: componentsArray.length > 0 && "delete-product",
|
|
2130
2139
|
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
|
-
|
|
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 =
|
|
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
|
|
161
|
+
case 6:
|
|
167
162
|
return _context2.abrupt("return", _context2.sent);
|
|
168
163
|
|
|
169
|
-
case
|
|
164
|
+
case 7:
|
|
170
165
|
case "end":
|
|
171
166
|
return _context2.stop();
|
|
172
167
|
}
|