contentoh-components-library 21.5.3 → 21.5.4
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/dist/components/organisms/InputGroup/index.js +1 -1
- package/dist/components/organisms/Table/styles.js +1 -1
- package/dist/components/pages/MultipleEdition/saveData.js +9 -19
- package/dist/components/pages/MultipleEdition/styles.js +1 -1
- package/dist/components/pages/MultipleEdition/utils.js +86 -153
- package/package.json +4 -1
- package/src/assets/images/Icons/addv2.svg +8 -0
- package/src/assets/images/Icons/beenhere.svg +9 -0
- package/src/assets/images/Icons/checkv2.svg +8 -0
- package/src/assets/images/Icons/close-magenta.svg +9 -0
- package/src/assets/images/Icons/close.svg +8 -0
- package/src/assets/images/Icons/closeCircle.svg +8 -0
- package/src/assets/images/Icons/delete-forever-red.svg +9 -0
- package/src/assets/images/Icons/delete-forever-white.svg +10 -0
- package/src/assets/images/Icons/edit.svg +8 -0
- package/src/assets/images/Icons/fullscreen.svg +3 -0
- package/src/assets/images/Icons/infoNR.svg +8 -0
- package/src/assets/images/Icons/options.svg +3 -0
- package/src/assets/images/Icons/save-white-gray.svg +9 -0
- package/src/assets/images/Icons/save-white.svg +9 -0
- package/src/assets/images/Icons/save.svg +8 -0
- package/src/assets/images/Icons/search.svg +3 -0
- package/src/assets/images/Icons/settings.svg +8 -0
- package/src/assets/images/Icons/trash.svg +8 -0
- package/src/assets/images/Icons/undo.svg +8 -0
- package/src/assets/images/Icons/upload-file-white.svg +4 -0
- package/src/assets/images/Icons/upload-file.svg +10 -0
- package/src/assets/images/Icons/upload_file.svg +10 -0
- package/src/assets/images/Icons/warningv2.svg +3 -0
- package/src/assets/images/checkBox/checkrosa.svg +3 -0
- package/src/assets/images/checkBox/checkverde.svg +3 -0
- package/src/assets/images/flagsv2/highPriority.svg +3 -0
- package/src/assets/images/flagsv2/lowPriority.svg +3 -0
- package/src/assets/images/flagsv2/mediumPriority.svg +3 -0
- package/src/assets/images/flagsv2/noPriority.svg +3 -0
- package/src/assets/images/generalButton/closeIconWhite.svg +4 -0
- package/src/assets/images/generalButton/closeIconv2.svg +4 -0
- package/src/assets/images/generalButton/saveIconpink.svg +3 -0
- package/src/components/atoms/Avatar/index.js +8 -2
- package/src/components/atoms/ButtonV2/ButtonV2.stories.js +1 -0
- package/src/components/atoms/ButtonV2/index.js +1 -0
- package/src/components/atoms/ButtonV2/styles.js +16 -0
- package/src/components/atoms/CharsMissing/Wysiwyg.stories.js +12 -0
- package/src/components/atoms/CharsMissing/index.js +60 -0
- package/src/components/atoms/CharsMissing/styles.js +44 -0
- package/src/components/atoms/CheckBox/CheckBox.stories.js +5 -0
- package/src/components/atoms/CheckBox/index.js +5 -1
- package/src/components/atoms/CheckBox/styles.js +9 -3
- package/src/components/atoms/CustomChip/CustomChip.stories.js +16 -0
- package/src/components/atoms/CustomChip/index.js +34 -0
- package/src/components/atoms/CustomChip/styles.js +6 -0
- package/src/components/atoms/FeatureTagv2/FeatureTagv2.stories.js +16 -0
- package/src/components/atoms/FeatureTagv2/index.js +10 -0
- package/src/components/atoms/FeatureTagv2/styles.js +56 -0
- package/src/components/atoms/GeneralButton/styles.js +46 -0
- package/src/components/atoms/GeneralInput/index.js +3 -0
- package/src/components/atoms/GeneralInput/styles.js +19 -1
- package/src/components/atoms/GeneralInputv2/GeneralInputv2.stories.js +33 -0
- package/src/components/atoms/GeneralInputv2/index.js +155 -0
- package/src/components/atoms/GeneralInputv2/styles.js +67 -0
- package/src/components/atoms/InputFormatter/index.js +2 -1
- package/src/components/atoms/InputFormatter/styles.js +9 -4
- package/src/components/atoms/InputFormatterv2/Wysiwyg.stories.js +12 -0
- package/src/components/atoms/InputFormatterv2/index.js +148 -0
- package/src/components/atoms/InputFormatterv2/styles.js +39 -0
- package/src/components/atoms/InputImages/InputImages.stories.js +19 -0
- package/src/components/atoms/InputImages/index.js +25 -0
- package/src/components/atoms/InputImages/styles.js +17 -0
- package/src/components/atoms/Multiselect/Multiselect.stories.js +364 -0
- package/src/components/atoms/Multiselect/index.js +351 -0
- package/src/components/atoms/Multiselect/styles.js +33 -0
- package/src/components/atoms/NumberMandatory/NumberMandatory.stories.js +19 -0
- package/src/components/atoms/NumberMandatory/index.js +16 -0
- package/src/components/atoms/NumberMandatory/styles.js +11 -0
- package/src/components/atoms/ObservationFlag/ObservationFlag.stories.js +20 -0
- package/src/components/atoms/ObservationFlag/index.js +167 -0
- package/src/components/atoms/ObservationFlag/styles.js +104 -0
- package/src/components/atoms/PriorityFlagv2/PriorityFlagv2.stories.js +20 -0
- package/src/components/atoms/PriorityFlagv2/index.js +20 -0
- package/src/components/atoms/PriorityFlagv2/styles.js +6 -0
- package/src/components/atoms/ProductImage/index.js +24 -11
- package/src/components/atoms/ProductImage/styles.js +7 -0
- package/src/components/atoms/ProductImagev2/ProductImagev2.stories.js +28 -0
- package/src/components/atoms/ProductImagev2/index.js +16 -0
- package/src/components/atoms/ProductImagev2/styles.js +62 -0
- package/src/components/atoms/Progress/Progress.stories.js +25 -0
- package/src/components/atoms/Progress/index.js +74 -0
- package/src/components/atoms/Progress/styles.js +98 -0
- package/src/components/atoms/ScreenHeaderv2/ScreenHeaderv2.stories.js +53 -0
- package/src/components/atoms/ScreenHeaderv2/index.js +134 -0
- package/src/components/atoms/ScreenHeaderv2/styles.js +103 -0
- package/src/components/atoms/Selectv2/VersionSelect.js +27 -0
- package/src/components/atoms/Selectv2/index.js +35 -0
- package/src/components/atoms/Selectv2/style.js +93 -0
- package/src/components/atoms/SliderToolTip/styles.js +1 -1
- package/src/components/atoms/TabSection/index.js +1 -1
- package/src/components/atoms/TabSection/styles.js +0 -3
- package/src/components/atoms/TabSectionv2/TabSection.stories.js +25 -0
- package/src/components/atoms/TabSectionv2/index.js +9 -0
- package/src/components/atoms/TabSectionv2/styles.js +20 -0
- package/src/components/atoms/TooltipLight/Tooltip.stories.js +20 -0
- package/src/components/atoms/TooltipLight/index.js +46 -0
- package/src/components/atoms/TooltipLight/styles.js +65 -0
- package/src/components/atoms/WordsMissing/Wysiwyg.stories.js +12 -0
- package/src/components/atoms/WordsMissing/index.js +60 -0
- package/src/components/atoms/WordsMissing/styles.js +10 -0
- package/src/components/molecules/AddGroup/AddGroup.stories.js +15 -0
- package/src/components/molecules/AddGroup/index.js +84 -0
- package/src/components/molecules/AddGroup/styles.js +141 -0
- package/src/components/molecules/AsignationInfo/AsignationInfo.stories.js +17 -0
- package/src/components/molecules/AsignationInfo/index.js +108 -0
- package/src/components/molecules/AsignationInfo/styles.js +86 -0
- package/src/components/molecules/BoxAttribute/index.js +32 -25
- package/src/components/molecules/BoxAttribute/styles.js +1 -1
- package/src/components/molecules/BoxButtons/index.js +23 -22
- package/src/components/molecules/CarouselImagesLogin/index.js +1 -1
- package/src/components/molecules/EditionActiveImagev2/EditionActiveImagev2.stories.js +12 -0
- package/src/components/molecules/EditionActiveImagev2/index.js +15 -0
- package/src/components/molecules/EditionActiveImagev2/styles.js +7 -0
- package/src/components/molecules/EditionTabs/EditionTabs.stories.js +12 -0
- package/src/components/molecules/EditionTabs/index.js +33 -0
- package/src/components/molecules/EditionTabs/styles.js +24 -0
- package/src/components/molecules/FeaturesBarv2/FeaturesBarv2.stories.js +20 -0
- package/src/components/molecules/FeaturesBarv2/index.js +32 -0
- package/src/components/molecules/FeaturesBarv2/styles.js +17 -0
- package/src/components/molecules/GalleryElement/index.js +76 -1
- package/src/components/molecules/GalleryElementv2/GalleryElementv2.stories.js +30 -0
- package/src/components/molecules/GalleryElementv2/index.js +142 -0
- package/src/components/molecules/GalleryElementv2/styles.js +119 -0
- package/src/components/molecules/GalleryHeader/index.js +1 -0
- package/src/components/molecules/GalleryHeaderv2/GalleryHeaderv2.stories.js +10 -0
- package/src/components/molecules/GalleryHeaderv2/index.js +25 -0
- package/src/components/molecules/GalleryHeaderv2/styles.js +47 -0
- package/src/components/molecules/GroupSelect/GroupSelect.stories.js +35 -0
- package/src/components/molecules/GroupSelect/SelectItem.js +105 -0
- package/src/components/molecules/GroupSelect/index.js +190 -0
- package/src/components/molecules/GroupSelect/styles.js +124 -0
- package/src/components/molecules/HeaderTop/index.js +52 -6
- package/src/components/molecules/HeaderTopv2/HeaderTopv2.stories.js +10 -0
- package/src/components/molecules/HeaderTopv2/index.js +100 -0
- package/src/components/molecules/HeaderTopv2/styles.js +33 -0
- package/src/components/molecules/ImageSelectorv2/ImageSelectorv2.stories.js +46 -0
- package/src/components/molecules/ImageSelectorv2/index.js +22 -0
- package/src/components/molecules/ImageSelectorv2/styles.js +15 -0
- package/src/components/molecules/Phase/Phase.stories.js +107 -0
- package/src/components/molecules/Phase/index.js +391 -0
- package/src/components/molecules/Phase/styles.js +97 -0
- package/src/components/molecules/ProductNameHeader/index.js +19 -1
- package/src/components/molecules/ProductNameHeaderv2/ProductNameHeaderv2.stories.js +37 -0
- package/src/components/molecules/ProductNameHeaderv2/index.js +12 -0
- package/src/components/molecules/ProductNameHeaderv2/styles.js +10 -0
- package/src/components/molecules/ProductSkuStatus/ProductSkuStatus.stories.js +37 -0
- package/src/components/molecules/ProductSkuStatus/index.js +26 -0
- package/src/components/molecules/ProductSkuStatus/styles.js +7 -0
- package/src/components/molecules/RetailerSelectorv2/RetailerSelectorv2.stories.js +35 -0
- package/src/components/molecules/RetailerSelectorv2/index.js +80 -0
- package/src/components/molecules/RetailerSelectorv2/styles.js +21 -0
- package/src/components/molecules/ServiceDataValidator/ServiceDataValidator.stories.js +90 -0
- package/src/components/molecules/ServiceDataValidator/index.js +49 -0
- package/src/components/molecules/ServiceDataValidator/styles.js +36 -0
- package/src/components/molecules/SignInLogin/index.js +11 -11
- package/src/components/molecules/StatusAsignationInfo/FinancedCompanies.js +501 -63
- package/src/components/molecules/StatusAsignationInfo/index.js +1 -1
- package/src/components/molecules/StatusRetailer/StatusAsignationInfo.stories.js +17 -0
- package/src/components/molecules/StatusRetailer/index.js +55 -0
- package/src/components/molecules/StatusRetailer/styles.js +85 -0
- package/src/components/molecules/StripeCardSelector/CardSelector.stories.js +1 -2
- package/src/components/molecules/TabsMenuv2/TabsMenuv2.stories.js +19 -0
- package/src/components/molecules/TabsMenuv2/index.js +112 -0
- package/src/components/molecules/TabsMenuv2/styles.js +19 -0
- package/src/components/molecules/TagAndInput/index.js +8 -6
- package/src/components/molecules/TagAndInputv2/TagAndInputv2.stories.js +24 -0
- package/src/components/molecules/TagAndInputv2/index.js +86 -0
- package/src/components/molecules/TagAndInputv2/styles.js +35 -0
- package/src/components/molecules/Validation/Validation.stories.js +12 -0
- package/src/components/molecules/Validation/index.js +77 -0
- package/src/components/molecules/Validation/styles.js +19 -0
- package/src/components/molecules/VersionItemv2/VersionItemv2.stories.js +14 -0
- package/src/components/molecules/VersionItemv2/index.js +59 -0
- package/src/components/molecules/VersionItemv2/styles.js +47 -0
- package/src/components/organisms/BarButtons/BarButtons.stories.js +13 -0
- package/src/components/organisms/BarButtons/index.js +150 -0
- package/src/components/organisms/BarButtons/styles.js +54 -0
- package/src/components/organisms/Chat/Chat.stories.js +27 -7
- package/src/components/organisms/Chat/ContainerItems/index.js +18 -2
- package/src/components/organisms/Chat/ContainerItems/styles.js +14 -2
- package/src/components/organisms/Chat/ContentChat/index.js +88 -12
- package/src/components/organisms/Chat/Footer/index.js +11 -0
- package/src/components/organisms/Chat/index.js +46 -4
- package/src/components/organisms/Chat/styles.js +4 -0
- package/src/components/organisms/Chatv2/ChatLists/ChatLists.stories.js +65 -0
- package/src/components/organisms/Chatv2/ChatLists/Rotoplas.jpeg +0 -0
- package/src/components/organisms/Chatv2/ChatLists/THD.png +0 -0
- package/src/components/organisms/Chatv2/ChatLists/index.js +141 -0
- package/src/components/organisms/Chatv2/ChatLists/styles.js +162 -0
- package/src/components/organisms/Chatv2/Chatv2.stories.js +184 -0
- package/src/components/organisms/Chatv2/ContainerItems/ContainerItems.stories.js +142 -0
- package/src/components/organisms/Chatv2/ContainerItems/index.js +538 -0
- package/src/components/organisms/Chatv2/ContainerItems/styles.js +360 -0
- package/src/components/organisms/Chatv2/ContentChat/ContentChat.stories.js +102 -0
- package/src/components/organisms/Chatv2/ContentChat/Rotoplas.jpeg +0 -0
- package/src/components/organisms/Chatv2/ContentChat/THD.png +0 -0
- package/src/components/organisms/Chatv2/ContentChat/index.js +1016 -0
- package/src/components/organisms/Chatv2/ContentChat/styles.js +44 -0
- package/src/components/organisms/Chatv2/Footer/Footer.stories.js +22 -0
- package/src/components/organisms/Chatv2/Footer/index.js +668 -0
- package/src/components/organisms/Chatv2/Footer/styles.js +290 -0
- package/src/components/organisms/Chatv2/Header/Header.stories.js +66 -0
- package/src/components/organisms/Chatv2/Header/index.js +93 -0
- package/src/components/organisms/Chatv2/Header/styles.js +49 -0
- package/src/components/organisms/Chatv2/index.js +281 -0
- package/src/components/organisms/Chatv2/styles.js +85 -0
- package/src/components/organisms/CompleteServices/CompleteServices.stories.js +91 -0
- package/src/components/organisms/CompleteServices/index.js +82 -0
- package/src/components/organisms/CompleteServices/styles.js +35 -0
- package/src/components/organisms/DashboardMetric/index.js +6 -3
- package/src/components/organisms/DragAndDropPhases/DragAndDropPhases.stories.js +13 -0
- package/src/components/organisms/DragAndDropPhases/index.js +336 -0
- package/src/components/organisms/DragAndDropPhases/styles.js +107 -0
- package/src/components/organisms/DragPrueba/DragPrueba.stories.js +12 -0
- package/src/components/organisms/DragPrueba/index.js +57 -0
- package/src/components/organisms/DragPrueba/styles.js +8 -0
- package/src/components/organisms/EditGroup/EditGroup.stories.js +20 -0
- package/src/components/organisms/EditGroup/index.js +321 -0
- package/src/components/organisms/EditGroup/styles.js +207 -0
- package/src/components/organisms/FullProductNameHeader/index.js +13 -1
- package/src/components/organisms/FullProductNamev2/FullProductNamev2.stories.js +28 -0
- package/src/components/organisms/FullProductNamev2/index.js +101 -0
- package/src/components/organisms/FullProductNamev2/styles.js +49 -0
- package/src/components/organisms/FullTabsMenuv2/FullTabsMenuv2.stories.js +22 -0
- package/src/components/organisms/FullTabsMenuv2/index.js +142 -0
- package/src/components/organisms/FullTabsMenuv2/styles.js +47 -0
- package/src/components/organisms/GridProducts/GridProducts.stories.js +682 -107
- package/src/components/organisms/ImageDataTablev2/ImageDataTablev2.stories.js +24 -0
- package/src/components/organisms/ImageDataTablev2/index.js +124 -0
- package/src/components/organisms/ImageDataTablev2/styles.js +18 -0
- package/src/components/organisms/ImagePreviewerv2/ImagePreviewerv2.stories.js +38 -0
- package/src/components/organisms/ImagePreviewerv2/index.js +22 -0
- package/src/components/organisms/ImagePreviewerv2/styles.js +7 -0
- package/src/components/organisms/ImageUploader/ImageUploader.stories.js +15 -0
- package/src/components/organisms/ImageUploader/index.js +62 -0
- package/src/components/organisms/ImageUploader/styles.js +29 -0
- package/src/components/organisms/ImageVisor/ImageVisor.stories.js +15 -0
- package/src/components/organisms/ImageVisor/index.js +143 -0
- package/src/components/organisms/ImageVisor/styles.js +106 -0
- package/src/components/organisms/InputGroup/index.js +292 -144
- package/src/components/organisms/InputGroup/styles.js +31 -0
- package/src/components/organisms/InputGroupv2/InputGroupv2.stories.js +31 -0
- package/src/components/organisms/InputGroupv2/index.js +296 -0
- package/src/components/organisms/InputGroupv2/styles.js +90 -0
- package/src/components/organisms/MandatoryBar/MandatoryBar.stories.js +18 -0
- package/src/components/organisms/MandatoryBar/index.js +31 -0
- package/src/components/organisms/MandatoryBar/styles.js +12 -0
- package/src/components/organisms/Modal/Modal.stories.js +2 -1
- package/src/components/organisms/Modal/index.js +9 -2
- package/src/components/organisms/Modal/styles.js +8 -1
- package/src/components/organisms/OrderDetail/utils/Table/utils.js +6 -16
- package/src/components/organisms/ProductImageModalv2/ProductImageModalv2.stories.js +90 -0
- package/src/components/organisms/ProductImageModalv2/index.js +105 -0
- package/src/components/organisms/ProductImageModalv2/styles.js +71 -0
- package/src/components/organisms/RenameImagesBar/RenameImagesBar.stories.js +18 -0
- package/src/components/organisms/RenameImagesBar/index.js +30 -0
- package/src/components/organisms/RenameImagesBar/styles.js +12 -0
- package/src/components/organisms/Table/Table.stories.js +609 -0
- package/src/components/organisms/Table/index.js +84 -0
- package/src/components/organisms/Table/styles.js +114 -0
- package/src/components/organisms/VersionSelectorv2/VersionSelectorv2.stories.js +15 -0
- package/src/components/organisms/VersionSelectorv2/index.js +105 -0
- package/src/components/organisms/VersionSelectorv2/styles.js +45 -0
- package/src/components/pages/Dashboard/Dashboard.stories.js +33 -38
- package/src/components/pages/Dashboard/index.js +36 -7
- package/src/components/pages/MultipleEdition/MultipleEdition.stories.js +17 -0
- package/src/components/pages/MultipleEdition/components/ImageUploader.js +62 -0
- package/src/components/pages/MultipleEdition/components/ImageUploaderStyles.js +29 -0
- package/src/components/pages/MultipleEdition/components/ImageVisor.js +143 -0
- package/src/components/pages/MultipleEdition/components/styles.js +106 -0
- package/src/components/pages/MultipleEdition/index.js +248 -0
- package/src/components/pages/MultipleEdition/saveData.js +92 -0
- package/src/components/pages/MultipleEdition/styles.js +201 -0
- package/src/components/pages/MultipleEdition/utils.js +1073 -0
- package/src/components/pages/ProductEditionv2/ProductEditionv2.stories.js +213 -0
- package/src/components/pages/ProductEditionv2/index.js +1758 -0
- package/src/components/pages/ProductEditionv2/styles.js +154 -0
- package/src/components/pages/ProviderProductEdition/ProviderProductEdition.stories.js +56 -60
- package/src/components/pages/ProviderProductEdition/index.js +148 -133
- package/src/components/pages/ProviderProductEdition/styles.js +5 -1
- package/src/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +4 -0
- package/src/components/pages/RetailerProductEdition/generateThumnail.js +21 -0
- package/src/components/pages/RetailerProductEdition/index.js +293 -300
- package/src/components/pages/RetailerProductEdition/styles.js +4 -0
- package/src/components/pages/RetailerProductEdition/utils.js +37 -0
- package/src/global-files/data.js +6 -10
- package/src/global-files/variables.js +6 -0
- package/src/index.js +12 -0
|
@@ -24,15 +24,21 @@ import descriptionSent from "../../../assets/images/modalsSVGs/descriptionSent.s
|
|
|
24
24
|
import imagesSent from "../../../assets/images/modalsSVGs/uploadingImages.svg";
|
|
25
25
|
import { TagAndInput } from "../../molecules/TagAndInput/index";
|
|
26
26
|
import { Button } from "../../atoms/GeneralButton";
|
|
27
|
-
import { Commentary } from "../../atoms/Commentary";
|
|
28
27
|
import { GenericModal } from "../../atoms/GenericModal";
|
|
29
28
|
import { ScreenHeader } from "../../atoms/ScreenHeader";
|
|
30
29
|
import { Loading } from "../../atoms/Loading";
|
|
31
30
|
import succes from "../../../assets/images/genericModal/genericModalCheck.svg";
|
|
32
|
-
import errorModal from "../../../assets/images/genericModal/errorModal.svg";
|
|
33
31
|
import { VersionSelector } from "../../organisms/VersionSelector";
|
|
34
32
|
import { useCloseModal } from "../../../global-files/customHooks";
|
|
35
|
-
import {
|
|
33
|
+
import {
|
|
34
|
+
getAuditVersion,
|
|
35
|
+
getInputsData,
|
|
36
|
+
createMessage,
|
|
37
|
+
sendMessage,
|
|
38
|
+
} from "./utils";
|
|
39
|
+
import { Modal } from "../../organisms/Modal";
|
|
40
|
+
import { ButtonV2 } from "../../atoms/ButtonV2";
|
|
41
|
+
import generateThumbnail from "./generateThumnail";
|
|
36
42
|
|
|
37
43
|
const reducerImages = (state, action) => {
|
|
38
44
|
let { values, attrForImgs, inputsByRetailer } = state;
|
|
@@ -86,7 +92,20 @@ const reducerImages = (state, action) => {
|
|
|
86
92
|
action.retailerId &&
|
|
87
93
|
inputsByRetailer[action.retailerId]?.filter((input) => {
|
|
88
94
|
imageIdArray.push(input.id_image);
|
|
89
|
-
valuesInitial.forEach((value) => {
|
|
95
|
+
valuesInitial.forEach(async (value) => {
|
|
96
|
+
if(value.ext=="mp4"){
|
|
97
|
+
convertirVideoABase64("https://" +
|
|
98
|
+
process.env.REACT_APP_IMAGES_BUCKET +
|
|
99
|
+
".s3.amazonaws.com/" +
|
|
100
|
+
value.srcDB)
|
|
101
|
+
.then(async base64 => {
|
|
102
|
+
const videoSrc = 'data:video/mp4;base64,' + base64.split(',')[1]; // Añade el tipo MIME adecuado
|
|
103
|
+
value.src= await generateThumbnail(videoSrc,2);
|
|
104
|
+
})
|
|
105
|
+
.catch(error => {
|
|
106
|
+
console.error('Error:', error);
|
|
107
|
+
});
|
|
108
|
+
}
|
|
90
109
|
if (value.image_id === input.id_image) orderedImages.push(value);
|
|
91
110
|
});
|
|
92
111
|
});
|
|
@@ -107,6 +126,42 @@ const reducerImages = (state, action) => {
|
|
|
107
126
|
const S3_BUCKET = process.env.REACT_APP_IMAGES_BUCKET;
|
|
108
127
|
const REGION = "us-east-1";
|
|
109
128
|
|
|
129
|
+
function convertirVideoABase64(url) {
|
|
130
|
+
return new Promise((resolve, reject) => {
|
|
131
|
+
const xhr = new XMLHttpRequest();
|
|
132
|
+
xhr.open('GET', url, true);
|
|
133
|
+
xhr.responseType = 'blob';
|
|
134
|
+
xhr.onload = function() {
|
|
135
|
+
if (xhr.status === 200) {
|
|
136
|
+
const blob = xhr.response;
|
|
137
|
+
const reader = new FileReader();
|
|
138
|
+
reader.onloadend = function() {
|
|
139
|
+
resolve(reader.result);
|
|
140
|
+
};
|
|
141
|
+
reader.readAsDataURL(blob);
|
|
142
|
+
} else {
|
|
143
|
+
reject(new Error('Error al cargar el video'));
|
|
144
|
+
}
|
|
145
|
+
};
|
|
146
|
+
xhr.onerror = function() {
|
|
147
|
+
reject(new Error('Error de red al cargar el video'));
|
|
148
|
+
};
|
|
149
|
+
xhr.send();
|
|
150
|
+
});
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
function obtenerDuracionVideoBase64(base64Data) {
|
|
154
|
+
return new Promise((resolve, reject) => {
|
|
155
|
+
const video = document.createElement('video');
|
|
156
|
+
video.src = base64Data;
|
|
157
|
+
video.addEventListener('loadedmetadata', () => {
|
|
158
|
+
resolve(video.duration);
|
|
159
|
+
});
|
|
160
|
+
video.addEventListener('error', reject);
|
|
161
|
+
});
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
|
|
110
165
|
AWS.config.update({
|
|
111
166
|
accessKeyId: process.env.REACT_APP_KUTS3,
|
|
112
167
|
secretAccessKey: process.env.REACT_APP_AKUTS3,
|
|
@@ -132,8 +187,9 @@ export const RetailerProductEdition = ({
|
|
|
132
187
|
const [datasheets, setDatasheets] = useState([]);
|
|
133
188
|
const [images, setImages] = useReducer(reducerImages, {});
|
|
134
189
|
const [showModal, setShowModal] = useState(false);
|
|
190
|
+
const [showRejectModal, setShowRejectModal] = useState(false);
|
|
135
191
|
const { getRootProps, getInputProps } = useDropzone({
|
|
136
|
-
accept: "image
|
|
192
|
+
accept: "image/*, video/mp4",
|
|
137
193
|
noKeyboard: true,
|
|
138
194
|
multiple: true,
|
|
139
195
|
noClick: true,
|
|
@@ -142,25 +198,63 @@ export const RetailerProductEdition = ({
|
|
|
142
198
|
acceptedFiles.map((file) => {
|
|
143
199
|
const reader = new FileReader();
|
|
144
200
|
reader.fileName = file.name;
|
|
145
|
-
reader.onload = function (e) {
|
|
201
|
+
reader.onload = async function (e) {
|
|
146
202
|
const ext = e.srcElement.fileName.split(".");
|
|
147
203
|
const img = new Image();
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
204
|
+
if (ext[ext.length - 1] == "mp4") {
|
|
205
|
+
obtenerDuracionVideoBase64(e.target.result)
|
|
206
|
+
.then(async (duracion) => {
|
|
207
|
+
if (duracion > 15 && duracion < 600) {
|
|
208
|
+
img.src = await generateThumbnail(e.target.result, 2);
|
|
209
|
+
setTimeout(() => {
|
|
210
|
+
const width = img.width;
|
|
211
|
+
const height = img.height;
|
|
212
|
+
const newImg = {
|
|
213
|
+
action: "addImg",
|
|
214
|
+
img: {
|
|
215
|
+
src: img.src, //e.target.result,
|
|
216
|
+
name: e.target.fileName,
|
|
217
|
+
ext: ext[ext.length - 1],
|
|
218
|
+
width: width,
|
|
219
|
+
height: height,
|
|
220
|
+
video_src:
|
|
221
|
+
ext[ext.length - 1] == "mp4" ? e.target.result : "",
|
|
222
|
+
},
|
|
223
|
+
};
|
|
224
|
+
setImages(newImg);
|
|
225
|
+
}, 500);
|
|
226
|
+
} else {
|
|
227
|
+
setModalAlert({
|
|
228
|
+
show: true,
|
|
229
|
+
title: "Hubo un error al subir el video",
|
|
230
|
+
message:
|
|
231
|
+
"Los videos deben durar entre 15 segundos y 10 minutos",
|
|
232
|
+
});
|
|
233
|
+
}
|
|
234
|
+
})
|
|
235
|
+
.catch((error) => {
|
|
236
|
+
console.error("Error al obtener la duración del video:", error);
|
|
237
|
+
});
|
|
238
|
+
} else {
|
|
239
|
+
img.src = e.target.result;
|
|
240
|
+
setTimeout(() => {
|
|
241
|
+
const width = img.width;
|
|
242
|
+
const height = img.height;
|
|
243
|
+
const newImg = {
|
|
244
|
+
action: "addImg",
|
|
245
|
+
img: {
|
|
246
|
+
src: img.src, //e.target.result,
|
|
247
|
+
name: e.target.fileName,
|
|
248
|
+
ext: ext[ext.length - 1],
|
|
249
|
+
width: width,
|
|
250
|
+
height: height,
|
|
251
|
+
video_src:
|
|
252
|
+
ext[ext.length - 1] == "mp4" ? e.target.result : "",
|
|
253
|
+
},
|
|
254
|
+
};
|
|
255
|
+
setImages(newImg);
|
|
256
|
+
}, 500);
|
|
257
|
+
}
|
|
164
258
|
};
|
|
165
259
|
reader.onerror = function (error) {
|
|
166
260
|
console.log("dropzoneError: ", error);
|
|
@@ -218,6 +312,44 @@ export const RetailerProductEdition = ({
|
|
|
218
312
|
const [auditDescriptions, setAuditDescriptions] = useState([]);
|
|
219
313
|
const [auditImages, setAuditImages] = useState([]);
|
|
220
314
|
const [compare, setCompare] = useState(false);
|
|
315
|
+
const [observation,setObservation] = useState();
|
|
316
|
+
const [valRejAll, setValRejAll] = useState(false);
|
|
317
|
+
const [modalAlert, setModalAlert] = useState({
|
|
318
|
+
show: false,
|
|
319
|
+
title: "",
|
|
320
|
+
message: "",
|
|
321
|
+
errorInputMessage: false,
|
|
322
|
+
});
|
|
323
|
+
|
|
324
|
+
const [desc, setDesc] = useState([]);
|
|
325
|
+
const [fich, setFich] = useState([]);
|
|
326
|
+
const [imag, setImag] = useState([]);
|
|
327
|
+
|
|
328
|
+
const [isObservationVisible, setObservationVisible] = useState(false);
|
|
329
|
+
|
|
330
|
+
const toggleObservation = () => {
|
|
331
|
+
setObservationVisible(!isObservationVisible);
|
|
332
|
+
};
|
|
333
|
+
// const handleClickOutside = (event) => {
|
|
334
|
+
// if (
|
|
335
|
+
// isObservationVisible &&
|
|
336
|
+
// !event.target.closest(".Observation") &&
|
|
337
|
+
// !event.target.closest(".Container")
|
|
338
|
+
// ) {
|
|
339
|
+
// hideObservation();
|
|
340
|
+
// }
|
|
341
|
+
// };
|
|
342
|
+
|
|
343
|
+
// useEffect(() => {
|
|
344
|
+
// document.addEventListener("click", handleClickOutside);
|
|
345
|
+
// return () => {
|
|
346
|
+
// document.removeEventListener("click", handleClickOutside);
|
|
347
|
+
// };
|
|
348
|
+
// }, [isObservationVisible]);
|
|
349
|
+
|
|
350
|
+
const hideObservation = () => {
|
|
351
|
+
setObservationVisible(false);
|
|
352
|
+
};
|
|
221
353
|
|
|
222
354
|
useEffect(async () => {
|
|
223
355
|
const { id_article } = product?.article || {};
|
|
@@ -628,10 +760,20 @@ export const RetailerProductEdition = ({
|
|
|
628
760
|
setImagesUploaded(false);
|
|
629
761
|
const promiseArray = [];
|
|
630
762
|
data?.articleData?.forEach((e) => {
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
763
|
+
let file;
|
|
764
|
+
if(e.ext=="mp4"){
|
|
765
|
+
file = Buffer.from(
|
|
766
|
+
e.video_src.replace(/^data:video\/\w+;base64,/, ""),
|
|
767
|
+
"base64"
|
|
768
|
+
);
|
|
769
|
+
e.video_src="";
|
|
770
|
+
}
|
|
771
|
+
else{
|
|
772
|
+
file = Buffer.from(
|
|
773
|
+
e.src.replace(/^data:image\/\w+;base64,/, ""),
|
|
774
|
+
"base64"
|
|
775
|
+
);
|
|
776
|
+
}
|
|
635
777
|
const params = {
|
|
636
778
|
ACL: "public-read",
|
|
637
779
|
Body: file,
|
|
@@ -821,84 +963,6 @@ export const RetailerProductEdition = ({
|
|
|
821
963
|
}
|
|
822
964
|
};
|
|
823
965
|
|
|
824
|
-
// const sendToFacilitator = async (result) => {
|
|
825
|
-
// setLoading(true);
|
|
826
|
-
// try {
|
|
827
|
-
// let concept = getConcept(activeTab);
|
|
828
|
-
|
|
829
|
-
// const productTemp = { ...product };
|
|
830
|
-
// const evalStatus = retailerStatus;
|
|
831
|
-
// const articleId = product.article.id_article;
|
|
832
|
-
// const orderId = product.orderId;
|
|
833
|
-
|
|
834
|
-
// // const body = {
|
|
835
|
-
// // orderArticleRetailers: [
|
|
836
|
-
// // { orderId, articleId, retailersIds: [activeRetailer.id] },
|
|
837
|
-
// // ],
|
|
838
|
-
// // isAproved: false,
|
|
839
|
-
// // service: concept,
|
|
840
|
-
// // };
|
|
841
|
-
|
|
842
|
-
// const body = {
|
|
843
|
-
// articleId: product.article.id_article,
|
|
844
|
-
// orderId: product.orderId,
|
|
845
|
-
// concept: concept,
|
|
846
|
-
// result: result,
|
|
847
|
-
// evalStatus: evalStatus,
|
|
848
|
-
// retailerId: activeRetailer.id,
|
|
849
|
-
// };
|
|
850
|
-
|
|
851
|
-
// let res;
|
|
852
|
-
// let message;
|
|
853
|
-
// if (result) {
|
|
854
|
-
// body.isAproved = result === "A";
|
|
855
|
-
// res = await axios.put(
|
|
856
|
-
// `${process.env.REACT_APP_EVALUATION_ENDPOINT}`,
|
|
857
|
-
// body,
|
|
858
|
-
// {
|
|
859
|
-
// headers: {
|
|
860
|
-
// Authorization: token,
|
|
861
|
-
// },
|
|
862
|
-
// }
|
|
863
|
-
// );
|
|
864
|
-
// console.log(JSON.parse(res.data.body), "res");
|
|
865
|
-
// getServices();
|
|
866
|
-
// } else {
|
|
867
|
-
// const specialistDone = ["RC", "RA", "CA"].includes(evalStatus);
|
|
868
|
-
|
|
869
|
-
// if (specialistDone) {
|
|
870
|
-
// message = `${activeTab} enviada a facilitador`;
|
|
871
|
-
// getSectionIcon();
|
|
872
|
-
// } else if (["IE", "AC", "RP", "RCA"].includes(evalStatus)) {
|
|
873
|
-
// message = "Evaluación enviada";
|
|
874
|
-
// getSectionIcon();
|
|
875
|
-
// }
|
|
876
|
-
// res = await axios.put(
|
|
877
|
-
// `${process.env.REACT_APP_EVALUATION_ENDPOINT}`,
|
|
878
|
-
// body,
|
|
879
|
-
// {
|
|
880
|
-
// headers: {
|
|
881
|
-
// Authorization: token,
|
|
882
|
-
// },
|
|
883
|
-
// }
|
|
884
|
-
// );
|
|
885
|
-
// }
|
|
886
|
-
// if (res.data.statusCode === 200) {
|
|
887
|
-
// const response = JSON.parse(res.data.body)?.successfulData;
|
|
888
|
-
// const statusObject =
|
|
889
|
-
// response[`${orderId}-${articleId}-${activeRetailer.id}`];
|
|
890
|
-
// productTemp.status = statusObject["generalStatus"];
|
|
891
|
-
// productTemp[`${concept}_status`] = statusObject[`${concept}Status`];
|
|
892
|
-
// await loadData();
|
|
893
|
-
// if (message) setMessage(message);
|
|
894
|
-
// sessionStorage.setItem("productSelected", JSON.stringify(productTemp));
|
|
895
|
-
// setProduct(productTemp);
|
|
896
|
-
// }
|
|
897
|
-
// } catch (error) {
|
|
898
|
-
// console.log(error);
|
|
899
|
-
// }
|
|
900
|
-
// setLoading(false);
|
|
901
|
-
// };
|
|
902
966
|
const sendToFacilitator = async (result) => {
|
|
903
967
|
setLoading(true);
|
|
904
968
|
try {
|
|
@@ -950,6 +1014,25 @@ export const RetailerProductEdition = ({
|
|
|
950
1014
|
const { newStatus, newOrderStatus, newArticleStatus } = JSON.parse(
|
|
951
1015
|
res.data.body
|
|
952
1016
|
);
|
|
1017
|
+
const messageToChat = createMessage(
|
|
1018
|
+
product.retailers,
|
|
1019
|
+
activeRetailer.id,
|
|
1020
|
+
evalStatus,
|
|
1021
|
+
newStatus,
|
|
1022
|
+
activeTab
|
|
1023
|
+
);
|
|
1024
|
+
|
|
1025
|
+
const data = {
|
|
1026
|
+
paramsBody: {
|
|
1027
|
+
id: product.article.id_article,
|
|
1028
|
+
version: version,
|
|
1029
|
+
items: [{ type: "status", value: messageToChat }],
|
|
1030
|
+
retailerId: activeRetailer.id,
|
|
1031
|
+
status: product.status,
|
|
1032
|
+
},
|
|
1033
|
+
paramsHeader: { Authorization: token },
|
|
1034
|
+
};
|
|
1035
|
+
await sendMessage(data);
|
|
953
1036
|
if (newOrderStatus) productTemp.status = newArticleStatus[articleId];
|
|
954
1037
|
productTemp[`${concept}_status`] = newStatus;
|
|
955
1038
|
await loadData();
|
|
@@ -992,35 +1075,19 @@ export const RetailerProductEdition = ({
|
|
|
992
1075
|
return product?.article[`id_auditor`] === user.id_user;
|
|
993
1076
|
};
|
|
994
1077
|
|
|
995
|
-
const createComment = async (
|
|
996
|
-
let concept = "";
|
|
997
|
-
switch (activeTab) {
|
|
998
|
-
case "Ficha técnica":
|
|
999
|
-
concept = "datasheet";
|
|
1000
|
-
break;
|
|
1001
|
-
case "Imágenes":
|
|
1002
|
-
concept = "images";
|
|
1003
|
-
break;
|
|
1004
|
-
|
|
1005
|
-
default:
|
|
1006
|
-
concept = "description";
|
|
1007
|
-
break;
|
|
1008
|
-
}
|
|
1078
|
+
const createComment = async (messages = [], retailerId) => {
|
|
1009
1079
|
const data = {
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
await axios.post(`${process.env.REACT_APP_COMMENTS_ENDPOINT}`, data, {
|
|
1017
|
-
headers: {
|
|
1018
|
-
Authorization: token,
|
|
1080
|
+
paramsBody: {
|
|
1081
|
+
id: product.article.id_article,
|
|
1082
|
+
version: version,
|
|
1083
|
+
items: messages,
|
|
1084
|
+
retailerId: retailerId,
|
|
1085
|
+
status: product.status,
|
|
1019
1086
|
},
|
|
1020
|
-
|
|
1021
|
-
|
|
1087
|
+
paramsHeader: { Authorization: token },
|
|
1088
|
+
};
|
|
1022
1089
|
setMessage("");
|
|
1023
|
-
|
|
1090
|
+
return sendMessage(data);
|
|
1024
1091
|
};
|
|
1025
1092
|
|
|
1026
1093
|
const getRequired = (services) => {
|
|
@@ -1272,6 +1339,7 @@ export const RetailerProductEdition = ({
|
|
|
1272
1339
|
};
|
|
1273
1340
|
|
|
1274
1341
|
useEffect(() => {
|
|
1342
|
+
console.log(servicesData, "servicesData");
|
|
1275
1343
|
let status = getRetailerStatus(servicesData, activeTab);
|
|
1276
1344
|
setRetailerStatus(status);
|
|
1277
1345
|
}, [activeTab, servicesData, activeRetailer]);
|
|
@@ -1284,70 +1352,6 @@ export const RetailerProductEdition = ({
|
|
|
1284
1352
|
setSaving(loading);
|
|
1285
1353
|
}, [loading]);
|
|
1286
1354
|
|
|
1287
|
-
// const validateAll = async (result) => {
|
|
1288
|
-
// try {
|
|
1289
|
-
// setLoading(true);
|
|
1290
|
-
// const evaluationArray = [];
|
|
1291
|
-
// let conceptArray = ["description", "datasheet", "images"];
|
|
1292
|
-
// switch (user.id_role) {
|
|
1293
|
-
// case 4:
|
|
1294
|
-
// conceptArray = ["description", "datasheet"];
|
|
1295
|
-
// break;
|
|
1296
|
-
// case 5:
|
|
1297
|
-
// conceptArray = ["images"];
|
|
1298
|
-
// break;
|
|
1299
|
-
|
|
1300
|
-
// default:
|
|
1301
|
-
// conceptArray = ["description", "datasheet", "images"];
|
|
1302
|
-
// break;
|
|
1303
|
-
// }
|
|
1304
|
-
|
|
1305
|
-
// const isAproved = result === "A";
|
|
1306
|
-
// const retailersIds = [];
|
|
1307
|
-
// servicesData?.forEach((ret) => {
|
|
1308
|
-
// if (!retailersIds.includes(ret.id_retailer))
|
|
1309
|
-
// retailersIds.push(ret.id_retailer);
|
|
1310
|
-
// });
|
|
1311
|
-
// const body = {
|
|
1312
|
-
// orderArticleRetailers: [
|
|
1313
|
-
// {
|
|
1314
|
-
// orderId: product.id_order ?? product.orderId,
|
|
1315
|
-
// articleId: product.article.id_article,
|
|
1316
|
-
// retailersIds,
|
|
1317
|
-
// },
|
|
1318
|
-
// ],
|
|
1319
|
-
// isAproved,
|
|
1320
|
-
// };
|
|
1321
|
-
// conceptArray.forEach((concept) => {
|
|
1322
|
-
// body.service = concept;
|
|
1323
|
-
// evaluationArray.push(
|
|
1324
|
-
// axios.put(`${process.env.REACT_APP_EVALUATION_ENDPOINT}`, body, {
|
|
1325
|
-
// headers: {
|
|
1326
|
-
// Authorization: token,
|
|
1327
|
-
// },
|
|
1328
|
-
// })
|
|
1329
|
-
// );
|
|
1330
|
-
// });
|
|
1331
|
-
|
|
1332
|
-
// await Promise.all(evaluationArray);
|
|
1333
|
-
|
|
1334
|
-
// const productTemp = product;
|
|
1335
|
-
// productTemp.status = `${result}A`;
|
|
1336
|
-
// productTemp.datasheet_status =
|
|
1337
|
-
// productTemp.datasheet_status === "NA" ? "NA" : `${result}A`;
|
|
1338
|
-
// productTemp.description_status =
|
|
1339
|
-
// productTemp.description_status === "NA" ? "NA" : `${result}A`;
|
|
1340
|
-
// productTemp.images_status =
|
|
1341
|
-
// productTemp.images_status === "NA" ? "NA" : `${result}A`;
|
|
1342
|
-
// sessionStorage.setItem("productSelected", JSON.stringify(productTemp));
|
|
1343
|
-
// setProduct(productTemp);
|
|
1344
|
-
|
|
1345
|
-
// await loadData();
|
|
1346
|
-
// } catch (error) {
|
|
1347
|
-
// console.log(error);
|
|
1348
|
-
// }
|
|
1349
|
-
// };
|
|
1350
|
-
|
|
1351
1355
|
const validateAll = async (result) => {
|
|
1352
1356
|
try {
|
|
1353
1357
|
setLoading(true);
|
|
@@ -1366,6 +1370,8 @@ export const RetailerProductEdition = ({
|
|
|
1366
1370
|
break;
|
|
1367
1371
|
}
|
|
1368
1372
|
|
|
1373
|
+
const messages = [];
|
|
1374
|
+
|
|
1369
1375
|
servicesData?.forEach((ret) => {
|
|
1370
1376
|
if (conceptArray.includes(ret.service)) {
|
|
1371
1377
|
let data = {
|
|
@@ -1385,19 +1391,19 @@ export const RetailerProductEdition = ({
|
|
|
1385
1391
|
);
|
|
1386
1392
|
}
|
|
1387
1393
|
});
|
|
1388
|
-
|
|
1389
1394
|
await Promise.all(evaluationArray);
|
|
1390
1395
|
|
|
1391
1396
|
const productTemp = product;
|
|
1392
1397
|
productTemp.status = `${result}A`;
|
|
1393
1398
|
productTemp.datasheet_status =
|
|
1394
|
-
productTemp.datasheet_status === "
|
|
1399
|
+
productTemp.datasheet_status === "NS" ? "NS" : `${result}A`;
|
|
1395
1400
|
productTemp.description_status =
|
|
1396
|
-
productTemp.description_status === "
|
|
1401
|
+
productTemp.description_status === "NS" ? "NS" : `${result}A`;
|
|
1397
1402
|
productTemp.images_status =
|
|
1398
|
-
productTemp.images_status === "
|
|
1403
|
+
productTemp.images_status === "NS" ? "NS" : `${result}A`;
|
|
1399
1404
|
sessionStorage.setItem("productSelected", JSON.stringify(productTemp));
|
|
1400
1405
|
setProduct(productTemp);
|
|
1406
|
+
const messagesResponse = await Promise.all(messages);
|
|
1401
1407
|
|
|
1402
1408
|
await loadData();
|
|
1403
1409
|
} catch (error) {
|
|
@@ -1405,6 +1411,21 @@ export const RetailerProductEdition = ({
|
|
|
1405
1411
|
}
|
|
1406
1412
|
};
|
|
1407
1413
|
|
|
1414
|
+
const getObservation = async () => {
|
|
1415
|
+
const response = await axios.get(
|
|
1416
|
+
`${process.env.REACT_APP_READ_OBSERVATION}?articleId=${product.article.id_article}&orderId=${product?.orderId}`,
|
|
1417
|
+
{
|
|
1418
|
+
headers: {
|
|
1419
|
+
Authorization: sessionStorage.getItem("jwt"),
|
|
1420
|
+
},
|
|
1421
|
+
}
|
|
1422
|
+
);
|
|
1423
|
+
const parseData = JSON.parse(response.data.body).data[0];
|
|
1424
|
+
setObservation(parseData.observations);
|
|
1425
|
+
};
|
|
1426
|
+
useEffect(() => {
|
|
1427
|
+
getObservation();
|
|
1428
|
+
}, []);
|
|
1408
1429
|
return (
|
|
1409
1430
|
<Container headerTop={headerTop}>
|
|
1410
1431
|
<HeaderTop
|
|
@@ -1413,8 +1434,10 @@ export const RetailerProductEdition = ({
|
|
|
1413
1434
|
setCompare={setCompare}
|
|
1414
1435
|
isAuditor={[1, 6].includes(user.id_role)}
|
|
1415
1436
|
withChat={location?.state?.withChat}
|
|
1416
|
-
|
|
1437
|
+
chatType={location?.state?.chatType}
|
|
1438
|
+
productSelected={product}
|
|
1417
1439
|
token={token}
|
|
1440
|
+
activeRetailer={activeRetailer}
|
|
1418
1441
|
/>
|
|
1419
1442
|
<div className="data-container">
|
|
1420
1443
|
<div className="image-data-panel">
|
|
@@ -1445,6 +1468,7 @@ export const RetailerProductEdition = ({
|
|
|
1445
1468
|
<div className="product-information">
|
|
1446
1469
|
<FullProductNameHeader
|
|
1447
1470
|
headerData={product}
|
|
1471
|
+
productObservation={observation}
|
|
1448
1472
|
percent={activePercentage}
|
|
1449
1473
|
activeRetailer={activeRetailer}
|
|
1450
1474
|
servicesData={servicesData}
|
|
@@ -1454,36 +1478,7 @@ export const RetailerProductEdition = ({
|
|
|
1454
1478
|
sendToFacilitator("A");
|
|
1455
1479
|
}}
|
|
1456
1480
|
reject={() => {
|
|
1457
|
-
|
|
1458
|
-
setMessage("Rechazado");
|
|
1459
|
-
setComponentsArray([
|
|
1460
|
-
<img src={errorModal} />,
|
|
1461
|
-
<ScreenHeader
|
|
1462
|
-
text={"Agrega tu comentarios para enviar el rechazo"}
|
|
1463
|
-
headerType={"input-name-header"}
|
|
1464
|
-
color={"white"}
|
|
1465
|
-
/>,
|
|
1466
|
-
<TagAndInput
|
|
1467
|
-
label={"Caja de Comentario"}
|
|
1468
|
-
inputType={"textarea"}
|
|
1469
|
-
inputId={"modal-commentary-box"}
|
|
1470
|
-
index={0}
|
|
1471
|
-
color={"white"}
|
|
1472
|
-
/>,
|
|
1473
|
-
<Button
|
|
1474
|
-
buttonType={"general-default-button"}
|
|
1475
|
-
label={"Enviar comentario"}
|
|
1476
|
-
onClick={(e) =>
|
|
1477
|
-
createComment(
|
|
1478
|
-
e,
|
|
1479
|
-
document.querySelector(
|
|
1480
|
-
"#modal-commentary-box .ql-container .ql-editor > p"
|
|
1481
|
-
).innerHTML,
|
|
1482
|
-
activeTab
|
|
1483
|
-
)
|
|
1484
|
-
}
|
|
1485
|
-
/>,
|
|
1486
|
-
]);
|
|
1481
|
+
setShowRejectModal(true);
|
|
1487
1482
|
}}
|
|
1488
1483
|
showApproveRejectAll={
|
|
1489
1484
|
approveRejectAllButtons() && (auditorAssigned() || userAssigned())
|
|
@@ -1493,37 +1488,13 @@ export const RetailerProductEdition = ({
|
|
|
1493
1488
|
}
|
|
1494
1489
|
approveAll={() => validateAll("A")}
|
|
1495
1490
|
rejectAll={() => {
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
setComponentsArray([
|
|
1499
|
-
<img src={errorModal} />,
|
|
1500
|
-
<ScreenHeader
|
|
1501
|
-
text={"Agrega tu comentarios para enviar el rechazo"}
|
|
1502
|
-
headerType={"input-name-header"}
|
|
1503
|
-
color={"white"}
|
|
1504
|
-
/>,
|
|
1505
|
-
<TagAndInput
|
|
1506
|
-
label={"Caja de Comentario"}
|
|
1507
|
-
inputType={"textarea"}
|
|
1508
|
-
inputId={"modal-commentary-box"}
|
|
1509
|
-
index={0}
|
|
1510
|
-
color={"white"}
|
|
1511
|
-
/>,
|
|
1512
|
-
<Button
|
|
1513
|
-
buttonType={"general-default-button"}
|
|
1514
|
-
label={"Enviar comentario"}
|
|
1515
|
-
onClick={(e) =>
|
|
1516
|
-
createComment(
|
|
1517
|
-
e,
|
|
1518
|
-
document.querySelector(
|
|
1519
|
-
"#modal-commentary-box .ql-container .ql-editor > p"
|
|
1520
|
-
).innerHTML,
|
|
1521
|
-
activeTab
|
|
1522
|
-
)
|
|
1523
|
-
}
|
|
1524
|
-
/>,
|
|
1525
|
-
]);
|
|
1491
|
+
setShowRejectModal(true);
|
|
1492
|
+
setValRejAll(true);
|
|
1526
1493
|
}}
|
|
1494
|
+
isObservationVisible={isObservationVisible}
|
|
1495
|
+
toggleObservation={toggleObservation}
|
|
1496
|
+
// handleClickOutside={handleClickOutside}
|
|
1497
|
+
hideObservation={hideObservation}
|
|
1527
1498
|
/>
|
|
1528
1499
|
<FullTabsMenu
|
|
1529
1500
|
tabsSections={tabsSections}
|
|
@@ -1538,6 +1509,12 @@ export const RetailerProductEdition = ({
|
|
|
1538
1509
|
isRetailer={isRetailer}
|
|
1539
1510
|
showSaveButton={auditorAssigned() || userAssigned()}
|
|
1540
1511
|
version={version}
|
|
1512
|
+
desc={desc}
|
|
1513
|
+
setDesc={setDesc}
|
|
1514
|
+
fich={fich}
|
|
1515
|
+
setFich={setFich}
|
|
1516
|
+
imag={imag}
|
|
1517
|
+
setImag={setImag}
|
|
1541
1518
|
updatedDescriptions={updatedDescriptions}
|
|
1542
1519
|
setUpdatedDescriptions={setUpdatedDescriptions}
|
|
1543
1520
|
updatedDatasheets={updatedDatasheets}
|
|
@@ -1652,47 +1629,6 @@ export const RetailerProductEdition = ({
|
|
|
1652
1629
|
{(userAssigned(activeTab) || auditorAssigned()) &&
|
|
1653
1630
|
product[`${getConcept(activeTab)}_status`] !== "NS" && (
|
|
1654
1631
|
<div className="commentary-box">
|
|
1655
|
-
{!comment ? (
|
|
1656
|
-
<div className="commentary">
|
|
1657
|
-
<TagAndInput
|
|
1658
|
-
label={"Caja de Comentario"}
|
|
1659
|
-
inputType={"textarea"}
|
|
1660
|
-
inputCols={80}
|
|
1661
|
-
inputRows={4}
|
|
1662
|
-
inputId={"commentary-box"}
|
|
1663
|
-
index={0}
|
|
1664
|
-
/>
|
|
1665
|
-
<div className="buttons-box">
|
|
1666
|
-
<Button
|
|
1667
|
-
buttonType={"general-transparent-button"}
|
|
1668
|
-
label={"Enviar comentario"}
|
|
1669
|
-
onClick={(e) =>
|
|
1670
|
-
createComment(
|
|
1671
|
-
e,
|
|
1672
|
-
document.querySelector(
|
|
1673
|
-
"#commentary-box .ql-container .ql-editor > p"
|
|
1674
|
-
).innerHTML,
|
|
1675
|
-
activeTab
|
|
1676
|
-
)
|
|
1677
|
-
}
|
|
1678
|
-
/>
|
|
1679
|
-
</div>
|
|
1680
|
-
</div>
|
|
1681
|
-
) : (
|
|
1682
|
-
<div className="feedback-box">
|
|
1683
|
-
<Commentary
|
|
1684
|
-
comment={comment?.message?.replace(/<.*?\/?>/gm, "")}
|
|
1685
|
-
reviewed={crossComment}
|
|
1686
|
-
/>
|
|
1687
|
-
<Button
|
|
1688
|
-
buttonType={"circular-button accept-button"}
|
|
1689
|
-
onClick={async () => {
|
|
1690
|
-
setCrossComment(true);
|
|
1691
|
-
commentRevised();
|
|
1692
|
-
}}
|
|
1693
|
-
/>
|
|
1694
|
-
</div>
|
|
1695
|
-
)}
|
|
1696
1632
|
{[7, 8].includes(user.id_role) && (
|
|
1697
1633
|
<Button
|
|
1698
1634
|
buttonType={
|
|
@@ -1750,6 +1686,63 @@ export const RetailerProductEdition = ({
|
|
|
1750
1686
|
jwt={token}
|
|
1751
1687
|
/>
|
|
1752
1688
|
)}
|
|
1689
|
+
{showRejectModal && (
|
|
1690
|
+
<Modal
|
|
1691
|
+
title={`Agregar mensaje de rechazo para ${activeTab?.toLowerCase()}`}
|
|
1692
|
+
show={showRejectModal}
|
|
1693
|
+
customComponent={
|
|
1694
|
+
<TagAndInput
|
|
1695
|
+
inputType={"textarea"}
|
|
1696
|
+
inputId={"modal-message-box"}
|
|
1697
|
+
index={0}
|
|
1698
|
+
color={"white"}
|
|
1699
|
+
/>
|
|
1700
|
+
}
|
|
1701
|
+
buttons={[
|
|
1702
|
+
<ButtonV2
|
|
1703
|
+
key={"btn-Cancelar"}
|
|
1704
|
+
type={"white"}
|
|
1705
|
+
label={"Cancelar"}
|
|
1706
|
+
size={12}
|
|
1707
|
+
onClick={() => {
|
|
1708
|
+
setShowRejectModal(false);
|
|
1709
|
+
}}
|
|
1710
|
+
/>,
|
|
1711
|
+
<ButtonV2
|
|
1712
|
+
key={"btn-Aceptar"}
|
|
1713
|
+
type={"pink"}
|
|
1714
|
+
label={"Aceptar"}
|
|
1715
|
+
size={12}
|
|
1716
|
+
onClick={async () => {
|
|
1717
|
+
const body = document.querySelector(
|
|
1718
|
+
"#modal-message-box .ql-container .ql-editor > p"
|
|
1719
|
+
).innerHTML;
|
|
1720
|
+
const messages = [
|
|
1721
|
+
{ type: "message", value: body?.replace(/<.*?\/?>/gm, "") },
|
|
1722
|
+
];
|
|
1723
|
+
await createComment(messages, activeRetailer.id);
|
|
1724
|
+
valRejAll ? validateAll("R") : sendToFacilitator("R");
|
|
1725
|
+
setMessage("Rechazado");
|
|
1726
|
+
setShowRejectModal(false);
|
|
1727
|
+
}}
|
|
1728
|
+
/>,
|
|
1729
|
+
]}
|
|
1730
|
+
/>
|
|
1731
|
+
)}
|
|
1732
|
+
<Modal
|
|
1733
|
+
className="container-modalAlert"
|
|
1734
|
+
show={modalAlert.show}
|
|
1735
|
+
title={modalAlert.title}
|
|
1736
|
+
message={modalAlert.message}
|
|
1737
|
+
icon={"info"}
|
|
1738
|
+
onClickBtnDefault={(event) => {
|
|
1739
|
+
setModalAlert((prev) => ({
|
|
1740
|
+
...prev,
|
|
1741
|
+
show: false,
|
|
1742
|
+
errorInputMessage: false,
|
|
1743
|
+
}));
|
|
1744
|
+
}}
|
|
1745
|
+
/>
|
|
1753
1746
|
</Container>
|
|
1754
1747
|
);
|
|
1755
1748
|
};
|