contentoh-components-library 21.5.2 → 21.5.3
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/Table/styles.js +1 -1
- package/dist/components/pages/MultipleEdition/saveData.js +19 -9
- package/dist/components/pages/MultipleEdition/styles.js +1 -1
- package/dist/components/pages/MultipleEdition/utils.js +153 -86
- package/package.json +1 -4
- package/src/components/atoms/Avatar/index.js +2 -8
- package/src/components/atoms/ButtonV2/ButtonV2.stories.js +0 -1
- package/src/components/atoms/ButtonV2/index.js +0 -1
- package/src/components/atoms/ButtonV2/styles.js +0 -16
- package/src/components/atoms/CheckBox/CheckBox.stories.js +0 -5
- package/src/components/atoms/CheckBox/index.js +1 -5
- package/src/components/atoms/CheckBox/styles.js +3 -9
- package/src/components/atoms/GeneralButton/styles.js +0 -46
- package/src/components/atoms/GeneralInput/index.js +0 -3
- package/src/components/atoms/GeneralInput/styles.js +1 -19
- package/src/components/atoms/InputFormatter/index.js +1 -2
- package/src/components/atoms/InputFormatter/styles.js +4 -9
- package/src/components/atoms/ProductImage/index.js +11 -24
- package/src/components/atoms/ProductImage/styles.js +0 -7
- 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 +3 -0
- package/src/components/molecules/BoxAttribute/index.js +25 -32
- package/src/components/molecules/BoxAttribute/styles.js +1 -1
- package/src/components/molecules/BoxButtons/index.js +22 -23
- package/src/components/molecules/CarouselImagesLogin/index.js +1 -1
- package/src/components/molecules/GalleryElement/index.js +1 -76
- package/src/components/molecules/GalleryHeader/index.js +0 -1
- package/src/components/molecules/HeaderTop/index.js +6 -52
- package/src/components/molecules/ProductNameHeader/index.js +1 -19
- package/src/components/molecules/SignInLogin/index.js +11 -11
- package/src/components/molecules/StatusAsignationInfo/FinancedCompanies.js +63 -501
- package/src/components/molecules/StatusAsignationInfo/index.js +1 -1
- package/src/components/molecules/StripeCardSelector/CardSelector.stories.js +2 -1
- package/src/components/molecules/TagAndInput/index.js +6 -8
- package/src/components/organisms/Chat/Chat.stories.js +7 -27
- package/src/components/organisms/Chat/ContainerItems/index.js +2 -18
- package/src/components/organisms/Chat/ContainerItems/styles.js +2 -14
- package/src/components/organisms/Chat/ContentChat/index.js +12 -88
- package/src/components/organisms/Chat/Footer/index.js +0 -11
- package/src/components/organisms/Chat/index.js +4 -46
- package/src/components/organisms/Chat/styles.js +0 -4
- package/src/components/organisms/DashboardMetric/index.js +3 -6
- package/src/components/organisms/FullProductNameHeader/index.js +1 -13
- package/src/components/organisms/GridProducts/GridProducts.stories.js +107 -682
- package/src/components/organisms/InputGroup/index.js +144 -292
- package/src/components/organisms/InputGroup/styles.js +0 -31
- package/src/components/organisms/Modal/Modal.stories.js +1 -2
- package/src/components/organisms/Modal/index.js +2 -9
- package/src/components/organisms/Modal/styles.js +1 -8
- package/src/components/organisms/OrderDetail/utils/Table/utils.js +16 -6
- package/src/components/pages/Dashboard/Dashboard.stories.js +38 -33
- package/src/components/pages/Dashboard/index.js +7 -36
- package/src/components/pages/ProviderProductEdition/ProviderProductEdition.stories.js +60 -56
- package/src/components/pages/ProviderProductEdition/index.js +133 -148
- package/src/components/pages/ProviderProductEdition/styles.js +1 -5
- package/src/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +0 -4
- package/src/components/pages/RetailerProductEdition/index.js +300 -293
- package/src/components/pages/RetailerProductEdition/styles.js +0 -4
- package/src/components/pages/RetailerProductEdition/utils.js +0 -37
- package/src/global-files/data.js +10 -6
- package/src/global-files/variables.js +0 -6
- package/src/index.js +0 -12
- package/src/assets/images/Icons/addv2.svg +0 -8
- package/src/assets/images/Icons/beenhere.svg +0 -9
- package/src/assets/images/Icons/checkv2.svg +0 -8
- package/src/assets/images/Icons/close-magenta.svg +0 -9
- package/src/assets/images/Icons/close.svg +0 -8
- package/src/assets/images/Icons/closeCircle.svg +0 -8
- package/src/assets/images/Icons/delete-forever-red.svg +0 -9
- package/src/assets/images/Icons/delete-forever-white.svg +0 -10
- package/src/assets/images/Icons/edit.svg +0 -8
- package/src/assets/images/Icons/fullscreen.svg +0 -3
- package/src/assets/images/Icons/infoNR.svg +0 -8
- package/src/assets/images/Icons/options.svg +0 -3
- package/src/assets/images/Icons/save-white-gray.svg +0 -9
- package/src/assets/images/Icons/save-white.svg +0 -9
- package/src/assets/images/Icons/save.svg +0 -8
- package/src/assets/images/Icons/search.svg +0 -3
- package/src/assets/images/Icons/settings.svg +0 -8
- package/src/assets/images/Icons/trash.svg +0 -8
- package/src/assets/images/Icons/undo.svg +0 -8
- package/src/assets/images/Icons/upload-file-white.svg +0 -4
- package/src/assets/images/Icons/upload-file.svg +0 -10
- package/src/assets/images/Icons/upload_file.svg +0 -10
- package/src/assets/images/Icons/warningv2.svg +0 -3
- package/src/assets/images/checkBox/checkrosa.svg +0 -3
- package/src/assets/images/checkBox/checkverde.svg +0 -3
- package/src/assets/images/flagsv2/highPriority.svg +0 -3
- package/src/assets/images/flagsv2/lowPriority.svg +0 -3
- package/src/assets/images/flagsv2/mediumPriority.svg +0 -3
- package/src/assets/images/flagsv2/noPriority.svg +0 -3
- package/src/assets/images/generalButton/closeIconWhite.svg +0 -4
- package/src/assets/images/generalButton/closeIconv2.svg +0 -4
- package/src/assets/images/generalButton/saveIconpink.svg +0 -3
- package/src/components/atoms/CharsMissing/Wysiwyg.stories.js +0 -12
- package/src/components/atoms/CharsMissing/index.js +0 -60
- package/src/components/atoms/CharsMissing/styles.js +0 -44
- package/src/components/atoms/CustomChip/CustomChip.stories.js +0 -16
- package/src/components/atoms/CustomChip/index.js +0 -34
- package/src/components/atoms/CustomChip/styles.js +0 -6
- package/src/components/atoms/FeatureTagv2/FeatureTagv2.stories.js +0 -16
- package/src/components/atoms/FeatureTagv2/index.js +0 -10
- package/src/components/atoms/FeatureTagv2/styles.js +0 -56
- package/src/components/atoms/GeneralInputv2/GeneralInputv2.stories.js +0 -33
- package/src/components/atoms/GeneralInputv2/index.js +0 -155
- package/src/components/atoms/GeneralInputv2/styles.js +0 -67
- package/src/components/atoms/InputFormatterv2/Wysiwyg.stories.js +0 -12
- package/src/components/atoms/InputFormatterv2/index.js +0 -148
- package/src/components/atoms/InputFormatterv2/styles.js +0 -39
- package/src/components/atoms/InputImages/InputImages.stories.js +0 -19
- package/src/components/atoms/InputImages/index.js +0 -25
- package/src/components/atoms/InputImages/styles.js +0 -17
- package/src/components/atoms/Multiselect/Multiselect.stories.js +0 -364
- package/src/components/atoms/Multiselect/index.js +0 -351
- package/src/components/atoms/Multiselect/styles.js +0 -33
- package/src/components/atoms/NumberMandatory/NumberMandatory.stories.js +0 -19
- package/src/components/atoms/NumberMandatory/index.js +0 -16
- package/src/components/atoms/NumberMandatory/styles.js +0 -11
- package/src/components/atoms/ObservationFlag/ObservationFlag.stories.js +0 -20
- package/src/components/atoms/ObservationFlag/index.js +0 -167
- package/src/components/atoms/ObservationFlag/styles.js +0 -104
- package/src/components/atoms/PriorityFlagv2/PriorityFlagv2.stories.js +0 -20
- package/src/components/atoms/PriorityFlagv2/index.js +0 -20
- package/src/components/atoms/PriorityFlagv2/styles.js +0 -6
- package/src/components/atoms/ProductImagev2/ProductImagev2.stories.js +0 -28
- package/src/components/atoms/ProductImagev2/index.js +0 -16
- package/src/components/atoms/ProductImagev2/styles.js +0 -62
- package/src/components/atoms/Progress/Progress.stories.js +0 -25
- package/src/components/atoms/Progress/index.js +0 -74
- package/src/components/atoms/Progress/styles.js +0 -98
- package/src/components/atoms/ScreenHeaderv2/ScreenHeaderv2.stories.js +0 -53
- package/src/components/atoms/ScreenHeaderv2/index.js +0 -134
- package/src/components/atoms/ScreenHeaderv2/styles.js +0 -103
- package/src/components/atoms/Selectv2/VersionSelect.js +0 -27
- package/src/components/atoms/Selectv2/index.js +0 -35
- package/src/components/atoms/Selectv2/style.js +0 -93
- package/src/components/atoms/TabSectionv2/TabSection.stories.js +0 -25
- package/src/components/atoms/TabSectionv2/index.js +0 -9
- package/src/components/atoms/TabSectionv2/styles.js +0 -20
- package/src/components/atoms/TooltipLight/Tooltip.stories.js +0 -20
- package/src/components/atoms/TooltipLight/index.js +0 -46
- package/src/components/atoms/TooltipLight/styles.js +0 -65
- package/src/components/atoms/WordsMissing/Wysiwyg.stories.js +0 -12
- package/src/components/atoms/WordsMissing/index.js +0 -60
- package/src/components/atoms/WordsMissing/styles.js +0 -10
- package/src/components/molecules/AddGroup/AddGroup.stories.js +0 -15
- package/src/components/molecules/AddGroup/index.js +0 -84
- package/src/components/molecules/AddGroup/styles.js +0 -141
- package/src/components/molecules/AsignationInfo/AsignationInfo.stories.js +0 -17
- package/src/components/molecules/AsignationInfo/index.js +0 -108
- package/src/components/molecules/AsignationInfo/styles.js +0 -86
- package/src/components/molecules/EditionActiveImagev2/EditionActiveImagev2.stories.js +0 -12
- package/src/components/molecules/EditionActiveImagev2/index.js +0 -15
- package/src/components/molecules/EditionActiveImagev2/styles.js +0 -7
- package/src/components/molecules/EditionTabs/EditionTabs.stories.js +0 -12
- package/src/components/molecules/EditionTabs/index.js +0 -33
- package/src/components/molecules/EditionTabs/styles.js +0 -24
- package/src/components/molecules/FeaturesBarv2/FeaturesBarv2.stories.js +0 -20
- package/src/components/molecules/FeaturesBarv2/index.js +0 -32
- package/src/components/molecules/FeaturesBarv2/styles.js +0 -17
- package/src/components/molecules/GalleryElementv2/GalleryElementv2.stories.js +0 -30
- package/src/components/molecules/GalleryElementv2/index.js +0 -142
- package/src/components/molecules/GalleryElementv2/styles.js +0 -119
- package/src/components/molecules/GalleryHeaderv2/GalleryHeaderv2.stories.js +0 -10
- package/src/components/molecules/GalleryHeaderv2/index.js +0 -25
- package/src/components/molecules/GalleryHeaderv2/styles.js +0 -47
- package/src/components/molecules/GroupSelect/GroupSelect.stories.js +0 -35
- package/src/components/molecules/GroupSelect/SelectItem.js +0 -105
- package/src/components/molecules/GroupSelect/index.js +0 -190
- package/src/components/molecules/GroupSelect/styles.js +0 -124
- package/src/components/molecules/HeaderTopv2/HeaderTopv2.stories.js +0 -10
- package/src/components/molecules/HeaderTopv2/index.js +0 -100
- package/src/components/molecules/HeaderTopv2/styles.js +0 -33
- package/src/components/molecules/ImageSelectorv2/ImageSelectorv2.stories.js +0 -46
- package/src/components/molecules/ImageSelectorv2/index.js +0 -22
- package/src/components/molecules/ImageSelectorv2/styles.js +0 -15
- package/src/components/molecules/Phase/Phase.stories.js +0 -107
- package/src/components/molecules/Phase/index.js +0 -391
- package/src/components/molecules/Phase/styles.js +0 -97
- package/src/components/molecules/ProductNameHeaderv2/ProductNameHeaderv2.stories.js +0 -37
- package/src/components/molecules/ProductNameHeaderv2/index.js +0 -12
- package/src/components/molecules/ProductNameHeaderv2/styles.js +0 -10
- package/src/components/molecules/ProductSkuStatus/ProductSkuStatus.stories.js +0 -37
- package/src/components/molecules/ProductSkuStatus/index.js +0 -26
- package/src/components/molecules/ProductSkuStatus/styles.js +0 -7
- package/src/components/molecules/RetailerSelectorv2/RetailerSelectorv2.stories.js +0 -35
- package/src/components/molecules/RetailerSelectorv2/index.js +0 -80
- package/src/components/molecules/RetailerSelectorv2/styles.js +0 -21
- package/src/components/molecules/ServiceDataValidator/ServiceDataValidator.stories.js +0 -90
- package/src/components/molecules/ServiceDataValidator/index.js +0 -49
- package/src/components/molecules/ServiceDataValidator/styles.js +0 -36
- package/src/components/molecules/StatusRetailer/StatusAsignationInfo.stories.js +0 -17
- package/src/components/molecules/StatusRetailer/index.js +0 -55
- package/src/components/molecules/StatusRetailer/styles.js +0 -85
- package/src/components/molecules/TabsMenuv2/TabsMenuv2.stories.js +0 -19
- package/src/components/molecules/TabsMenuv2/index.js +0 -112
- package/src/components/molecules/TabsMenuv2/styles.js +0 -19
- package/src/components/molecules/TagAndInputv2/TagAndInputv2.stories.js +0 -24
- package/src/components/molecules/TagAndInputv2/index.js +0 -86
- package/src/components/molecules/TagAndInputv2/styles.js +0 -35
- package/src/components/molecules/Validation/Validation.stories.js +0 -12
- package/src/components/molecules/Validation/index.js +0 -77
- package/src/components/molecules/Validation/styles.js +0 -19
- package/src/components/molecules/VersionItemv2/VersionItemv2.stories.js +0 -14
- package/src/components/molecules/VersionItemv2/index.js +0 -59
- package/src/components/molecules/VersionItemv2/styles.js +0 -47
- package/src/components/organisms/BarButtons/BarButtons.stories.js +0 -13
- package/src/components/organisms/BarButtons/index.js +0 -150
- package/src/components/organisms/BarButtons/styles.js +0 -54
- package/src/components/organisms/Chatv2/ChatLists/ChatLists.stories.js +0 -65
- 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 +0 -141
- package/src/components/organisms/Chatv2/ChatLists/styles.js +0 -162
- package/src/components/organisms/Chatv2/Chatv2.stories.js +0 -184
- package/src/components/organisms/Chatv2/ContainerItems/ContainerItems.stories.js +0 -142
- package/src/components/organisms/Chatv2/ContainerItems/index.js +0 -538
- package/src/components/organisms/Chatv2/ContainerItems/styles.js +0 -360
- package/src/components/organisms/Chatv2/ContentChat/ContentChat.stories.js +0 -102
- 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 +0 -1016
- package/src/components/organisms/Chatv2/ContentChat/styles.js +0 -44
- package/src/components/organisms/Chatv2/Footer/Footer.stories.js +0 -22
- package/src/components/organisms/Chatv2/Footer/index.js +0 -668
- package/src/components/organisms/Chatv2/Footer/styles.js +0 -290
- package/src/components/organisms/Chatv2/Header/Header.stories.js +0 -66
- package/src/components/organisms/Chatv2/Header/index.js +0 -93
- package/src/components/organisms/Chatv2/Header/styles.js +0 -49
- package/src/components/organisms/Chatv2/index.js +0 -281
- package/src/components/organisms/Chatv2/styles.js +0 -85
- package/src/components/organisms/CompleteServices/CompleteServices.stories.js +0 -91
- package/src/components/organisms/CompleteServices/index.js +0 -82
- package/src/components/organisms/CompleteServices/styles.js +0 -35
- package/src/components/organisms/DragAndDropPhases/DragAndDropPhases.stories.js +0 -13
- package/src/components/organisms/DragAndDropPhases/index.js +0 -336
- package/src/components/organisms/DragAndDropPhases/styles.js +0 -107
- package/src/components/organisms/DragPrueba/DragPrueba.stories.js +0 -12
- package/src/components/organisms/DragPrueba/index.js +0 -57
- package/src/components/organisms/DragPrueba/styles.js +0 -8
- package/src/components/organisms/EditGroup/EditGroup.stories.js +0 -20
- package/src/components/organisms/EditGroup/index.js +0 -321
- package/src/components/organisms/EditGroup/styles.js +0 -207
- package/src/components/organisms/FullProductNamev2/FullProductNamev2.stories.js +0 -28
- package/src/components/organisms/FullProductNamev2/index.js +0 -101
- package/src/components/organisms/FullProductNamev2/styles.js +0 -49
- package/src/components/organisms/FullTabsMenuv2/FullTabsMenuv2.stories.js +0 -22
- package/src/components/organisms/FullTabsMenuv2/index.js +0 -142
- package/src/components/organisms/FullTabsMenuv2/styles.js +0 -47
- package/src/components/organisms/ImageDataTablev2/ImageDataTablev2.stories.js +0 -24
- package/src/components/organisms/ImageDataTablev2/index.js +0 -124
- package/src/components/organisms/ImageDataTablev2/styles.js +0 -18
- package/src/components/organisms/ImagePreviewerv2/ImagePreviewerv2.stories.js +0 -38
- package/src/components/organisms/ImagePreviewerv2/index.js +0 -22
- package/src/components/organisms/ImagePreviewerv2/styles.js +0 -7
- package/src/components/organisms/ImageUploader/ImageUploader.stories.js +0 -15
- package/src/components/organisms/ImageUploader/index.js +0 -62
- package/src/components/organisms/ImageUploader/styles.js +0 -29
- package/src/components/organisms/ImageVisor/ImageVisor.stories.js +0 -15
- package/src/components/organisms/ImageVisor/index.js +0 -143
- package/src/components/organisms/ImageVisor/styles.js +0 -106
- package/src/components/organisms/InputGroupv2/InputGroupv2.stories.js +0 -31
- package/src/components/organisms/InputGroupv2/index.js +0 -296
- package/src/components/organisms/InputGroupv2/styles.js +0 -90
- package/src/components/organisms/MandatoryBar/MandatoryBar.stories.js +0 -18
- package/src/components/organisms/MandatoryBar/index.js +0 -31
- package/src/components/organisms/MandatoryBar/styles.js +0 -12
- package/src/components/organisms/ProductImageModalv2/ProductImageModalv2.stories.js +0 -90
- package/src/components/organisms/ProductImageModalv2/index.js +0 -105
- package/src/components/organisms/ProductImageModalv2/styles.js +0 -71
- package/src/components/organisms/RenameImagesBar/RenameImagesBar.stories.js +0 -18
- package/src/components/organisms/RenameImagesBar/index.js +0 -30
- package/src/components/organisms/RenameImagesBar/styles.js +0 -12
- package/src/components/organisms/Table/Table.stories.js +0 -609
- package/src/components/organisms/Table/index.js +0 -84
- package/src/components/organisms/Table/styles.js +0 -114
- package/src/components/organisms/VersionSelectorv2/VersionSelectorv2.stories.js +0 -15
- package/src/components/organisms/VersionSelectorv2/index.js +0 -105
- package/src/components/organisms/VersionSelectorv2/styles.js +0 -45
- package/src/components/pages/MultipleEdition/MultipleEdition.stories.js +0 -17
- package/src/components/pages/MultipleEdition/components/ImageUploader.js +0 -62
- package/src/components/pages/MultipleEdition/components/ImageUploaderStyles.js +0 -29
- package/src/components/pages/MultipleEdition/components/ImageVisor.js +0 -143
- package/src/components/pages/MultipleEdition/components/styles.js +0 -106
- package/src/components/pages/MultipleEdition/index.js +0 -248
- package/src/components/pages/MultipleEdition/saveData.js +0 -92
- package/src/components/pages/MultipleEdition/styles.js +0 -201
- package/src/components/pages/MultipleEdition/utils.js +0 -1073
- package/src/components/pages/ProductEditionv2/ProductEditionv2.stories.js +0 -213
- package/src/components/pages/ProductEditionv2/index.js +0 -1758
- package/src/components/pages/ProductEditionv2/styles.js +0 -154
- package/src/components/pages/RetailerProductEdition/generateThumnail.js +0 -21
|
@@ -24,21 +24,15 @@ 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";
|
|
27
28
|
import { GenericModal } from "../../atoms/GenericModal";
|
|
28
29
|
import { ScreenHeader } from "../../atoms/ScreenHeader";
|
|
29
30
|
import { Loading } from "../../atoms/Loading";
|
|
30
31
|
import succes from "../../../assets/images/genericModal/genericModalCheck.svg";
|
|
32
|
+
import errorModal from "../../../assets/images/genericModal/errorModal.svg";
|
|
31
33
|
import { VersionSelector } from "../../organisms/VersionSelector";
|
|
32
34
|
import { useCloseModal } from "../../../global-files/customHooks";
|
|
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";
|
|
35
|
+
import { getAuditVersion, getInputsData } from "./utils";
|
|
42
36
|
|
|
43
37
|
const reducerImages = (state, action) => {
|
|
44
38
|
let { values, attrForImgs, inputsByRetailer } = state;
|
|
@@ -92,20 +86,7 @@ const reducerImages = (state, action) => {
|
|
|
92
86
|
action.retailerId &&
|
|
93
87
|
inputsByRetailer[action.retailerId]?.filter((input) => {
|
|
94
88
|
imageIdArray.push(input.id_image);
|
|
95
|
-
valuesInitial.forEach(
|
|
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
|
-
}
|
|
89
|
+
valuesInitial.forEach((value) => {
|
|
109
90
|
if (value.image_id === input.id_image) orderedImages.push(value);
|
|
110
91
|
});
|
|
111
92
|
});
|
|
@@ -126,42 +107,6 @@ const reducerImages = (state, action) => {
|
|
|
126
107
|
const S3_BUCKET = process.env.REACT_APP_IMAGES_BUCKET;
|
|
127
108
|
const REGION = "us-east-1";
|
|
128
109
|
|
|
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
|
-
|
|
165
110
|
AWS.config.update({
|
|
166
111
|
accessKeyId: process.env.REACT_APP_KUTS3,
|
|
167
112
|
secretAccessKey: process.env.REACT_APP_AKUTS3,
|
|
@@ -187,9 +132,8 @@ export const RetailerProductEdition = ({
|
|
|
187
132
|
const [datasheets, setDatasheets] = useState([]);
|
|
188
133
|
const [images, setImages] = useReducer(reducerImages, {});
|
|
189
134
|
const [showModal, setShowModal] = useState(false);
|
|
190
|
-
const [showRejectModal, setShowRejectModal] = useState(false);
|
|
191
135
|
const { getRootProps, getInputProps } = useDropzone({
|
|
192
|
-
accept: "image
|
|
136
|
+
accept: "image/*",
|
|
193
137
|
noKeyboard: true,
|
|
194
138
|
multiple: true,
|
|
195
139
|
noClick: true,
|
|
@@ -198,63 +142,25 @@ export const RetailerProductEdition = ({
|
|
|
198
142
|
acceptedFiles.map((file) => {
|
|
199
143
|
const reader = new FileReader();
|
|
200
144
|
reader.fileName = file.name;
|
|
201
|
-
reader.onload =
|
|
145
|
+
reader.onload = function (e) {
|
|
202
146
|
const ext = e.srcElement.fileName.split(".");
|
|
203
147
|
const img = new Image();
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
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
|
-
}
|
|
148
|
+
img.src = e.target.result;
|
|
149
|
+
setTimeout(() => {
|
|
150
|
+
const width = img.width;
|
|
151
|
+
const height = img.height;
|
|
152
|
+
const newImg = {
|
|
153
|
+
action: "addImg",
|
|
154
|
+
img: {
|
|
155
|
+
src: e.target.result,
|
|
156
|
+
name: e.target.fileName,
|
|
157
|
+
ext: ext[ext.length - 1],
|
|
158
|
+
width: width,
|
|
159
|
+
height: height,
|
|
160
|
+
},
|
|
161
|
+
};
|
|
162
|
+
setImages(newImg);
|
|
163
|
+
}, 500);
|
|
258
164
|
};
|
|
259
165
|
reader.onerror = function (error) {
|
|
260
166
|
console.log("dropzoneError: ", error);
|
|
@@ -312,44 +218,6 @@ export const RetailerProductEdition = ({
|
|
|
312
218
|
const [auditDescriptions, setAuditDescriptions] = useState([]);
|
|
313
219
|
const [auditImages, setAuditImages] = useState([]);
|
|
314
220
|
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
|
-
};
|
|
353
221
|
|
|
354
222
|
useEffect(async () => {
|
|
355
223
|
const { id_article } = product?.article || {};
|
|
@@ -760,20 +628,10 @@ export const RetailerProductEdition = ({
|
|
|
760
628
|
setImagesUploaded(false);
|
|
761
629
|
const promiseArray = [];
|
|
762
630
|
data?.articleData?.forEach((e) => {
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
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
|
-
}
|
|
631
|
+
const file = Buffer.from(
|
|
632
|
+
e.src.replace(/^data:image\/\w+;base64,/, ""),
|
|
633
|
+
"base64"
|
|
634
|
+
);
|
|
777
635
|
const params = {
|
|
778
636
|
ACL: "public-read",
|
|
779
637
|
Body: file,
|
|
@@ -963,6 +821,84 @@ export const RetailerProductEdition = ({
|
|
|
963
821
|
}
|
|
964
822
|
};
|
|
965
823
|
|
|
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
|
+
// };
|
|
966
902
|
const sendToFacilitator = async (result) => {
|
|
967
903
|
setLoading(true);
|
|
968
904
|
try {
|
|
@@ -1014,25 +950,6 @@ export const RetailerProductEdition = ({
|
|
|
1014
950
|
const { newStatus, newOrderStatus, newArticleStatus } = JSON.parse(
|
|
1015
951
|
res.data.body
|
|
1016
952
|
);
|
|
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);
|
|
1036
953
|
if (newOrderStatus) productTemp.status = newArticleStatus[articleId];
|
|
1037
954
|
productTemp[`${concept}_status`] = newStatus;
|
|
1038
955
|
await loadData();
|
|
@@ -1075,19 +992,35 @@ export const RetailerProductEdition = ({
|
|
|
1075
992
|
return product?.article[`id_auditor`] === user.id_user;
|
|
1076
993
|
};
|
|
1077
994
|
|
|
1078
|
-
const createComment = async (
|
|
995
|
+
const createComment = async (e, body, tab) => {
|
|
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
|
+
}
|
|
1079
1009
|
const data = {
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
status: product.status,
|
|
1086
|
-
},
|
|
1087
|
-
paramsHeader: { Authorization: token },
|
|
1010
|
+
articleId: product?.article?.id_article,
|
|
1011
|
+
orderId: product?.orderId,
|
|
1012
|
+
message: body?.replace(/<.*?\/?>/gm, ""),
|
|
1013
|
+
concept: concept,
|
|
1014
|
+
version: version,
|
|
1088
1015
|
};
|
|
1016
|
+
await axios.post(`${process.env.REACT_APP_COMMENTS_ENDPOINT}`, data, {
|
|
1017
|
+
headers: {
|
|
1018
|
+
Authorization: token,
|
|
1019
|
+
},
|
|
1020
|
+
});
|
|
1021
|
+
await getComments(tab);
|
|
1089
1022
|
setMessage("");
|
|
1090
|
-
|
|
1023
|
+
setComponentsArray([]);
|
|
1091
1024
|
};
|
|
1092
1025
|
|
|
1093
1026
|
const getRequired = (services) => {
|
|
@@ -1339,7 +1272,6 @@ export const RetailerProductEdition = ({
|
|
|
1339
1272
|
};
|
|
1340
1273
|
|
|
1341
1274
|
useEffect(() => {
|
|
1342
|
-
console.log(servicesData, "servicesData");
|
|
1343
1275
|
let status = getRetailerStatus(servicesData, activeTab);
|
|
1344
1276
|
setRetailerStatus(status);
|
|
1345
1277
|
}, [activeTab, servicesData, activeRetailer]);
|
|
@@ -1352,6 +1284,70 @@ export const RetailerProductEdition = ({
|
|
|
1352
1284
|
setSaving(loading);
|
|
1353
1285
|
}, [loading]);
|
|
1354
1286
|
|
|
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
|
+
|
|
1355
1351
|
const validateAll = async (result) => {
|
|
1356
1352
|
try {
|
|
1357
1353
|
setLoading(true);
|
|
@@ -1370,8 +1366,6 @@ export const RetailerProductEdition = ({
|
|
|
1370
1366
|
break;
|
|
1371
1367
|
}
|
|
1372
1368
|
|
|
1373
|
-
const messages = [];
|
|
1374
|
-
|
|
1375
1369
|
servicesData?.forEach((ret) => {
|
|
1376
1370
|
if (conceptArray.includes(ret.service)) {
|
|
1377
1371
|
let data = {
|
|
@@ -1391,19 +1385,19 @@ export const RetailerProductEdition = ({
|
|
|
1391
1385
|
);
|
|
1392
1386
|
}
|
|
1393
1387
|
});
|
|
1388
|
+
|
|
1394
1389
|
await Promise.all(evaluationArray);
|
|
1395
1390
|
|
|
1396
1391
|
const productTemp = product;
|
|
1397
1392
|
productTemp.status = `${result}A`;
|
|
1398
1393
|
productTemp.datasheet_status =
|
|
1399
|
-
productTemp.datasheet_status === "
|
|
1394
|
+
productTemp.datasheet_status === "NA" ? "NA" : `${result}A`;
|
|
1400
1395
|
productTemp.description_status =
|
|
1401
|
-
productTemp.description_status === "
|
|
1396
|
+
productTemp.description_status === "NA" ? "NA" : `${result}A`;
|
|
1402
1397
|
productTemp.images_status =
|
|
1403
|
-
productTemp.images_status === "
|
|
1398
|
+
productTemp.images_status === "NA" ? "NA" : `${result}A`;
|
|
1404
1399
|
sessionStorage.setItem("productSelected", JSON.stringify(productTemp));
|
|
1405
1400
|
setProduct(productTemp);
|
|
1406
|
-
const messagesResponse = await Promise.all(messages);
|
|
1407
1401
|
|
|
1408
1402
|
await loadData();
|
|
1409
1403
|
} catch (error) {
|
|
@@ -1411,21 +1405,6 @@ export const RetailerProductEdition = ({
|
|
|
1411
1405
|
}
|
|
1412
1406
|
};
|
|
1413
1407
|
|
|
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
|
-
}, []);
|
|
1429
1408
|
return (
|
|
1430
1409
|
<Container headerTop={headerTop}>
|
|
1431
1410
|
<HeaderTop
|
|
@@ -1434,10 +1413,8 @@ export const RetailerProductEdition = ({
|
|
|
1434
1413
|
setCompare={setCompare}
|
|
1435
1414
|
isAuditor={[1, 6].includes(user.id_role)}
|
|
1436
1415
|
withChat={location?.state?.withChat}
|
|
1437
|
-
|
|
1438
|
-
productSelected={product}
|
|
1416
|
+
productSelected={productSelected}
|
|
1439
1417
|
token={token}
|
|
1440
|
-
activeRetailer={activeRetailer}
|
|
1441
1418
|
/>
|
|
1442
1419
|
<div className="data-container">
|
|
1443
1420
|
<div className="image-data-panel">
|
|
@@ -1468,7 +1445,6 @@ export const RetailerProductEdition = ({
|
|
|
1468
1445
|
<div className="product-information">
|
|
1469
1446
|
<FullProductNameHeader
|
|
1470
1447
|
headerData={product}
|
|
1471
|
-
productObservation={observation}
|
|
1472
1448
|
percent={activePercentage}
|
|
1473
1449
|
activeRetailer={activeRetailer}
|
|
1474
1450
|
servicesData={servicesData}
|
|
@@ -1478,7 +1454,36 @@ export const RetailerProductEdition = ({
|
|
|
1478
1454
|
sendToFacilitator("A");
|
|
1479
1455
|
}}
|
|
1480
1456
|
reject={() => {
|
|
1481
|
-
|
|
1457
|
+
sendToFacilitator("R");
|
|
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
|
+
]);
|
|
1482
1487
|
}}
|
|
1483
1488
|
showApproveRejectAll={
|
|
1484
1489
|
approveRejectAllButtons() && (auditorAssigned() || userAssigned())
|
|
@@ -1488,13 +1493,37 @@ export const RetailerProductEdition = ({
|
|
|
1488
1493
|
}
|
|
1489
1494
|
approveAll={() => validateAll("A")}
|
|
1490
1495
|
rejectAll={() => {
|
|
1491
|
-
|
|
1492
|
-
|
|
1496
|
+
validateAll("R");
|
|
1497
|
+
setMessage("Rechazado");
|
|
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
|
+
]);
|
|
1493
1526
|
}}
|
|
1494
|
-
isObservationVisible={isObservationVisible}
|
|
1495
|
-
toggleObservation={toggleObservation}
|
|
1496
|
-
// handleClickOutside={handleClickOutside}
|
|
1497
|
-
hideObservation={hideObservation}
|
|
1498
1527
|
/>
|
|
1499
1528
|
<FullTabsMenu
|
|
1500
1529
|
tabsSections={tabsSections}
|
|
@@ -1509,12 +1538,6 @@ export const RetailerProductEdition = ({
|
|
|
1509
1538
|
isRetailer={isRetailer}
|
|
1510
1539
|
showSaveButton={auditorAssigned() || userAssigned()}
|
|
1511
1540
|
version={version}
|
|
1512
|
-
desc={desc}
|
|
1513
|
-
setDesc={setDesc}
|
|
1514
|
-
fich={fich}
|
|
1515
|
-
setFich={setFich}
|
|
1516
|
-
imag={imag}
|
|
1517
|
-
setImag={setImag}
|
|
1518
1541
|
updatedDescriptions={updatedDescriptions}
|
|
1519
1542
|
setUpdatedDescriptions={setUpdatedDescriptions}
|
|
1520
1543
|
updatedDatasheets={updatedDatasheets}
|
|
@@ -1629,6 +1652,47 @@ export const RetailerProductEdition = ({
|
|
|
1629
1652
|
{(userAssigned(activeTab) || auditorAssigned()) &&
|
|
1630
1653
|
product[`${getConcept(activeTab)}_status`] !== "NS" && (
|
|
1631
1654
|
<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
|
+
)}
|
|
1632
1696
|
{[7, 8].includes(user.id_role) && (
|
|
1633
1697
|
<Button
|
|
1634
1698
|
buttonType={
|
|
@@ -1686,63 +1750,6 @@ export const RetailerProductEdition = ({
|
|
|
1686
1750
|
jwt={token}
|
|
1687
1751
|
/>
|
|
1688
1752
|
)}
|
|
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
|
-
/>
|
|
1746
1753
|
</Container>
|
|
1747
1754
|
);
|
|
1748
1755
|
};
|