contentoh-components-library 21.4.8 → 21.4.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/.env.development +1 -5
- package/.env.production +1 -3
- package/dist/components/atoms/Avatar/index.js +2 -3
- package/dist/components/atoms/Card/index.js +5 -46
- package/dist/components/atoms/Card/styles.js +1 -3
- package/dist/components/atoms/CheckBox/index.js +2 -7
- package/dist/components/atoms/CheckBox/styles.js +1 -1
- package/dist/components/atoms/InputFormatter/styles.js +1 -1
- package/dist/components/molecules/CarouselImagesLogin/index.js +1 -1
- package/dist/components/molecules/HeaderTop/index.js +11 -68
- package/dist/components/molecules/TagAndInput/index.js +1 -1
- package/dist/components/organisms/Chat/Chat.stories.js +8 -27
- package/dist/components/organisms/Chat/ContainerItems/index.js +3 -19
- package/dist/components/organisms/Chat/ContainerItems/styles.js +1 -1
- package/dist/components/organisms/Chat/ContentChat/index.js +197 -350
- package/dist/components/organisms/Chat/Footer/index.js +39 -48
- package/dist/components/organisms/Chat/index.js +4 -49
- package/dist/components/organisms/FullProductNameHeader/index.js +2 -2
- package/dist/components/organisms/Modal/styles.js +1 -1
- package/dist/components/pages/ProviderProductEdition/ProviderProductEdition.stories.js +4 -37
- package/dist/components/pages/ProviderProductEdition/index.js +175 -188
- package/dist/components/pages/ProviderProductEdition/styles.js +1 -1
- package/dist/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +3 -7
- package/dist/components/pages/RetailerProductEdition/index.js +273 -288
- package/dist/components/pages/RetailerProductEdition/styles.js +1 -1
- package/dist/components/pages/RetailerProductEdition/utils.js +2 -61
- package/dist/index.js +52 -234
- package/package.json +1 -4
- package/src/components/atoms/Avatar/index.js +2 -8
- package/src/components/atoms/Card/index.js +2 -35
- package/src/components/atoms/Card/styles.js +5 -41
- package/src/components/atoms/CheckBox/index.js +1 -4
- package/src/components/atoms/CheckBox/styles.js +0 -2
- package/src/components/atoms/InputFormatter/styles.js +1 -2
- package/src/components/molecules/CarouselImagesLogin/index.js +1 -1
- package/src/components/molecules/HeaderTop/index.js +6 -52
- package/src/components/molecules/TagAndInput/index.js +8 -10
- 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 -10
- 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/FullProductNameHeader/index.js +1 -1
- package/src/components/organisms/Modal/styles.js +1 -4
- package/src/components/organisms/OrderDetail/utils/Table/utils.js +16 -6
- package/src/components/pages/ProviderProductEdition/ProviderProductEdition.stories.js +1 -40
- package/src/components/pages/ProviderProductEdition/index.js +129 -132
- package/src/components/pages/ProviderProductEdition/styles.js +1 -5
- package/src/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +2 -6
- package/src/components/pages/RetailerProductEdition/index.js +135 -121
- package/src/components/pages/RetailerProductEdition/styles.js +0 -4
- package/src/components/pages/RetailerProductEdition/utils.js +0 -37
- package/src/index.js +0 -15
- package/src/components/atoms/ImageCarousel/ImgeSlider.stories.js +0 -76
- package/src/components/atoms/ImageCarousel/index.js +0 -103
- package/src/components/atoms/ImageCarousel/styles.js +0 -79
- package/src/components/atoms/PercentTag/PercentTag.stories.js +0 -7
- package/src/components/atoms/PercentTag/index.js +0 -9
- package/src/components/atoms/PercentTag/styles.js +0 -69
- package/src/components/atoms/RatingStars/RatingStars.stories.js +0 -10
- package/src/components/atoms/RatingStars/index.js +0 -31
- package/src/components/atoms/RatingStars/styles.js +0 -28
- package/src/components/atoms/RetailerCatalog/RetailerCatalog.stories.js +0 -36
- package/src/components/atoms/RetailerCatalog/index.js +0 -49
- package/src/components/atoms/RetailerCatalog/styles.js +0 -30
- package/src/components/atoms/RetailerOption/RetailerOption.stories.js +0 -15
- package/src/components/atoms/RetailerOption/index.js +0 -53
- package/src/components/atoms/RetailerOption/styles.js +0 -41
- package/src/components/atoms/RetailersList/RetailersList.stories.js +0 -33
- package/src/components/atoms/RetailersList/index.js +0 -20
- package/src/components/atoms/RetailersList/styles.js +0 -19
- package/src/components/atoms/UserCatalog/UserCatalog.stories.js +0 -67
- package/src/components/atoms/UserCatalog/index.js +0 -96
- package/src/components/atoms/UserCatalog/styles.js +0 -24
- package/src/components/atoms/UserOption/UserOption.stories.js +0 -25
- package/src/components/atoms/UserOption/index.js +0 -95
- package/src/components/atoms/UserOption/styles.js +0 -61
- package/src/components/atoms/UserSelector/UserSelector.stories.js +0 -25
- package/src/components/atoms/UserSelector/index.js +0 -86
- package/src/components/atoms/UserSelector/styles.js +0 -55
- package/src/components/molecules/GridItem/GridItem.stories.js +0 -126
- package/src/components/molecules/GridItem/index.js +0 -97
- package/src/components/molecules/GridItem/styles.js +0 -104
- package/src/components/molecules/HeaderItem/ColumnItem.js +0 -9
- package/src/components/molecules/HeaderItem/HeaderItem.stories.js +0 -24
- package/src/components/molecules/HeaderItem/index.js +0 -26
- package/src/components/molecules/HeaderItem/styles.js +0 -27
- package/src/components/molecules/RowItem/ColumnItem.js +0 -9
- package/src/components/molecules/RowItem/RowItem.stories.js +0 -5660
- package/src/components/molecules/RowItem/index.js +0 -45
- package/src/components/molecules/RowItem/styles.js +0 -40
- package/src/components/molecules/StripeCardForm/StripeCardForm.stories.js +0 -13
- package/src/components/molecules/StripeCardForm/index.js +0 -42
- package/src/components/molecules/StripeCardForm/paymentForm.js +0 -124
- package/src/components/molecules/StripeCardForm/styles.js +0 -73
- package/src/components/molecules/StripeCardSelector/CardSelector.stories.js +0 -12
- package/src/components/molecules/StripeCardSelector/index.js +0 -44
- package/src/components/molecules/StripeCardSelector/styles.js +0 -4
- package/src/components/molecules/StripeCardSelector/utils.js +0 -17
- package/src/components/organisms/GridProducts/GridProducts.stories.js +0 -5485
- package/src/components/organisms/GridProducts/index.js +0 -50
- package/src/components/organisms/GridProducts/styles.js +0 -14
- package/src/components/organisms/GridProducts/utils.js +0 -111
- package/src/components/organisms/SideModal/SideModal.stories.js +0 -23
- package/src/components/organisms/SideModal/index.js +0 -50
- package/src/components/organisms/SideModal/styles.js +0 -30
|
@@ -17,14 +17,14 @@ export const Chat = (props) => {
|
|
|
17
17
|
const {
|
|
18
18
|
chatType, // "merchant_product" | "order_product" | "ticket"
|
|
19
19
|
chatContainerType, // ("fixed") | ("popUp")
|
|
20
|
-
chatData
|
|
20
|
+
chatData, // {} => aqui poner los datos requeridos segun el tipo de chat
|
|
21
21
|
classNameContainerFixed, // clases CSS del envoltoria chat fixed
|
|
22
22
|
size = 14, // tamaño del icono
|
|
23
23
|
} = props;
|
|
24
24
|
const [showPopUpChat, setShowPopUpChat] = useState(false);
|
|
25
25
|
const [data, setData] = useState();
|
|
26
26
|
|
|
27
|
-
const { ticketCompany
|
|
27
|
+
const { ticketCompany } = chatData || {};
|
|
28
28
|
|
|
29
29
|
useEffect(() => {
|
|
30
30
|
switch (chatType) {
|
|
@@ -37,9 +37,6 @@ export const Chat = (props) => {
|
|
|
37
37
|
case "ticket":
|
|
38
38
|
validateChatTicket();
|
|
39
39
|
break;
|
|
40
|
-
case "product_status":
|
|
41
|
-
validateProductStatus();
|
|
42
|
-
break;
|
|
43
40
|
default:
|
|
44
41
|
setData({
|
|
45
42
|
code: 404,
|
|
@@ -49,45 +46,6 @@ export const Chat = (props) => {
|
|
|
49
46
|
}
|
|
50
47
|
}, [chatType]);
|
|
51
48
|
|
|
52
|
-
const validateProductStatus = () => {
|
|
53
|
-
const {
|
|
54
|
-
userToken, // string
|
|
55
|
-
id, // number
|
|
56
|
-
version,
|
|
57
|
-
retailerId, // number
|
|
58
|
-
status,
|
|
59
|
-
orderId,
|
|
60
|
-
} = chatData;
|
|
61
|
-
|
|
62
|
-
if (!isValidGeneral(userToken, id)) return;
|
|
63
|
-
|
|
64
|
-
// validar el ID de la cadena asociada al producto en la OT
|
|
65
|
-
if (!isValidNaturalNumber(retailerId)) {
|
|
66
|
-
setDataError("La cadena relacionada al producto no es válida");
|
|
67
|
-
return;
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
// validar el ID de la version asociada al producto en la OT
|
|
71
|
-
if (!isValidNaturalNumber(version)) {
|
|
72
|
-
setDataError("La versión del producto no es válida");
|
|
73
|
-
return;
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
if (orderId && !isValidNaturalNumber(orderId)) {
|
|
77
|
-
setDataError("La orden del producto no es válida");
|
|
78
|
-
return;
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
setData({
|
|
82
|
-
userToken,
|
|
83
|
-
id,
|
|
84
|
-
version,
|
|
85
|
-
retailerId,
|
|
86
|
-
orderId,
|
|
87
|
-
status,
|
|
88
|
-
});
|
|
89
|
-
};
|
|
90
|
-
|
|
91
49
|
const isValidGeneral = (userToken, id) => {
|
|
92
50
|
// validar token del user
|
|
93
51
|
if (isStringEmpty(userToken)) {
|
|
@@ -239,7 +197,7 @@ export const Chat = (props) => {
|
|
|
239
197
|
dataChat={data}
|
|
240
198
|
showBtnClose={false}
|
|
241
199
|
ticketCompany={ticketCompany}
|
|
242
|
-
activeRetailer={props.activeRetailer
|
|
200
|
+
activeRetailer={props.activeRetailer}
|
|
243
201
|
/>
|
|
244
202
|
</ContainerFixed>
|
|
245
203
|
);
|
|
@@ -272,7 +230,7 @@ export const Chat = (props) => {
|
|
|
272
230
|
onClickBtnClose={() => {
|
|
273
231
|
setShowPopUpChat(false);
|
|
274
232
|
}}
|
|
275
|
-
activeRetailer={props.activeRetailer
|
|
233
|
+
activeRetailer={props.activeRetailer}
|
|
276
234
|
/>
|
|
277
235
|
</ContainerPopUp>
|
|
278
236
|
</Slide>
|
|
@@ -23,7 +23,7 @@ export const FullProductNameHeader = ({
|
|
|
23
23
|
useEffect(() => {
|
|
24
24
|
const rtls = headerData?.retailers || headerData?.retailersAvailable;
|
|
25
25
|
servicesData &&
|
|
26
|
-
rtls
|
|
26
|
+
rtls.forEach((rt) => {
|
|
27
27
|
const element = [];
|
|
28
28
|
servicesData.forEach((sd) => {
|
|
29
29
|
if (sd.id_retailer === rt.id) {
|
|
@@ -31,6 +31,7 @@ export const ContainerModal = styled.div`
|
|
|
31
31
|
align-items: center;
|
|
32
32
|
justify-content: flex-start;
|
|
33
33
|
gap: 6px;
|
|
34
|
+
margin-bottom: 20px;
|
|
34
35
|
|
|
35
36
|
.label-title {
|
|
36
37
|
width: 100%;
|
|
@@ -41,10 +42,6 @@ export const ContainerModal = styled.div`
|
|
|
41
42
|
color: #262626;
|
|
42
43
|
white-space: pre-wrap;
|
|
43
44
|
}
|
|
44
|
-
|
|
45
|
-
& + * {
|
|
46
|
-
margin-top: 20px;
|
|
47
|
-
}
|
|
48
45
|
}
|
|
49
46
|
|
|
50
47
|
.iconModal {
|
|
@@ -1,31 +1,41 @@
|
|
|
1
1
|
export const servicesCodeIcon = {
|
|
2
2
|
datasheet: (
|
|
3
3
|
<div key="datasheet" className="tooltip">
|
|
4
|
-
<span className="material-icons small"
|
|
4
|
+
<span className="material-icons small">
|
|
5
|
+

|
|
6
|
+
</span>
|
|
5
7
|
<span className="tooltiptext">Ficha Técnica</span>
|
|
6
8
|
</div>
|
|
7
9
|
),
|
|
8
10
|
description: (
|
|
9
11
|
<div key="description" className="tooltip">
|
|
10
|
-
<span className="material-icons small"
|
|
12
|
+
<span className="material-icons small">
|
|
13
|
+

|
|
14
|
+
</span>
|
|
11
15
|
<span className="tooltiptext">Descripción</span>
|
|
12
16
|
</div>
|
|
13
17
|
),
|
|
14
18
|
image: (
|
|
15
19
|
<div key="image" className="tooltip">
|
|
16
|
-
<span className="material-icons small"
|
|
20
|
+
<span className="material-icons small">
|
|
21
|
+

|
|
22
|
+
</span>
|
|
17
23
|
<span className="tooltiptext">Imagen</span>
|
|
18
24
|
</div>
|
|
19
25
|
),
|
|
20
26
|
translate: (
|
|
21
27
|
<div key="translate" className="tooltip">
|
|
22
|
-
<span className="material-icons small"
|
|
28
|
+
<span className="material-icons small">
|
|
29
|
+

|
|
30
|
+
</span>
|
|
23
31
|
<span className="tooltiptext">Traducción</span>
|
|
24
32
|
</div>
|
|
25
33
|
),
|
|
26
34
|
build: (
|
|
27
|
-
<div key="build"
|
|
28
|
-
<span className="material-icons small"
|
|
35
|
+
<div key="build" className="tooltip">
|
|
36
|
+
<span className="material-icons small">
|
|
37
|
+

|
|
38
|
+
</span>
|
|
29
39
|
<span className="tooltiptext">Construcción</span>
|
|
30
40
|
</div>
|
|
31
41
|
),
|
|
@@ -16,7 +16,7 @@ ProviderProductEditionDefault.args = {
|
|
|
16
16
|
Imágenes: false,
|
|
17
17
|
},
|
|
18
18
|
token:
|
|
19
|
-
"eyJraWQiOiJkQWJkZCtlclwvTlwveVRQUWNvUlVyOCtrNUd2M1hMM2N1MWUzQ09zWExVRnc9IiwiYWxnIjoiUlMyNTYifQ.
|
|
19
|
+
"eyJraWQiOiJkQWJkZCtlclwvTlwveVRQUWNvUlVyOCtrNUd2M1hMM2N1MWUzQ09zWExVRnc9IiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiI1ODg0YWUzNC01OWQ2LTQ0NTQtYjk4ZS04MjE1MThiY2MzYTciLCJjb2duaXRvOmdyb3VwcyI6WyJ1c3VhcmlvX2NvbnRlbnRvaCJdLCJlbWFpbF92ZXJpZmllZCI6dHJ1ZSwiaXNzIjoiaHR0cHM6XC9cL2NvZ25pdG8taWRwLnVzLWVhc3QtMS5hbWF6b25hd3MuY29tXC91cy1lYXN0LTFfWE1aUWRxa0dqIiwicGhvbmVfbnVtYmVyX3ZlcmlmaWVkIjpmYWxzZSwiY29nbml0bzp1c2VybmFtZSI6IjU4ODRhZTM0LTU5ZDYtNDQ1NC1iOThlLTgyMTUxOGJjYzNhNyIsImNvZ25pdG86cm9sZXMiOlsiYXJuOmF3czppYW06Ojg5ODY3MDIzMjgwNzpyb2xlXC9jb250ZW50b2gtZGV2LXVzLWVhc3QtMS1sYW1iZGFSb2xlIl0sImF1ZCI6IjVhYzh0cGdzNmdic3ExM2ZydnJwaWVlcDQwIiwiZXZlbnRfaWQiOiJjOWRjOWE1OS0xNTAxLTQyOTgtODRjMi03MDM4NzRhNzIxMTEiLCJ0b2tlbl91c2UiOiJpZCIsImF1dGhfdGltZSI6MTY4MjQ2Mjc4NCwibmFtZSI6IkNhZGVuYSBJc21hZWwiLCJwaG9uZV9udW1iZXIiOiIrNTIzMTExMzY2MzM2IiwiZXhwIjoxNjgyNDY2Mzg0LCJpYXQiOjE2ODI0NjI3ODQsImVtYWlsIjoiY2FkZW5hLmlzbWFlbEBhbGxmcmVlbWFpbC5uZXQifQ.ebKSsnTxKoNfWDoKGFJRlLWgNulGj4KrDe0EgsqLEIVx3Qu0lgmg43UY5tZ3FUlRE8XO2UGq0XxEgdbGOe_4nbTRYigdvxP3bh3cPQ0s68hlTDfhPRvxVJYlaO4s0rhk9rt_VVteTyLfhPHFCymrkFYYDB8bVvKnxUUCX_nJvqGQkl48JiYgvYVLpuus5FvRkGwi1u-jTtMoKiUK-jw9MxI18hD0FWXVnJr-q9ftf2d0bv4JRv4XJ_tRh1N6jps5n3c_KKZswqRfGLU-8MS2X3DU6pDqEP2BZAGXksiFYXYH_uHE6BKJAl7EEhkDTqZsx_jWtVSXTdDg_QDKrOw0Kg",
|
|
20
20
|
articleId: 238,
|
|
21
21
|
category: 846,
|
|
22
22
|
version: 2,
|
|
@@ -35,43 +35,6 @@ ProviderProductEditionDefault.args = {
|
|
|
35
35
|
id: 58,
|
|
36
36
|
},
|
|
37
37
|
],
|
|
38
|
-
statusByRetailer: {
|
|
39
|
-
12: {
|
|
40
|
-
datasheet: "AA",
|
|
41
|
-
description: "AA",
|
|
42
|
-
images: "AA",
|
|
43
|
-
},
|
|
44
|
-
29: {
|
|
45
|
-
datasheet: "AA",
|
|
46
|
-
description: "AA",
|
|
47
|
-
images: "AA",
|
|
48
|
-
},
|
|
49
|
-
63: {
|
|
50
|
-
datasheet: "AA",
|
|
51
|
-
description: "AA",
|
|
52
|
-
images: "AA",
|
|
53
|
-
},
|
|
54
|
-
},
|
|
55
|
-
checked: false,
|
|
56
|
-
retailersAvailable: [
|
|
57
|
-
{
|
|
58
|
-
id: 12,
|
|
59
|
-
name: "La Comer",
|
|
60
|
-
},
|
|
61
|
-
{
|
|
62
|
-
id: 29,
|
|
63
|
-
name: "Farmacias del Ahorro",
|
|
64
|
-
},
|
|
65
|
-
{
|
|
66
|
-
id: 63,
|
|
67
|
-
name: "DAX",
|
|
68
|
-
},
|
|
69
|
-
],
|
|
70
|
-
categoryName:
|
|
71
|
-
"Salud y Belleza|Cuidado del Cabello|Shampoos y Acondicionadores",
|
|
72
|
-
upc: "750955287656712",
|
|
73
|
-
id_article: 39270,
|
|
74
|
-
id_order: 15142,
|
|
75
38
|
},
|
|
76
39
|
productToEdit: {
|
|
77
40
|
idCategory: 2126,
|
|
@@ -101,8 +64,6 @@ ProviderProductEditionDefault.args = {
|
|
|
101
64
|
search: "",
|
|
102
65
|
hash: "",
|
|
103
66
|
state: {
|
|
104
|
-
withChat: true,
|
|
105
|
-
chatType: "product_status",
|
|
106
67
|
origin: "RequestWithContentoh",
|
|
107
68
|
},
|
|
108
69
|
key: "24vwut",
|
|
@@ -39,9 +39,6 @@ import Slide1_4 from "../../../assets/images/sliderToolTip/slide4.svg";
|
|
|
39
39
|
import Slide1_5 from "../../../assets/images/sliderToolTip/slide5.svg";
|
|
40
40
|
import { VersionSelector } from "../../organisms/VersionSelector";
|
|
41
41
|
import { useCloseModal } from "../../../global-files/customHooks";
|
|
42
|
-
import { createMessage, sendMessage } from "../RetailerProductEdition/utils";
|
|
43
|
-
import { Modal } from "../../organisms/Modal";
|
|
44
|
-
import { ButtonV2 } from "../../atoms/ButtonV2";
|
|
45
42
|
|
|
46
43
|
const reducerImages = (state, action) => {
|
|
47
44
|
let { values, attrForImgs, inputsByRetailer } = state;
|
|
@@ -217,7 +214,6 @@ export const ProviderProductEdition = ({
|
|
|
217
214
|
const isRetailer = user?.is_retailer;
|
|
218
215
|
const [loading, setLoading] = useState(true);
|
|
219
216
|
const [validatedAll, setValidatedAll] = useState(false);
|
|
220
|
-
const [showRejectModal, setShowRejectModal] = useState(false);
|
|
221
217
|
|
|
222
218
|
const [origin, setOrigin] = useState({
|
|
223
219
|
"Ficha técnica": null,
|
|
@@ -347,6 +343,28 @@ export const ProviderProductEdition = ({
|
|
|
347
343
|
(type) => {
|
|
348
344
|
const formatter = new Intl.ListFormat("es", { type: "conjunction" });
|
|
349
345
|
switch (type) {
|
|
346
|
+
case "error":
|
|
347
|
+
setGlobalModal({
|
|
348
|
+
message: `${activeTab} rechazada`,
|
|
349
|
+
detail: "Agrega tu comentarios para enviar el rechazo",
|
|
350
|
+
img: errorModal,
|
|
351
|
+
textArea: true,
|
|
352
|
+
button1: {
|
|
353
|
+
name: "Enviar",
|
|
354
|
+
action: (e) => {
|
|
355
|
+
const textArea = document.querySelector("#area");
|
|
356
|
+
if (textArea.value) {
|
|
357
|
+
textArea.style.border = "none";
|
|
358
|
+
createComment(e, textArea.value);
|
|
359
|
+
showGlobalModal("commentsSent");
|
|
360
|
+
validatedAll ? validateAll("R") : sendEvaluation("R");
|
|
361
|
+
} else {
|
|
362
|
+
textArea.style.border = "2px solid red";
|
|
363
|
+
}
|
|
364
|
+
},
|
|
365
|
+
},
|
|
366
|
+
});
|
|
367
|
+
break;
|
|
350
368
|
case "generic":
|
|
351
369
|
setGlobalModal(dataGenericModal);
|
|
352
370
|
break;
|
|
@@ -506,9 +524,7 @@ export const ProviderProductEdition = ({
|
|
|
506
524
|
);
|
|
507
525
|
setServicesData(parsedResponse);
|
|
508
526
|
}
|
|
509
|
-
|
|
510
|
-
!activeRetailer.id &&
|
|
511
|
-
setActiveRetailer(active ? active : retailers[0]);
|
|
527
|
+
!activeRetailer.id && setActiveRetailer(active ? active : retailers[0]);
|
|
512
528
|
};
|
|
513
529
|
|
|
514
530
|
const isRevision = () => {
|
|
@@ -584,7 +600,7 @@ export const ProviderProductEdition = ({
|
|
|
584
600
|
});
|
|
585
601
|
}
|
|
586
602
|
setProduct(productTemp);
|
|
587
|
-
|
|
603
|
+
setActivePercentage(retailers[0]?.percentage);
|
|
588
604
|
}, [percentages]);
|
|
589
605
|
|
|
590
606
|
const loadInputs = () => {
|
|
@@ -828,19 +844,32 @@ export const ProviderProductEdition = ({
|
|
|
828
844
|
}
|
|
829
845
|
};
|
|
830
846
|
|
|
831
|
-
const createComment = async (
|
|
847
|
+
const createComment = async (e, body, tab) => {
|
|
848
|
+
let concept = "";
|
|
849
|
+
switch (activeTab) {
|
|
850
|
+
case "Ficha técnica":
|
|
851
|
+
concept = "datasheet";
|
|
852
|
+
break;
|
|
853
|
+
case "Imágenes":
|
|
854
|
+
concept = "images";
|
|
855
|
+
break;
|
|
856
|
+
|
|
857
|
+
default:
|
|
858
|
+
concept = "description";
|
|
859
|
+
break;
|
|
860
|
+
}
|
|
832
861
|
const data = {
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
status: product.status || productEdit.product.status,
|
|
839
|
-
},
|
|
840
|
-
paramsHeader: { Authorization: token },
|
|
862
|
+
articleId: product?.id_article,
|
|
863
|
+
orderId: product?.orderId,
|
|
864
|
+
message: body,
|
|
865
|
+
concept: concept,
|
|
866
|
+
version: version,
|
|
841
867
|
};
|
|
842
|
-
|
|
843
|
-
|
|
868
|
+
await axios.post(`${process.env.REACT_APP_COMMENTS_ENDPOINT}`, data, {
|
|
869
|
+
headers: {
|
|
870
|
+
Authorization: token,
|
|
871
|
+
},
|
|
872
|
+
});
|
|
844
873
|
};
|
|
845
874
|
|
|
846
875
|
useEffect(() => {
|
|
@@ -1040,27 +1069,6 @@ export const ProviderProductEdition = ({
|
|
|
1040
1069
|
const { newArticleStatus, newServiceStatus, newStatus } = JSON.parse(
|
|
1041
1070
|
res.data.body
|
|
1042
1071
|
);
|
|
1043
|
-
|
|
1044
|
-
const message = createMessage(
|
|
1045
|
-
product.retailers || product.retailersAvailable,
|
|
1046
|
-
activeRetailer.id,
|
|
1047
|
-
product[sectionStatusKey],
|
|
1048
|
-
newStatus,
|
|
1049
|
-
activeTab
|
|
1050
|
-
);
|
|
1051
|
-
|
|
1052
|
-
const messageData = {
|
|
1053
|
-
paramsBody: {
|
|
1054
|
-
id: product.article.id_article || productEdit.ArticleId,
|
|
1055
|
-
version: version,
|
|
1056
|
-
items: [{ type: "status", value: message }],
|
|
1057
|
-
retailerId: activeRetailer.id,
|
|
1058
|
-
status: product.status || productEdit.product.status,
|
|
1059
|
-
},
|
|
1060
|
-
paramsHeader: { Authorization: token },
|
|
1061
|
-
};
|
|
1062
|
-
await sendMessage(messageData);
|
|
1063
|
-
|
|
1064
1072
|
if (newArticleStatus) productTemp.status = newArticleStatus[articleId];
|
|
1065
1073
|
const retailerStatusCopy = { ...retailerStatus };
|
|
1066
1074
|
retailerStatusCopy[activeRetailer.id][concept] = newStatus;
|
|
@@ -1092,7 +1100,6 @@ export const ProviderProductEdition = ({
|
|
|
1092
1100
|
result,
|
|
1093
1101
|
isAproved: result === "A",
|
|
1094
1102
|
};
|
|
1095
|
-
const messages = [];
|
|
1096
1103
|
servicesData?.forEach((ret) => {
|
|
1097
1104
|
const { service, id_retailer } = ret;
|
|
1098
1105
|
let data = {};
|
|
@@ -1109,18 +1116,6 @@ export const ProviderProductEdition = ({
|
|
|
1109
1116
|
},
|
|
1110
1117
|
})
|
|
1111
1118
|
);
|
|
1112
|
-
if (product[`${ret.service}_status`] !== "NS") {
|
|
1113
|
-
const message = createMessage(
|
|
1114
|
-
product.retailers,
|
|
1115
|
-
ret.id_retailer,
|
|
1116
|
-
product[`${ret.service}_status`],
|
|
1117
|
-
`${result}A`,
|
|
1118
|
-
ret.service
|
|
1119
|
-
);
|
|
1120
|
-
messages.push(
|
|
1121
|
-
createComment([{ type: "status", value: message }], ret.id_retailer)
|
|
1122
|
-
);
|
|
1123
|
-
}
|
|
1124
1119
|
});
|
|
1125
1120
|
await Promise.all(evaluationArray);
|
|
1126
1121
|
const userType = user.is_retailer === 1 ? "CA" : "P";
|
|
@@ -1160,7 +1155,6 @@ export const ProviderProductEdition = ({
|
|
|
1160
1155
|
product: productTemp,
|
|
1161
1156
|
})
|
|
1162
1157
|
);
|
|
1163
|
-
await Promise.all(messages);
|
|
1164
1158
|
|
|
1165
1159
|
await loadData();
|
|
1166
1160
|
} catch (error) {
|
|
@@ -1289,7 +1283,8 @@ export const ProviderProductEdition = ({
|
|
|
1289
1283
|
return;
|
|
1290
1284
|
} else if (user.is_retailer) {
|
|
1291
1285
|
if (product.id_order || product.orderId) {
|
|
1292
|
-
|
|
1286
|
+
setValidatedAll(true);
|
|
1287
|
+
showGlobalModal("error");
|
|
1293
1288
|
} else {
|
|
1294
1289
|
setDataGenericModal((prev) => ({
|
|
1295
1290
|
...prev,
|
|
@@ -1301,7 +1296,8 @@ export const ProviderProductEdition = ({
|
|
|
1301
1296
|
showGlobalModal("generic");
|
|
1302
1297
|
}
|
|
1303
1298
|
} else {
|
|
1304
|
-
|
|
1299
|
+
setValidatedAll(true);
|
|
1300
|
+
showGlobalModal("error");
|
|
1305
1301
|
}
|
|
1306
1302
|
}
|
|
1307
1303
|
};
|
|
@@ -1311,7 +1307,6 @@ export const ProviderProductEdition = ({
|
|
|
1311
1307
|
<HeaderTop
|
|
1312
1308
|
setHeaderTop={setHeaderTop}
|
|
1313
1309
|
withChat={location?.state?.withChat}
|
|
1314
|
-
chatType={location?.state?.chatType}
|
|
1315
1310
|
productSelected={productSelected}
|
|
1316
1311
|
token={token}
|
|
1317
1312
|
activeRetailer={activeRetailer}
|
|
@@ -1390,7 +1385,7 @@ export const ProviderProductEdition = ({
|
|
|
1390
1385
|
} else if (user.is_retailer) {
|
|
1391
1386
|
if (product.id_order || product.orderId) {
|
|
1392
1387
|
setValidatedAll(true);
|
|
1393
|
-
|
|
1388
|
+
showGlobalModal("error");
|
|
1394
1389
|
} else {
|
|
1395
1390
|
setDataGenericModal((prev) => ({
|
|
1396
1391
|
...prev,
|
|
@@ -1402,14 +1397,12 @@ export const ProviderProductEdition = ({
|
|
|
1402
1397
|
showGlobalModal("generic");
|
|
1403
1398
|
}
|
|
1404
1399
|
} else {
|
|
1405
|
-
setShowRejectModal(true);
|
|
1406
1400
|
setValidatedAll(true);
|
|
1401
|
+
showGlobalModal("error");
|
|
1407
1402
|
}
|
|
1408
1403
|
}}
|
|
1409
1404
|
approve={() => sendToEvaluation("A")}
|
|
1410
|
-
reject={() =>
|
|
1411
|
-
setShowRejectModal(true);
|
|
1412
|
-
}}
|
|
1405
|
+
reject={() => sendToEvaluation("R")}
|
|
1413
1406
|
/>
|
|
1414
1407
|
<FullTabsMenu
|
|
1415
1408
|
tabsSections={tabsSections}
|
|
@@ -1529,41 +1522,87 @@ export const ProviderProductEdition = ({
|
|
|
1529
1522
|
</>
|
|
1530
1523
|
)}
|
|
1531
1524
|
</div>
|
|
1532
|
-
{
|
|
1533
|
-
<div className="
|
|
1534
|
-
|
|
1535
|
-
<
|
|
1536
|
-
|
|
1537
|
-
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
<
|
|
1546
|
-
|
|
1547
|
-
|
|
1525
|
+
{isRevision() && getSectionStatus() ? (
|
|
1526
|
+
<div className="commentary-box">
|
|
1527
|
+
{!comment ? (
|
|
1528
|
+
<div className="commentary">
|
|
1529
|
+
<TagAndInput
|
|
1530
|
+
label={"Caja de Comentario"}
|
|
1531
|
+
inputType={"textarea"}
|
|
1532
|
+
inputCols={80}
|
|
1533
|
+
inputRows={4}
|
|
1534
|
+
inputId={"commentary-box"}
|
|
1535
|
+
index={0}
|
|
1536
|
+
/>
|
|
1537
|
+
<div className="buttons-box">
|
|
1538
|
+
<Button
|
|
1539
|
+
buttonType={"general-transparent-button"}
|
|
1540
|
+
label={"Enviar comentario"}
|
|
1541
|
+
onClick={(e) =>
|
|
1542
|
+
createComment(
|
|
1543
|
+
e,
|
|
1544
|
+
document.querySelector(
|
|
1545
|
+
"#description-commentary-box-0 .ql-container .ql-editor > p"
|
|
1546
|
+
).innerHTML,
|
|
1547
|
+
activeTab
|
|
1548
|
+
)
|
|
1549
|
+
}
|
|
1550
|
+
/>
|
|
1551
|
+
</div>
|
|
1552
|
+
</div>
|
|
1548
1553
|
) : (
|
|
1549
|
-
|
|
1550
|
-
<
|
|
1551
|
-
|
|
1552
|
-
|
|
1553
|
-
iconSize={"big-image"}
|
|
1554
|
-
slidePosition={"top-slide"}
|
|
1554
|
+
<div className="feedback-box">
|
|
1555
|
+
<Commentary
|
|
1556
|
+
comment={comment.message}
|
|
1557
|
+
reviewed={crossComment}
|
|
1555
1558
|
/>
|
|
1556
1559
|
<Button
|
|
1557
|
-
|
|
1558
|
-
|
|
1559
|
-
|
|
1560
|
+
buttonType={"circular-button accept-button"}
|
|
1561
|
+
onClick={async () => {
|
|
1562
|
+
setCrossComment(true);
|
|
1563
|
+
commentRevised();
|
|
1560
1564
|
}}
|
|
1561
|
-
buttonType="general-default-button"
|
|
1562
|
-
label="Enviar a Content-oh!"
|
|
1563
1565
|
/>
|
|
1564
|
-
|
|
1566
|
+
</div>
|
|
1565
1567
|
)}
|
|
1566
1568
|
</div>
|
|
1569
|
+
) : (
|
|
1570
|
+
!revision && (
|
|
1571
|
+
<div className="required-inputs-message">
|
|
1572
|
+
<div>
|
|
1573
|
+
<p>
|
|
1574
|
+
Los atributos son requeridos por las plataformas de las
|
|
1575
|
+
cadenas, es muy importante completar los campos requeridos
|
|
1576
|
+
ya que pueden rechazar el producto por falta de información.
|
|
1577
|
+
</p>
|
|
1578
|
+
</div>
|
|
1579
|
+
{inCart ? (
|
|
1580
|
+
<button type="button">
|
|
1581
|
+
<Link to="/checkout">
|
|
1582
|
+
<p>Articulo en carrito</p>
|
|
1583
|
+
<p>Ir a checkout</p>
|
|
1584
|
+
</Link>
|
|
1585
|
+
</button>
|
|
1586
|
+
) : (
|
|
1587
|
+
<>
|
|
1588
|
+
<SliderToolTip
|
|
1589
|
+
infoIcon={InfoIcon}
|
|
1590
|
+
slidefront={slidefront}
|
|
1591
|
+
iconSize={"big-image"}
|
|
1592
|
+
slidePosition={"top-slide"}
|
|
1593
|
+
/>
|
|
1594
|
+
<Button
|
|
1595
|
+
onClick={() => {
|
|
1596
|
+
setShowContentohRequestModal &&
|
|
1597
|
+
setShowContentohRequestModal(true);
|
|
1598
|
+
}}
|
|
1599
|
+
buttonType="general-default-button"
|
|
1600
|
+
label="Enviar a Content-oh!"
|
|
1601
|
+
/>
|
|
1602
|
+
</>
|
|
1603
|
+
)}
|
|
1604
|
+
</div>
|
|
1605
|
+
)
|
|
1567
1606
|
)}
|
|
1568
1607
|
</div>
|
|
1569
1608
|
</div>
|
|
@@ -1606,48 +1645,6 @@ export const ProviderProductEdition = ({
|
|
|
1606
1645
|
jwt={token}
|
|
1607
1646
|
/>
|
|
1608
1647
|
)}
|
|
1609
|
-
{showRejectModal && (
|
|
1610
|
-
<Modal
|
|
1611
|
-
title={"Agregar mensaje de rechazo"}
|
|
1612
|
-
show={showRejectModal}
|
|
1613
|
-
customComponent={
|
|
1614
|
-
<TagAndInput
|
|
1615
|
-
inputType={"textarea"}
|
|
1616
|
-
inputId={"modal-message-box"}
|
|
1617
|
-
index={0}
|
|
1618
|
-
color={"white"}
|
|
1619
|
-
/>
|
|
1620
|
-
}
|
|
1621
|
-
buttons={[
|
|
1622
|
-
<ButtonV2
|
|
1623
|
-
key={"btn-Cancelar"}
|
|
1624
|
-
type={"white"}
|
|
1625
|
-
label={"Cancelar"}
|
|
1626
|
-
size={12}
|
|
1627
|
-
onClick={() => {
|
|
1628
|
-
setShowRejectModal(false);
|
|
1629
|
-
}}
|
|
1630
|
-
/>,
|
|
1631
|
-
<ButtonV2
|
|
1632
|
-
key={"btn-Aceptar"}
|
|
1633
|
-
type={"pink"}
|
|
1634
|
-
label={"Aceptar"}
|
|
1635
|
-
size={12}
|
|
1636
|
-
onClick={async () => {
|
|
1637
|
-
const body = document.querySelector(
|
|
1638
|
-
"#modal-message-box .ql-container .ql-editor > p"
|
|
1639
|
-
).innerHTML;
|
|
1640
|
-
const messages = [
|
|
1641
|
-
{ type: "message", value: body?.replace(/<.*?\/?>/gm, "") },
|
|
1642
|
-
];
|
|
1643
|
-
await createComment(messages, activeRetailer.id);
|
|
1644
|
-
validatedAll ? validateAll("R") : sendToEvaluation("R");
|
|
1645
|
-
setShowRejectModal(false);
|
|
1646
|
-
}}
|
|
1647
|
-
/>,
|
|
1648
|
-
]}
|
|
1649
|
-
/>
|
|
1650
|
-
)}
|
|
1651
1648
|
</Container>
|
|
1652
1649
|
);
|
|
1653
1650
|
};
|
|
@@ -107,10 +107,6 @@ export const Container = styled.div`
|
|
|
107
107
|
}
|
|
108
108
|
}
|
|
109
109
|
}
|
|
110
|
-
#modal-message-box {
|
|
111
|
-
width: 400px;
|
|
112
|
-
height: 100px;
|
|
113
|
-
}
|
|
114
110
|
.container {
|
|
115
111
|
width: 100%;
|
|
116
112
|
height: 100%;
|
|
@@ -119,4 +115,4 @@ export const Container = styled.div`
|
|
|
119
115
|
width: 100%;
|
|
120
116
|
}
|
|
121
117
|
}
|
|
122
|
-
`;
|
|
118
|
+
`;
|
|
@@ -16,7 +16,7 @@ RetailerProductEditionDefault.args = {
|
|
|
16
16
|
Imágenes: false,
|
|
17
17
|
},
|
|
18
18
|
token:
|
|
19
|
-
"eyJraWQiOiJkQWJkZCtlclwvTlwveVRQUWNvUlVyOCtrNUd2M1hMM2N1MWUzQ09zWExVRnc9IiwiYWxnIjoiUlMyNTYifQ.
|
|
19
|
+
"eyJraWQiOiJkQWJkZCtlclwvTlwveVRQUWNvUlVyOCtrNUd2M1hMM2N1MWUzQ09zWExVRnc9IiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiJhNmM0ZDNkNi0yNGE0LTQxZDQtYWQwZi1kMDg3NDM4YWI1YjYiLCJjb2duaXRvOmdyb3VwcyI6WyJjb2xhYm9yYWRvcmVzX2NvbnRlbnRvaCJdLCJlbWFpbF92ZXJpZmllZCI6dHJ1ZSwiaXNzIjoiaHR0cHM6XC9cL2NvZ25pdG8taWRwLnVzLWVhc3QtMS5hbWF6b25hd3MuY29tXC91cy1lYXN0LTFfWE1aUWRxa0dqIiwiY29nbml0bzp1c2VybmFtZSI6ImE2YzRkM2Q2LTI0YTQtNDFkNC1hZDBmLWQwODc0MzhhYjViNiIsImNvZ25pdG86cm9sZXMiOlsiYXJuOmF3czppYW06Ojg5ODY3MDIzMjgwNzpyb2xlXC9jb250ZW50b2gtZGV2LXVzLWVhc3QtMS1sYW1iZGFSb2xlIl0sImF1ZCI6IjVhYzh0cGdzNmdic3ExM2ZydnJwaWVlcDQwIiwiZXZlbnRfaWQiOiIyYjU3MjZlMy04MjM2LTRmYzMtODBkMi05NWVmYmU4ODdjOTYiLCJ0b2tlbl91c2UiOiJpZCIsImF1dGhfdGltZSI6MTY4MjAxNjI5MSwibmFtZSI6IkNvbGFib3JhZG9yIiwicGhvbmVfbnVtYmVyIjoiKzUyMTExMSIsImV4cCI6MTY4MjAxOTg5MSwiaWF0IjoxNjgyMDE2MjkxLCJlbWFpbCI6ImV0Y0Bjb250ZW50b2guY29tIn0.SCj_yp1NkGCED59JHoDSdFAOakIOvZVeC0yLwt9z0BtenDXlU0m5cUofQQonnWPM8Q70yMFEkyMGI9kQs_fz1gxrmrSc2FGefn3B_1Vymq3pQ_S1JrY_syYf88m_GtJKOywEnE6--Ef9lZhFBFKGtqRJ4H8JBa9Xb96uCjAKyEMCSURDlw37pk2RQdULlZPj17Zb6Xrqi2lwrhpI1ByptX3__UoTiZklnTXwIxM4JdU7yuhXLznaEH8NOSd2Jw-CV6FCUbYBHlnRYBQg7B5mwyVKtDQm6QpRgBTBPCvljJJpFjRKUcnon8WZiFXx1qVbkWPt2vCT1TZqqoSLdlP6lA",
|
|
20
20
|
productSelected: {
|
|
21
21
|
services: {
|
|
22
22
|
datasheets: 1,
|
|
@@ -73,11 +73,7 @@ RetailerProductEditionDefault.args = {
|
|
|
73
73
|
upc: "7543453453",
|
|
74
74
|
},
|
|
75
75
|
location: {
|
|
76
|
-
product: { articleId:
|
|
77
|
-
state: {
|
|
78
|
-
withChat: true,
|
|
79
|
-
chatType: "product_status",
|
|
80
|
-
},
|
|
76
|
+
product: { articleId: 39290, versionId: 7 },
|
|
81
77
|
},
|
|
82
78
|
user: {
|
|
83
79
|
id_user: 37,
|