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.
Files changed (61) hide show
  1. package/dist/assets/images/sliderToolTip/slide21.svg +9 -0
  2. package/dist/assets/images/sliderToolTip/slide22.svg +9 -0
  3. package/dist/assets/images/sliderToolTip/slide23.svg +9 -0
  4. package/dist/components/atoms/CheckBox/styles.js +1 -1
  5. package/dist/components/atoms/ListCommercialRetailers/ListCommercialRetailers.stories.js +36 -0
  6. package/dist/components/atoms/ListCommercialRetailers/index.js +64 -0
  7. package/dist/components/atoms/ListCommercialRetailers/styles.js +20 -0
  8. package/dist/components/atoms/MenuCommercialRetailers/MenuCommercialRetailers.stories.js +37 -0
  9. package/dist/components/atoms/MenuCommercialRetailers/index.js +25 -0
  10. package/dist/components/atoms/MenuCommercialRetailers/styles.js +20 -0
  11. package/dist/components/atoms/MenuProductImage/MenuProductImage.stories.js +28 -0
  12. package/dist/components/atoms/MenuProductImage/index.js +88 -0
  13. package/dist/components/atoms/MenuProductImage/styles.js +20 -0
  14. package/dist/components/atoms/SliderToolTip/SliderToolTip.stories.js +67 -13
  15. package/dist/components/atoms/SliderToolTip/index.js +64 -134
  16. package/dist/components/atoms/SliderToolTip/styles.js +2 -2
  17. package/dist/components/atoms/VerticalSideMenuMainPage/VerticalSideMenuMainPage.stories.js +44 -1
  18. package/dist/components/atoms/VerticalSideMenuMainPage/index.js +45 -48
  19. package/dist/components/atoms/VerticalSideMenuMainPage/styles.js +30 -3
  20. package/dist/components/molecules/ApproveRejetPanel/ApproveRejetPanel.stories.js +25 -0
  21. package/dist/components/molecules/ApproveRejetPanel/index.js +49 -0
  22. package/dist/components/molecules/ApproveRejetPanel/styles.js +18 -0
  23. package/dist/components/molecules/SignInLoginCreationApp/SignInLogin.stories.js +28 -0
  24. package/dist/components/molecules/SignInLoginCreationApp/index.js +270 -0
  25. package/dist/components/molecules/SignInLoginCreationApp/styles.js +20 -0
  26. package/dist/components/molecules/StatusAsignationInfo/index.js +29 -1
  27. package/dist/components/pages/ProviderProductEdition/index.js +106 -12
  28. package/dist/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +56 -65
  29. package/dist/components/pages/RetailerProductEdition/index.js +118 -8
  30. package/dist/global-files/global-styles.css +0 -1
  31. package/dist/index.js +38 -51
  32. package/package.json +1 -1
  33. package/src/assets/images/sliderToolTip/slide21.svg +9 -0
  34. package/src/assets/images/sliderToolTip/slide22.svg +9 -0
  35. package/src/assets/images/sliderToolTip/slide23.svg +9 -0
  36. package/src/components/atoms/CheckBox/styles.js +0 -1
  37. package/src/components/atoms/SliderToolTip/SliderToolTip.stories.js +77 -11
  38. package/src/components/atoms/SliderToolTip/index.js +91 -154
  39. package/src/components/atoms/SliderToolTip/styles.js +51 -22
  40. package/src/components/atoms/ValidationPanel/index.js +1 -1
  41. package/src/components/atoms/VerticalSideMenuMainPage/VerticalSideMenuMainPage.stories.js +24 -1
  42. package/src/components/atoms/VerticalSideMenuMainPage/index.js +37 -30
  43. package/src/components/atoms/VerticalSideMenuMainPage/styles.js +76 -18
  44. package/src/components/molecules/AvatarAndValidation/index.js +1 -1
  45. package/src/components/molecules/StatusAsignationInfo/index.js +31 -0
  46. package/src/components/organisms/FullProductNameHeader/index.js +1 -1
  47. package/src/components/pages/ProviderProductEdition/ProviderProductEdition.stories.js +1 -1
  48. package/src/components/pages/ProviderProductEdition/index.js +113 -12
  49. package/src/components/pages/ProviderProductEdition/styles.js +1 -1
  50. package/src/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +57 -68
  51. package/src/components/pages/RetailerProductEdition/index.js +103 -2
  52. package/src/index.js +0 -1
  53. package/dist/components/atoms/Percent/Percent.stories.js +0 -39
  54. package/dist/components/atoms/Percent/index.js +0 -39
  55. package/dist/components/atoms/Percent/styles.js +0 -20
  56. package/dist/components/molecules/TextAndGradient/TextAndGradient.stories.js +0 -31
  57. package/dist/components/molecules/TextAndGradient/index.js +0 -36
  58. package/dist/components/molecules/TextAndGradient/styles.js +0 -18
  59. package/src/components/pages/RegistrationLoginFirstStep/RegistrationLoginFirstStep.stories.js +0 -17
  60. package/src/components/pages/RegistrationLoginFirstStep/index.js +0 -160
  61. 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: ${({ bar }) => (bar ? 200 : 58)}px;
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: ${({ bar }) => (bar ? 20 : 50)}px;
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
- img {
17
- cursor: pointer;
18
- width:"25px" !important;
17
+ &.actived {
18
+ width: 200px;
19
+ padding: 23px 10px 15px 10px;
20
+ border-radius: 20px;
19
21
  }
20
22
  .navbar-top {
21
- & + * {
22
- margin-top: 15px;
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: 38px;
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
- div:hover {
62
+ .option-link:hover {
35
63
  background: #e33aa9;
36
64
  }
37
- }
38
- .logo {
39
- cursor: default;
40
- & + * {
41
- margin-top: 225%;
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
  `;
@@ -72,4 +72,4 @@ export const AvatarAndValidation = ({
72
72
  )}
73
73
  </Container>
74
74
  );
75
- };
75
+ };
@@ -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
@@ -81,4 +81,4 @@ export const FullProductNameHeader = ({
81
81
  </div>
82
82
  </Container>
83
83
  );
84
- };
84
+ };
@@ -183,4 +183,4 @@ ProviderProductEditionDefault.args = {
183
183
  },
184
184
  src: "https://content-management-profile.s3.amazonaws.com/id-59/59.png?1656113146885",
185
185
  },
186
- };
186
+ };
@@ -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 = `${result}C`;
895
- productTemp.description_status = `${result}C`;
896
- productTemp.images_status = `${result}C`;
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
- user.is_retailer === 1 &&
1008
- (product.id_order || product.orderId) &&
1009
- isRevision() &&
1010
- getSectionStatus()
1011
- }
1012
- approveAll={() => validateAll("A")}
1013
- rejectAll={() => validateAll("R")}
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
+ };
@@ -115,4 +115,4 @@ export const Container = styled.div`
115
115
  width: 100%;
116
116
  }
117
117
  }
118
- `;
118
+ `;
@@ -16,110 +16,99 @@ RetailerProductEditionDefault.args = {
16
16
  Imágenes: false,
17
17
  },
18
18
  token:
19
- "eyJraWQiOiJEV3owZnNieXg2MXNFcVduN3RCXC81bVhod3ZNbFZIOTgwUnZcL3RjT0lKdEk9IiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiIwYjY2YTRhOS03NzkwLTQwMzQtYTMwYS1jMDA4MDg5NjI4NjciLCJjb2duaXRvOmdyb3VwcyI6WyJjb2xhYm9yYWRvcmVzX2NvbnRlbnRvaCJdLCJlbWFpbF92ZXJpZmllZCI6dHJ1ZSwiaXNzIjoiaHR0cHM6XC9cL2NvZ25pdG8taWRwLnVzLWVhc3QtMS5hbWF6b25hd3MuY29tXC91cy1lYXN0LTFfbFN6UVo0WjdSIiwiY29nbml0bzp1c2VybmFtZSI6IjBiNjZhNGE5LTc3OTAtNDAzNC1hMzBhLWMwMDgwODk2Mjg2NyIsImF1ZCI6IjUyZDlza2tkY2c4cWpwODhvb2sxdXNlNm1rIiwiZXZlbnRfaWQiOiJkMjc2ZGUwMy01YmM3LTRkZjEtYTk4MC1jYmYwYjkyOGU3MDEiLCJ0b2tlbl91c2UiOiJpZCIsImF1dGhfdGltZSI6MTY1NjEwMDM2MSwibmFtZSI6IkNvbGFib3JhZG9yIiwicGhvbmVfbnVtYmVyIjoiKzUyMTExMSIsImV4cCI6MTY1NjEwMzk2MSwiaWF0IjoxNjU2MTAwMzYxLCJlbWFpbCI6ImJheWFkaTE1MzhAbW5xbG0uY29tIn0.WmbNT419c79ZIIZIxT8bW6YjSAvlGW_36cehBQWtdPPIeeRWO1ZVOkJeimGNm9dKwIVzdieg13mUPmJOcFZMQGtNoj4yOYOhSrQBEOg4Gr3Rv94RAEa-AcoFNns55Cl98krqF42qoYYeFRV9nH1iZrMU2sEML6kxwWgxAza5eXFie_MioMphXxMsWj3BT5Fmzk8SSHsAuf8jIjUTdGtFsNv2TOOU8YjTlljYij9cvLpu9Udlaj6tVnnElCcGskQk-U7QXqjHYDpOgeEkdWZU-Cy-vm4bT6qYCQHNtMxVCu_RZPpNm_p3vSWgkhj__baJsffhsb-PAETQKPTLuT690w",
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: 1213,
30
- status: "AA",
31
- datasheet_status: "AA",
32
- prio: "low",
33
- version: 2,
34
- description_status: "AA",
35
- images_status: "AA",
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: 17517,
38
- id_category: "691",
39
- name: "Antitranspirante Lady Speed Stick Clinical Complete en Barra para Dama 45 g",
40
- upc: "7509546066172",
41
- timestamp: "2021-10-09T16:33:17.000Z",
42
- id_user: 203,
43
- status: "RECEPTION",
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: 226,
46
- company_name: "Prueba Test S.A de C.V.",
47
- country: "null",
48
- id_order: 1213,
49
- id_datasheet_especialist: 334,
50
- id_datasheet_facilitator: 158,
51
- id_description_especialist: 334,
52
- id_description_facilitator: 158,
53
- id_images_especialist: 366,
54
- id_images_facilitator: 14,
55
- id_auditor: 94,
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
- "SALUD Y BELLEZA|CUIDADO CORPORAL|DESODORANTES CABALLERO Y DAMA",
59
- missingAttributes: 1,
60
- missingDescriptions: 0,
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: 4,
66
- name: "Walmart Super y Superama",
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: 6,
73
- name: "HEB",
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: "null",
87
- upc: "7509546066172",
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: 423,
94
- name: "Facilitador Textos",
95
- last_name: " ",
96
- email: "bayadi1538@mnqlm.com",
97
- position: "Tester",
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: null,
100
- id_company: 254,
101
- id_cognito: "0b66a4a9-7790-4034-a30a-c00808962867",
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: 4,
97
+ id_role: 6,
109
98
  active: 1,
110
99
  is_retailer: 0,
111
- email_notify: null,
100
+ email_notify: 0,
112
101
  membership: {
113
- id: 750,
114
- start_date: "2022-01-07T21:32:54.000Z",
115
- end_date: "2023-01-07T21:32:54.000Z",
116
- planID: 6,
117
- plan: "prod_KvGd6YSTJyR3AP",
118
- name: "Plan Small",
119
- user_limit: "10",
120
- products_limit: "1000",
121
- type: "Enterprise",
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-prod.s3.amazonaws.com/id-423/423.png?1656100361978",
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
+ };