contentoh-components-library 21.3.4 → 21.3.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.env.development +2 -5
- package/.env.production +25 -25
- package/dist/components/atoms/GeneralButton/index.js +6 -2
- package/dist/components/atoms/Select/VersionSelect.js +2 -1
- package/dist/components/molecules/CustomSelect/CustomSelect.stories.js +22 -21
- package/dist/components/molecules/CustomSelect/SelectItem.js +1 -10
- package/dist/components/molecules/HeaderTop/index.js +5 -10
- package/dist/components/molecules/HeaderTop/styles.js +1 -1
- package/dist/components/organisms/CreateVersion/RenderChilds.js +11 -11
- package/dist/components/organisms/CreateVersion/index.js +30 -89
- package/dist/components/organisms/OrderDetail/OrderDetail.stories.js +1 -1
- package/dist/components/organisms/OrderDetail/index.js +20 -11
- package/dist/components/organisms/OrderDetail/styles.js +1 -1
- package/dist/components/organisms/OrderDetail/utils/Table/styles.js +1 -1
- package/dist/components/organisms/OrderDetail/utils/Table/utils.js +45 -15
- package/dist/components/organisms/VersionSelector/index.js +28 -2
- package/dist/components/pages/ProviderProductEdition/ProviderProductEdition.stories.js +69 -147
- package/dist/components/pages/ProviderProductEdition/index.js +19 -39
- package/dist/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +77 -67
- package/dist/components/pages/RetailerProductEdition/index.js +5 -24
- package/dist/global-files/fonts.css +0 -6
- package/dist/global-files/variables.js +0 -2
- package/dist/index.js +46 -267
- package/package.json +1 -12
- package/src/components/atoms/GeneralButton/index.js +4 -1
- package/src/components/atoms/Select/VersionSelect.js +4 -2
- package/src/components/molecules/CustomSelect/CustomSelect.stories.js +12 -20
- package/src/components/molecules/CustomSelect/SelectItem.js +0 -7
- package/src/components/molecules/HeaderTop/index.js +6 -11
- package/src/components/molecules/HeaderTop/styles.js +0 -4
- package/src/components/organisms/CreateVersion/RenderChilds.js +28 -34
- package/src/components/organisms/CreateVersion/index.js +16 -36
- package/src/components/organisms/OrderDetail/OrderDetail.stories.js +1 -1
- package/src/components/organisms/OrderDetail/index.js +19 -12
- package/src/components/organisms/OrderDetail/styles.js +1 -0
- package/src/components/organisms/OrderDetail/utils/Table/styles.js +26 -0
- package/src/components/organisms/OrderDetail/utils/Table/utils.js +30 -15
- package/src/components/organisms/VersionSelector/index.js +18 -3
- package/src/components/pages/ProviderProductEdition/ProviderProductEdition.stories.js +75 -166
- package/src/components/pages/ProviderProductEdition/index.js +3 -22
- package/src/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +79 -67
- package/src/components/pages/RetailerProductEdition/index.js +2 -14
- package/src/global-files/customHooks.js +2 -2
- package/src/global-files/fonts.css +0 -6
- package/src/global-files/variables.js +0 -2
- package/src/index.js +0 -17
- package/dist/assets/images/customSelect/starIcon.svg +0 -14
- package/dist/assets/images/defaultImages/Spinner.gif +0 -0
- package/dist/assets/images/defaultImages/notFound.svg +0 -124
- package/dist/components/atoms/ButtonFileChooser/ButtonFileChooser.stories.js +0 -72
- package/dist/components/atoms/ButtonFileChooser/index.js +0 -118
- package/dist/components/atoms/ButtonFileChooser/styles.js +0 -20
- package/dist/components/atoms/ButtonV2/ButtonV2.stories.js +0 -66
- package/dist/components/atoms/ButtonV2/index.js +0 -110
- package/dist/components/atoms/ButtonV2/styles.js +0 -53
- package/dist/components/atoms/CustomIcon/CustomIcon.stories.js +0 -50
- package/dist/components/atoms/CustomIcon/index.js +0 -40
- package/dist/components/atoms/CustomIcon/styles.js +0 -33
- package/dist/components/atoms/IconFile/IconFile.stories.js +0 -48
- package/dist/components/atoms/IconFile/index.js +0 -249
- package/dist/components/atoms/IconFile/styles.js +0 -23
- package/dist/components/atoms/Image/Image.stories.js +0 -73
- package/dist/components/atoms/Image/index.js +0 -76
- package/dist/components/atoms/Image/styles.js +0 -43
- package/dist/components/atoms/ImageLink/ImageLink.stories.js +0 -63
- package/dist/components/atoms/ImageLink/index.js +0 -77
- package/dist/components/atoms/ImageLink/styles.js +0 -40
- package/dist/components/atoms/ImagePreview/ImagePreview.stories.js +0 -70
- package/dist/components/atoms/ImagePreview/index.js +0 -222
- package/dist/components/atoms/ImagePreview/styles.js +0 -44
- package/dist/components/atoms/InputText/InputText.stories.js +0 -60
- package/dist/components/atoms/InputText/index.js +0 -66
- package/dist/components/atoms/InputText/styles.js +0 -32
- package/dist/components/atoms/NotFound/NotFound.stories.js +0 -36
- package/dist/components/atoms/NotFound/index.js +0 -75
- package/dist/components/atoms/NotFound/styles.js +0 -20
- package/dist/components/atoms/SelectItemV2/SelectItemV2.stories.js +0 -45
- package/dist/components/atoms/SelectItemV2/index.js +0 -57
- package/dist/components/atoms/SelectItemV2/styles.js +0 -30
- package/dist/components/atoms/Tooltip/Tooltip.stories.js +0 -66
- package/dist/components/atoms/Tooltip/index.js +0 -72
- package/dist/components/atoms/Tooltip/styles.js +0 -20
- package/dist/components/molecules/ButtonDownloadFile/DownloadFile.stories.js +0 -66
- package/dist/components/molecules/ButtonDownloadFile/index.js +0 -179
- package/dist/components/molecules/ButtonDownloadFile/styles.js +0 -23
- package/dist/components/molecules/Dropdown/Dropdown.stories.js +0 -98
- package/dist/components/molecules/Dropdown/index.js +0 -150
- package/dist/components/molecules/Dropdown/styles.js +0 -26
- package/dist/components/molecules/ImageTooltip/ImageTooltip.stories.js +0 -82
- package/dist/components/molecules/ImageTooltip/index.js +0 -85
- package/dist/components/molecules/ImageTooltip/styles.js +0 -33
- package/dist/components/molecules/SelectV2/SelectV2.stories.js +0 -119
- package/dist/components/molecules/SelectV2/index.js +0 -306
- package/dist/components/molecules/SelectV2/styles.js +0 -42
- package/dist/components/molecules/SelectV2/test.js +0 -95
- package/dist/components/molecules/SelectV2/test.stories.js +0 -27
- package/dist/components/organisms/Chat/Chat.stories.js +0 -215
- package/dist/components/organisms/Chat/ChatLists/ChatLists.stories.js +0 -83
- package/dist/components/organisms/Chat/ChatLists/index.js +0 -160
- package/dist/components/organisms/Chat/ChatLists/styles.js +0 -29
- package/dist/components/organisms/Chat/ContainerItems/ContainerItems.stories.js +0 -176
- package/dist/components/organisms/Chat/ContainerItems/index.js +0 -569
- package/dist/components/organisms/Chat/ContainerItems/styles.js +0 -20
- package/dist/components/organisms/Chat/ContentChat/ContentChat.stories.js +0 -142
- package/dist/components/organisms/Chat/ContentChat/index.js +0 -1422
- package/dist/components/organisms/Chat/ContentChat/styles.js +0 -20
- package/dist/components/organisms/Chat/Footer/Footer.stories.js +0 -43
- package/dist/components/organisms/Chat/Footer/index.js +0 -984
- package/dist/components/organisms/Chat/Footer/styles.js +0 -32
- package/dist/components/organisms/Chat/Header/Header.stories.js +0 -96
- package/dist/components/organisms/Chat/Header/index.js +0 -84
- package/dist/components/organisms/Chat/Header/styles.js +0 -20
- package/dist/components/organisms/Chat/index.js +0 -327
- package/dist/components/organisms/Chat/styles.js +0 -29
- package/dist/components/organisms/Modal/Modal.stories.js +0 -66
- package/dist/components/organisms/Modal/index.js +0 -95
- package/dist/components/organisms/Modal/styles.js +0 -20
- package/dist/components/organisms/RangeCalendar/RangeCalendar.stories.js +0 -33
- package/dist/components/organisms/RangeCalendar/index.js +0 -148
- package/dist/components/organisms/RangeCalendar/styles.js +0 -27
- package/dist/global-files/handle_http.js +0 -383
- package/dist/global-files/utils.js +0 -484
- package/src/assets/images/customSelect/starIcon.svg +0 -14
- package/src/assets/images/defaultImages/Spinner.gif +0 -0
- package/src/assets/images/defaultImages/notFound.svg +0 -124
- package/src/components/atoms/ButtonFileChooser/ButtonFileChooser.stories.js +0 -47
- package/src/components/atoms/ButtonFileChooser/index.js +0 -69
- package/src/components/atoms/ButtonFileChooser/styles.js +0 -4
- package/src/components/atoms/ButtonV2/ButtonV2.stories.js +0 -53
- package/src/components/atoms/ButtonV2/index.js +0 -85
- package/src/components/atoms/ButtonV2/styles.js +0 -217
- package/src/components/atoms/CustomIcon/CustomIcon.stories.js +0 -36
- package/src/components/atoms/CustomIcon/index.js +0 -41
- package/src/components/atoms/CustomIcon/styles.js +0 -85
- package/src/components/atoms/IconFile/IconFile.stories.js +0 -35
- package/src/components/atoms/IconFile/index.js +0 -119
- package/src/components/atoms/IconFile/styles.js +0 -67
- package/src/components/atoms/Image/Image.stories.js +0 -51
- package/src/components/atoms/Image/index.js +0 -55
- package/src/components/atoms/Image/styles.js +0 -34
- package/src/components/atoms/ImageLink/ImageLink.stories.js +0 -43
- package/src/components/atoms/ImageLink/index.js +0 -57
- package/src/components/atoms/ImageLink/styles.js +0 -30
- package/src/components/atoms/ImagePreview/ImagePreview.stories.js +0 -52
- package/src/components/atoms/ImagePreview/index.js +0 -191
- package/src/components/atoms/ImagePreview/styles.js +0 -77
- package/src/components/atoms/InputText/InputText.stories.js +0 -39
- package/src/components/atoms/InputText/index.js +0 -61
- package/src/components/atoms/InputText/styles.js +0 -89
- package/src/components/atoms/NotFound/NotFound.stories.js +0 -19
- package/src/components/atoms/NotFound/index.js +0 -52
- package/src/components/atoms/NotFound/styles.js +0 -55
- package/src/components/atoms/SelectItemV2/SelectItemV2.stories.js +0 -26
- package/src/components/atoms/SelectItemV2/index.js +0 -61
- package/src/components/atoms/SelectItemV2/styles.js +0 -90
- package/src/components/atoms/Tooltip/Tooltip.stories.js +0 -51
- package/src/components/atoms/Tooltip/index.js +0 -59
- package/src/components/atoms/Tooltip/styles.js +0 -42
- package/src/components/molecules/ButtonDownloadFile/DownloadFile.stories.js +0 -54
- package/src/components/molecules/ButtonDownloadFile/index.js +0 -111
- package/src/components/molecules/ButtonDownloadFile/styles.js +0 -66
- package/src/components/molecules/Dropdown/Dropdown.stories.js +0 -103
- package/src/components/molecules/Dropdown/index.js +0 -150
- package/src/components/molecules/Dropdown/styles.js +0 -75
- package/src/components/molecules/ImageTooltip/ImageTooltip.stories.js +0 -68
- package/src/components/molecules/ImageTooltip/index.js +0 -63
- package/src/components/molecules/ImageTooltip/styles.js +0 -18
- package/src/components/molecules/SelectV2/SelectV2.stories.js +0 -114
- package/src/components/molecules/SelectV2/index.js +0 -350
- package/src/components/molecules/SelectV2/styles.js +0 -105
- package/src/components/molecules/SelectV2/test.js +0 -61
- package/src/components/molecules/SelectV2/test.stories.js +0 -10
- package/src/components/organisms/Chat/Chat.stories.js +0 -199
- package/src/components/organisms/Chat/ChatLists/ChatLists.stories.js +0 -65
- package/src/components/organisms/Chat/ChatLists/Rotoplas.jpeg +0 -0
- package/src/components/organisms/Chat/ChatLists/THD.png +0 -0
- package/src/components/organisms/Chat/ChatLists/index.js +0 -141
- package/src/components/organisms/Chat/ChatLists/styles.js +0 -162
- package/src/components/organisms/Chat/ContainerItems/ContainerItems.stories.js +0 -142
- package/src/components/organisms/Chat/ContainerItems/index.js +0 -549
- package/src/components/organisms/Chat/ContainerItems/styles.js +0 -328
- package/src/components/organisms/Chat/ContentChat/ContentChat.stories.js +0 -102
- package/src/components/organisms/Chat/ContentChat/Rotoplas.jpeg +0 -0
- package/src/components/organisms/Chat/ContentChat/THD.png +0 -0
- package/src/components/organisms/Chat/ContentChat/index.js +0 -900
- package/src/components/organisms/Chat/ContentChat/styles.js +0 -41
- package/src/components/organisms/Chat/Footer/Footer.stories.js +0 -22
- package/src/components/organisms/Chat/Footer/index.js +0 -669
- package/src/components/organisms/Chat/Footer/styles.js +0 -286
- package/src/components/organisms/Chat/Header/Header.stories.js +0 -66
- package/src/components/organisms/Chat/Header/index.js +0 -94
- package/src/components/organisms/Chat/Header/styles.js +0 -49
- package/src/components/organisms/Chat/index.js +0 -294
- package/src/components/organisms/Chat/styles.js +0 -42
- package/src/components/organisms/Modal/Modal.stories.js +0 -55
- package/src/components/organisms/Modal/index.js +0 -97
- package/src/components/organisms/Modal/styles.js +0 -103
- package/src/components/organisms/RangeCalendar/RangeCalendar.stories.js +0 -16
- package/src/components/organisms/RangeCalendar/index.js +0 -121
- package/src/components/organisms/RangeCalendar/styles.js +0 -883
- package/src/global-files/handle_http.js +0 -231
- package/src/global-files/utils.js +0 -309
|
@@ -2,7 +2,6 @@ import { Container } from "./styles";
|
|
|
2
2
|
import { ScreenHeader } from "../../atoms/ScreenHeader/index";
|
|
3
3
|
import { Button } from "../../atoms/GeneralButton/index";
|
|
4
4
|
import { useEffect, useRef } from "react";
|
|
5
|
-
import { Chat } from "../../organisms/Chat";
|
|
6
5
|
|
|
7
6
|
export const HeaderTop = ({ setHeaderTop }) => {
|
|
8
7
|
const headerTop = useRef();
|
|
@@ -14,16 +13,12 @@ export const HeaderTop = ({ setHeaderTop }) => {
|
|
|
14
13
|
return (
|
|
15
14
|
<Container ref={headerTop}>
|
|
16
15
|
<ScreenHeader text="Edición de producto" />
|
|
17
|
-
<
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
window.location.href = `/products`;
|
|
24
|
-
}}
|
|
25
|
-
/>
|
|
26
|
-
</div>
|
|
16
|
+
<Button
|
|
17
|
+
buttonType="close-button"
|
|
18
|
+
onClick={() => {
|
|
19
|
+
window.location.href = `/products`;
|
|
20
|
+
}}
|
|
21
|
+
/>
|
|
27
22
|
</Container>
|
|
28
23
|
);
|
|
29
24
|
};
|
|
@@ -21,27 +21,25 @@ export const Children = (
|
|
|
21
21
|
<img src={createVersionImg} alt="create version icon" />
|
|
22
22
|
<ScreenHeader
|
|
23
23
|
fontFamily={FontFamily.Raleway_500}
|
|
24
|
-
headerType=
|
|
24
|
+
headerType="product-name-header"
|
|
25
25
|
color={GlobalColors.white}
|
|
26
|
-
text=
|
|
26
|
+
text="Crea una nueva versión"
|
|
27
27
|
/>
|
|
28
28
|
<ScreenHeader
|
|
29
29
|
fontFamily={FontFamily.Raleway}
|
|
30
|
-
headerType=
|
|
30
|
+
headerType="retailer-name-header"
|
|
31
31
|
color={GlobalColors.white}
|
|
32
|
-
text=
|
|
33
|
-
"Puedes elegir el contenido de versiones anteriores o crear una versión desde cero"
|
|
34
|
-
}
|
|
32
|
+
text="Puedes elegir el contenido de versiones anteriores o crear una versión desde cero"
|
|
35
33
|
/>
|
|
36
34
|
<div className="buttons-container">
|
|
37
35
|
<Button
|
|
38
|
-
label=
|
|
39
|
-
buttonType=
|
|
36
|
+
label="Versión desde cero"
|
|
37
|
+
buttonType="general-transparent-button"
|
|
40
38
|
onClick={() => setStep("empty-version")}
|
|
41
39
|
/>
|
|
42
40
|
<Button
|
|
43
|
-
label=
|
|
44
|
-
buttonType=
|
|
41
|
+
label="Versión personalizada"
|
|
42
|
+
buttonType="general-default-button"
|
|
45
43
|
onClick={() => setStep("create-version")}
|
|
46
44
|
/>
|
|
47
45
|
</div>
|
|
@@ -53,27 +51,25 @@ export const Children = (
|
|
|
53
51
|
<img src={genericModalWarning} alt="warning icon" />
|
|
54
52
|
<ScreenHeader
|
|
55
53
|
fontFamily={FontFamily.Raleway_500}
|
|
56
|
-
headerType=
|
|
54
|
+
headerType="product-name-header"
|
|
57
55
|
color={GlobalColors.white}
|
|
58
|
-
text=
|
|
59
|
-
"Si creas una versión desde cero perderas la información actual"
|
|
60
|
-
}
|
|
56
|
+
text="Si creas una versión desde cero perderas la información actual"
|
|
61
57
|
/>
|
|
62
58
|
<ScreenHeader
|
|
63
59
|
fontFamily={FontFamily.Raleway}
|
|
64
|
-
headerType=
|
|
60
|
+
headerType="retailer-name-header"
|
|
65
61
|
color={GlobalColors.white}
|
|
66
|
-
text=
|
|
62
|
+
text="¿Deseas Continuar?"
|
|
67
63
|
/>
|
|
68
64
|
<div className="buttons-container">
|
|
69
65
|
<Button
|
|
70
|
-
label=
|
|
71
|
-
buttonType=
|
|
66
|
+
label="Atrás"
|
|
67
|
+
buttonType="general-transparent-button"
|
|
72
68
|
onClick={() => setStep("version-options")}
|
|
73
69
|
/>
|
|
74
70
|
<Button
|
|
75
|
-
label=
|
|
76
|
-
buttonType=
|
|
71
|
+
label="Continuar"
|
|
72
|
+
buttonType="general-default-button"
|
|
77
73
|
onClick={() => createVersion(true)}
|
|
78
74
|
/>
|
|
79
75
|
</div>
|
|
@@ -84,18 +80,16 @@ export const Children = (
|
|
|
84
80
|
<CreateVersion>
|
|
85
81
|
<ScreenHeader
|
|
86
82
|
fontFamily={FontFamily.Raleway_500}
|
|
87
|
-
headerType=
|
|
83
|
+
headerType="retailer-name-header"
|
|
88
84
|
color={GlobalColors.white}
|
|
89
|
-
text=
|
|
90
|
-
"Elige el contenido que deseas utilizar de versiones anteriores"
|
|
91
|
-
}
|
|
85
|
+
text="Elige el contenido que deseas utilizar de versiones anteriores"
|
|
92
86
|
/>
|
|
93
87
|
<div className="version-selector">
|
|
94
88
|
<div className="selector">
|
|
95
89
|
<VersionSelect
|
|
96
90
|
versions={versions}
|
|
97
|
-
label=
|
|
98
|
-
id=
|
|
91
|
+
label="Ficha técnica"
|
|
92
|
+
id="datasheet"
|
|
99
93
|
selectedVersions={selectedVersions}
|
|
100
94
|
onChange={(e) => onChange(e)}
|
|
101
95
|
/>
|
|
@@ -103,8 +97,8 @@ export const Children = (
|
|
|
103
97
|
<div className="selector">
|
|
104
98
|
<VersionSelect
|
|
105
99
|
versions={versions}
|
|
106
|
-
label=
|
|
107
|
-
id=
|
|
100
|
+
label="Descripción"
|
|
101
|
+
id="description"
|
|
108
102
|
selectedVersions={selectedVersions}
|
|
109
103
|
onChange={(e) => onChange(e)}
|
|
110
104
|
/>
|
|
@@ -112,8 +106,8 @@ export const Children = (
|
|
|
112
106
|
<div className="selector">
|
|
113
107
|
<VersionSelect
|
|
114
108
|
versions={versions}
|
|
115
|
-
label=
|
|
116
|
-
id=
|
|
109
|
+
label="Imágenes"
|
|
110
|
+
id="image"
|
|
117
111
|
selectedVersions={selectedVersions}
|
|
118
112
|
onChange={(e) => onChange(e)}
|
|
119
113
|
/>
|
|
@@ -121,13 +115,13 @@ export const Children = (
|
|
|
121
115
|
</div>
|
|
122
116
|
<div className="buttons-container">
|
|
123
117
|
<Button
|
|
124
|
-
label=
|
|
125
|
-
buttonType=
|
|
118
|
+
label="Atrás"
|
|
119
|
+
buttonType="general-transparent-button"
|
|
126
120
|
onClick={() => setStep("version-options")}
|
|
127
121
|
/>
|
|
128
122
|
<Button
|
|
129
|
-
label=
|
|
130
|
-
buttonType=
|
|
123
|
+
label="Continuar"
|
|
124
|
+
buttonType="general-default-button"
|
|
131
125
|
onClick={() => createVersion()}
|
|
132
126
|
/>
|
|
133
127
|
</div>
|
|
@@ -5,48 +5,32 @@ import { useEffect, useState } from "react";
|
|
|
5
5
|
import { Children } from "./RenderChilds";
|
|
6
6
|
import axios from "axios";
|
|
7
7
|
|
|
8
|
-
export const CreateVersion = ({
|
|
8
|
+
export const CreateVersion = ({
|
|
9
|
+
articleId,
|
|
10
|
+
version,
|
|
11
|
+
setShowCreateVersion,
|
|
12
|
+
versionsList,
|
|
13
|
+
realoadVersion,
|
|
14
|
+
jwt,
|
|
15
|
+
}) => {
|
|
9
16
|
const [step, setStep] = useState("version-options");
|
|
10
|
-
const [versions, setVersions] = useState([]);
|
|
11
17
|
const [selectedVersions, setSelectedVersions] = useState({
|
|
12
18
|
datasheet: version,
|
|
13
19
|
description: version,
|
|
14
20
|
image: version,
|
|
15
21
|
});
|
|
16
22
|
|
|
17
|
-
const getVersions = async () => {
|
|
18
|
-
try {
|
|
19
|
-
const response = await axios({
|
|
20
|
-
method: "get",
|
|
21
|
-
url: `${process.env.REACT_APP_VERSIONS_ENDPOINT}?articleId=${idArticle}&provider=true`,
|
|
22
|
-
headers: {
|
|
23
|
-
Authorization: sessionStorage.getItem("jwt"),
|
|
24
|
-
},
|
|
25
|
-
});
|
|
26
|
-
setVersions(JSON.parse(response.data.body).data);
|
|
27
|
-
} catch (error) {
|
|
28
|
-
console.log(error);
|
|
29
|
-
}
|
|
30
|
-
};
|
|
31
|
-
|
|
32
23
|
const createVersion = async (isEmpty) => {
|
|
33
24
|
try {
|
|
34
|
-
let data = {
|
|
35
|
-
articleId: idArticle,
|
|
36
|
-
isEmpty,
|
|
37
|
-
};
|
|
25
|
+
let data = { articleId, isEmpty };
|
|
38
26
|
|
|
39
|
-
isEmpty
|
|
27
|
+
if (!isEmpty) data["version"] = selectedVersions;
|
|
40
28
|
|
|
41
|
-
await axios({
|
|
42
|
-
|
|
43
|
-
url: process.env.REACT_APP_VERSIONS_ENDPOINT,
|
|
44
|
-
data: data,
|
|
45
|
-
headers: {
|
|
46
|
-
Authorization: sessionStorage.getItem("jwt"),
|
|
47
|
-
},
|
|
29
|
+
await axios.post(process.env.REACT_APP_VERSIONS_ENDPOINT, data, {
|
|
30
|
+
headers: { Authorization: jwt },
|
|
48
31
|
});
|
|
49
32
|
setShowCreateVersion(false);
|
|
33
|
+
realoadVersion && realoadVersion();
|
|
50
34
|
} catch (error) {
|
|
51
35
|
console.log(error);
|
|
52
36
|
}
|
|
@@ -55,17 +39,13 @@ export const CreateVersion = ({ idArticle, version, setShowCreateVersion }) => {
|
|
|
55
39
|
const onChange = (e) => {
|
|
56
40
|
setSelectedVersions({
|
|
57
41
|
...selectedVersions,
|
|
58
|
-
[e.target.name]: parseInt(e.target.value
|
|
42
|
+
[e.target.name]: parseInt(e.target.value),
|
|
59
43
|
});
|
|
60
44
|
};
|
|
61
45
|
|
|
62
|
-
useEffect(async () => {
|
|
63
|
-
await getVersions();
|
|
64
|
-
}, []);
|
|
65
|
-
|
|
66
46
|
return (
|
|
67
47
|
<Container>
|
|
68
|
-
<div className="modal-container">
|
|
48
|
+
<div id="create-version" className="modal-container">
|
|
69
49
|
<div className="button-container">
|
|
70
50
|
<Button
|
|
71
51
|
image={closeIcon}
|
|
@@ -77,7 +57,7 @@ export const CreateVersion = ({ idArticle, version, setShowCreateVersion }) => {
|
|
|
77
57
|
{Children(
|
|
78
58
|
step,
|
|
79
59
|
setStep,
|
|
80
|
-
|
|
60
|
+
versionsList,
|
|
81
61
|
selectedVersions,
|
|
82
62
|
onChange,
|
|
83
63
|
createVersion
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React, { useState, useEffect } from "react";
|
|
2
2
|
import { Status } from "../../atoms/Status/index";
|
|
3
3
|
import { ProgressBar } from "../../atoms/ProgressBar/index";
|
|
4
|
+
import { Loading } from "../../atoms/Loading/index";
|
|
4
5
|
import moment from "moment";
|
|
5
6
|
import "moment/locale/es";
|
|
6
7
|
import {
|
|
@@ -18,6 +19,7 @@ moment.locale("es");
|
|
|
18
19
|
|
|
19
20
|
export const OrderDetail = (props) => {
|
|
20
21
|
const { order } = props;
|
|
22
|
+
const [isLoading, setIsLoading] = useState(true);
|
|
21
23
|
const [showPaymentButton, setShowPaymentButton] = useState(
|
|
22
24
|
order.payment !== "pagado"
|
|
23
25
|
);
|
|
@@ -51,6 +53,7 @@ export const OrderDetail = (props) => {
|
|
|
51
53
|
|
|
52
54
|
useEffect(() => {
|
|
53
55
|
const ac = new AbortController();
|
|
56
|
+
setIsLoading(true);
|
|
54
57
|
props.getOrderDetail &&
|
|
55
58
|
props
|
|
56
59
|
.getOrderDetail({ query: { orderId: order.id_order } })
|
|
@@ -75,6 +78,7 @@ export const OrderDetail = (props) => {
|
|
|
75
78
|
});
|
|
76
79
|
setOrderData(obj);
|
|
77
80
|
setDataGeneral({ ...countArticles, totalArticles });
|
|
81
|
+
setIsLoading(false);
|
|
78
82
|
});
|
|
79
83
|
return () => ac.abort(); // Abort both fetches on unmount
|
|
80
84
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
@@ -155,18 +159,21 @@ export const OrderDetail = (props) => {
|
|
|
155
159
|
</div>
|
|
156
160
|
</Details>
|
|
157
161
|
<div className="body">
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
162
|
+
{isLoading
|
|
163
|
+
? <Loading />
|
|
164
|
+
: <Table
|
|
165
|
+
headers={[
|
|
166
|
+
{ width: 140, name: "UPC" },
|
|
167
|
+
{ width: 210, name: "Nombre" },
|
|
168
|
+
{ width: 100, name: "Cadena", type: "groupImages" },
|
|
169
|
+
{ width: 130, name: "Servicios", type: "services" },
|
|
170
|
+
{ width: 70, name: "Estatus", type: "status" },
|
|
171
|
+
{ width: 65, name: "Fact.", type: "checkout" },
|
|
172
|
+
]}
|
|
173
|
+
data={orderData}
|
|
174
|
+
isProvider={props.isProvider}
|
|
175
|
+
/>
|
|
176
|
+
}
|
|
170
177
|
</div>
|
|
171
178
|
<div className="footer">
|
|
172
179
|
<h2 className="headerTitle">Totales</h2>
|
|
@@ -36,6 +36,32 @@ export const Column = styled.div`
|
|
|
36
36
|
&:nth-child(2) {
|
|
37
37
|
overflow: hidden;
|
|
38
38
|
}
|
|
39
|
+
|
|
40
|
+
.tooltip {
|
|
41
|
+
position: relative;
|
|
42
|
+
display: inline-block;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.tooltip .tooltiptext {
|
|
46
|
+
visibility: hidden;
|
|
47
|
+
background-color: #fff;
|
|
48
|
+
color: black;
|
|
49
|
+
text-align: center;
|
|
50
|
+
padding: 5px 0;
|
|
51
|
+
border-radius: 3px;
|
|
52
|
+
|
|
53
|
+
position: absolute;
|
|
54
|
+
z-index: 1;
|
|
55
|
+
top: -8px;
|
|
56
|
+
left: 3px;
|
|
57
|
+
font-family: Roboto;
|
|
58
|
+
font-size: 10px;
|
|
59
|
+
padding: 2px 5px;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
.tooltip:hover .tooltiptext {
|
|
63
|
+
visibility: visible;
|
|
64
|
+
}
|
|
39
65
|
`;
|
|
40
66
|
|
|
41
67
|
export const Rows = styled.div`
|
|
@@ -1,27 +1,42 @@
|
|
|
1
1
|
export const servicesCodeIcon = {
|
|
2
2
|
datasheet: (
|
|
3
|
-
<
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
<div key="datasheet" className="tooltip">
|
|
4
|
+
<span className="material-icons small">
|
|
5
|
+

|
|
6
|
+
</span>
|
|
7
|
+
<span className="tooltiptext">Ficha Técnica</span>
|
|
8
|
+
</div>
|
|
6
9
|
),
|
|
7
10
|
description: (
|
|
8
|
-
<
|
|
9
|
-
|
|
10
|
-
|
|
11
|
+
<div key="description" className="tooltip">
|
|
12
|
+
<span className="material-icons small">
|
|
13
|
+

|
|
14
|
+
</span>
|
|
15
|
+
<span className="tooltiptext">Descripción</span>
|
|
16
|
+
</div>
|
|
11
17
|
),
|
|
12
18
|
image: (
|
|
13
|
-
<
|
|
14
|
-
|
|
15
|
-
|
|
19
|
+
<div key="image" className="tooltip">
|
|
20
|
+
<span className="material-icons small">
|
|
21
|
+

|
|
22
|
+
</span>
|
|
23
|
+
<span className="tooltiptext">Imagen</span>
|
|
24
|
+
</div>
|
|
16
25
|
),
|
|
17
26
|
translate: (
|
|
18
|
-
<
|
|
19
|
-
|
|
20
|
-
|
|
27
|
+
<div key="translate" className="tooltip">
|
|
28
|
+
<span className="material-icons small">
|
|
29
|
+

|
|
30
|
+
</span>
|
|
31
|
+
<span className="tooltiptext">Traducción</span>
|
|
32
|
+
</div>
|
|
21
33
|
),
|
|
22
34
|
build: (
|
|
23
|
-
<
|
|
24
|
-
|
|
25
|
-
|
|
35
|
+
<div key="build" className="tooltip">
|
|
36
|
+
<span className="material-icons small">
|
|
37
|
+

|
|
38
|
+
</span>
|
|
39
|
+
<span className="tooltiptext">Construcción</span>
|
|
40
|
+
</div>
|
|
26
41
|
),
|
|
27
42
|
};
|
|
@@ -8,7 +8,8 @@ import closeIcon from "../../../assets/images/versionSelector/closeVersionSelect
|
|
|
8
8
|
import { GlobalColors } from "contentoh-components-library/dist/global-files/variables";
|
|
9
9
|
import { FontFamily } from "../../../global-files/variables";
|
|
10
10
|
import { VersionItem } from "../../molecules/VersionItem";
|
|
11
|
-
import {
|
|
11
|
+
import { CreateVersion } from "../../organisms/CreateVersion";
|
|
12
|
+
import { useCloseModal } from "../../../global-files/customHooks";
|
|
12
13
|
|
|
13
14
|
export const VersionSelector = ({
|
|
14
15
|
modalId,
|
|
@@ -16,11 +17,13 @@ export const VersionSelector = ({
|
|
|
16
17
|
setVersion,
|
|
17
18
|
companyName,
|
|
18
19
|
currentVersion,
|
|
19
|
-
setShowCreateVersion,
|
|
20
20
|
setShowVersionSelector,
|
|
21
21
|
jwt,
|
|
22
22
|
}) => {
|
|
23
23
|
const [versions, setVersions] = useState([]);
|
|
24
|
+
const [showCreateVersion, setShowCreateVersion] =
|
|
25
|
+
useCloseModal("create-version");
|
|
26
|
+
const [reload, setReload] = useState(false);
|
|
24
27
|
|
|
25
28
|
const loadProductVersions = async (articleId) => {
|
|
26
29
|
try {
|
|
@@ -41,13 +44,15 @@ export const VersionSelector = ({
|
|
|
41
44
|
};
|
|
42
45
|
|
|
43
46
|
useEffect(() => {
|
|
47
|
+
const ac = new AbortController();
|
|
44
48
|
loadProductVersions(articleId);
|
|
45
49
|
|
|
46
50
|
return () => {
|
|
47
51
|
setVersions([]);
|
|
48
52
|
setShowCreateVersion(false);
|
|
53
|
+
return () => ac.abort(); // Abort both fetches on unmount
|
|
49
54
|
};
|
|
50
|
-
}, []);
|
|
55
|
+
}, [reload]);
|
|
51
56
|
|
|
52
57
|
return (
|
|
53
58
|
<Container id={modalId}>
|
|
@@ -86,6 +91,16 @@ export const VersionSelector = ({
|
|
|
86
91
|
/>
|
|
87
92
|
))}
|
|
88
93
|
</div>
|
|
94
|
+
{showCreateVersion && (
|
|
95
|
+
<CreateVersion
|
|
96
|
+
articleId={articleId}
|
|
97
|
+
version={currentVersion}
|
|
98
|
+
versionsList={versions}
|
|
99
|
+
setShowCreateVersion={setShowCreateVersion}
|
|
100
|
+
realoadVersion={() => setReload(!reload)}
|
|
101
|
+
jwt={jwt}
|
|
102
|
+
/>
|
|
103
|
+
)}
|
|
89
104
|
</Container>
|
|
90
105
|
);
|
|
91
106
|
};
|