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.
- package/.env.development +3 -0
- package/.env.production +2 -3
- 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/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 +88 -66
- package/dist/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +73 -41
- package/dist/components/pages/RetailerProductEdition/index.js +20 -15
- 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 +13 -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/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 +88 -67
- package/src/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +78 -41
- package/src/components/pages/RetailerProductEdition/index.js +19 -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
|
@@ -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
|
-
|
|
731
|
-
|
|
732
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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":
|
|
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
84
|
company_id: 1,
|
|
65
85
|
company_name: "GRUPO BRAHMA",
|
|
66
86
|
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:
|
|
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: "
|
|
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:
|
|
83
|
-
name: "
|
|
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: "
|
|
118
|
+
upc: "7509546078915"
|
|
87
119
|
},
|
|
88
120
|
location: {
|
|
89
121
|
product: {
|
|
90
|
-
articleId:
|
|
122
|
+
articleId: 354,
|
|
91
123
|
versionId: 3
|
|
92
124
|
}
|
|
93
125
|
},
|
|
94
126
|
user: {
|
|
95
|
-
id_user:
|
|
96
|
-
name: "
|
|
97
|
-
last_name: "
|
|
98
|
-
email: "
|
|
99
|
-
position: "
|
|
127
|
+
id_user: 51,
|
|
128
|
+
name: "ADMIN PRUEBA",
|
|
129
|
+
last_name: "",
|
|
130
|
+
email: "etc@contentoh.com",
|
|
131
|
+
position: "",
|
|
100
132
|
telephone: "",
|
|
101
|
-
country: "
|
|
133
|
+
country: "",
|
|
102
134
|
id_company: 2,
|
|
103
|
-
id_cognito: "
|
|
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:
|
|
142
|
+
id_role: 1,
|
|
111
143
|
active: 1,
|
|
112
144
|
is_retailer: 0,
|
|
113
145
|
email_notify: 1,
|
|
114
|
-
is_user_tech:
|
|
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-
|
|
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
|
-
|
|
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();
|
|
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
|
|
787
|
+
var _Object$keys, _percentages$product$, _retailers$;
|
|
786
788
|
|
|
787
|
-
product === null || product === void 0 ? void 0 :
|
|
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
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
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 && (
|
|
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
|
-
|
|
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
|
}
|