contentoh-components-library 21.5.7 → 21.5.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/organisms/InputGroup/index.js +1 -9
- 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/GridProducts/index.js +1 -1
- package/src/components/organisms/InputGroup/index.js +144 -303
- 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
|
@@ -1,321 +0,0 @@
|
|
|
1
|
-
import React, { useState, useEffect, useReducer, useRef } from "react";
|
|
2
|
-
import { Container } from "./styles";
|
|
3
|
-
import { Button } from "@mui/material";
|
|
4
|
-
import { GroupRow } from "./styles";
|
|
5
|
-
import { ButtonV2 } from "../../atoms/ButtonV2";
|
|
6
|
-
import trash from "../../../assets/images/Icons/trash.svg";
|
|
7
|
-
import edit from "../../../assets/images/Icons/edit.svg";
|
|
8
|
-
import close from "../../../assets/images/Icons/close.svg";
|
|
9
|
-
import save from "../../../assets/images/Icons/save.svg";
|
|
10
|
-
import { Fade, Grow, Zoom, Backdrop } from "@mui/material";
|
|
11
|
-
import axios from "axios";
|
|
12
|
-
|
|
13
|
-
const reducerGroups = (state, action) => {
|
|
14
|
-
let { values } = state;
|
|
15
|
-
switch (action.type) {
|
|
16
|
-
case "init":
|
|
17
|
-
return { ...state, values: action.payload };
|
|
18
|
-
case "addGroup":
|
|
19
|
-
values = [...values, action.group];
|
|
20
|
-
return { ...state, values };
|
|
21
|
-
case "updateGroup":
|
|
22
|
-
values[action.payload.index][action.payload.property] =
|
|
23
|
-
action.payload.value;
|
|
24
|
-
return { ...state, values };
|
|
25
|
-
case "deleteGroup":
|
|
26
|
-
values = values.map((item) =>
|
|
27
|
-
item.groupId !== action.payload.id ? item : { ...item, isDeleted: true }
|
|
28
|
-
);
|
|
29
|
-
return { ...state, values };
|
|
30
|
-
default:
|
|
31
|
-
return state;
|
|
32
|
-
}
|
|
33
|
-
};
|
|
34
|
-
|
|
35
|
-
export const EditGroup = ({ token, show, onClose }) => {
|
|
36
|
-
const [groups, setGroups] = useState([]);
|
|
37
|
-
const [state, dispatch] = useReducer(reducerGroups, {});
|
|
38
|
-
const [isMoreThanTenGroups, setIsMoreThanTenGroups] = useState(false);
|
|
39
|
-
const [editingIndex, setEditingIndex] = useState(null);
|
|
40
|
-
const [deletingIndex, setDeletingIndex] = useState(null);
|
|
41
|
-
const [hoveredIndex, setHoveredIndex] = useState(null);
|
|
42
|
-
const [isEditingList, setIsEditingList] = useState([]);
|
|
43
|
-
const [newGroup, setNewGroup] = useState(false);
|
|
44
|
-
const [currentEditIndex, setCurrentEditIndex] = useState(null);
|
|
45
|
-
const [inputValue, setInputValue] = useState([]);
|
|
46
|
-
|
|
47
|
-
useEffect(() => {}, [groups]);
|
|
48
|
-
|
|
49
|
-
useEffect(() => {
|
|
50
|
-
loadData();
|
|
51
|
-
}, []);
|
|
52
|
-
|
|
53
|
-
const loadData = async () => {
|
|
54
|
-
try {
|
|
55
|
-
const response = await axios.post(
|
|
56
|
-
`${process.env.REACT_APP_GROUPS_ENDPOINT}/get`,
|
|
57
|
-
{},
|
|
58
|
-
{
|
|
59
|
-
headers: {
|
|
60
|
-
Authorization: token,
|
|
61
|
-
},
|
|
62
|
-
}
|
|
63
|
-
);
|
|
64
|
-
|
|
65
|
-
const receivedGroups = JSON.parse(response.data.body).groups;
|
|
66
|
-
const groupsArray = [];
|
|
67
|
-
receivedGroups.forEach(({ id, name, retailer_id }) => {
|
|
68
|
-
groupsArray.push({
|
|
69
|
-
groupId: id,
|
|
70
|
-
groupName: name || null,
|
|
71
|
-
retailerId: retailer_id || null,
|
|
72
|
-
});
|
|
73
|
-
});
|
|
74
|
-
setGroups(groupsArray);
|
|
75
|
-
|
|
76
|
-
dispatch({ type: "init", payload: groupsArray });
|
|
77
|
-
} catch (error) {
|
|
78
|
-
console.error("Error al obtener grupos:", error);
|
|
79
|
-
}
|
|
80
|
-
};
|
|
81
|
-
|
|
82
|
-
const AddGroup = async (index, concatenatedValue) => {
|
|
83
|
-
try {
|
|
84
|
-
const response = await axios.post(
|
|
85
|
-
`${process.env.REACT_APP_GROUPS_ENDPOINT}/create`,
|
|
86
|
-
{
|
|
87
|
-
groupName: concatenatedValue,
|
|
88
|
-
},
|
|
89
|
-
{
|
|
90
|
-
headers: {
|
|
91
|
-
Authorization: token,
|
|
92
|
-
},
|
|
93
|
-
}
|
|
94
|
-
);
|
|
95
|
-
|
|
96
|
-
const createdGroup = response.data.body;
|
|
97
|
-
dispatch({ type: "addGroup", payload: createdGroup });
|
|
98
|
-
setEditingIndex(null);
|
|
99
|
-
setInputValue([]);
|
|
100
|
-
setIsEditingList((prevList) => {
|
|
101
|
-
const newList = [...prevList];
|
|
102
|
-
newList[index] = false;
|
|
103
|
-
return newList;
|
|
104
|
-
});
|
|
105
|
-
setCurrentEditIndex(null);
|
|
106
|
-
loadData();
|
|
107
|
-
} catch (error) {
|
|
108
|
-
console.error("Error al agregar grupo:", error);
|
|
109
|
-
}
|
|
110
|
-
};
|
|
111
|
-
|
|
112
|
-
const handleUpdateGroup = async (index, groupId, updatedGroupName) => {
|
|
113
|
-
try {
|
|
114
|
-
const response = await axios.post(
|
|
115
|
-
`${process.env.REACT_APP_GROUPS_ENDPOINT}/update?id=${groupId}&groupName=${updatedGroupName}`,
|
|
116
|
-
{},
|
|
117
|
-
{
|
|
118
|
-
headers: {
|
|
119
|
-
Authorization: token,
|
|
120
|
-
},
|
|
121
|
-
}
|
|
122
|
-
);
|
|
123
|
-
const updatedData = response.data.body;
|
|
124
|
-
dispatch({
|
|
125
|
-
type: "updateGroup",
|
|
126
|
-
payload: {
|
|
127
|
-
index,
|
|
128
|
-
property: "groupName",
|
|
129
|
-
value: updatedData.groupName,
|
|
130
|
-
},
|
|
131
|
-
});
|
|
132
|
-
setEditingIndex(null);
|
|
133
|
-
setInputValue([]);
|
|
134
|
-
setIsEditingList((prevList) => {
|
|
135
|
-
const newList = [...prevList];
|
|
136
|
-
newList[index] = false;
|
|
137
|
-
return newList;
|
|
138
|
-
});
|
|
139
|
-
setCurrentEditIndex(null);
|
|
140
|
-
loadData();
|
|
141
|
-
} catch (error) {
|
|
142
|
-
console.error("Error al actualizar grupo:", error);
|
|
143
|
-
}
|
|
144
|
-
};
|
|
145
|
-
|
|
146
|
-
const deleteGroup = async (groupId) => {
|
|
147
|
-
try {
|
|
148
|
-
const response = await axios.post(
|
|
149
|
-
`${process.env.REACT_APP_GROUPS_ENDPOINT}/delete?id=${groupId}`,
|
|
150
|
-
{},
|
|
151
|
-
{
|
|
152
|
-
headers: {
|
|
153
|
-
Authorization: token,
|
|
154
|
-
},
|
|
155
|
-
}
|
|
156
|
-
);
|
|
157
|
-
dispatch({
|
|
158
|
-
type: "deleteGroup",
|
|
159
|
-
payload: { id: groupId },
|
|
160
|
-
});
|
|
161
|
-
loadData();
|
|
162
|
-
} catch (error) {
|
|
163
|
-
console.error("Error al borrar grupo:", error);
|
|
164
|
-
}
|
|
165
|
-
};
|
|
166
|
-
|
|
167
|
-
const handleEditButtonClick = (index) => {
|
|
168
|
-
if (isEditingList[index]) {
|
|
169
|
-
handleSaveChanges(index);
|
|
170
|
-
} else {
|
|
171
|
-
setIsEditingList((prevList) => {
|
|
172
|
-
const newList = [...prevList];
|
|
173
|
-
newList[index] = true;
|
|
174
|
-
return newList;
|
|
175
|
-
});
|
|
176
|
-
setEditingIndex(index);
|
|
177
|
-
setInputValue(groups[index].groupName);
|
|
178
|
-
setNewGroup(groups[index].groupId);
|
|
179
|
-
setCurrentEditIndex(index);
|
|
180
|
-
}
|
|
181
|
-
};
|
|
182
|
-
|
|
183
|
-
const handleDeleteButtonClick = async (groupId) => {
|
|
184
|
-
await deleteGroup(groupId);
|
|
185
|
-
};
|
|
186
|
-
|
|
187
|
-
const handleInputChange = (value, index) => {
|
|
188
|
-
setInputValue((prevInputValue) => prevInputValue + value);
|
|
189
|
-
|
|
190
|
-
setGroups((prevGroups) => {
|
|
191
|
-
const updatedGroups = [...prevGroups];
|
|
192
|
-
if (index !== undefined) {
|
|
193
|
-
updatedGroups[index] = { ...updatedGroups[index], groupName: value };
|
|
194
|
-
}
|
|
195
|
-
return updatedGroups;
|
|
196
|
-
});
|
|
197
|
-
};
|
|
198
|
-
|
|
199
|
-
const handleAddButtonClick = () => {
|
|
200
|
-
const isAnyGroupEditing = isEditingList.some((editing) => editing);
|
|
201
|
-
if (!isAnyGroupEditing && groups.length < 20) {
|
|
202
|
-
setIsEditingList((prevList) => {
|
|
203
|
-
const newList = [...prevList];
|
|
204
|
-
newList[groups.length] = true;
|
|
205
|
-
return newList;
|
|
206
|
-
});
|
|
207
|
-
setEditingIndex(groups.length);
|
|
208
|
-
const nuevoGrupo = {
|
|
209
|
-
groupName: inputValue,
|
|
210
|
-
isEditing: true,
|
|
211
|
-
};
|
|
212
|
-
setGroups([...groups, nuevoGrupo]);
|
|
213
|
-
setIsMoreThanTenGroups(groups.length + 1 > 10);
|
|
214
|
-
setNewGroup(undefined);
|
|
215
|
-
setCurrentEditIndex(groups.length);
|
|
216
|
-
}
|
|
217
|
-
};
|
|
218
|
-
|
|
219
|
-
const handleSaveChanges = (index) => {
|
|
220
|
-
const concatenatedValue = groups[index].groupName;
|
|
221
|
-
if (newGroup !== undefined) {
|
|
222
|
-
handleUpdateGroup(index, newGroup, concatenatedValue);
|
|
223
|
-
} else {
|
|
224
|
-
AddGroup(index, concatenatedValue);
|
|
225
|
-
}
|
|
226
|
-
};
|
|
227
|
-
|
|
228
|
-
return (
|
|
229
|
-
<Backdrop
|
|
230
|
-
open={show}
|
|
231
|
-
className="container-backgroundModal"
|
|
232
|
-
timeout={400}
|
|
233
|
-
style={{
|
|
234
|
-
backgroundColor: "transparent",
|
|
235
|
-
zIndex: show ? 10 : -1,
|
|
236
|
-
}}
|
|
237
|
-
>
|
|
238
|
-
<Fade in={show} timeout={400}>
|
|
239
|
-
<Container>
|
|
240
|
-
<div className="Modal-edit-group">
|
|
241
|
-
<div className="header">
|
|
242
|
-
<h2 className="title-edit">Editar grupos</h2>
|
|
243
|
-
<Button
|
|
244
|
-
className={`circular-button close-edit-button`}
|
|
245
|
-
onClick={onClose}
|
|
246
|
-
>
|
|
247
|
-
<img src={close} alt="close icon" />
|
|
248
|
-
</Button>
|
|
249
|
-
</div>
|
|
250
|
-
<p className="details-edit">
|
|
251
|
-
Agrega, edita y borra. Luego guarda los cambios.
|
|
252
|
-
</p>
|
|
253
|
-
<div
|
|
254
|
-
className={`${
|
|
255
|
-
isMoreThanTenGroups ? "table-groups-max" : "table-groups-edit"
|
|
256
|
-
}`}
|
|
257
|
-
>
|
|
258
|
-
{groups.map((group, index) => (
|
|
259
|
-
<GroupRow
|
|
260
|
-
key={group.groupId}
|
|
261
|
-
editing={editingIndex === index}
|
|
262
|
-
deleting={deletingIndex === index}
|
|
263
|
-
onMouseEnter={() => setHoveredIndex(index)}
|
|
264
|
-
onMouseLeave={() => setHoveredIndex(null)}
|
|
265
|
-
className={`group-row ${
|
|
266
|
-
isEditingList[index] ? "editing" : ""
|
|
267
|
-
}`}
|
|
268
|
-
>
|
|
269
|
-
<input
|
|
270
|
-
key={index}
|
|
271
|
-
className={`input-group`}
|
|
272
|
-
placeholder="Escribe el nombre del grupo"
|
|
273
|
-
value={index !== undefined ? group.groupName : inputValue}
|
|
274
|
-
onChange={(e) => handleInputChange(e.target.value, index)}
|
|
275
|
-
disabled={!isEditingList[index]}
|
|
276
|
-
autoFocus={isEditingList[index] && editingIndex === index}
|
|
277
|
-
/>
|
|
278
|
-
{currentEditIndex === index ? (
|
|
279
|
-
<Button
|
|
280
|
-
className={`circular-button save-group-button visible`}
|
|
281
|
-
onClick={() => handleSaveChanges(index)}
|
|
282
|
-
>
|
|
283
|
-
<img src={save} alt="save update icon" />
|
|
284
|
-
</Button>
|
|
285
|
-
) : (
|
|
286
|
-
<>
|
|
287
|
-
<Button
|
|
288
|
-
className={`circular-button edit-group-button ${
|
|
289
|
-
hoveredIndex === index ? "visible" : ""
|
|
290
|
-
}`}
|
|
291
|
-
onClick={() => handleEditButtonClick(index)}
|
|
292
|
-
>
|
|
293
|
-
<img src={edit} alt="edit icon" />
|
|
294
|
-
</Button>
|
|
295
|
-
<Button
|
|
296
|
-
className={`circular-button delete-group-button ${
|
|
297
|
-
hoveredIndex === index ? "visible" : ""
|
|
298
|
-
}`}
|
|
299
|
-
onClick={() => handleDeleteButtonClick(group.groupId)}
|
|
300
|
-
>
|
|
301
|
-
<img src={trash} alt="trash icon" />
|
|
302
|
-
</Button>
|
|
303
|
-
</>
|
|
304
|
-
)}
|
|
305
|
-
</GroupRow>
|
|
306
|
-
))}
|
|
307
|
-
</div>
|
|
308
|
-
<div className="container-save-add">
|
|
309
|
-
<Button
|
|
310
|
-
className="button-group-add"
|
|
311
|
-
onClick={() => handleAddButtonClick()}
|
|
312
|
-
>
|
|
313
|
-
+ Agregar Grupo
|
|
314
|
-
</Button>
|
|
315
|
-
</div>
|
|
316
|
-
</div>
|
|
317
|
-
</Container>
|
|
318
|
-
</Fade>
|
|
319
|
-
</Backdrop>
|
|
320
|
-
);
|
|
321
|
-
};
|
|
@@ -1,207 +0,0 @@
|
|
|
1
|
-
import styled, {keyframes} from "styled-components";
|
|
2
|
-
import { GlobalColors, FontFamily } from "../../../global-files/variables";
|
|
3
|
-
|
|
4
|
-
const fadeIn = keyframes`
|
|
5
|
-
from {
|
|
6
|
-
opacity: 0;
|
|
7
|
-
}
|
|
8
|
-
to {
|
|
9
|
-
opacity: 1;
|
|
10
|
-
}
|
|
11
|
-
`;
|
|
12
|
-
|
|
13
|
-
export const Container = styled.div`
|
|
14
|
-
width: 100%;
|
|
15
|
-
height: 100%;
|
|
16
|
-
overflow: auto;
|
|
17
|
-
display: grid;
|
|
18
|
-
place-items: center;
|
|
19
|
-
.header {
|
|
20
|
-
width: 100%;
|
|
21
|
-
display: flex;
|
|
22
|
-
justify-content: space-between;
|
|
23
|
-
}
|
|
24
|
-
.close-edit-button {
|
|
25
|
-
min-width: 24px;
|
|
26
|
-
height: 24px;
|
|
27
|
-
background-color: transparent;
|
|
28
|
-
border: none;
|
|
29
|
-
border-radius: 50%;
|
|
30
|
-
cursor: pointer;
|
|
31
|
-
transition: background-color 0.3s ease, opacity 0.3s ease;
|
|
32
|
-
display: flex;
|
|
33
|
-
justify-content: center;
|
|
34
|
-
align-items: center;
|
|
35
|
-
-webkit-filter: grayscale(100%);
|
|
36
|
-
filter: grayscale(100%);
|
|
37
|
-
opacity:0.4;
|
|
38
|
-
img {
|
|
39
|
-
width: 10px;
|
|
40
|
-
height: 10px;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
&:hover {
|
|
44
|
-
background-color: ${GlobalColors.blue_light};
|
|
45
|
-
-webkit-filter: grayscale(0);
|
|
46
|
-
filter: grayscale(0);
|
|
47
|
-
opacity:1;
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
.Modal-edit-group {
|
|
51
|
-
position: absolute;
|
|
52
|
-
top: 10%;
|
|
53
|
-
z-index: 20;
|
|
54
|
-
width: fit-content;
|
|
55
|
-
max-width: 80%;
|
|
56
|
-
min-width: 80px;
|
|
57
|
-
height: fit-content;
|
|
58
|
-
max-height: 100%;
|
|
59
|
-
min-height: 120px;
|
|
60
|
-
display: flex;
|
|
61
|
-
flex-direction: column;
|
|
62
|
-
align-items: center;
|
|
63
|
-
background-color: white;
|
|
64
|
-
border-radius: 10px;
|
|
65
|
-
border: 1px solid ${GlobalColors.gray_light};
|
|
66
|
-
padding: 25px 25px 20px 25px;
|
|
67
|
-
box-shadow: 0px 2px 4px 0px #00000040;
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
.title-edit {
|
|
71
|
-
width: 100%;
|
|
72
|
-
font-family: ${FontFamily.RobotoMedium}, sans-serif;
|
|
73
|
-
font-size: 17px;
|
|
74
|
-
font-weight: 500;
|
|
75
|
-
line-height: 20px;
|
|
76
|
-
letter-spacing: 0em;
|
|
77
|
-
text-align: left;
|
|
78
|
-
color: ${GlobalColors.black};
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
.details-edit {
|
|
82
|
-
width: 100%;
|
|
83
|
-
font-family: ${FontFamily.RobotoMedium}, sans-serif;
|
|
84
|
-
font-size: 12px;
|
|
85
|
-
font-weight: 400;
|
|
86
|
-
line-height: 14px;
|
|
87
|
-
letter-spacing: 0em;
|
|
88
|
-
text-align: left;
|
|
89
|
-
color: ${GlobalColors.gray};
|
|
90
|
-
margin: 5px 0 10px;
|
|
91
|
-
}
|
|
92
|
-
.container-save-add {
|
|
93
|
-
width: 100%;
|
|
94
|
-
display: flex;
|
|
95
|
-
justify-content: space-between;
|
|
96
|
-
margin-top: 20px;
|
|
97
|
-
}
|
|
98
|
-
.button-group-add {
|
|
99
|
-
font-family: ${FontFamily.RobotoRegular}, sans-serif;
|
|
100
|
-
font-size: 12px;
|
|
101
|
-
font-weight: 400;
|
|
102
|
-
line-height: 14px;
|
|
103
|
-
letter-spacing: 0em;
|
|
104
|
-
text-align: left;
|
|
105
|
-
color: ${GlobalColors.magenta_s2};
|
|
106
|
-
text-transform: capitalize;
|
|
107
|
-
border: none;
|
|
108
|
-
background: transparent;
|
|
109
|
-
border-radius: 20px;
|
|
110
|
-
&:hover {
|
|
111
|
-
background-color: ${GlobalColors.blue_light};
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
.table-groups-edit {
|
|
115
|
-
width: 100%;
|
|
116
|
-
min-width: 288px;
|
|
117
|
-
border: 1px solid ${GlobalColors.gray_light};
|
|
118
|
-
border-radius: 5px;
|
|
119
|
-
}
|
|
120
|
-
.table-groups-max {
|
|
121
|
-
min-width: 288px;
|
|
122
|
-
border: 1px solid ${GlobalColors.gray_light};
|
|
123
|
-
border-radius: 5px;
|
|
124
|
-
display: grid;
|
|
125
|
-
grid-template-columns: repeat(2, 1fr);
|
|
126
|
-
}
|
|
127
|
-
.modal-save {
|
|
128
|
-
.contentModal {
|
|
129
|
-
width: 25%;
|
|
130
|
-
}
|
|
131
|
-
}
|
|
132
|
-
`;
|
|
133
|
-
|
|
134
|
-
export const GroupRow = styled.div`
|
|
135
|
-
width: 100%;
|
|
136
|
-
height: 34px;
|
|
137
|
-
margin: 0;
|
|
138
|
-
display: flex;
|
|
139
|
-
justify-content: space-between;
|
|
140
|
-
align-items: center;
|
|
141
|
-
font-family: Roboto;
|
|
142
|
-
font-size: 12px;
|
|
143
|
-
font-weight: 400;
|
|
144
|
-
line-height: 14px;
|
|
145
|
-
letter-spacing: 0em;
|
|
146
|
-
text-align: left;
|
|
147
|
-
text-decoration: none;
|
|
148
|
-
border-bottom: 1px solid ${GlobalColors.gray_light};
|
|
149
|
-
padding: 0 8px 0 0;
|
|
150
|
-
input {
|
|
151
|
-
width:100%;
|
|
152
|
-
min-width: 215px;
|
|
153
|
-
background: transparent;
|
|
154
|
-
color: ${GlobalColors.gray};
|
|
155
|
-
border: 0;
|
|
156
|
-
font-size: 12px;
|
|
157
|
-
font-family:${FontFamily.RobotoRegular}, sans-serif;
|
|
158
|
-
padding: 5px 20px;
|
|
159
|
-
::placeholder {
|
|
160
|
-
color: #CBCBCB;
|
|
161
|
-
}
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
input:focus {
|
|
165
|
-
border: 0;
|
|
166
|
-
}
|
|
167
|
-
&.editing {
|
|
168
|
-
background-color: ${GlobalColors.blue_light};
|
|
169
|
-
color: black;
|
|
170
|
-
input{
|
|
171
|
-
color: ${GlobalColors.black};
|
|
172
|
-
}
|
|
173
|
-
}
|
|
174
|
-
|
|
175
|
-
.save-group-button,
|
|
176
|
-
.edit-group-button,
|
|
177
|
-
.delete-group-button {
|
|
178
|
-
min-width: 24px;
|
|
179
|
-
height: 24px;
|
|
180
|
-
background-color: transparent;
|
|
181
|
-
border: none;
|
|
182
|
-
border-radius: 50%;
|
|
183
|
-
cursor: pointer;
|
|
184
|
-
transition: background-color 0.3s ease, opacity 0.3s ease;
|
|
185
|
-
display: flex;
|
|
186
|
-
justify-content: center;
|
|
187
|
-
align-items: center;
|
|
188
|
-
|
|
189
|
-
img {
|
|
190
|
-
width: 12px;
|
|
191
|
-
height: 12px;
|
|
192
|
-
}
|
|
193
|
-
|
|
194
|
-
&:hover {
|
|
195
|
-
background-color: ${GlobalColors.blue_light};
|
|
196
|
-
}
|
|
197
|
-
}
|
|
198
|
-
.edit-group-button,
|
|
199
|
-
.delete-group-button {
|
|
200
|
-
display: none;
|
|
201
|
-
}
|
|
202
|
-
|
|
203
|
-
.visible {
|
|
204
|
-
display: flex;
|
|
205
|
-
animation: ${fadeIn} 0.3s ease-in-out forwards;
|
|
206
|
-
}
|
|
207
|
-
`;
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { FullProductNamev2 } from "./index";
|
|
2
|
-
|
|
3
|
-
export default {
|
|
4
|
-
title: "Components/organisms/FullProductNamev2",
|
|
5
|
-
component: FullProductNamev2,
|
|
6
|
-
};
|
|
7
|
-
|
|
8
|
-
const Template = (args) => <FullProductNamev2 {...args} />;
|
|
9
|
-
export const FullProductNamev2Default = Template.bind({});
|
|
10
|
-
|
|
11
|
-
FullProductNamev2Default.args = {
|
|
12
|
-
headerData: {
|
|
13
|
-
name: "Nombre del producto",
|
|
14
|
-
status: "P",
|
|
15
|
-
percent: 20,
|
|
16
|
-
backgroundColor: "in_progress",
|
|
17
|
-
priority: "low",
|
|
18
|
-
date: new Date().toLocaleDateString(),
|
|
19
|
-
features: [
|
|
20
|
-
{ feature: "Prov", value: "Unilever" },
|
|
21
|
-
{ feature: "Vendor", value: "1234567890" },
|
|
22
|
-
{ feature: "SKU", value: "1234567890" },
|
|
23
|
-
{ feature: "UPC", value: "1234567890" },
|
|
24
|
-
{ feature: "Categoría", value: "Desodorantes Caballero y Dama" },
|
|
25
|
-
],
|
|
26
|
-
validation: "null-button",
|
|
27
|
-
},
|
|
28
|
-
};
|
|
@@ -1,101 +0,0 @@
|
|
|
1
|
-
import { Container } from "./styles";
|
|
2
|
-
import { ProductNameHeaderv2 } from "../../molecules/ProductNameHeaderv2";
|
|
3
|
-
import { FeaturesBarv2 } from "../../molecules/FeaturesBarv2";
|
|
4
|
-
import { Button } from "../../atoms/GeneralButton/index";
|
|
5
|
-
import { useState } from "react";
|
|
6
|
-
import { useEffect } from "react";
|
|
7
|
-
import { ProductSkuStatus } from "../../molecules/ProductSkuStatus";
|
|
8
|
-
import { PriorityFlagv2 } from "../../atoms/PriorityFlagv2";
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
export const FullProductNamev2 = ({
|
|
12
|
-
headerData,
|
|
13
|
-
percent,
|
|
14
|
-
servicesData,
|
|
15
|
-
version,
|
|
16
|
-
setShowVersionSelector,
|
|
17
|
-
}) => {
|
|
18
|
-
const [retailers, setRetailers] = useState([]);
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
useEffect(() => {
|
|
22
|
-
const rtls = headerData?.retailers || headerData?.retailersAvailable;
|
|
23
|
-
servicesData &&
|
|
24
|
-
rtls?.forEach((rt) => {
|
|
25
|
-
const element = [];
|
|
26
|
-
servicesData.forEach((sd) => {
|
|
27
|
-
if (sd.id_retailer === rt.id) {
|
|
28
|
-
element.push(sd.status ? sd.status : "R");
|
|
29
|
-
} else element.push("NA");
|
|
30
|
-
rt["services"] = element;
|
|
31
|
-
});
|
|
32
|
-
});
|
|
33
|
-
setRetailers(rtls);
|
|
34
|
-
}, [servicesData]);
|
|
35
|
-
|
|
36
|
-
const getTime = (date) => {
|
|
37
|
-
if (!date) return "";
|
|
38
|
-
return new Date(date).toLocaleDateString();
|
|
39
|
-
};
|
|
40
|
-
|
|
41
|
-
return (
|
|
42
|
-
<Container>
|
|
43
|
-
<div className="top-product-close">
|
|
44
|
-
<ProductNameHeaderv2
|
|
45
|
-
productName={headerData?.article?.name || headerData?.name}
|
|
46
|
-
/>
|
|
47
|
-
<Button
|
|
48
|
-
buttonType="general-white-button close-buttonv2"
|
|
49
|
-
onClick={() => {
|
|
50
|
-
window.location.href = `/products`;
|
|
51
|
-
}}
|
|
52
|
-
/>
|
|
53
|
-
</div>
|
|
54
|
-
|
|
55
|
-
<div className="features-bar-container">
|
|
56
|
-
<FeaturesBarv2
|
|
57
|
-
containerClassName="bar-container"
|
|
58
|
-
features={[
|
|
59
|
-
{
|
|
60
|
-
feature: "Categoría",
|
|
61
|
-
value: headerData?.article?.category || headerData?.categoryName,
|
|
62
|
-
},
|
|
63
|
-
{
|
|
64
|
-
feature: "Proveedor",
|
|
65
|
-
value: headerData?.article?.company_name,
|
|
66
|
-
},
|
|
67
|
-
]}
|
|
68
|
-
/>
|
|
69
|
-
</div>
|
|
70
|
-
<div className="features-bar-sku">
|
|
71
|
-
<PriorityFlagv2 priority={headerData?.prio}/>
|
|
72
|
-
<FeaturesBarv2
|
|
73
|
-
containerClassName="bar-sku"
|
|
74
|
-
contClassName="bar-sku-cont"
|
|
75
|
-
features={[
|
|
76
|
-
{
|
|
77
|
-
feature: "SKU",
|
|
78
|
-
value: headerData?.article?.upc || headerData?.upc,
|
|
79
|
-
},
|
|
80
|
-
]}
|
|
81
|
-
/>
|
|
82
|
-
<ProductSkuStatus
|
|
83
|
-
productName={headerData?.article?.name || headerData?.name}
|
|
84
|
-
statusType={
|
|
85
|
-
headerData?.version_status ||
|
|
86
|
-
headerData?.status ||
|
|
87
|
-
headerData?.article_status
|
|
88
|
-
}
|
|
89
|
-
setShowVersionSelector={setShowVersionSelector}
|
|
90
|
-
percentRequired={percent}
|
|
91
|
-
showShield={true}
|
|
92
|
-
percent={percent?.toFixed(0)}
|
|
93
|
-
date={getTime(headerData?.article?.timestamp || headerData?.timestamp)}
|
|
94
|
-
containerClassName="bar-sku"
|
|
95
|
-
contClassName="bar-sku-cont"
|
|
96
|
-
version={version}
|
|
97
|
-
/>
|
|
98
|
-
</div>
|
|
99
|
-
</Container>
|
|
100
|
-
);
|
|
101
|
-
};
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import styled from "styled-components";
|
|
2
|
-
import { GlobalColors, FontFamily } from "../../../global-files/variables";
|
|
3
|
-
|
|
4
|
-
export const Container = styled.div`
|
|
5
|
-
background: ${GlobalColors.blue_light};
|
|
6
|
-
padding: 16px 20px 15px 20px;
|
|
7
|
-
border-radius: 10px;
|
|
8
|
-
width: 100%;
|
|
9
|
-
.features-bar-container {
|
|
10
|
-
display: flex;
|
|
11
|
-
flex-direction:column;
|
|
12
|
-
justify-content: space-between;
|
|
13
|
-
margin:10px 0px;
|
|
14
|
-
}
|
|
15
|
-
.features-bar-sku {
|
|
16
|
-
margin:10px 5px;
|
|
17
|
-
display: flex;
|
|
18
|
-
gap: 8px;
|
|
19
|
-
align-items: center;
|
|
20
|
-
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
& + * {
|
|
24
|
-
margin-top: 0px;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
.top-product-close{
|
|
28
|
-
display:flex;
|
|
29
|
-
justify-content:space-between;
|
|
30
|
-
button {
|
|
31
|
-
width: 34px;
|
|
32
|
-
height: 34px;
|
|
33
|
-
border: 1px solid #f0f0f0;
|
|
34
|
-
background-size: 20px;
|
|
35
|
-
padding: 0;
|
|
36
|
-
display: flex;
|
|
37
|
-
justify-content: center;
|
|
38
|
-
align-items: center;
|
|
39
|
-
img {
|
|
40
|
-
height: 15px;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
& + * {
|
|
44
|
-
margin-left: 10px;
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
`;
|