contentoh-components-library 21.1.27 → 21.1.30
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/images/sliderToolTip/slide21.svg +9 -0
- package/dist/assets/images/sliderToolTip/slide22.svg +9 -0
- package/dist/assets/images/sliderToolTip/slide23.svg +9 -0
- package/dist/components/atoms/CheckBox/styles.js +1 -1
- package/dist/components/atoms/ListCommercialRetailers/ListCommercialRetailers.stories.js +36 -0
- package/dist/components/atoms/ListCommercialRetailers/index.js +64 -0
- package/dist/components/atoms/ListCommercialRetailers/styles.js +20 -0
- package/dist/components/atoms/MenuCommercialRetailers/MenuCommercialRetailers.stories.js +37 -0
- package/dist/components/atoms/MenuCommercialRetailers/index.js +25 -0
- package/dist/components/atoms/MenuCommercialRetailers/styles.js +20 -0
- package/dist/components/atoms/MenuProductImage/MenuProductImage.stories.js +28 -0
- package/dist/components/atoms/MenuProductImage/index.js +88 -0
- package/dist/components/atoms/MenuProductImage/styles.js +20 -0
- package/dist/components/atoms/SliderToolTip/SliderToolTip.stories.js +67 -13
- package/dist/components/atoms/SliderToolTip/index.js +64 -134
- package/dist/components/atoms/SliderToolTip/styles.js +2 -2
- package/dist/components/atoms/VerticalSideMenuMainPage/VerticalSideMenuMainPage.stories.js +44 -1
- package/dist/components/atoms/VerticalSideMenuMainPage/index.js +45 -48
- package/dist/components/atoms/VerticalSideMenuMainPage/styles.js +30 -3
- package/dist/components/molecules/ApproveRejetPanel/ApproveRejetPanel.stories.js +25 -0
- package/dist/components/molecules/ApproveRejetPanel/index.js +49 -0
- package/dist/components/molecules/ApproveRejetPanel/styles.js +18 -0
- package/dist/components/molecules/SignInLoginCreationApp/SignInLogin.stories.js +28 -0
- package/dist/components/molecules/SignInLoginCreationApp/index.js +270 -0
- package/dist/components/molecules/SignInLoginCreationApp/styles.js +20 -0
- package/dist/components/molecules/StatusAsignationInfo/index.js +29 -1
- package/dist/components/pages/ProviderProductEdition/index.js +106 -12
- package/dist/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +56 -65
- package/dist/components/pages/RetailerProductEdition/index.js +118 -8
- package/dist/global-files/global-styles.css +0 -1
- package/dist/index.js +38 -51
- package/package.json +1 -1
- package/src/assets/images/sliderToolTip/slide21.svg +9 -0
- package/src/assets/images/sliderToolTip/slide22.svg +9 -0
- package/src/assets/images/sliderToolTip/slide23.svg +9 -0
- package/src/components/atoms/CheckBox/styles.js +0 -1
- package/src/components/atoms/SliderToolTip/SliderToolTip.stories.js +77 -11
- package/src/components/atoms/SliderToolTip/index.js +91 -154
- package/src/components/atoms/SliderToolTip/styles.js +51 -22
- package/src/components/atoms/ValidationPanel/index.js +1 -1
- package/src/components/atoms/VerticalSideMenuMainPage/VerticalSideMenuMainPage.stories.js +24 -1
- package/src/components/atoms/VerticalSideMenuMainPage/index.js +37 -30
- package/src/components/atoms/VerticalSideMenuMainPage/styles.js +76 -18
- package/src/components/molecules/AvatarAndValidation/index.js +1 -1
- package/src/components/molecules/StatusAsignationInfo/index.js +31 -0
- package/src/components/organisms/FullProductNameHeader/index.js +1 -1
- package/src/components/pages/ProviderProductEdition/ProviderProductEdition.stories.js +1 -1
- package/src/components/pages/ProviderProductEdition/index.js +113 -12
- package/src/components/pages/ProviderProductEdition/styles.js +1 -1
- package/src/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +57 -68
- package/src/components/pages/RetailerProductEdition/index.js +103 -2
- package/src/index.js +0 -1
- package/dist/components/atoms/Percent/Percent.stories.js +0 -39
- package/dist/components/atoms/Percent/index.js +0 -39
- package/dist/components/atoms/Percent/styles.js +0 -20
- package/dist/components/molecules/TextAndGradient/TextAndGradient.stories.js +0 -31
- package/dist/components/molecules/TextAndGradient/index.js +0 -36
- package/dist/components/molecules/TextAndGradient/styles.js +0 -18
- package/src/components/pages/RegistrationLoginFirstStep/RegistrationLoginFirstStep.stories.js +0 -17
- package/src/components/pages/RegistrationLoginFirstStep/index.js +0 -160
- package/src/components/pages/RegistrationLoginFirstStep/styles.js +0 -85
|
@@ -1,45 +1,103 @@
|
|
|
1
1
|
import styled from "styled-components";
|
|
2
|
-
|
|
2
|
+
import { NavLink } from "react-router-dom";
|
|
3
|
+
//styled(NavLink)
|
|
3
4
|
export const Container = styled.div`
|
|
4
5
|
height: 100%;
|
|
5
|
-
width:
|
|
6
|
+
width: 58px;
|
|
6
7
|
box-sizing: border-box;
|
|
7
8
|
padding: 23px 10px 70px 10px;
|
|
8
9
|
flex-direction: column;
|
|
9
10
|
justify-content: space-between;
|
|
10
11
|
overflow: auto;
|
|
11
|
-
border-radius:
|
|
12
|
+
border-radius: 50px;
|
|
12
13
|
background: linear-gradient(180deg, #e33aa9 0%, #3b1366 100%);
|
|
13
14
|
scrollbar-width: none;
|
|
14
15
|
display: flex;
|
|
15
16
|
text-align: center;
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
17
|
+
&.actived {
|
|
18
|
+
width: 200px;
|
|
19
|
+
padding: 23px 10px 15px 10px;
|
|
20
|
+
border-radius: 20px;
|
|
19
21
|
}
|
|
20
22
|
.navbar-top {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
+
.logo {
|
|
24
|
+
& + * {
|
|
25
|
+
margin-top: ${({ bar }) => (bar === "" ? 145 : 50)}%;
|
|
26
|
+
}
|
|
23
27
|
}
|
|
24
28
|
.option {
|
|
29
|
+
display: flex;
|
|
30
|
+
flex-direction: column;
|
|
31
|
+
align-items: flex-start;
|
|
32
|
+
padding-left: ${({ bar }) => (bar ? 5 : 0)}px;
|
|
25
33
|
div {
|
|
26
|
-
height:
|
|
34
|
+
height: ${({ bar }) => (bar ? 32 : 38)}px;
|
|
35
|
+
width: ${({ bar }) => (bar ? 165 : 38)}px;
|
|
27
36
|
display: flex;
|
|
28
|
-
justify-content: center;
|
|
29
|
-
border-radius: 100
|
|
30
|
-
|
|
37
|
+
justify-content: ${({ bar }) => (bar ? "flex-start" : "center")};
|
|
38
|
+
border-radius: ${({ bar }) => (bar ? 18 : 100)}px;
|
|
39
|
+
align-items: center;
|
|
40
|
+
font-family: "Raleway";
|
|
41
|
+
font-style: normal;
|
|
42
|
+
font-weight: 400;
|
|
43
|
+
font-size: 18px;
|
|
44
|
+
line-height: 21px;
|
|
45
|
+
letter-spacing: -0.015em;
|
|
46
|
+
color: #fafafa;
|
|
47
|
+
text-decoration: none;
|
|
48
|
+
&.option-link {
|
|
49
|
+
cursor: pointer;
|
|
31
50
|
margin-top: 12px;
|
|
51
|
+
padding-left: ${({ bar }) => (bar ? 15 : 0)}px;
|
|
52
|
+
}
|
|
53
|
+
p {
|
|
54
|
+
cursor: pointer;
|
|
55
|
+
}
|
|
56
|
+
img {
|
|
57
|
+
& + * {
|
|
58
|
+
margin-left: 12px;
|
|
59
|
+
}
|
|
32
60
|
}
|
|
33
61
|
}
|
|
34
|
-
|
|
62
|
+
.option-link:hover {
|
|
35
63
|
background: #e33aa9;
|
|
36
64
|
}
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
65
|
+
.sub-option {
|
|
66
|
+
display: flex;
|
|
67
|
+
flex-direction: column;
|
|
68
|
+
padding-left: ${({ bar }) => (bar ? 28 : 20)}px;
|
|
69
|
+
height: auto;
|
|
70
|
+
width: auto;
|
|
71
|
+
div {
|
|
72
|
+
display: flex;
|
|
73
|
+
justify-content: flex-start;
|
|
74
|
+
text-decoration: none;
|
|
75
|
+
position: relative;
|
|
76
|
+
font-size: 13px;
|
|
77
|
+
border-left: 1px solid #f0eef2;
|
|
78
|
+
border-radius: 0;
|
|
79
|
+
color: #f0eef2;
|
|
80
|
+
padding-top: 20px;
|
|
81
|
+
padding-left: 12px;
|
|
82
|
+
height: 25px;
|
|
83
|
+
&::before {
|
|
84
|
+
border-left: 1px solid #e33aa9;
|
|
85
|
+
width: 10px;
|
|
86
|
+
content: "";
|
|
87
|
+
border-radius: 50%;
|
|
88
|
+
height: 10px;
|
|
89
|
+
background-color: white;
|
|
90
|
+
position: absolute;
|
|
91
|
+
left: ${({ bar }) => (bar ? -4 : -16)}%;
|
|
92
|
+
bottom: 1%;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
42
95
|
}
|
|
43
96
|
}
|
|
44
97
|
}
|
|
98
|
+
.menu-bottom {
|
|
99
|
+
display: flex;
|
|
100
|
+
justify-content: ${({ bar }) => (bar ? "flex-end" : "center")};
|
|
101
|
+
cursor: pointer;
|
|
102
|
+
}
|
|
45
103
|
`;
|
|
@@ -6,6 +6,11 @@ import { Button } from "../../atoms/GeneralButton";
|
|
|
6
6
|
import { useEffect, useState } from "react";
|
|
7
7
|
import { AsignationOption } from "../../atoms/AsignationOption/index";
|
|
8
8
|
import { getProfilePicture } from "../../../global-files/data";
|
|
9
|
+
import { SliderToolTip } from "../../atoms/SliderToolTip";
|
|
10
|
+
import InfoIcon from "../../../assets/images/sliderToolTip/infoIcon.svg";
|
|
11
|
+
import Slide1 from "../../../assets/images/sliderToolTip/slide21.svg";
|
|
12
|
+
import Slide2 from "../../../assets/images/sliderToolTip/slide22.svg";
|
|
13
|
+
import Slide3 from "../../../assets/images/sliderToolTip/slide23.svg";
|
|
9
14
|
|
|
10
15
|
export const StatusAsignationInfo = ({
|
|
11
16
|
status = "-",
|
|
@@ -31,6 +36,26 @@ export const StatusAsignationInfo = ({
|
|
|
31
36
|
setShowAsignationPanel(false);
|
|
32
37
|
}
|
|
33
38
|
};
|
|
39
|
+
const slidefront = [
|
|
40
|
+
{
|
|
41
|
+
slide: Slide1,
|
|
42
|
+
title: "Valida tu producto en cada activo digital",
|
|
43
|
+
description:
|
|
44
|
+
"Al solicitar a Content-oh! podrás validar la información, imágenes y documentación de tu producto, esto hará más sencillo que puedas aprobar o rechazar el contenido.",
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
slide: Slide2,
|
|
48
|
+
title: "Aprueba o rechaza con un clic",
|
|
49
|
+
description:
|
|
50
|
+
"Cuando termines de revisar tu información, elige si aproebas o rechazas, esto enviara una notificiación a nuestro equipo, para continuar o corregir el producto.",
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
slide: Slide3,
|
|
54
|
+
title: "Estatus de tu producto en el proceso",
|
|
55
|
+
description:
|
|
56
|
+
"La mayor parte del proceso podrás identificar que estatus tiene tu producto, esto dara visibilidad a todo tu equipo para saber la etapa se encuentra.",
|
|
57
|
+
},
|
|
58
|
+
];
|
|
34
59
|
|
|
35
60
|
useEffect(() => {
|
|
36
61
|
if (showAsignationPanel) {
|
|
@@ -40,6 +65,12 @@ export const StatusAsignationInfo = ({
|
|
|
40
65
|
|
|
41
66
|
return (
|
|
42
67
|
<Container id={id}>
|
|
68
|
+
<SliderToolTip
|
|
69
|
+
infoIcon={InfoIcon}
|
|
70
|
+
slidefront={slidefront}
|
|
71
|
+
iconSize={"medium-image"}
|
|
72
|
+
slidePosition={"bottom-slide"}
|
|
73
|
+
></SliderToolTip>
|
|
43
74
|
{status !== "-" && <StatusTag statusType={status} ovalForm={true} />}
|
|
44
75
|
{showSaveButton && (
|
|
45
76
|
<Button
|
|
@@ -33,6 +33,13 @@ import { Link } from "react-router-dom";
|
|
|
33
33
|
import face from "../../../assets/images/defaultImages/defaultProfileImage.svg";
|
|
34
34
|
import errorModal from "../../../assets/images/genericModal/errorModal.svg";
|
|
35
35
|
import { GlobalModal } from "../../organisms/GlobalModal/index";
|
|
36
|
+
import { SliderToolTip } from "../../atoms/SliderToolTip";
|
|
37
|
+
import InfoIcon from "../../../assets/images/sliderToolTip/infoIcon.svg";
|
|
38
|
+
import Slide1_1 from "../../../assets/images/sliderToolTip/slide1.svg";
|
|
39
|
+
import Slide1_2 from "../../../assets/images/sliderToolTip/slide2.svg";
|
|
40
|
+
import Slide1_3 from "../../../assets/images/sliderToolTip/slide3.svg";
|
|
41
|
+
import Slide1_4 from "../../../assets/images/sliderToolTip/slide4.svg";
|
|
42
|
+
import Slide1_5 from "../../../assets/images/sliderToolTip/slide5.svg";
|
|
36
43
|
|
|
37
44
|
const reducerImages = (state, action) => {
|
|
38
45
|
let { values, attrForImgs } = state;
|
|
@@ -891,9 +898,12 @@ export const ProviderProductEdition = ({
|
|
|
891
898
|
await Promise.all(sendAll);
|
|
892
899
|
const productTemp = product;
|
|
893
900
|
productTemp.article_status = `${result}C`;
|
|
894
|
-
productTemp.datasheet_status =
|
|
895
|
-
|
|
896
|
-
productTemp.
|
|
901
|
+
productTemp.datasheet_status =
|
|
902
|
+
productTemp.datasheet_status === "NA" ? "NA" : `${result}C`;
|
|
903
|
+
productTemp.description_status =
|
|
904
|
+
productTemp.description_status === "NA" ? "NA" : `${result}C`;
|
|
905
|
+
productTemp.images_status =
|
|
906
|
+
productTemp.images_status === "NA" ? "NA" : `${result}C`;
|
|
897
907
|
setProduct(productTemp);
|
|
898
908
|
sessionStorage.setItem("productSelected", JSON.stringify(productTemp));
|
|
899
909
|
setProductEdit({
|
|
@@ -970,6 +980,35 @@ export const ProviderProductEdition = ({
|
|
|
970
980
|
setSaving(loading);
|
|
971
981
|
}, [loading]);
|
|
972
982
|
|
|
983
|
+
const slidefront = [
|
|
984
|
+
{
|
|
985
|
+
slide: Slide1_1,
|
|
986
|
+
description:
|
|
987
|
+
"Creamos tu contenido, y todo lo que haga falta para tu producto, cada sección puedes socilitar contenido enriquecido, y nosotros lo haremos por ti.",
|
|
988
|
+
},
|
|
989
|
+
{
|
|
990
|
+
slide: Slide1_2,
|
|
991
|
+
description:
|
|
992
|
+
"Puedes agregar solicitudes de contenido enriquecido a tu carrito de compra las veces que sean necesarias. Una vez completada tu lista con los servicios necesitados sigue el proceso de compra en checkout.",
|
|
993
|
+
},
|
|
994
|
+
{
|
|
995
|
+
slide: Slide1_3,
|
|
996
|
+
description:
|
|
997
|
+
"Revisa el contenido que deseas solicilitar, valida y tambien puedes agregar contenido extra, traducciones, o simplemente completar el checkout.",
|
|
998
|
+
},
|
|
999
|
+
{
|
|
1000
|
+
slide: Slide1_4,
|
|
1001
|
+
description:
|
|
1002
|
+
"Elige el tipo de entrega de tu producto, puedes ser recolección en el lugar o por el contrario puedes dejarlo en nuestras oficinas.",
|
|
1003
|
+
},
|
|
1004
|
+
{
|
|
1005
|
+
slide: Slide1_5,
|
|
1006
|
+
title: "Bienvenido al modo Content-oh!",
|
|
1007
|
+
description:
|
|
1008
|
+
"Finalmente elige la forma de pago que más te guste, procede con el pago y listo.",
|
|
1009
|
+
},
|
|
1010
|
+
];
|
|
1011
|
+
|
|
973
1012
|
return (
|
|
974
1013
|
<Container headerTop={headerTop}>
|
|
975
1014
|
<HeaderTop setHeaderTop={setHeaderTop} />
|
|
@@ -1003,14 +1042,68 @@ export const ProviderProductEdition = ({
|
|
|
1003
1042
|
setActiveRetailer={setActiveRetailer}
|
|
1004
1043
|
showValidationButtons={isRevision() && getSectionStatus()}
|
|
1005
1044
|
servicesData={servicesData ? servicesData : null}
|
|
1006
|
-
showApproveRejectAll={
|
|
1007
|
-
|
|
1008
|
-
(
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1045
|
+
showApproveRejectAll={isRevision() && getSectionStatus()}
|
|
1046
|
+
approveAll={() => {
|
|
1047
|
+
if (
|
|
1048
|
+
originProp === "RequestWithoutContentoh" &&
|
|
1049
|
+
!user.is_retailer &&
|
|
1050
|
+
(!product.id_order || !product.orderId)
|
|
1051
|
+
) {
|
|
1052
|
+
setDataGenericModal((prev) => ({
|
|
1053
|
+
...prev,
|
|
1054
|
+
button2: {
|
|
1055
|
+
name: "Continuar",
|
|
1056
|
+
action: () => evaluationToRetailer("A"),
|
|
1057
|
+
},
|
|
1058
|
+
}));
|
|
1059
|
+
setShowGenericModal(true);
|
|
1060
|
+
} else {
|
|
1061
|
+
if (user.is_retailer) {
|
|
1062
|
+
if (product.id_order || product.orderId) {
|
|
1063
|
+
validateAll("A");
|
|
1064
|
+
} else {
|
|
1065
|
+
setDataGenericModal((prev) => ({
|
|
1066
|
+
...prev,
|
|
1067
|
+
button2: {
|
|
1068
|
+
name: "Continuar",
|
|
1069
|
+
action: () => evaluationToRetailer("A"),
|
|
1070
|
+
},
|
|
1071
|
+
}));
|
|
1072
|
+
setShowGenericModal(true);
|
|
1073
|
+
}
|
|
1074
|
+
} else {
|
|
1075
|
+
validateAll("A");
|
|
1076
|
+
}
|
|
1077
|
+
}
|
|
1078
|
+
}}
|
|
1079
|
+
rejectAll={() => {
|
|
1080
|
+
if (
|
|
1081
|
+
originProp === "RequestWithoutContentoh" &&
|
|
1082
|
+
!user.is_retailer &&
|
|
1083
|
+
(!product.id_order || !product.orderId)
|
|
1084
|
+
) {
|
|
1085
|
+
return;
|
|
1086
|
+
} else {
|
|
1087
|
+
if (user.is_retailer) {
|
|
1088
|
+
if (product.id_order || product.orderId) {
|
|
1089
|
+
validateAll("R");
|
|
1090
|
+
setModalViewError(true);
|
|
1091
|
+
} else {
|
|
1092
|
+
setDataGenericModal((prev) => ({
|
|
1093
|
+
...prev,
|
|
1094
|
+
button2: {
|
|
1095
|
+
name: "Continuar",
|
|
1096
|
+
action: () => evaluationToRetailer("R"),
|
|
1097
|
+
},
|
|
1098
|
+
}));
|
|
1099
|
+
setShowGenericModal(true);
|
|
1100
|
+
}
|
|
1101
|
+
} else {
|
|
1102
|
+
validateAll("R");
|
|
1103
|
+
setModalViewError(true);
|
|
1104
|
+
}
|
|
1105
|
+
}
|
|
1106
|
+
}}
|
|
1014
1107
|
approve={() => {
|
|
1015
1108
|
if (
|
|
1016
1109
|
origin[activeTab] === "RequestWithoutContentoh" &&
|
|
@@ -1252,6 +1345,13 @@ export const ProviderProductEdition = ({
|
|
|
1252
1345
|
</Link>
|
|
1253
1346
|
</button>
|
|
1254
1347
|
) : (
|
|
1348
|
+
<>
|
|
1349
|
+
<SliderToolTip
|
|
1350
|
+
infoIcon={InfoIcon}
|
|
1351
|
+
slidefront={slidefront}
|
|
1352
|
+
iconSize={"big-image"}
|
|
1353
|
+
slidePosition={"top-slide"}
|
|
1354
|
+
></SliderToolTip>
|
|
1255
1355
|
<Button
|
|
1256
1356
|
onClick={() => {
|
|
1257
1357
|
setShowContentohRequestModal &&
|
|
@@ -1260,6 +1360,7 @@ export const ProviderProductEdition = ({
|
|
|
1260
1360
|
buttonType="general-default-button"
|
|
1261
1361
|
label="Enviar a Content-oh!"
|
|
1262
1362
|
/>
|
|
1363
|
+
</>
|
|
1263
1364
|
)}
|
|
1264
1365
|
</div>
|
|
1265
1366
|
)}
|
|
@@ -1340,4 +1441,4 @@ export const ProviderProductEdition = ({
|
|
|
1340
1441
|
)}
|
|
1341
1442
|
</Container>
|
|
1342
1443
|
);
|
|
1343
|
-
};
|
|
1444
|
+
};
|
|
@@ -16,110 +16,99 @@ RetailerProductEditionDefault.args = {
|
|
|
16
16
|
Imágenes: false,
|
|
17
17
|
},
|
|
18
18
|
token:
|
|
19
|
-
"
|
|
20
|
-
articleId: 238,
|
|
21
|
-
category: 846,
|
|
22
|
-
version: 2,
|
|
19
|
+
"eyJraWQiOiJkQWJkZCtlclwvTlwveVRQUWNvUlVyOCtrNUd2M1hMM2N1MWUzQ09zWExVRnc9IiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiJjOTRhNzMwNS05MzY1LTQ2ZmYtYTQyMy00YjRiYzNiOGIxODAiLCJjb2duaXRvOmdyb3VwcyI6WyJjb2xhYm9yYWRvcmVzX2NvbnRlbnRvaCJdLCJlbWFpbF92ZXJpZmllZCI6dHJ1ZSwiaXNzIjoiaHR0cHM6XC9cL2NvZ25pdG8taWRwLnVzLWVhc3QtMS5hbWF6b25hd3MuY29tXC91cy1lYXN0LTFfWE1aUWRxa0dqIiwicGhvbmVfbnVtYmVyX3ZlcmlmaWVkIjp0cnVlLCJjb2duaXRvOnVzZXJuYW1lIjoiYzk0YTczMDUtOTM2NS00NmZmLWE0MjMtNGI0YmMzYjhiMTgwIiwiY29nbml0bzpyb2xlcyI6WyJhcm46YXdzOmlhbTo6ODk4NjcwMjMyODA3OnJvbGVcL2NvbnRlbnRvaC1kZXYtdXMtZWFzdC0xLWxhbWJkYVJvbGUiXSwiYXVkIjoiNWFjOHRwZ3M2Z2JzcTEzZnJ2cnBpZWVwNDAiLCJldmVudF9pZCI6ImExY2QwOGQ3LTM0MTgtNGI0ZC1hODNmLTJlOWE0N2E2ZTQzYSIsInRva2VuX3VzZSI6ImlkIiwiYXV0aF90aW1lIjoxNjU2Mzc1MzQ5LCJuYW1lIjoiQ29sYWJvcmFkb3IiLCJwaG9uZV9udW1iZXIiOiIrNTIxMTExIiwiZXhwIjoxNjU2Mzc4OTQ5LCJpYXQiOjE2NTYzNzUzNDksImVtYWlsIjoic2FsbWVyb24uNUBob3RtYWlsLmNvbSJ9.AXD7CR-3bJz6vIdBBNB_3xLfaTvlFjHi-cwKdN5qCUSY4msnf1a1RhMEThL3wt7fXi15dy5Fy5b_7zgkWc_NY35Otu1ifQNmSxemncx5qFsNsBH6OvIaZrhiw7XXkfQF20w22f4o8VFW1u0cWudFBYYm6tXlKVEetw-NEu94Mnip0BtQQUU6rFjz5hQM0gWYsvOMmSX3JKQWl4thirzTOqJxrKebFeWnUMs5D3hlFpKeBSKodgB6lLw2522SJmxWXmGCaDOVSMUP9LqB9PsboSOBfSeQpkbIZqd9iNWbrFCusGhnoRrQABucqFwlQ6KPHYTPaOOux-X3pf6i5woX4g",
|
|
23
20
|
productSelected: {
|
|
24
21
|
services: {
|
|
25
22
|
datasheets: 1,
|
|
26
23
|
descriptions: 1,
|
|
27
24
|
images: 1,
|
|
28
25
|
},
|
|
29
|
-
orderId:
|
|
30
|
-
status: "
|
|
31
|
-
datasheet_status: "
|
|
32
|
-
prio: "
|
|
33
|
-
version:
|
|
34
|
-
description_status: "
|
|
35
|
-
images_status: "
|
|
26
|
+
orderId: 64,
|
|
27
|
+
status: "AF",
|
|
28
|
+
datasheet_status: "AF",
|
|
29
|
+
prio: "none",
|
|
30
|
+
version: 7,
|
|
31
|
+
description_status: "AF",
|
|
32
|
+
images_status: "AF",
|
|
36
33
|
article: {
|
|
37
|
-
id_article:
|
|
38
|
-
id_category: "
|
|
39
|
-
name: "
|
|
40
|
-
upc: "
|
|
41
|
-
timestamp: "
|
|
42
|
-
id_user:
|
|
43
|
-
status: "
|
|
34
|
+
id_article: 35707,
|
|
35
|
+
id_category: "41",
|
|
36
|
+
name: "chetos",
|
|
37
|
+
upc: "1010101010",
|
|
38
|
+
timestamp: "2022-06-16T18:12:42.000Z",
|
|
39
|
+
id_user: 28,
|
|
40
|
+
status: "NULL",
|
|
44
41
|
active: 1,
|
|
45
|
-
company_id:
|
|
46
|
-
company_name: "
|
|
47
|
-
country: "
|
|
48
|
-
id_order:
|
|
49
|
-
id_datasheet_especialist:
|
|
50
|
-
id_datasheet_facilitator:
|
|
51
|
-
id_description_especialist:
|
|
52
|
-
id_description_facilitator:
|
|
53
|
-
id_images_especialist:
|
|
54
|
-
id_images_facilitator:
|
|
55
|
-
id_auditor:
|
|
42
|
+
company_id: 1,
|
|
43
|
+
company_name: "COMPANY DEV",
|
|
44
|
+
country: "México",
|
|
45
|
+
id_order: 64,
|
|
46
|
+
id_datasheet_especialist: 54,
|
|
47
|
+
id_datasheet_facilitator: 52,
|
|
48
|
+
id_description_especialist: 54,
|
|
49
|
+
id_description_facilitator: 52,
|
|
50
|
+
id_images_especialist: 55,
|
|
51
|
+
id_images_facilitator: 53,
|
|
52
|
+
id_auditor: 30,
|
|
56
53
|
id_recepcionist: null,
|
|
57
|
-
category:
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
missingImages: -4,
|
|
54
|
+
category: "ABARROTES|BOTANAS, GOLOSINAS Y CHOCOLATES|BOTANAS",
|
|
55
|
+
missingAttributes: null,
|
|
56
|
+
missingDescriptions: null,
|
|
57
|
+
missingImages: null,
|
|
62
58
|
},
|
|
63
59
|
retailers: [
|
|
64
60
|
{
|
|
65
|
-
id:
|
|
66
|
-
name: "
|
|
61
|
+
id: 3,
|
|
62
|
+
name: "Sam´s Club",
|
|
67
63
|
country: "México",
|
|
68
64
|
id_region: 1,
|
|
69
65
|
active: 1,
|
|
70
66
|
},
|
|
71
67
|
{
|
|
72
|
-
id:
|
|
73
|
-
name: "
|
|
74
|
-
country: "México",
|
|
75
|
-
id_region: 1,
|
|
76
|
-
active: 1,
|
|
77
|
-
},
|
|
78
|
-
{
|
|
79
|
-
id: 29,
|
|
80
|
-
name: "Farmacias del Ahorro",
|
|
68
|
+
id: 8,
|
|
69
|
+
name: "Fragua",
|
|
81
70
|
country: "México",
|
|
82
71
|
id_region: 1,
|
|
83
72
|
active: 1,
|
|
84
73
|
},
|
|
85
74
|
],
|
|
86
|
-
country: "
|
|
87
|
-
upc: "
|
|
75
|
+
country: "México",
|
|
76
|
+
upc: "1010101010",
|
|
88
77
|
},
|
|
89
78
|
location: {
|
|
90
79
|
product: { articleId: 109485, versionId: 3 },
|
|
91
80
|
},
|
|
92
81
|
user: {
|
|
93
|
-
id_user:
|
|
94
|
-
name: "
|
|
95
|
-
last_name: "
|
|
96
|
-
email: "
|
|
97
|
-
position: "
|
|
82
|
+
id_user: 30,
|
|
83
|
+
name: "Admin",
|
|
84
|
+
last_name: "Ulises",
|
|
85
|
+
email: "salmeron.5@hotmail.com",
|
|
86
|
+
position: "Admin",
|
|
98
87
|
telephone: null,
|
|
99
|
-
country:
|
|
100
|
-
id_company:
|
|
101
|
-
id_cognito: "
|
|
88
|
+
country: "México",
|
|
89
|
+
id_company: 2,
|
|
90
|
+
id_cognito: "c94a7305-9365-46ff-a423-4b4bc3b8b180",
|
|
102
91
|
birth_Date: null,
|
|
103
92
|
about_me: null,
|
|
104
93
|
zip_code: null,
|
|
105
94
|
address: null,
|
|
106
95
|
job: null,
|
|
107
96
|
id_stripe: null,
|
|
108
|
-
id_role:
|
|
97
|
+
id_role: 6,
|
|
109
98
|
active: 1,
|
|
110
99
|
is_retailer: 0,
|
|
111
|
-
email_notify:
|
|
100
|
+
email_notify: 0,
|
|
112
101
|
membership: {
|
|
113
|
-
id:
|
|
114
|
-
start_date: "
|
|
115
|
-
end_date: "
|
|
116
|
-
planID:
|
|
117
|
-
plan: "
|
|
118
|
-
name: "Plan
|
|
119
|
-
user_limit: "
|
|
120
|
-
products_limit: "
|
|
121
|
-
type: "
|
|
102
|
+
id: 2,
|
|
103
|
+
start_date: "2021-11-05T02:35:12.000Z",
|
|
104
|
+
end_date: "2022-11-05T02:34:49.000Z",
|
|
105
|
+
planID: 1,
|
|
106
|
+
plan: "prod_KtkvuFFLpOdP6e",
|
|
107
|
+
name: "Plan Free",
|
|
108
|
+
user_limit: "1",
|
|
109
|
+
products_limit: "3",
|
|
110
|
+
type: "PyMES",
|
|
122
111
|
},
|
|
123
|
-
src: "https://content-management-profile
|
|
112
|
+
src: "https://content-management-profile.s3.amazonaws.com/id-30/30.png?1656375350443",
|
|
124
113
|
},
|
|
125
|
-
};
|
|
114
|
+
};
|
|
@@ -77,7 +77,6 @@ export const RetailerProductEdition = ({
|
|
|
77
77
|
tabsSections,
|
|
78
78
|
productSelected = {},
|
|
79
79
|
user = {},
|
|
80
|
-
location = {},
|
|
81
80
|
token,
|
|
82
81
|
}) => {
|
|
83
82
|
const [activeTab, setActiveTab] = useState("Descripción");
|
|
@@ -165,6 +164,7 @@ export const RetailerProductEdition = ({
|
|
|
165
164
|
const [socketType, setSocketType] = useState(null);
|
|
166
165
|
const [servicesStatus, setServicesStatus] = useState([]);
|
|
167
166
|
const [saving, setSaving] = useState(loading);
|
|
167
|
+
const isAuditor = user.id_role === 6;
|
|
168
168
|
|
|
169
169
|
useEffect(() => {
|
|
170
170
|
checkAll && setSelectedImages(images.values);
|
|
@@ -1081,6 +1081,66 @@ export const RetailerProductEdition = ({
|
|
|
1081
1081
|
setSaving(loading);
|
|
1082
1082
|
}, [loading]);
|
|
1083
1083
|
|
|
1084
|
+
const validateAll = async (result) => {
|
|
1085
|
+
try {
|
|
1086
|
+
setLoading(true);
|
|
1087
|
+
const evaluationArray = [];
|
|
1088
|
+
const sendAll = [];
|
|
1089
|
+
const conceptArray = ["description", "datasheet", "images"];
|
|
1090
|
+
|
|
1091
|
+
servicesData?.forEach((ret) => {
|
|
1092
|
+
let data = {
|
|
1093
|
+
articleId: product.article.id_article,
|
|
1094
|
+
orderId: product.id_order ?? product.orderId,
|
|
1095
|
+
concept: ret.service,
|
|
1096
|
+
result: result,
|
|
1097
|
+
evalStatus: product[`${ret.service}_status`],
|
|
1098
|
+
retailerId: ret.id_retailer,
|
|
1099
|
+
};
|
|
1100
|
+
evaluationArray.push(
|
|
1101
|
+
axios.put(`${process.env.REACT_APP_EVALUATION_ENDPOINT}`, data, {
|
|
1102
|
+
headers: {
|
|
1103
|
+
Authorization: token,
|
|
1104
|
+
},
|
|
1105
|
+
})
|
|
1106
|
+
);
|
|
1107
|
+
});
|
|
1108
|
+
|
|
1109
|
+
await Promise.all(evaluationArray);
|
|
1110
|
+
|
|
1111
|
+
conceptArray?.forEach((concept) => {
|
|
1112
|
+
let data = {
|
|
1113
|
+
articleId: product.article.id_article,
|
|
1114
|
+
orderId: product.id_order ?? product.orderId,
|
|
1115
|
+
concept,
|
|
1116
|
+
evalStatus: product[`${concept}_status`],
|
|
1117
|
+
};
|
|
1118
|
+
sendAll.push(
|
|
1119
|
+
axios.put(`${process.env.REACT_APP_SEND_EVAL}`, data, {
|
|
1120
|
+
headers: {
|
|
1121
|
+
Authorization: token,
|
|
1122
|
+
},
|
|
1123
|
+
})
|
|
1124
|
+
);
|
|
1125
|
+
});
|
|
1126
|
+
await Promise.all(sendAll);
|
|
1127
|
+
const productTemp = product;
|
|
1128
|
+
productTemp.status = `${result}A`;
|
|
1129
|
+
productTemp.datasheet_status =
|
|
1130
|
+
productTemp.datasheet_status === "NA" ? "NA" : `${result}A`;
|
|
1131
|
+
productTemp.description_status =
|
|
1132
|
+
productTemp.description_status === "NA" ? "NA" : `${result}A`;
|
|
1133
|
+
productTemp.images_status =
|
|
1134
|
+
productTemp.images_status === "NA" ? "NA" : `${result}A`;
|
|
1135
|
+
sessionStorage.setItem("productSelected", JSON.stringify(productTemp));
|
|
1136
|
+
setProduct(productTemp);
|
|
1137
|
+
|
|
1138
|
+
loadData();
|
|
1139
|
+
} catch (error) {
|
|
1140
|
+
console.log(error);
|
|
1141
|
+
}
|
|
1142
|
+
};
|
|
1143
|
+
|
|
1084
1144
|
return (
|
|
1085
1145
|
<Container headerTop={headerTop}>
|
|
1086
1146
|
<HeaderTop setHeaderTop={setHeaderTop} />
|
|
@@ -1150,9 +1210,50 @@ export const RetailerProductEdition = ({
|
|
|
1150
1210
|
/>,
|
|
1151
1211
|
]);
|
|
1152
1212
|
}}
|
|
1213
|
+
showApproveRejectAll={
|
|
1214
|
+
isAuditor &&
|
|
1215
|
+
servicesData.every((serv) =>
|
|
1216
|
+
["RA", "AA", "AP", "AC", "AF"].includes(serv.status)
|
|
1217
|
+
) &&
|
|
1218
|
+
approveRejectButtons() &&
|
|
1219
|
+
(auditorAssigned() || userAssigned())
|
|
1220
|
+
}
|
|
1153
1221
|
showValidationButtons={
|
|
1154
1222
|
approveRejectButtons() && (auditorAssigned() || userAssigned())
|
|
1155
1223
|
}
|
|
1224
|
+
approveAll={() => validateAll("A")}
|
|
1225
|
+
rejectAll={() => {
|
|
1226
|
+
validateAll("R");
|
|
1227
|
+
setMessage("Rechazado");
|
|
1228
|
+
setComponentsArray([
|
|
1229
|
+
<img src={errorModal} />,
|
|
1230
|
+
<ScreenHeader
|
|
1231
|
+
text={"Agrega tu comentarios para enviar el rechazo"}
|
|
1232
|
+
headerType={"input-name-header"}
|
|
1233
|
+
color={"white"}
|
|
1234
|
+
/>,
|
|
1235
|
+
<TagAndInput
|
|
1236
|
+
label={"Caja de Comentario"}
|
|
1237
|
+
inputType={"textarea"}
|
|
1238
|
+
inputId={"modal-commentary-box"}
|
|
1239
|
+
index={0}
|
|
1240
|
+
color={"white"}
|
|
1241
|
+
/>,
|
|
1242
|
+
<Button
|
|
1243
|
+
buttonType={"general-default-button"}
|
|
1244
|
+
label={"Enviar comentario"}
|
|
1245
|
+
onClick={(e) =>
|
|
1246
|
+
createComment(
|
|
1247
|
+
e,
|
|
1248
|
+
document.querySelector(
|
|
1249
|
+
"#modal-commentary-box .ql-container .ql-editor > p"
|
|
1250
|
+
).innerHTML,
|
|
1251
|
+
activeTab
|
|
1252
|
+
)
|
|
1253
|
+
}
|
|
1254
|
+
/>,
|
|
1255
|
+
]);
|
|
1256
|
+
}}
|
|
1156
1257
|
/>
|
|
1157
1258
|
<FullTabsMenu
|
|
1158
1259
|
tabsSections={tabsSections}
|
|
@@ -1348,4 +1449,4 @@ export const RetailerProductEdition = ({
|
|
|
1348
1449
|
)}
|
|
1349
1450
|
</Container>
|
|
1350
1451
|
);
|
|
1351
|
-
};
|
|
1452
|
+
};
|