contentoh-components-library 21.4.74 → 21.4.77
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/assets/images/Icons/addv2.svg +8 -0
- package/dist/assets/images/Icons/checkv2.svg +8 -0
- package/dist/assets/images/Icons/options.svg +3 -0
- package/dist/assets/images/Icons/trash.svg +8 -0
- package/dist/assets/images/Icons/undo.svg +8 -0
- package/dist/assets/images/Icons/warningv2.svg +3 -0
- package/dist/assets/images/checkBox/checkrosa.svg +3 -0
- package/dist/assets/images/checkBox/checkverde.svg +3 -0
- package/dist/components/atoms/Avatar/index.js +3 -2
- package/dist/components/atoms/ButtonV2/ButtonV2.stories.js +1 -1
- package/dist/components/atoms/ButtonV2/index.js +1 -1
- package/dist/components/atoms/ButtonV2/styles.js +1 -1
- package/dist/components/atoms/CheckBox/CheckBox.stories.js +8 -1
- package/dist/components/atoms/CheckBox/index.js +8 -0
- package/dist/components/atoms/CheckBox/styles.js +8 -1
- package/dist/components/atoms/GeneralButton/styles.js +6 -2
- package/dist/components/atoms/InputFormatter/styles.js +3 -3
- package/dist/components/atoms/ObservationFlag/ObservationFlag.stories.js +38 -0
- package/dist/components/atoms/ObservationFlag/index.js +52 -0
- package/dist/components/atoms/ObservationFlag/styles.js +18 -0
- package/dist/components/atoms/SliderToolTip/styles.js +1 -1
- package/dist/components/molecules/BoxAttribute/index.js +3 -3
- package/dist/components/molecules/BoxAttribute/styles.js +1 -1
- package/dist/components/molecules/BoxButtons/index.js +0 -1
- package/dist/components/molecules/CarouselImagesLogin/index.js +1 -1
- package/dist/components/molecules/GroupSelect/GroupSelect.stories.js +53 -0
- package/dist/components/molecules/GroupSelect/SelectItem.js +142 -0
- package/dist/components/molecules/GroupSelect/index.js +254 -0
- package/dist/components/molecules/GroupSelect/styles.js +25 -0
- package/dist/components/molecules/HeaderTop/index.js +68 -11
- package/dist/components/molecules/Phase/index.js +205 -43
- package/dist/components/molecules/Phase/styles.js +1 -1
- package/dist/components/molecules/ProductNameHeader/index.js +8 -3
- package/dist/components/molecules/SignInLogin/index.js +36 -28
- package/dist/components/molecules/StripeCardSelector/CardSelector.stories.js +1 -2
- package/dist/components/organisms/Chat/Chat.stories.js +27 -8
- package/dist/components/organisms/Chat/ContainerItems/index.js +19 -3
- package/dist/components/organisms/Chat/ContainerItems/styles.js +1 -1
- package/dist/components/organisms/Chat/ContentChat/index.js +350 -197
- package/dist/components/organisms/Chat/Footer/index.js +48 -39
- package/dist/components/organisms/Chat/index.js +49 -4
- package/dist/components/organisms/Chat/styles.js +1 -1
- package/dist/components/organisms/DashboardMetric/index.js +12 -6
- package/dist/components/organisms/DragAndDropPhases/DragAndDropPhases.stories.js +26 -1
- package/dist/components/organisms/DragAndDropPhases/index.js +262 -32
- package/dist/components/organisms/DragAndDropPhases/styles.js +8 -4
- package/dist/components/organisms/EditGroup/EditGroup.stories.js +39 -0
- package/dist/components/organisms/EditGroup/index.js +242 -0
- package/dist/components/organisms/EditGroup/styles.js +36 -0
- package/dist/components/organisms/FullProductNameHeader/index.js +5 -3
- package/dist/components/organisms/InputGroup/index.js +1 -10
- package/dist/components/organisms/Modal/Modal.stories.js +2 -1
- package/dist/components/organisms/Modal/index.js +6 -1
- package/dist/components/organisms/Modal/styles.js +1 -1
- package/dist/components/organisms/VersionSelector/index.js +101 -169
- package/dist/components/pages/Dashboard/Dashboard.stories.js +33 -36
- package/dist/components/pages/Dashboard/index.js +37 -9
- package/dist/components/pages/ProviderProductEdition/index.js +120 -144
- package/dist/components/pages/ProviderProductEdition/styles.js +1 -1
- package/dist/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +4 -0
- package/dist/components/pages/RetailerProductEdition/index.js +322 -406
- package/dist/components/pages/RetailerProductEdition/styles.js +1 -1
- package/dist/components/pages/RetailerProductEdition/utils.js +61 -2
- package/dist/global-files/data.js +11 -3
- package/dist/global-files/variables.js +7 -1
- package/dist/index.js +201 -58
- package/package.json +3 -1
- package/src/assets/images/Icons/addv2.svg +8 -0
- package/src/assets/images/Icons/checkv2.svg +8 -0
- package/src/assets/images/Icons/infoNR.svg +8 -0
- package/src/assets/images/Icons/options.svg +3 -0
- package/src/assets/images/Icons/trash.svg +8 -0
- package/src/assets/images/Icons/undo.svg +8 -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/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/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/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/ImageCarousel/ImgeSlider.stories.js +76 -0
- package/src/components/atoms/ImageCarousel/index.js +103 -0
- package/src/components/atoms/ImageCarousel/styles.js +79 -0
- 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/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 +33 -0
- package/src/components/atoms/ObservationFlag/styles.js +3 -0
- package/src/components/atoms/PercentTag/PercentTag.stories.js +7 -0
- package/src/components/atoms/PercentTag/index.js +9 -0
- package/src/components/atoms/PercentTag/styles.js +69 -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/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/RatingStars/RatingStars.stories.js +10 -0
- package/src/components/atoms/RatingStars/index.js +31 -0
- package/src/components/atoms/RatingStars/styles.js +28 -0
- package/src/components/atoms/RetailerCatalog/RetailerCatalog.stories.js +36 -0
- package/src/components/atoms/RetailerCatalog/index.js +49 -0
- package/src/components/atoms/RetailerCatalog/styles.js +30 -0
- package/src/components/atoms/RetailerOption/RetailerOption.stories.js +15 -0
- package/src/components/atoms/RetailerOption/index.js +53 -0
- package/src/components/atoms/RetailerOption/styles.js +41 -0
- package/src/components/atoms/RetailersList/RetailersList.stories.js +33 -0
- package/src/components/atoms/RetailersList/index.js +20 -0
- package/src/components/atoms/RetailersList/styles.js +19 -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 +1 -1
- 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/UserCatalog/UserCatalog.stories.js +67 -0
- package/src/components/atoms/UserCatalog/index.js +100 -0
- package/src/components/atoms/UserCatalog/styles.js +24 -0
- package/src/components/atoms/UserOption/UserOption.stories.js +25 -0
- package/src/components/atoms/UserOption/index.js +95 -0
- package/src/components/atoms/UserOption/styles.js +61 -0
- package/src/components/atoms/UserSelector/UserSelector.stories.js +25 -0
- package/src/components/atoms/UserSelector/index.js +86 -0
- package/src/components/atoms/UserSelector/styles.js +55 -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/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/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/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/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/GridItem/GridItem.stories.js +126 -0
- package/src/components/molecules/GridItem/index.js +105 -0
- package/src/components/molecules/GridItem/styles.js +104 -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/HeaderItem/ColumnItem.js +9 -0
- package/src/components/molecules/HeaderItem/HeaderItem.stories.js +24 -0
- package/src/components/molecules/HeaderItem/index.js +26 -0
- package/src/components/molecules/HeaderItem/styles.js +27 -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 +37 -0
- package/src/components/molecules/Phase/index.js +185 -0
- package/src/components/molecules/Phase/styles.js +91 -0
- package/src/components/molecules/ProductNameHeader/index.js +5 -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/RowItem/ColumnItem.js +9 -0
- package/src/components/molecules/RowItem/RowItem.stories.js +5660 -0
- package/src/components/molecules/RowItem/index.js +45 -0
- package/src/components/molecules/RowItem/styles.js +40 -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/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 +6 -5
- 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 +40 -0
- package/src/components/organisms/DragAndDropPhases/index.js +236 -0
- package/src/components/organisms/DragAndDropPhases/styles.js +69 -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 +18 -0
- package/src/components/organisms/EditGroup/index.js +168 -0
- package/src/components/organisms/EditGroup/styles.js +115 -0
- package/src/components/organisms/FullProductNameHeader/index.js +3 -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 +5485 -0
- package/src/components/organisms/GridProducts/index.js +50 -0
- package/src/components/organisms/GridProducts/styles.js +14 -0
- package/src/components/organisms/GridProducts/utils.js +111 -0
- 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/InputGroup/index.js +131 -119
- 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 +8 -1
- 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/VersionSelector/index.js +100 -100
- 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/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/index.js +100 -131
- package/src/components/pages/ProviderProductEdition/styles.js +5 -1
- package/src/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +4 -0
- package/src/components/pages/RetailerProductEdition/index.js +124 -278
- 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 +11 -0
- package/dist/assets/fonts/roboto/LICENSE.txt +0 -202
|
@@ -37,7 +37,7 @@ var _GalleryElement = require("../../molecules/GalleryElement");
|
|
|
37
37
|
|
|
38
38
|
var _fileSaver = require("file-saver");
|
|
39
39
|
|
|
40
|
-
var
|
|
40
|
+
var _data2 = require("../../../global-files/data");
|
|
41
41
|
|
|
42
42
|
var _GalleryHeader = require("../../molecules/GalleryHeader");
|
|
43
43
|
|
|
@@ -61,8 +61,6 @@ var _index = require("../../molecules/TagAndInput/index");
|
|
|
61
61
|
|
|
62
62
|
var _GeneralButton = require("../../atoms/GeneralButton");
|
|
63
63
|
|
|
64
|
-
var _Commentary = require("../../atoms/Commentary");
|
|
65
|
-
|
|
66
64
|
var _GenericModal = require("../../atoms/GenericModal");
|
|
67
65
|
|
|
68
66
|
var _ScreenHeader = require("../../atoms/ScreenHeader");
|
|
@@ -71,14 +69,16 @@ var _Loading = require("../../atoms/Loading");
|
|
|
71
69
|
|
|
72
70
|
var _genericModalCheck = _interopRequireDefault(require("../../../assets/images/genericModal/genericModalCheck.svg"));
|
|
73
71
|
|
|
74
|
-
var _errorModal = _interopRequireDefault(require("../../../assets/images/genericModal/errorModal.svg"));
|
|
75
|
-
|
|
76
72
|
var _VersionSelector = require("../../organisms/VersionSelector");
|
|
77
73
|
|
|
78
74
|
var _customHooks = require("../../../global-files/customHooks");
|
|
79
75
|
|
|
80
76
|
var _utils = require("./utils");
|
|
81
77
|
|
|
78
|
+
var _Modal = require("../../organisms/Modal");
|
|
79
|
+
|
|
80
|
+
var _ButtonV = require("../../atoms/ButtonV2");
|
|
81
|
+
|
|
82
82
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
83
83
|
|
|
84
84
|
var reducerImages = function reducerImages(state, action) {
|
|
@@ -202,7 +202,7 @@ var myBucket = new _awsSdk.default.S3({
|
|
|
202
202
|
});
|
|
203
203
|
|
|
204
204
|
var RetailerProductEdition = function RetailerProductEdition(_ref) {
|
|
205
|
-
var _product$retailers, _location$state, _product$services2, _datasheets$, _datasheets$$data, _product$
|
|
205
|
+
var _product$retailers, _location$state, _location$state2, _product$services2, _datasheets$, _datasheets$$data, _product$article17;
|
|
206
206
|
|
|
207
207
|
var tabsSections = _ref.tabsSections,
|
|
208
208
|
_ref$productSelected = _ref.productSelected,
|
|
@@ -252,6 +252,11 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
|
|
|
252
252
|
showModal = _useState14[0],
|
|
253
253
|
setShowModal = _useState14[1];
|
|
254
254
|
|
|
255
|
+
var _useState15 = (0, _react.useState)(false),
|
|
256
|
+
_useState16 = (0, _slicedToArray2.default)(_useState15, 2),
|
|
257
|
+
showRejectModal = _useState16[0],
|
|
258
|
+
setShowRejectModal = _useState16[1];
|
|
259
|
+
|
|
255
260
|
var _useDropzone = (0, _reactDropzone.useDropzone)({
|
|
256
261
|
accept: "image/*",
|
|
257
262
|
noKeyboard: true,
|
|
@@ -296,149 +301,149 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
|
|
|
296
301
|
getRootProps = _useDropzone.getRootProps,
|
|
297
302
|
getInputProps = _useDropzone.getInputProps;
|
|
298
303
|
|
|
299
|
-
var _useState15 = (0, _react.useState)([]),
|
|
300
|
-
_useState16 = (0, _slicedToArray2.default)(_useState15, 2),
|
|
301
|
-
updatedDatasheets = _useState16[0],
|
|
302
|
-
setUpdatedDatasheets = _useState16[1];
|
|
303
|
-
|
|
304
304
|
var _useState17 = (0, _react.useState)([]),
|
|
305
305
|
_useState18 = (0, _slicedToArray2.default)(_useState17, 2),
|
|
306
|
-
|
|
307
|
-
|
|
306
|
+
updatedDatasheets = _useState18[0],
|
|
307
|
+
setUpdatedDatasheets = _useState18[1];
|
|
308
308
|
|
|
309
|
-
var _useState19 = (0, _react.useState)(
|
|
309
|
+
var _useState19 = (0, _react.useState)([]),
|
|
310
310
|
_useState20 = (0, _slicedToArray2.default)(_useState19, 2),
|
|
311
|
-
|
|
312
|
-
|
|
311
|
+
updatedDescriptions = _useState20[0],
|
|
312
|
+
setUpdatedDescriptions = _useState20[1];
|
|
313
313
|
|
|
314
|
-
var _useState21 = (0, _react.useState)(),
|
|
314
|
+
var _useState21 = (0, _react.useState)(false),
|
|
315
315
|
_useState22 = (0, _slicedToArray2.default)(_useState21, 2),
|
|
316
|
-
|
|
317
|
-
|
|
316
|
+
imagesUploaded = _useState22[0],
|
|
317
|
+
setImagesUploaded = _useState22[1];
|
|
318
318
|
|
|
319
|
-
var _useState23 = (0, _react.useState)(
|
|
320
|
-
percentage: 0
|
|
321
|
-
})),
|
|
319
|
+
var _useState23 = (0, _react.useState)(),
|
|
322
320
|
_useState24 = (0, _slicedToArray2.default)(_useState23, 2),
|
|
323
|
-
|
|
324
|
-
|
|
321
|
+
dataImages = _useState24[0],
|
|
322
|
+
setDataImages = _useState24[1];
|
|
325
323
|
|
|
326
|
-
|
|
327
|
-
|
|
324
|
+
var _useState25 = (0, _react.useState)(new Array(product === null || product === void 0 ? void 0 : (_product$retailers = product.retailers) === null || _product$retailers === void 0 ? void 0 : _product$retailers.length).fill({
|
|
325
|
+
percentage: 0
|
|
326
|
+
})),
|
|
328
327
|
_useState26 = (0, _slicedToArray2.default)(_useState25, 2),
|
|
329
|
-
|
|
330
|
-
|
|
328
|
+
percentages = _useState26[0],
|
|
329
|
+
setPercentages = _useState26[1]; // const [percentages, setPercentages] = useState([{ retailers: {} }]);
|
|
331
330
|
|
|
332
|
-
|
|
331
|
+
|
|
332
|
+
var _useState27 = (0, _react.useState)(0),
|
|
333
333
|
_useState28 = (0, _slicedToArray2.default)(_useState27, 2),
|
|
334
|
-
|
|
335
|
-
|
|
334
|
+
activePercentage = _useState28[0],
|
|
335
|
+
setActivePercentage = _useState28[1];
|
|
336
336
|
|
|
337
|
-
var _useState29 = (0, _react.useState)(
|
|
337
|
+
var _useState29 = (0, _react.useState)({}),
|
|
338
338
|
_useState30 = (0, _slicedToArray2.default)(_useState29, 2),
|
|
339
|
-
|
|
340
|
-
|
|
339
|
+
activeRetailer = _useState30[0],
|
|
340
|
+
setActiveRetailer = _useState30[1];
|
|
341
341
|
|
|
342
342
|
var _useState31 = (0, _react.useState)([]),
|
|
343
343
|
_useState32 = (0, _slicedToArray2.default)(_useState31, 2),
|
|
344
|
-
|
|
345
|
-
|
|
344
|
+
services = _useState32[0],
|
|
345
|
+
setServices = _useState32[1];
|
|
346
346
|
|
|
347
|
-
var _useState33 = (0, _react.useState)(
|
|
347
|
+
var _useState33 = (0, _react.useState)([]),
|
|
348
348
|
_useState34 = (0, _slicedToArray2.default)(_useState33, 2),
|
|
349
|
-
|
|
350
|
-
|
|
349
|
+
servicesData = _useState34[0],
|
|
350
|
+
setServicesData = _useState34[1];
|
|
351
351
|
|
|
352
|
-
var _useState35 = (0, _react.useState)(
|
|
352
|
+
var _useState35 = (0, _react.useState)(""),
|
|
353
353
|
_useState36 = (0, _slicedToArray2.default)(_useState35, 2),
|
|
354
|
-
|
|
355
|
-
|
|
354
|
+
message = _useState36[0],
|
|
355
|
+
setMessage = _useState36[1];
|
|
356
356
|
|
|
357
|
-
var _useState37 = (0, _react.useState)(
|
|
357
|
+
var _useState37 = (0, _react.useState)(JSON.parse(sessionStorage.getItem("productSelected")) ? JSON.parse(sessionStorage.getItem("productSelected")) : productSelected),
|
|
358
358
|
_useState38 = (0, _slicedToArray2.default)(_useState37, 2),
|
|
359
|
-
|
|
360
|
-
|
|
359
|
+
product = _useState38[0],
|
|
360
|
+
setProduct = _useState38[1];
|
|
361
361
|
|
|
362
|
-
var _useState39 = (0, _react.useState)(
|
|
362
|
+
var _useState39 = (0, _react.useState)(null),
|
|
363
363
|
_useState40 = (0, _slicedToArray2.default)(_useState39, 2),
|
|
364
|
-
|
|
365
|
-
|
|
364
|
+
icon = _useState40[0],
|
|
365
|
+
setIcon = _useState40[1];
|
|
366
366
|
|
|
367
|
-
var _useState41 = (0, _react.useState)(
|
|
367
|
+
var _useState41 = (0, _react.useState)(product === null || product === void 0 ? void 0 : product.version),
|
|
368
368
|
_useState42 = (0, _slicedToArray2.default)(_useState41, 2),
|
|
369
|
-
|
|
370
|
-
|
|
369
|
+
version = _useState42[0],
|
|
370
|
+
setVersion = _useState42[1];
|
|
371
371
|
|
|
372
|
-
var _useState43 = (0, _react.useState)(
|
|
372
|
+
var _useState43 = (0, _react.useState)({}),
|
|
373
373
|
_useState44 = (0, _slicedToArray2.default)(_useState43, 2),
|
|
374
|
-
|
|
375
|
-
|
|
374
|
+
comments = _useState44[0],
|
|
375
|
+
setComments = _useState44[1];
|
|
376
|
+
|
|
377
|
+
var _useState45 = (0, _react.useState)(""),
|
|
378
|
+
_useState46 = (0, _slicedToArray2.default)(_useState45, 2),
|
|
379
|
+
comment = _useState46[0],
|
|
380
|
+
setComment = _useState46[1];
|
|
376
381
|
|
|
377
|
-
var
|
|
382
|
+
var _useState47 = (0, _react.useState)({
|
|
378
383
|
"Ficha técnica": 0,
|
|
379
384
|
Descripción: 0,
|
|
380
385
|
Imágenes: 0
|
|
381
386
|
}),
|
|
382
|
-
_useState46 = (0, _slicedToArray2.default)(_useState45, 2),
|
|
383
|
-
requiredNull = _useState46[0],
|
|
384
|
-
setRequiredNull = _useState46[1];
|
|
385
|
-
|
|
386
|
-
var _useState47 = (0, _react.useState)(false),
|
|
387
387
|
_useState48 = (0, _slicedToArray2.default)(_useState47, 2),
|
|
388
|
-
|
|
389
|
-
|
|
388
|
+
requiredNull = _useState48[0],
|
|
389
|
+
setRequiredNull = _useState48[1];
|
|
390
390
|
|
|
391
|
-
var _useState49 = (0, _react.useState)(
|
|
391
|
+
var _useState49 = (0, _react.useState)(false),
|
|
392
392
|
_useState50 = (0, _slicedToArray2.default)(_useState49, 2),
|
|
393
|
-
|
|
394
|
-
|
|
393
|
+
crossComment = _useState50[0],
|
|
394
|
+
setCrossComment = _useState50[1];
|
|
395
395
|
|
|
396
|
-
var _useState51 = (0, _react.useState)(
|
|
396
|
+
var _useState51 = (0, _react.useState)([]),
|
|
397
397
|
_useState52 = (0, _slicedToArray2.default)(_useState51, 2),
|
|
398
|
-
|
|
399
|
-
|
|
398
|
+
userGroups = _useState52[0],
|
|
399
|
+
setUserGroups = _useState52[1];
|
|
400
400
|
|
|
401
|
-
var _useState53 = (0, _react.useState)(
|
|
401
|
+
var _useState53 = (0, _react.useState)({}),
|
|
402
402
|
_useState54 = (0, _slicedToArray2.default)(_useState53, 2),
|
|
403
|
-
|
|
404
|
-
|
|
403
|
+
assig = _useState54[0],
|
|
404
|
+
setAssig = _useState54[1];
|
|
405
405
|
|
|
406
406
|
var _useState55 = (0, _react.useState)([]),
|
|
407
407
|
_useState56 = (0, _slicedToArray2.default)(_useState55, 2),
|
|
408
|
-
|
|
409
|
-
|
|
408
|
+
selectedImages = _useState56[0],
|
|
409
|
+
setSelectedImages = _useState56[1];
|
|
410
410
|
|
|
411
|
-
var _useState57 = (0, _react.useState)(
|
|
411
|
+
var _useState57 = (0, _react.useState)([]),
|
|
412
412
|
_useState58 = (0, _slicedToArray2.default)(_useState57, 2),
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
var isRetailer = user === null || user === void 0 ? void 0 : user.is_retailer;
|
|
413
|
+
componentsArray = _useState58[0],
|
|
414
|
+
setComponentsArray = _useState58[1];
|
|
417
415
|
|
|
418
|
-
var _useState59 = (0, _react.useState)(
|
|
416
|
+
var _useState59 = (0, _react.useState)(false),
|
|
419
417
|
_useState60 = (0, _slicedToArray2.default)(_useState59, 2),
|
|
420
|
-
|
|
421
|
-
|
|
418
|
+
checkAll = _useState60[0],
|
|
419
|
+
setCheckAll = _useState60[1];
|
|
422
420
|
|
|
423
|
-
var
|
|
421
|
+
var isRetailer = user === null || user === void 0 ? void 0 : user.is_retailer;
|
|
422
|
+
|
|
423
|
+
var _useState61 = (0, _react.useState)(true),
|
|
424
424
|
_useState62 = (0, _slicedToArray2.default)(_useState61, 2),
|
|
425
|
-
|
|
426
|
-
|
|
425
|
+
loading = _useState62[0],
|
|
426
|
+
setLoading = _useState62[1];
|
|
427
427
|
|
|
428
|
-
var _useState63 = (0, _react.useState)(
|
|
428
|
+
var _useState63 = (0, _react.useState)("-"),
|
|
429
429
|
_useState64 = (0, _slicedToArray2.default)(_useState63, 2),
|
|
430
|
-
|
|
431
|
-
|
|
430
|
+
retailerStatus = _useState64[0],
|
|
431
|
+
setRetailerStatus = _useState64[1];
|
|
432
432
|
|
|
433
|
-
var _useState65 = (0, _react.useState)(
|
|
433
|
+
var _useState65 = (0, _react.useState)([]),
|
|
434
434
|
_useState66 = (0, _slicedToArray2.default)(_useState65, 2),
|
|
435
|
-
|
|
436
|
-
|
|
435
|
+
statusArray = _useState66[0],
|
|
436
|
+
setStatusArray = _useState66[1];
|
|
437
437
|
|
|
438
|
-
var _useState67 = (0, _react.useState)(
|
|
438
|
+
var _useState67 = (0, _react.useState)(null),
|
|
439
439
|
_useState68 = (0, _slicedToArray2.default)(_useState67, 2),
|
|
440
|
-
|
|
441
|
-
|
|
440
|
+
socketType = _useState68[0],
|
|
441
|
+
setSocketType = _useState68[1];
|
|
442
|
+
|
|
443
|
+
var _useState69 = (0, _react.useState)(loading),
|
|
444
|
+
_useState70 = (0, _slicedToArray2.default)(_useState69, 2),
|
|
445
|
+
saving = _useState70[0],
|
|
446
|
+
setSaving = _useState70[1];
|
|
442
447
|
|
|
443
448
|
var _useCloseModal = (0, _customHooks.useCloseModal)("version-selector"),
|
|
444
449
|
_useCloseModal2 = (0, _slicedToArray2.default)(_useCloseModal, 2),
|
|
@@ -447,35 +452,60 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
|
|
|
447
452
|
|
|
448
453
|
var shotThd = [58, 59, 60, 61].includes(activeRetailer.id);
|
|
449
454
|
|
|
450
|
-
var
|
|
451
|
-
_useState70 = (0, _slicedToArray2.default)(_useState69, 2),
|
|
452
|
-
auditableVersion = _useState70[0],
|
|
453
|
-
setAuditableVersion = _useState70[1];
|
|
454
|
-
|
|
455
|
-
var _useState71 = (0, _react.useState)([]),
|
|
455
|
+
var _useState71 = (0, _react.useState)(null),
|
|
456
456
|
_useState72 = (0, _slicedToArray2.default)(_useState71, 2),
|
|
457
|
-
|
|
458
|
-
|
|
457
|
+
auditableVersion = _useState72[0],
|
|
458
|
+
setAuditableVersion = _useState72[1];
|
|
459
459
|
|
|
460
460
|
var _useState73 = (0, _react.useState)([]),
|
|
461
461
|
_useState74 = (0, _slicedToArray2.default)(_useState73, 2),
|
|
462
|
-
|
|
463
|
-
|
|
462
|
+
auditServices = _useState74[0],
|
|
463
|
+
setAuditServices = _useState74[1];
|
|
464
464
|
|
|
465
465
|
var _useState75 = (0, _react.useState)([]),
|
|
466
466
|
_useState76 = (0, _slicedToArray2.default)(_useState75, 2),
|
|
467
|
-
|
|
468
|
-
|
|
467
|
+
auditDatasheets = _useState76[0],
|
|
468
|
+
setAuditDatasheets = _useState76[1];
|
|
469
469
|
|
|
470
470
|
var _useState77 = (0, _react.useState)([]),
|
|
471
471
|
_useState78 = (0, _slicedToArray2.default)(_useState77, 2),
|
|
472
|
-
|
|
473
|
-
|
|
472
|
+
auditDescriptions = _useState78[0],
|
|
473
|
+
setAuditDescriptions = _useState78[1];
|
|
474
474
|
|
|
475
|
-
var _useState79 = (0, _react.useState)(
|
|
475
|
+
var _useState79 = (0, _react.useState)([]),
|
|
476
476
|
_useState80 = (0, _slicedToArray2.default)(_useState79, 2),
|
|
477
|
-
|
|
478
|
-
|
|
477
|
+
auditImages = _useState80[0],
|
|
478
|
+
setAuditImages = _useState80[1];
|
|
479
|
+
|
|
480
|
+
var _useState81 = (0, _react.useState)(false),
|
|
481
|
+
_useState82 = (0, _slicedToArray2.default)(_useState81, 2),
|
|
482
|
+
compare = _useState82[0],
|
|
483
|
+
setCompare = _useState82[1];
|
|
484
|
+
|
|
485
|
+
var _useState83 = (0, _react.useState)(),
|
|
486
|
+
_useState84 = (0, _slicedToArray2.default)(_useState83, 2),
|
|
487
|
+
observation = _useState84[0],
|
|
488
|
+
setObservation = _useState84[1];
|
|
489
|
+
|
|
490
|
+
var _useState85 = (0, _react.useState)(false),
|
|
491
|
+
_useState86 = (0, _slicedToArray2.default)(_useState85, 2),
|
|
492
|
+
valRejAll = _useState86[0],
|
|
493
|
+
setValRejAll = _useState86[1];
|
|
494
|
+
|
|
495
|
+
var _useState87 = (0, _react.useState)([]),
|
|
496
|
+
_useState88 = (0, _slicedToArray2.default)(_useState87, 2),
|
|
497
|
+
desc = _useState88[0],
|
|
498
|
+
setDesc = _useState88[1];
|
|
499
|
+
|
|
500
|
+
var _useState89 = (0, _react.useState)([]),
|
|
501
|
+
_useState90 = (0, _slicedToArray2.default)(_useState89, 2),
|
|
502
|
+
fich = _useState90[0],
|
|
503
|
+
setFich = _useState90[1];
|
|
504
|
+
|
|
505
|
+
var _useState91 = (0, _react.useState)([]),
|
|
506
|
+
_useState92 = (0, _slicedToArray2.default)(_useState91, 2),
|
|
507
|
+
imag = _useState92[0],
|
|
508
|
+
setImag = _useState92[1];
|
|
479
509
|
|
|
480
510
|
(0, _react.useEffect)( /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
|
|
481
511
|
var _ref3, id_article;
|
|
@@ -516,7 +546,7 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
|
|
|
516
546
|
}
|
|
517
547
|
|
|
518
548
|
_context2.next = 3;
|
|
519
|
-
return (0,
|
|
549
|
+
return (0, _data2.getRetailerServices)(product === null || product === void 0 ? void 0 : (_product$article = product.article) === null || _product$article === void 0 ? void 0 : _product$article.id_article, product === null || product === void 0 ? void 0 : (_product$article2 = product.article) === null || _product$article2 === void 0 ? void 0 : _product$article2.category, parseInt(product === null || product === void 0 ? void 0 : (_product$article3 = product.article) === null || _product$article3 === void 0 ? void 0 : _product$article3.id_category), auditableVersion.version, token);
|
|
520
550
|
|
|
521
551
|
case 3:
|
|
522
552
|
_auditServices = _context2.sent;
|
|
@@ -556,7 +586,7 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
|
|
|
556
586
|
case 0:
|
|
557
587
|
_context3.prev = 0;
|
|
558
588
|
_context3.next = 3;
|
|
559
|
-
return (0,
|
|
589
|
+
return (0, _data2.getRetailerServices)(product === null || product === void 0 ? void 0 : (_product$article4 = product.article) === null || _product$article4 === void 0 ? void 0 : _product$article4.id_article, product === null || product === void 0 ? void 0 : (_product$article5 = product.article) === null || _product$article5 === void 0 ? void 0 : _product$article5.category, parseInt(product === null || product === void 0 ? void 0 : (_product$article6 = product.article) === null || _product$article6 === void 0 ? void 0 : _product$article6.id_category), version, token);
|
|
560
590
|
|
|
561
591
|
case 3:
|
|
562
592
|
_services = _context3.sent;
|
|
@@ -585,7 +615,7 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
|
|
|
585
615
|
headers = {
|
|
586
616
|
Authorization: token
|
|
587
617
|
};
|
|
588
|
-
(0,
|
|
618
|
+
(0, _data2.getPercentage)({
|
|
589
619
|
data: data,
|
|
590
620
|
headers: headers
|
|
591
621
|
}).then(function (res) {
|
|
@@ -711,7 +741,7 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
|
|
|
711
741
|
getComments();
|
|
712
742
|
_context6.t0 = setUserGroups;
|
|
713
743
|
_context6.next = 6;
|
|
714
|
-
return (0,
|
|
744
|
+
return (0, _data2.fetchUsers)(token);
|
|
715
745
|
|
|
716
746
|
case 6:
|
|
717
747
|
_context6.t1 = _context6.sent;
|
|
@@ -813,7 +843,7 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
|
|
|
813
843
|
setActivePercentage((_retailers$ = retailers[0]) === null || _retailers$ === void 0 ? void 0 : _retailers$.percentage);
|
|
814
844
|
}, [percentages]);
|
|
815
845
|
(0, _react.useEffect)(function () {
|
|
816
|
-
|
|
846
|
+
//getInputsData(services, activeRetailer, setDatasheets, setDescriptions);
|
|
817
847
|
auditableVersion && loadAuditableData();
|
|
818
848
|
setActivePercentage(Math.round(activeRetailer === null || activeRetailer === void 0 ? void 0 : activeRetailer.percentage, 0));
|
|
819
849
|
(activeRetailer === null || activeRetailer === void 0 ? void 0 : activeRetailer.id) && setImages({
|
|
@@ -1028,6 +1058,7 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
|
|
|
1028
1058
|
};
|
|
1029
1059
|
});
|
|
1030
1060
|
setSocketType(imageInputs);
|
|
1061
|
+
console.log(images);
|
|
1031
1062
|
}, [images]);
|
|
1032
1063
|
var updateImages = (0, _react.useCallback)( /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee9() {
|
|
1033
1064
|
var _images$values3, _images$attrForImgs, _product$article14, _data$articleData, _data$articleData2, _data$updateImages;
|
|
@@ -1330,84 +1361,11 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
|
|
|
1330
1361
|
default:
|
|
1331
1362
|
break;
|
|
1332
1363
|
}
|
|
1333
|
-
};
|
|
1334
|
-
// setLoading(true);
|
|
1335
|
-
// try {
|
|
1336
|
-
// let concept = getConcept(activeTab);
|
|
1337
|
-
// const productTemp = { ...product };
|
|
1338
|
-
// const evalStatus = retailerStatus;
|
|
1339
|
-
// const articleId = product.article.id_article;
|
|
1340
|
-
// const orderId = product.orderId;
|
|
1341
|
-
// // const body = {
|
|
1342
|
-
// // orderArticleRetailers: [
|
|
1343
|
-
// // { orderId, articleId, retailersIds: [activeRetailer.id] },
|
|
1344
|
-
// // ],
|
|
1345
|
-
// // isAproved: false,
|
|
1346
|
-
// // service: concept,
|
|
1347
|
-
// // };
|
|
1348
|
-
// const body = {
|
|
1349
|
-
// articleId: product.article.id_article,
|
|
1350
|
-
// orderId: product.orderId,
|
|
1351
|
-
// concept: concept,
|
|
1352
|
-
// result: result,
|
|
1353
|
-
// evalStatus: evalStatus,
|
|
1354
|
-
// retailerId: activeRetailer.id,
|
|
1355
|
-
// };
|
|
1356
|
-
// let res;
|
|
1357
|
-
// let message;
|
|
1358
|
-
// if (result) {
|
|
1359
|
-
// body.isAproved = result === "A";
|
|
1360
|
-
// res = await axios.put(
|
|
1361
|
-
// `${process.env.REACT_APP_EVALUATION_ENDPOINT}`,
|
|
1362
|
-
// body,
|
|
1363
|
-
// {
|
|
1364
|
-
// headers: {
|
|
1365
|
-
// Authorization: token,
|
|
1366
|
-
// },
|
|
1367
|
-
// }
|
|
1368
|
-
// );
|
|
1369
|
-
// console.log(JSON.parse(res.data.body), "res");
|
|
1370
|
-
// getServices();
|
|
1371
|
-
// } else {
|
|
1372
|
-
// const specialistDone = ["RC", "RA", "CA"].includes(evalStatus);
|
|
1373
|
-
// if (specialistDone) {
|
|
1374
|
-
// message = `${activeTab} enviada a facilitador`;
|
|
1375
|
-
// getSectionIcon();
|
|
1376
|
-
// } else if (["IE", "AC", "RP", "RCA"].includes(evalStatus)) {
|
|
1377
|
-
// message = "Evaluación enviada";
|
|
1378
|
-
// getSectionIcon();
|
|
1379
|
-
// }
|
|
1380
|
-
// res = await axios.put(
|
|
1381
|
-
// `${process.env.REACT_APP_EVALUATION_ENDPOINT}`,
|
|
1382
|
-
// body,
|
|
1383
|
-
// {
|
|
1384
|
-
// headers: {
|
|
1385
|
-
// Authorization: token,
|
|
1386
|
-
// },
|
|
1387
|
-
// }
|
|
1388
|
-
// );
|
|
1389
|
-
// }
|
|
1390
|
-
// if (res.data.statusCode === 200) {
|
|
1391
|
-
// const response = JSON.parse(res.data.body)?.successfulData;
|
|
1392
|
-
// const statusObject =
|
|
1393
|
-
// response[`${orderId}-${articleId}-${activeRetailer.id}`];
|
|
1394
|
-
// productTemp.status = statusObject["generalStatus"];
|
|
1395
|
-
// productTemp[`${concept}_status`] = statusObject[`${concept}Status`];
|
|
1396
|
-
// await loadData();
|
|
1397
|
-
// if (message) setMessage(message);
|
|
1398
|
-
// sessionStorage.setItem("productSelected", JSON.stringify(productTemp));
|
|
1399
|
-
// setProduct(productTemp);
|
|
1400
|
-
// }
|
|
1401
|
-
// } catch (error) {
|
|
1402
|
-
// console.log(error);
|
|
1403
|
-
// }
|
|
1404
|
-
// setLoading(false);
|
|
1405
|
-
// };
|
|
1406
|
-
|
|
1364
|
+
};
|
|
1407
1365
|
|
|
1408
1366
|
var sendToFacilitator = /*#__PURE__*/function () {
|
|
1409
1367
|
var _ref15 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee11(result) {
|
|
1410
|
-
var concept, productTemp, evalStatus, articleId, orderId, data, res, _message, specialistDone, _JSON$parse5, newStatus, newOrderStatus, newArticleStatus;
|
|
1368
|
+
var concept, productTemp, evalStatus, articleId, orderId, data, res, _message, specialistDone, _JSON$parse5, newStatus, newOrderStatus, newArticleStatus, messageToChat, _data;
|
|
1411
1369
|
|
|
1412
1370
|
return _regenerator.default.wrap(function _callee11$(_context11) {
|
|
1413
1371
|
while (1) {
|
|
@@ -1470,39 +1428,59 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
|
|
|
1470
1428
|
|
|
1471
1429
|
case 21:
|
|
1472
1430
|
if (!(res.data.statusCode === 200)) {
|
|
1473
|
-
_context11.next =
|
|
1431
|
+
_context11.next = 34;
|
|
1474
1432
|
break;
|
|
1475
1433
|
}
|
|
1476
1434
|
|
|
1477
1435
|
_JSON$parse5 = JSON.parse(res.data.body), newStatus = _JSON$parse5.newStatus, newOrderStatus = _JSON$parse5.newOrderStatus, newArticleStatus = _JSON$parse5.newArticleStatus;
|
|
1436
|
+
messageToChat = (0, _utils.createMessage)(product.retailers, activeRetailer.id, evalStatus, newStatus, activeTab);
|
|
1437
|
+
_data = {
|
|
1438
|
+
paramsBody: {
|
|
1439
|
+
id: product.article.id_article,
|
|
1440
|
+
version: version,
|
|
1441
|
+
items: [{
|
|
1442
|
+
type: "status",
|
|
1443
|
+
value: messageToChat
|
|
1444
|
+
}],
|
|
1445
|
+
retailerId: activeRetailer.id,
|
|
1446
|
+
status: product.status
|
|
1447
|
+
},
|
|
1448
|
+
paramsHeader: {
|
|
1449
|
+
Authorization: token
|
|
1450
|
+
}
|
|
1451
|
+
};
|
|
1452
|
+
_context11.next = 27;
|
|
1453
|
+
return (0, _utils.sendMessage)(_data);
|
|
1454
|
+
|
|
1455
|
+
case 27:
|
|
1478
1456
|
if (newOrderStatus) productTemp.status = newArticleStatus[articleId];
|
|
1479
1457
|
productTemp["".concat(concept, "_status")] = newStatus;
|
|
1480
|
-
_context11.next =
|
|
1458
|
+
_context11.next = 31;
|
|
1481
1459
|
return loadData();
|
|
1482
1460
|
|
|
1483
|
-
case
|
|
1461
|
+
case 31:
|
|
1484
1462
|
if (_message) setMessage(_message);
|
|
1485
1463
|
sessionStorage.setItem("productSelected", JSON.stringify(productTemp));
|
|
1486
1464
|
setProduct(productTemp);
|
|
1487
1465
|
|
|
1488
|
-
case
|
|
1489
|
-
_context11.next =
|
|
1466
|
+
case 34:
|
|
1467
|
+
_context11.next = 39;
|
|
1490
1468
|
break;
|
|
1491
1469
|
|
|
1492
|
-
case
|
|
1493
|
-
_context11.prev =
|
|
1470
|
+
case 36:
|
|
1471
|
+
_context11.prev = 36;
|
|
1494
1472
|
_context11.t0 = _context11["catch"](1);
|
|
1495
1473
|
console.log(_context11.t0);
|
|
1496
1474
|
|
|
1497
|
-
case
|
|
1475
|
+
case 39:
|
|
1498
1476
|
setLoading(false);
|
|
1499
1477
|
|
|
1500
|
-
case
|
|
1478
|
+
case 40:
|
|
1501
1479
|
case "end":
|
|
1502
1480
|
return _context11.stop();
|
|
1503
1481
|
}
|
|
1504
1482
|
}
|
|
1505
|
-
}, _callee11, null, [[1,
|
|
1483
|
+
}, _callee11, null, [[1, 36]]);
|
|
1506
1484
|
}));
|
|
1507
1485
|
|
|
1508
1486
|
return function sendToFacilitator(_x) {
|
|
@@ -1537,55 +1515,33 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
|
|
|
1537
1515
|
};
|
|
1538
1516
|
|
|
1539
1517
|
var createComment = /*#__PURE__*/function () {
|
|
1540
|
-
var _ref16 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee12(
|
|
1541
|
-
var
|
|
1542
|
-
|
|
1543
|
-
|
|
1518
|
+
var _ref16 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee12() {
|
|
1519
|
+
var messages,
|
|
1520
|
+
retailerId,
|
|
1521
|
+
data,
|
|
1522
|
+
_args12 = arguments;
|
|
1544
1523
|
return _regenerator.default.wrap(function _callee12$(_context12) {
|
|
1545
1524
|
while (1) {
|
|
1546
1525
|
switch (_context12.prev = _context12.next) {
|
|
1547
1526
|
case 0:
|
|
1548
|
-
|
|
1549
|
-
|
|
1550
|
-
_context12.next = _context12.t0 === "Ficha técnica" ? 4 : _context12.t0 === "Imágenes" ? 6 : 8;
|
|
1551
|
-
break;
|
|
1552
|
-
|
|
1553
|
-
case 4:
|
|
1554
|
-
concept = "datasheet";
|
|
1555
|
-
return _context12.abrupt("break", 10);
|
|
1556
|
-
|
|
1557
|
-
case 6:
|
|
1558
|
-
concept = "images";
|
|
1559
|
-
return _context12.abrupt("break", 10);
|
|
1560
|
-
|
|
1561
|
-
case 8:
|
|
1562
|
-
concept = "description";
|
|
1563
|
-
return _context12.abrupt("break", 10);
|
|
1564
|
-
|
|
1565
|
-
case 10:
|
|
1527
|
+
messages = _args12.length > 0 && _args12[0] !== undefined ? _args12[0] : [];
|
|
1528
|
+
retailerId = _args12.length > 1 ? _args12[1] : undefined;
|
|
1566
1529
|
data = {
|
|
1567
|
-
|
|
1568
|
-
|
|
1569
|
-
|
|
1570
|
-
|
|
1571
|
-
|
|
1572
|
-
|
|
1573
|
-
|
|
1574
|
-
|
|
1575
|
-
headers: {
|
|
1530
|
+
paramsBody: {
|
|
1531
|
+
id: product.article.id_article,
|
|
1532
|
+
version: version,
|
|
1533
|
+
items: messages,
|
|
1534
|
+
retailerId: retailerId,
|
|
1535
|
+
status: product.status
|
|
1536
|
+
},
|
|
1537
|
+
paramsHeader: {
|
|
1576
1538
|
Authorization: token
|
|
1577
1539
|
}
|
|
1578
|
-
}
|
|
1579
|
-
|
|
1580
|
-
case 13:
|
|
1581
|
-
_context12.next = 15;
|
|
1582
|
-
return getComments(tab);
|
|
1583
|
-
|
|
1584
|
-
case 15:
|
|
1540
|
+
};
|
|
1585
1541
|
setMessage("");
|
|
1586
|
-
|
|
1542
|
+
return _context12.abrupt("return", (0, _utils.sendMessage)(data));
|
|
1587
1543
|
|
|
1588
|
-
case
|
|
1544
|
+
case 5:
|
|
1589
1545
|
case "end":
|
|
1590
1546
|
return _context12.stop();
|
|
1591
1547
|
}
|
|
@@ -1593,7 +1549,7 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
|
|
|
1593
1549
|
}, _callee12);
|
|
1594
1550
|
}));
|
|
1595
1551
|
|
|
1596
|
-
return function createComment(
|
|
1552
|
+
return function createComment() {
|
|
1597
1553
|
return _ref16.apply(this, arguments);
|
|
1598
1554
|
};
|
|
1599
1555
|
}();
|
|
@@ -1708,7 +1664,7 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
|
|
|
1708
1664
|
|
|
1709
1665
|
var setAssignation = /*#__PURE__*/function () {
|
|
1710
1666
|
var _ref18 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee14(assignationType, assignationId) {
|
|
1711
|
-
var _product$
|
|
1667
|
+
var _product$article16;
|
|
1712
1668
|
|
|
1713
1669
|
var concept, productTemp, data;
|
|
1714
1670
|
return _regenerator.default.wrap(function _callee14$(_context14) {
|
|
@@ -1738,7 +1694,7 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
|
|
|
1738
1694
|
data = {
|
|
1739
1695
|
articleList: [{
|
|
1740
1696
|
orderId: product.orderId,
|
|
1741
|
-
articleId: product === null || product === void 0 ? void 0 : (_product$
|
|
1697
|
+
articleId: product === null || product === void 0 ? void 0 : (_product$article16 = product.article) === null || _product$article16 === void 0 ? void 0 : _product$article16.id_article
|
|
1742
1698
|
}],
|
|
1743
1699
|
concept: concept,
|
|
1744
1700
|
userId: assignationId
|
|
@@ -1765,7 +1721,7 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
|
|
|
1765
1721
|
}, _callee14);
|
|
1766
1722
|
}));
|
|
1767
1723
|
|
|
1768
|
-
return function setAssignation(
|
|
1724
|
+
return function setAssignation(_x2, _x3) {
|
|
1769
1725
|
return _ref18.apply(this, arguments);
|
|
1770
1726
|
};
|
|
1771
1727
|
}();
|
|
@@ -1867,6 +1823,7 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
|
|
|
1867
1823
|
};
|
|
1868
1824
|
|
|
1869
1825
|
(0, _react.useEffect)(function () {
|
|
1826
|
+
console.log(servicesData, "servicesData");
|
|
1870
1827
|
var status = getRetailerStatus(servicesData, activeTab);
|
|
1871
1828
|
setRetailerStatus(status);
|
|
1872
1829
|
}, [activeTab, servicesData, activeRetailer]);
|
|
@@ -1875,68 +1832,11 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
|
|
|
1875
1832
|
}, [services, servicesData, activeTab]);
|
|
1876
1833
|
(0, _react.useEffect)(function () {
|
|
1877
1834
|
setSaving(loading);
|
|
1878
|
-
}, [loading]);
|
|
1879
|
-
// try {
|
|
1880
|
-
// setLoading(true);
|
|
1881
|
-
// const evaluationArray = [];
|
|
1882
|
-
// let conceptArray = ["description", "datasheet", "images"];
|
|
1883
|
-
// switch (user.id_role) {
|
|
1884
|
-
// case 4:
|
|
1885
|
-
// conceptArray = ["description", "datasheet"];
|
|
1886
|
-
// break;
|
|
1887
|
-
// case 5:
|
|
1888
|
-
// conceptArray = ["images"];
|
|
1889
|
-
// break;
|
|
1890
|
-
// default:
|
|
1891
|
-
// conceptArray = ["description", "datasheet", "images"];
|
|
1892
|
-
// break;
|
|
1893
|
-
// }
|
|
1894
|
-
// const isAproved = result === "A";
|
|
1895
|
-
// const retailersIds = [];
|
|
1896
|
-
// servicesData?.forEach((ret) => {
|
|
1897
|
-
// if (!retailersIds.includes(ret.id_retailer))
|
|
1898
|
-
// retailersIds.push(ret.id_retailer);
|
|
1899
|
-
// });
|
|
1900
|
-
// const body = {
|
|
1901
|
-
// orderArticleRetailers: [
|
|
1902
|
-
// {
|
|
1903
|
-
// orderId: product.id_order ?? product.orderId,
|
|
1904
|
-
// articleId: product.article.id_article,
|
|
1905
|
-
// retailersIds,
|
|
1906
|
-
// },
|
|
1907
|
-
// ],
|
|
1908
|
-
// isAproved,
|
|
1909
|
-
// };
|
|
1910
|
-
// conceptArray.forEach((concept) => {
|
|
1911
|
-
// body.service = concept;
|
|
1912
|
-
// evaluationArray.push(
|
|
1913
|
-
// axios.put(`${process.env.REACT_APP_EVALUATION_ENDPOINT}`, body, {
|
|
1914
|
-
// headers: {
|
|
1915
|
-
// Authorization: token,
|
|
1916
|
-
// },
|
|
1917
|
-
// })
|
|
1918
|
-
// );
|
|
1919
|
-
// });
|
|
1920
|
-
// await Promise.all(evaluationArray);
|
|
1921
|
-
// const productTemp = product;
|
|
1922
|
-
// productTemp.status = `${result}A`;
|
|
1923
|
-
// productTemp.datasheet_status =
|
|
1924
|
-
// productTemp.datasheet_status === "NA" ? "NA" : `${result}A`;
|
|
1925
|
-
// productTemp.description_status =
|
|
1926
|
-
// productTemp.description_status === "NA" ? "NA" : `${result}A`;
|
|
1927
|
-
// productTemp.images_status =
|
|
1928
|
-
// productTemp.images_status === "NA" ? "NA" : `${result}A`;
|
|
1929
|
-
// sessionStorage.setItem("productSelected", JSON.stringify(productTemp));
|
|
1930
|
-
// setProduct(productTemp);
|
|
1931
|
-
// await loadData();
|
|
1932
|
-
// } catch (error) {
|
|
1933
|
-
// console.log(error);
|
|
1934
|
-
// }
|
|
1935
|
-
// };
|
|
1835
|
+
}, [loading]);
|
|
1936
1836
|
|
|
1937
1837
|
var validateAll = /*#__PURE__*/function () {
|
|
1938
1838
|
var _ref19 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee15(result) {
|
|
1939
|
-
var evaluationArray, conceptArray, productTemp;
|
|
1839
|
+
var evaluationArray, conceptArray, messages, productTemp, messagesResponse;
|
|
1940
1840
|
return _regenerator.default.wrap(function _callee15$(_context15) {
|
|
1941
1841
|
while (1) {
|
|
1942
1842
|
switch (_context15.prev = _context15.next) {
|
|
@@ -1962,6 +1862,7 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
|
|
|
1962
1862
|
return _context15.abrupt("break", 13);
|
|
1963
1863
|
|
|
1964
1864
|
case 13:
|
|
1865
|
+
messages = [];
|
|
1965
1866
|
servicesData === null || servicesData === void 0 ? void 0 : servicesData.forEach(function (ret) {
|
|
1966
1867
|
if (conceptArray.includes(ret.service)) {
|
|
1967
1868
|
var _product$id_order;
|
|
@@ -1981,42 +1882,82 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
|
|
|
1981
1882
|
}));
|
|
1982
1883
|
}
|
|
1983
1884
|
});
|
|
1984
|
-
_context15.next =
|
|
1885
|
+
_context15.next = 17;
|
|
1985
1886
|
return Promise.all(evaluationArray);
|
|
1986
1887
|
|
|
1987
|
-
case
|
|
1888
|
+
case 17:
|
|
1988
1889
|
productTemp = product;
|
|
1989
1890
|
productTemp.status = "".concat(result, "A");
|
|
1990
|
-
productTemp.datasheet_status = productTemp.datasheet_status === "
|
|
1991
|
-
productTemp.description_status = productTemp.description_status === "
|
|
1992
|
-
productTemp.images_status = productTemp.images_status === "
|
|
1891
|
+
productTemp.datasheet_status = productTemp.datasheet_status === "NS" ? "NS" : "".concat(result, "A");
|
|
1892
|
+
productTemp.description_status = productTemp.description_status === "NS" ? "NS" : "".concat(result, "A");
|
|
1893
|
+
productTemp.images_status = productTemp.images_status === "NS" ? "NS" : "".concat(result, "A");
|
|
1993
1894
|
sessionStorage.setItem("productSelected", JSON.stringify(productTemp));
|
|
1994
1895
|
setProduct(productTemp);
|
|
1995
|
-
_context15.next =
|
|
1896
|
+
_context15.next = 26;
|
|
1897
|
+
return Promise.all(messages);
|
|
1898
|
+
|
|
1899
|
+
case 26:
|
|
1900
|
+
messagesResponse = _context15.sent;
|
|
1901
|
+
_context15.next = 29;
|
|
1996
1902
|
return loadData();
|
|
1997
1903
|
|
|
1998
|
-
case
|
|
1999
|
-
_context15.next =
|
|
1904
|
+
case 29:
|
|
1905
|
+
_context15.next = 34;
|
|
2000
1906
|
break;
|
|
2001
1907
|
|
|
2002
|
-
case
|
|
2003
|
-
_context15.prev =
|
|
1908
|
+
case 31:
|
|
1909
|
+
_context15.prev = 31;
|
|
2004
1910
|
_context15.t1 = _context15["catch"](0);
|
|
2005
1911
|
console.log(_context15.t1);
|
|
2006
1912
|
|
|
2007
|
-
case
|
|
1913
|
+
case 34:
|
|
2008
1914
|
case "end":
|
|
2009
1915
|
return _context15.stop();
|
|
2010
1916
|
}
|
|
2011
1917
|
}
|
|
2012
|
-
}, _callee15, null, [[0,
|
|
1918
|
+
}, _callee15, null, [[0, 31]]);
|
|
2013
1919
|
}));
|
|
2014
1920
|
|
|
2015
|
-
return function validateAll(
|
|
1921
|
+
return function validateAll(_x4) {
|
|
2016
1922
|
return _ref19.apply(this, arguments);
|
|
2017
1923
|
};
|
|
2018
1924
|
}();
|
|
2019
1925
|
|
|
1926
|
+
var getObservation = /*#__PURE__*/function () {
|
|
1927
|
+
var _ref20 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee16() {
|
|
1928
|
+
var response, parseData;
|
|
1929
|
+
return _regenerator.default.wrap(function _callee16$(_context16) {
|
|
1930
|
+
while (1) {
|
|
1931
|
+
switch (_context16.prev = _context16.next) {
|
|
1932
|
+
case 0:
|
|
1933
|
+
_context16.next = 2;
|
|
1934
|
+
return _axios.default.get("".concat(process.env.REACT_APP_READ_OBSERVATION, "?articleId=").concat(product.article.id_article, "&orderId=").concat(product === null || product === void 0 ? void 0 : product.orderId), {
|
|
1935
|
+
headers: {
|
|
1936
|
+
Authorization: sessionStorage.getItem("jwt")
|
|
1937
|
+
}
|
|
1938
|
+
});
|
|
1939
|
+
|
|
1940
|
+
case 2:
|
|
1941
|
+
response = _context16.sent;
|
|
1942
|
+
parseData = JSON.parse(response.data.body).data[0];
|
|
1943
|
+
setObservation(parseData.observations);
|
|
1944
|
+
|
|
1945
|
+
case 5:
|
|
1946
|
+
case "end":
|
|
1947
|
+
return _context16.stop();
|
|
1948
|
+
}
|
|
1949
|
+
}
|
|
1950
|
+
}, _callee16);
|
|
1951
|
+
}));
|
|
1952
|
+
|
|
1953
|
+
return function getObservation() {
|
|
1954
|
+
return _ref20.apply(this, arguments);
|
|
1955
|
+
};
|
|
1956
|
+
}();
|
|
1957
|
+
|
|
1958
|
+
(0, _react.useEffect)(function () {
|
|
1959
|
+
getObservation();
|
|
1960
|
+
}, []);
|
|
2020
1961
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_styles.Container, {
|
|
2021
1962
|
headerTop: headerTop,
|
|
2022
1963
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_HeaderTop.HeaderTop, {
|
|
@@ -2025,8 +1966,10 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
|
|
|
2025
1966
|
setCompare: setCompare,
|
|
2026
1967
|
isAuditor: [1, 6].includes(user.id_role),
|
|
2027
1968
|
withChat: location === null || location === void 0 ? void 0 : (_location$state = location.state) === null || _location$state === void 0 ? void 0 : _location$state.withChat,
|
|
2028
|
-
|
|
2029
|
-
|
|
1969
|
+
chatType: location === null || location === void 0 ? void 0 : (_location$state2 = location.state) === null || _location$state2 === void 0 ? void 0 : _location$state2.chatType,
|
|
1970
|
+
productSelected: product,
|
|
1971
|
+
token: token,
|
|
1972
|
+
activeRetailer: activeRetailer
|
|
2030
1973
|
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
2031
1974
|
className: "data-container",
|
|
2032
1975
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
@@ -2059,6 +2002,7 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
|
|
|
2059
2002
|
className: "product-information",
|
|
2060
2003
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_FullProductNameHeader.FullProductNameHeader, {
|
|
2061
2004
|
headerData: product,
|
|
2005
|
+
productObservation: observation,
|
|
2062
2006
|
percent: activePercentage,
|
|
2063
2007
|
activeRetailer: activeRetailer,
|
|
2064
2008
|
servicesData: servicesData,
|
|
@@ -2068,27 +2012,7 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
|
|
|
2068
2012
|
sendToFacilitator("A");
|
|
2069
2013
|
},
|
|
2070
2014
|
reject: function reject() {
|
|
2071
|
-
|
|
2072
|
-
setMessage("Rechazado");
|
|
2073
|
-
setComponentsArray([/*#__PURE__*/(0, _jsxRuntime.jsx)("img", {
|
|
2074
|
-
src: _errorModal.default
|
|
2075
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ScreenHeader.ScreenHeader, {
|
|
2076
|
-
text: "Agrega tu comentarios para enviar el rechazo",
|
|
2077
|
-
headerType: "input-name-header",
|
|
2078
|
-
color: "white"
|
|
2079
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_index.TagAndInput, {
|
|
2080
|
-
label: "Caja de Comentario",
|
|
2081
|
-
inputType: "textarea",
|
|
2082
|
-
inputId: "modal-commentary-box",
|
|
2083
|
-
index: 0,
|
|
2084
|
-
color: "white"
|
|
2085
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_GeneralButton.Button, {
|
|
2086
|
-
buttonType: "general-default-button",
|
|
2087
|
-
label: "Enviar comentario",
|
|
2088
|
-
onClick: function onClick(e) {
|
|
2089
|
-
return createComment(e, document.querySelector("#modal-commentary-box .ql-container .ql-editor > p").innerHTML, activeTab);
|
|
2090
|
-
}
|
|
2091
|
-
})]);
|
|
2015
|
+
setShowRejectModal(true);
|
|
2092
2016
|
},
|
|
2093
2017
|
showApproveRejectAll: approveRejectAllButtons() && (auditorAssigned() || userAssigned()),
|
|
2094
2018
|
showValidationButtons: approveRejectButtons() && (auditorAssigned() || userAssigned()),
|
|
@@ -2096,27 +2020,8 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
|
|
|
2096
2020
|
return validateAll("A");
|
|
2097
2021
|
},
|
|
2098
2022
|
rejectAll: function rejectAll() {
|
|
2099
|
-
|
|
2100
|
-
|
|
2101
|
-
setComponentsArray([/*#__PURE__*/(0, _jsxRuntime.jsx)("img", {
|
|
2102
|
-
src: _errorModal.default
|
|
2103
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ScreenHeader.ScreenHeader, {
|
|
2104
|
-
text: "Agrega tu comentarios para enviar el rechazo",
|
|
2105
|
-
headerType: "input-name-header",
|
|
2106
|
-
color: "white"
|
|
2107
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_index.TagAndInput, {
|
|
2108
|
-
label: "Caja de Comentario",
|
|
2109
|
-
inputType: "textarea",
|
|
2110
|
-
inputId: "modal-commentary-box",
|
|
2111
|
-
index: 0,
|
|
2112
|
-
color: "white"
|
|
2113
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_GeneralButton.Button, {
|
|
2114
|
-
buttonType: "general-default-button",
|
|
2115
|
-
label: "Enviar comentario",
|
|
2116
|
-
onClick: function onClick(e) {
|
|
2117
|
-
return createComment(e, document.querySelector("#modal-commentary-box .ql-container .ql-editor > p").innerHTML, activeTab);
|
|
2118
|
-
}
|
|
2119
|
-
})]);
|
|
2023
|
+
setShowRejectModal(true);
|
|
2024
|
+
setValRejAll(true);
|
|
2120
2025
|
}
|
|
2121
2026
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_FullTabsMenu.FullTabsMenu, {
|
|
2122
2027
|
tabsSections: tabsSections,
|
|
@@ -2131,6 +2036,12 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
|
|
|
2131
2036
|
isRetailer: isRetailer,
|
|
2132
2037
|
showSaveButton: auditorAssigned() || userAssigned(),
|
|
2133
2038
|
version: version,
|
|
2039
|
+
desc: desc,
|
|
2040
|
+
setDesc: setDesc,
|
|
2041
|
+
fich: fich,
|
|
2042
|
+
setFich: setFich,
|
|
2043
|
+
imag: imag,
|
|
2044
|
+
setImag: setImag,
|
|
2134
2045
|
updatedDescriptions: updatedDescriptions,
|
|
2135
2046
|
setUpdatedDescriptions: setUpdatedDescriptions,
|
|
2136
2047
|
updatedDatasheets: updatedDatasheets,
|
|
@@ -2188,7 +2099,7 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
|
|
|
2188
2099
|
auditInputGroup: auditDescriptions[0],
|
|
2189
2100
|
updatedDescriptions: updatedDescriptions,
|
|
2190
2101
|
setUpdatedDescriptions: setUpdatedDescriptions,
|
|
2191
|
-
articleId: product === null || product === void 0 ? void 0 : (_product$
|
|
2102
|
+
articleId: product === null || product === void 0 ? void 0 : (_product$article17 = product.article) === null || _product$article17 === void 0 ? void 0 : _product$article17.id_article,
|
|
2192
2103
|
version: version,
|
|
2193
2104
|
dinamicHeight: true,
|
|
2194
2105
|
compare: compare
|
|
@@ -2209,57 +2120,15 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
|
|
|
2209
2120
|
headerType: "input-name-header"
|
|
2210
2121
|
}))]
|
|
2211
2122
|
})
|
|
2212
|
-
}), (userAssigned(activeTab) || auditorAssigned()) && product["".concat(getConcept(activeTab), "_status")] !== "NS" && /*#__PURE__*/(0, _jsxRuntime.
|
|
2123
|
+
}), (userAssigned(activeTab) || auditorAssigned()) && product["".concat(getConcept(activeTab), "_status")] !== "NS" && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
2213
2124
|
className: "commentary-box",
|
|
2214
|
-
children: [
|
|
2215
|
-
className: "commentary",
|
|
2216
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_index.TagAndInput, {
|
|
2217
|
-
label: "Caja de Comentario",
|
|
2218
|
-
inputType: "textarea",
|
|
2219
|
-
inputCols: 80,
|
|
2220
|
-
inputRows: 4,
|
|
2221
|
-
inputId: "commentary-box",
|
|
2222
|
-
index: 0
|
|
2223
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
2224
|
-
className: "buttons-box",
|
|
2225
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_GeneralButton.Button, {
|
|
2226
|
-
buttonType: "general-transparent-button",
|
|
2227
|
-
label: "Enviar comentario",
|
|
2228
|
-
onClick: function onClick(e) {
|
|
2229
|
-
return createComment(e, document.querySelector("#commentary-box .ql-container .ql-editor > p").innerHTML, activeTab);
|
|
2230
|
-
}
|
|
2231
|
-
})
|
|
2232
|
-
})]
|
|
2233
|
-
}) : /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
2234
|
-
className: "feedback-box",
|
|
2235
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_Commentary.Commentary, {
|
|
2236
|
-
comment: comment === null || comment === void 0 ? void 0 : (_comment$message = comment.message) === null || _comment$message === void 0 ? void 0 : _comment$message.replace(/<.*?\/?>/gm, ""),
|
|
2237
|
-
reviewed: crossComment
|
|
2238
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_GeneralButton.Button, {
|
|
2239
|
-
buttonType: "circular-button accept-button",
|
|
2240
|
-
onClick: /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee16() {
|
|
2241
|
-
return _regenerator.default.wrap(function _callee16$(_context16) {
|
|
2242
|
-
while (1) {
|
|
2243
|
-
switch (_context16.prev = _context16.next) {
|
|
2244
|
-
case 0:
|
|
2245
|
-
setCrossComment(true);
|
|
2246
|
-
commentRevised();
|
|
2247
|
-
|
|
2248
|
-
case 2:
|
|
2249
|
-
case "end":
|
|
2250
|
-
return _context16.stop();
|
|
2251
|
-
}
|
|
2252
|
-
}
|
|
2253
|
-
}, _callee16);
|
|
2254
|
-
}))
|
|
2255
|
-
})]
|
|
2256
|
-
}), [7, 8].includes(user.id_role) && /*#__PURE__*/(0, _jsxRuntime.jsx)(_GeneralButton.Button, {
|
|
2125
|
+
children: [7, 8].includes(user.id_role) && /*#__PURE__*/(0, _jsxRuntime.jsx)(_GeneralButton.Button, {
|
|
2257
2126
|
buttonType: evaluationFinished(user.id_role, activeTab, statusArray) && requiredNull[activeTab] === 0 ? "general-green-button" : "general-button-disabled",
|
|
2258
2127
|
label: "Enviar evaluación",
|
|
2259
2128
|
onClick: function onClick() {
|
|
2260
2129
|
return sendToFacilitator();
|
|
2261
2130
|
}
|
|
2262
|
-
})
|
|
2131
|
+
})
|
|
2263
2132
|
})]
|
|
2264
2133
|
})]
|
|
2265
2134
|
}), showModal && /*#__PURE__*/(0, _jsxRuntime.jsx)(_ProductImageModal.ProductImageModal, {
|
|
@@ -2288,6 +2157,53 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
|
|
|
2288
2157
|
currentVersion: version,
|
|
2289
2158
|
setShowVersionSelector: setShowVersionSelector,
|
|
2290
2159
|
jwt: token
|
|
2160
|
+
}), showRejectModal && /*#__PURE__*/(0, _jsxRuntime.jsx)(_Modal.Modal, {
|
|
2161
|
+
title: "Agregar mensaje de rechazo para ".concat(activeTab === null || activeTab === void 0 ? void 0 : activeTab.toLowerCase()),
|
|
2162
|
+
show: showRejectModal,
|
|
2163
|
+
customComponent: /*#__PURE__*/(0, _jsxRuntime.jsx)(_index.TagAndInput, {
|
|
2164
|
+
inputType: "textarea",
|
|
2165
|
+
inputId: "modal-message-box",
|
|
2166
|
+
index: 0,
|
|
2167
|
+
color: "white"
|
|
2168
|
+
}),
|
|
2169
|
+
buttons: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_ButtonV.ButtonV2, {
|
|
2170
|
+
type: "white",
|
|
2171
|
+
label: "Cancelar",
|
|
2172
|
+
size: 12,
|
|
2173
|
+
onClick: function onClick() {
|
|
2174
|
+
setShowRejectModal(false);
|
|
2175
|
+
}
|
|
2176
|
+
}, "btn-Cancelar"), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ButtonV.ButtonV2, {
|
|
2177
|
+
type: "pink",
|
|
2178
|
+
label: "Aceptar",
|
|
2179
|
+
size: 12,
|
|
2180
|
+
onClick: /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee17() {
|
|
2181
|
+
var body, messages;
|
|
2182
|
+
return _regenerator.default.wrap(function _callee17$(_context17) {
|
|
2183
|
+
while (1) {
|
|
2184
|
+
switch (_context17.prev = _context17.next) {
|
|
2185
|
+
case 0:
|
|
2186
|
+
body = document.querySelector("#modal-message-box .ql-container .ql-editor > p").innerHTML;
|
|
2187
|
+
messages = [{
|
|
2188
|
+
type: "message",
|
|
2189
|
+
value: body === null || body === void 0 ? void 0 : body.replace(/<.*?\/?>/gm, "")
|
|
2190
|
+
}];
|
|
2191
|
+
_context17.next = 4;
|
|
2192
|
+
return createComment(messages, activeRetailer.id);
|
|
2193
|
+
|
|
2194
|
+
case 4:
|
|
2195
|
+
valRejAll ? validateAll("R") : sendToFacilitator("R");
|
|
2196
|
+
setMessage("Rechazado");
|
|
2197
|
+
setShowRejectModal(false);
|
|
2198
|
+
|
|
2199
|
+
case 7:
|
|
2200
|
+
case "end":
|
|
2201
|
+
return _context17.stop();
|
|
2202
|
+
}
|
|
2203
|
+
}
|
|
2204
|
+
}, _callee17);
|
|
2205
|
+
}))
|
|
2206
|
+
}, "btn-Aceptar")]
|
|
2291
2207
|
})]
|
|
2292
2208
|
});
|
|
2293
2209
|
};
|