contentoh-components-library 21.0.63 → 21.0.64

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 (246) hide show
  1. package/.env.development +5 -18
  2. package/.env.production +3 -16
  3. package/CHANGELOG.md +33 -31
  4. package/dist/assets/images/carouselImagesLogin/login2.svg +117 -0
  5. package/dist/assets/images/carouselImagesLogin/login3.svg +147 -0
  6. package/dist/assets/images/carouselImagesLogin/loginImage.svg +301 -0
  7. package/dist/assets/images/sliderToolTip/infoIcon.svg +4 -0
  8. package/dist/assets/images/sliderToolTip/slide1.svg +5 -0
  9. package/dist/assets/images/sliderToolTip/slide2.svg +9 -0
  10. package/dist/assets/images/sliderToolTip/slide3.svg +9 -0
  11. package/dist/assets/images/sliderToolTip/slide4.svg +9 -0
  12. package/dist/assets/images/sliderToolTip/slide5.svg +40 -0
  13. package/dist/components/atoms/AsignationOption/index.js +5 -9
  14. package/dist/components/atoms/AsignationOption/styles.js +1 -1
  15. package/dist/components/atoms/CheckBox/index.js +2 -4
  16. package/dist/components/atoms/GeneralButton/index.js +0 -5
  17. package/dist/components/atoms/GeneralButton/styles.js +2 -4
  18. package/dist/components/atoms/GeneralInput/index.js +25 -72
  19. package/dist/components/atoms/GeneralInput/styles.js +1 -7
  20. package/dist/components/atoms/GenericModal/index.js +2 -4
  21. package/dist/components/atoms/GenericModal/styles.js +1 -1
  22. package/dist/components/atoms/GradientPanel/styles.js +1 -1
  23. package/dist/components/atoms/ListCommercialRetailers/ListCommercialRetailers.stories.js +36 -0
  24. package/dist/components/atoms/ListCommercialRetailers/index.js +64 -0
  25. package/dist/components/atoms/ListCommercialRetailers/styles.js +20 -0
  26. package/dist/components/atoms/Loading/Loading.stories.js +28 -0
  27. package/dist/components/atoms/Loading/index.js +1 -0
  28. package/dist/components/atoms/LogoImage/index.js +1 -0
  29. package/dist/components/atoms/MenuCommercialRetailers/MenuCommercialRetailers.stories.js +37 -0
  30. package/dist/components/atoms/MenuCommercialRetailers/index.js +25 -0
  31. package/dist/components/{molecules/RetailerSelector → atoms/MenuCommercialRetailers}/styles.js +1 -1
  32. package/dist/components/atoms/MenuProductImage/MenuProductImage.stories.js +28 -0
  33. package/dist/components/atoms/MenuProductImage/index.js +88 -0
  34. package/dist/components/atoms/MenuProductImage/styles.js +20 -0
  35. package/dist/components/atoms/PriorityFlag/index.js +1 -1
  36. package/dist/components/atoms/ProductImage/styles.js +1 -1
  37. package/dist/components/atoms/ProgressBar/index.js +2 -2
  38. package/dist/components/atoms/ProgressBar/styles.js +5 -3
  39. package/dist/components/atoms/ScreenHeader/index.js +1 -1
  40. package/dist/components/atoms/ScreenHeader/styles.js +1 -1
  41. package/dist/components/atoms/SliderToolTip/SliderToolTip.stories.js +47 -0
  42. package/dist/components/atoms/SliderToolTip/index.js +200 -0
  43. package/dist/components/atoms/SliderToolTip/styles.js +24 -0
  44. package/dist/components/atoms/StatusTag/index.js +2 -37
  45. package/dist/components/atoms/StatusTag/styles.js +1 -1
  46. package/dist/components/atoms/ValidationPanel/index.js +3 -4
  47. package/dist/components/atoms/VerticalSideMenuMainPage/VerticalSideMenuMainPage.stories.js +22 -0
  48. package/dist/components/atoms/VerticalSideMenuMainPage/index.js +49 -0
  49. package/dist/components/atoms/{Commentary → VerticalSideMenuMainPage}/styles.js +1 -6
  50. package/dist/components/molecules/ApproveRejetPanel/ApproveRejetPanel.stories.js +25 -0
  51. package/dist/components/molecules/ApproveRejetPanel/index.js +49 -0
  52. package/dist/components/{atoms/CharCounter → molecules/ApproveRejetPanel}/styles.js +1 -3
  53. package/dist/components/molecules/AvatarAndValidation/index.js +7 -17
  54. package/dist/components/molecules/AvatarAndValidation/styles.js +1 -1
  55. package/dist/components/molecules/CarouselImagesLogin/index.js +40 -42
  56. package/dist/components/molecules/EmailResetPasswordLogin/EmailResetPasswordLogin.stories.js +28 -0
  57. package/dist/components/molecules/EmailResetPasswordLogin/index.js +153 -0
  58. package/dist/components/molecules/EmailResetPasswordLogin/styles.js +20 -0
  59. package/dist/components/molecules/FeaturesBar/index.js +1 -1
  60. package/dist/components/molecules/GalleryElement/index.js +21 -80
  61. package/dist/components/molecules/GalleryElement/styles.js +1 -1
  62. package/dist/components/molecules/GalleryHeader/index.js +6 -28
  63. package/dist/components/molecules/GalleryHeader/styles.js +1 -1
  64. package/dist/components/molecules/ImageSelector/index.js +4 -2
  65. package/dist/components/molecules/LoginPasswordStrength/index.js +9 -9
  66. package/dist/components/molecules/LoginPasswordStrength/styles.js +1 -1
  67. package/dist/components/{atoms/CharCounter/CharCounter.stories.js → molecules/LogoLoading/Loading.stories.js} +7 -10
  68. package/dist/components/molecules/LogoLoading/index.js +22 -0
  69. package/dist/components/molecules/LogoLoading/styles.js +18 -0
  70. package/dist/components/molecules/ProductNameHeader/index.js +2 -1
  71. package/dist/components/molecules/RegistrationFirstStep/RegistrationFirstStep.stories.js +28 -0
  72. package/dist/components/molecules/RegistrationFirstStep/index.js +308 -0
  73. package/dist/components/molecules/RegistrationFirstStep/styles.js +20 -0
  74. package/dist/components/molecules/RegistrationSecondStep/RegistrationSecondStep.stories.js +28 -0
  75. package/dist/components/molecules/RegistrationSecondStep/index.js +173 -0
  76. package/dist/components/molecules/RegistrationSecondStep/styles.js +20 -0
  77. package/dist/components/molecules/RegistrationThirdStep/RegistrationThirdStep.stories.js +28 -0
  78. package/dist/components/molecules/RegistrationThirdStep/index.js +155 -0
  79. package/dist/components/molecules/RegistrationThirdStep/styles.js +20 -0
  80. package/dist/components/molecules/SignInLogin/SignInLogin.stories.js +28 -0
  81. package/dist/components/molecules/SignInLogin/index.js +291 -0
  82. package/dist/components/molecules/SignInLogin/styles.js +20 -0
  83. package/dist/components/molecules/SignInLoginCreationApp/SignInLogin.stories.js +28 -0
  84. package/dist/components/molecules/SignInLoginCreationApp/index.js +270 -0
  85. package/dist/components/molecules/SignInLoginCreationApp/styles.js +20 -0
  86. package/dist/components/molecules/StatusAsignationInfo/index.js +25 -46
  87. package/dist/components/molecules/StatusAsignationInfo/styles.js +1 -1
  88. package/dist/components/molecules/TableHeader/index.js +5 -12
  89. package/dist/components/molecules/TableHeader/styles.js +1 -1
  90. package/dist/components/molecules/TagAndInput/index.js +2 -24
  91. package/dist/components/molecules/VerificationCodeResetPasswordLogin/VerificationCodeResetPasswordLogin.stories.js +28 -0
  92. package/dist/components/molecules/VerificationCodeResetPasswordLogin/index.js +211 -0
  93. package/dist/components/molecules/VerificationCodeResetPasswordLogin/styles.js +20 -0
  94. package/dist/components/molecules/VerificationCodeResetPasswordLogin/utils.js +69 -0
  95. package/dist/components/{atoms/InputFormatter/Wysiwyg.stories.js → organisms/ChangePassword/ChangePassword.stories.js} +7 -9
  96. package/dist/components/organisms/ChangePassword/index.js +124 -0
  97. package/dist/components/organisms/ChangePassword/styles.js +18 -0
  98. package/dist/components/organisms/FullProductNameHeader/index.js +8 -32
  99. package/dist/components/organisms/FullTabsMenu/index.js +5 -18
  100. package/dist/components/organisms/ImageDataTable/index.js +14 -90
  101. package/dist/components/organisms/InputGroup/index.js +13 -34
  102. package/dist/components/organisms/InputGroup/styles.js +1 -1
  103. package/dist/components/organisms/ProductImageModal/index.js +11 -15
  104. package/dist/components/organisms/ProductImageModal/styles.js +1 -1
  105. package/dist/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +347 -91
  106. package/dist/components/pages/RetailerProductEdition/index.js +60 -1608
  107. package/dist/components/pages/RetailerProductEdition/styles.js +1 -1
  108. package/dist/global-files/data.js +53 -212
  109. package/dist/global-files/global-styles.css +0 -1
  110. package/dist/global-files/variables.js +0 -1
  111. package/dist/index.js +277 -30
  112. package/package.json +14 -12
  113. package/src/assets/images/sliderToolTip/infoIcon.svg +4 -0
  114. package/src/assets/images/sliderToolTip/slide1.svg +5 -0
  115. package/src/assets/images/sliderToolTip/slide2.svg +9 -0
  116. package/src/assets/images/sliderToolTip/slide3.svg +9 -0
  117. package/src/assets/images/sliderToolTip/slide4.svg +9 -0
  118. package/src/assets/images/sliderToolTip/slide5.svg +40 -0
  119. package/src/components/atoms/AsignationOption/index.js +5 -7
  120. package/src/components/atoms/AsignationOption/styles.js +1 -9
  121. package/src/components/atoms/CheckBox/index.js +2 -8
  122. package/src/components/atoms/GeneralButton/index.js +2 -9
  123. package/src/components/atoms/GeneralButton/styles.js +0 -23
  124. package/src/components/atoms/GeneralInput/index.js +23 -71
  125. package/src/components/atoms/GeneralInput/styles.js +1 -11
  126. package/src/components/atoms/GenericModal/index.js +2 -2
  127. package/src/components/atoms/GenericModal/styles.js +2 -10
  128. package/src/components/atoms/GradientPanel/styles.js +1 -0
  129. package/src/components/atoms/Loading/Loading.stories.js +10 -0
  130. package/src/components/atoms/Loading/index.js +3 -2
  131. package/src/components/atoms/LogoImage/index.js +1 -1
  132. package/src/components/atoms/PriorityFlag/index.js +1 -1
  133. package/src/components/atoms/ProductImage/styles.js +1 -1
  134. package/src/components/atoms/ProgressBar/index.js +2 -2
  135. package/src/components/atoms/ProgressBar/styles.js +3 -54
  136. package/src/components/atoms/ScreenHeader/index.js +3 -7
  137. package/src/components/atoms/ScreenHeader/styles.js +2 -9
  138. package/src/components/atoms/SliderToolTip/SliderToolTip.stories.js +23 -0
  139. package/src/components/atoms/SliderToolTip/index.js +182 -0
  140. package/src/components/atoms/SliderToolTip/styles.js +168 -0
  141. package/src/components/atoms/StatusTag/index.js +2 -30
  142. package/src/components/atoms/StatusTag/styles.js +3 -15
  143. package/src/components/atoms/ValidationPanel/index.js +3 -3
  144. package/src/components/molecules/AvatarAndValidation/index.js +6 -24
  145. package/src/components/molecules/AvatarAndValidation/styles.js +1 -1
  146. package/src/components/molecules/CarouselImagesLogin/index.js +34 -37
  147. package/src/components/molecules/EmailResetPasswordLogin/EmailResetPasswordLogin.stories.js +11 -0
  148. package/src/components/molecules/EmailResetPasswordLogin/index.js +85 -0
  149. package/src/components/molecules/EmailResetPasswordLogin/styles.js +23 -0
  150. package/src/components/molecules/FeaturesBar/index.js +7 -10
  151. package/src/components/molecules/GalleryElement/index.js +36 -75
  152. package/src/components/molecules/GalleryElement/styles.js +11 -38
  153. package/src/components/molecules/GalleryHeader/index.js +8 -14
  154. package/src/components/molecules/GalleryHeader/styles.js +0 -16
  155. package/src/components/molecules/ImageSelector/index.js +3 -2
  156. package/src/components/molecules/LoginPasswordStrength/index.js +11 -6
  157. package/src/components/molecules/LoginPasswordStrength/styles.js +5 -1
  158. package/src/components/molecules/LogoLoading/Loading.stories.js +10 -0
  159. package/src/components/molecules/LogoLoading/index.js +12 -0
  160. package/src/components/molecules/LogoLoading/styles.js +16 -0
  161. package/src/components/molecules/ProductNameHeader/index.js +2 -1
  162. package/src/components/molecules/RegistrationFirstStep/RegistrationFirstStep.stories.js +11 -0
  163. package/src/components/molecules/RegistrationFirstStep/index.js +227 -0
  164. package/src/components/molecules/RegistrationFirstStep/styles.js +87 -0
  165. package/src/components/molecules/RegistrationSecondStep/RegistrationSecondStep.stories.js +11 -0
  166. package/src/components/molecules/RegistrationSecondStep/index.js +136 -0
  167. package/src/components/molecules/RegistrationSecondStep/styles.js +64 -0
  168. package/src/components/molecules/RegistrationThirdStep/RegistrationThirdStep.stories.js +11 -0
  169. package/src/components/molecules/RegistrationThirdStep/index.js +130 -0
  170. package/src/components/molecules/RegistrationThirdStep/styles.js +44 -0
  171. package/src/components/molecules/SignInLogin/SignInLogin.stories.js +11 -0
  172. package/src/components/molecules/SignInLogin/index.js +201 -0
  173. package/src/components/molecules/SignInLogin/styles.js +79 -0
  174. package/src/components/molecules/StatusAsignationInfo/index.js +38 -62
  175. package/src/components/molecules/StatusAsignationInfo/styles.js +2 -12
  176. package/src/components/molecules/TableHeader/index.js +3 -16
  177. package/src/components/molecules/TableHeader/styles.js +0 -5
  178. package/src/components/molecules/TagAndInput/index.js +2 -24
  179. package/src/components/molecules/VerificationCodeResetPasswordLogin/VerificationCodeResetPasswordLogin.stories.js +11 -0
  180. package/src/components/molecules/VerificationCodeResetPasswordLogin/index.js +171 -0
  181. package/src/components/molecules/VerificationCodeResetPasswordLogin/styles.js +54 -0
  182. package/src/components/molecules/VerificationCodeResetPasswordLogin/utils.js +54 -0
  183. package/src/components/organisms/ChangePassword/ChangePassword.stories.js +11 -0
  184. package/src/components/organisms/ChangePassword/index.js +77 -0
  185. package/src/components/organisms/ChangePassword/styles.js +13 -0
  186. package/src/components/organisms/FullProductNameHeader/index.js +7 -28
  187. package/src/components/organisms/FullTabsMenu/index.js +3 -15
  188. package/src/components/organisms/ImageDataTable/index.js +11 -89
  189. package/src/components/organisms/InputGroup/index.js +11 -46
  190. package/src/components/organisms/InputGroup/styles.js +0 -3
  191. package/src/components/organisms/ProductImageModal/index.js +12 -20
  192. package/src/components/organisms/ProductImageModal/styles.js +0 -3
  193. package/src/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +343 -91
  194. package/src/components/pages/RetailerProductEdition/index.js +48 -1238
  195. package/src/components/pages/RetailerProductEdition/styles.js +4 -67
  196. package/src/global-files/data.js +57 -156
  197. package/src/global-files/global-styles.css +0 -1
  198. package/src/global-files/variables.js +0 -1
  199. package/src/index.js +20 -1
  200. package/dist/assets/images/generalButton/downloadIcon.svg +0 -3
  201. package/dist/assets/images/modalsSVGs/attributesSent.svg +0 -208
  202. package/dist/assets/images/modalsSVGs/descriptionSent.svg +0 -237
  203. package/dist/assets/images/modalsSVGs/providerSent.svg +0 -445
  204. package/dist/assets/images/modalsSVGs/uploadingImages.svg +0 -148
  205. package/dist/components/atoms/CharCounter/index.js +0 -22
  206. package/dist/components/atoms/Commentary/Commentary.stories.js +0 -1
  207. package/dist/components/atoms/Commentary/index.js +0 -23
  208. package/dist/components/atoms/Input/index.js +0 -26
  209. package/dist/components/atoms/Input/style.js +0 -26
  210. package/dist/components/atoms/InputFormatter/index.js +0 -184
  211. package/dist/components/atoms/InputFormatter/styles.js +0 -33
  212. package/dist/components/atoms/LabelToInput/index.js +0 -53
  213. package/dist/components/atoms/LabelToInput/style.js +0 -22
  214. package/dist/components/atoms/Percent/Percent.stories.js +0 -39
  215. package/dist/components/atoms/Percent/index.js +0 -39
  216. package/dist/components/atoms/Percent/styles.js +0 -20
  217. package/dist/components/atoms/Select/index.js +0 -39
  218. package/dist/components/atoms/Select/style.js +0 -32
  219. package/dist/components/molecules/RetailerSelector/RetailerSelector.stories.js +0 -48
  220. package/dist/components/molecules/RetailerSelector/index.js +0 -74
  221. package/dist/components/molecules/TextAndGradient/TextAndGradient.stories.js +0 -31
  222. package/dist/components/molecules/TextAndGradient/index.js +0 -36
  223. package/dist/components/molecules/TextAndGradient/styles.js +0 -18
  224. package/src/assets/images/generalButton/downloadIcon.svg +0 -3
  225. package/src/assets/images/modalsSVGs/attributesSent.svg +0 -208
  226. package/src/assets/images/modalsSVGs/descriptionSent.svg +0 -237
  227. package/src/assets/images/modalsSVGs/providerSent.svg +0 -445
  228. package/src/assets/images/modalsSVGs/uploadingImages.svg +0 -148
  229. package/src/components/atoms/CharCounter/CharCounter.stories.js +0 -11
  230. package/src/components/atoms/CharCounter/index.js +0 -13
  231. package/src/components/atoms/CharCounter/styles.js +0 -10
  232. package/src/components/atoms/Commentary/Commentary.stories.js +0 -0
  233. package/src/components/atoms/Commentary/index.js +0 -9
  234. package/src/components/atoms/Commentary/styles.js +0 -16
  235. package/src/components/atoms/Input/index.js +0 -15
  236. package/src/components/atoms/Input/style.js +0 -31
  237. package/src/components/atoms/InputFormatter/Wysiwyg.stories.js +0 -12
  238. package/src/components/atoms/InputFormatter/index.js +0 -144
  239. package/src/components/atoms/InputFormatter/styles.js +0 -40
  240. package/src/components/atoms/LabelToInput/index.js +0 -26
  241. package/src/components/atoms/LabelToInput/style.js +0 -41
  242. package/src/components/atoms/Select/index.js +0 -35
  243. package/src/components/atoms/Select/style.js +0 -76
  244. package/src/components/molecules/RetailerSelector/RetailerSelector.stories.js +0 -35
  245. package/src/components/molecules/RetailerSelector/index.js +0 -63
  246. package/src/components/molecules/RetailerSelector/styles.js +0 -18
@@ -0,0 +1,171 @@
1
+ import { Container } from "./styles";
2
+ import { GradientPanel } from "../../atoms/GradientPanel";
3
+ import { useEffect, useState } from "react";
4
+ import { LogoImage } from "../../atoms/LogoImage";
5
+ import { ScreenHeader } from "../../atoms/ScreenHeader";
6
+ import { GlobalColors, FontFamily } from "../../../global-files/variables";
7
+ import { GeneralInput } from "../../atoms/GeneralInput";
8
+ import { Button } from "../../atoms/GeneralButton";
9
+ import { validateInput, validate } from "./utils";
10
+
11
+ export const VerificationCodeResetPasswordLogin = (props) => {
12
+ const [resend, setResend] = useState(false);
13
+ const [awsError, setAwsError] = useState("");
14
+ const [emptyVerificationCode, setEmptyVerificationCode] = useState(false);
15
+ const [inputCodeVerificationAll, setInputCodeVerificationAll] = useState(
16
+ document.querySelectorAll("[id^='verificationCodeInput']")
17
+ );
18
+ const inputPositions = [1, 2, 3, 4, 5, 6];
19
+
20
+ useEffect(() => {
21
+ props.confirmationError !== "" && setEmptyVerificationCode(false);
22
+ }, [props.confirmationError]);
23
+
24
+ const checkCode = (e, flag) => {
25
+ let valid = true;
26
+ e.preventDefault();
27
+ let code = "";
28
+ if (awsError === "" && !flag) {
29
+ inputPositions.map(
30
+ (position) =>
31
+ (code =
32
+ code +
33
+ document.querySelector(`#verificationCodeInput${position}`).value)
34
+ );
35
+ if (sessionStorage.getItem("resetError")) {
36
+ JSON.parse(sessionStorage.getItem("confirmationCode")) === code &&
37
+ (valid = false);
38
+ }
39
+ sessionStorage.setItem("confirmationCode", JSON.stringify(code));
40
+ valid &&
41
+ !sessionStorage.getItem("resetPasswordProcess") &&
42
+ props.setPaso(6);
43
+ valid &&
44
+ sessionStorage.getItem("resetPasswordProcess") &&
45
+ props.setPaso(8);
46
+ }
47
+ };
48
+
49
+ const validateResend = async (e) => {
50
+ e.preventDefault();
51
+ const email = JSON.parse(sessionStorage.getItem("email"));
52
+ try {
53
+ await props.Auth.forgotPassword(email);
54
+ sessionStorage.setItem("email", JSON.stringify(email));
55
+ sessionStorage.setItem("resetPasswordProcess", JSON.stringify("true"));
56
+ props.setPaso(5);
57
+ setEmptyVerificationCode(false);
58
+ setResend(true);
59
+ } catch (err) {
60
+ setAwsError(err.code);
61
+ console.log(err.message);
62
+ }
63
+ };
64
+
65
+ useEffect(() => {
66
+ setInputCodeVerificationAll(
67
+ document.querySelectorAll("[id^='verificationCodeInput']")
68
+ );
69
+ }, []);
70
+
71
+ const loginRight = [
72
+ <LogoImage key="1" />,
73
+ <div className="credenciales" key={"2"}>
74
+ <ScreenHeader
75
+ fontFamily={FontFamily.AvenirNext}
76
+ color={GlobalColors.s5}
77
+ text={"Ingresa tus credenciales"}
78
+ />
79
+ </div>,
80
+ <div className="user" key="3">
81
+ {sessionStorage.getItem("email") && (
82
+ <ScreenHeader
83
+ text={`Ingrese el código de verificación enviado a: ${JSON.parse(
84
+ sessionStorage.getItem("email")
85
+ )}`}
86
+ headerType={"input-name-header"}
87
+ />
88
+ )}
89
+ {!sessionStorage.getItem("email") && (
90
+ <ScreenHeader
91
+ text={`Ingrese código de verificación enviado a: ${
92
+ JSON.parse(sessionStorage.getItem("nuevoRegistro")).email
93
+ }`}
94
+ headerType={"input-name-header"}
95
+ />
96
+ )}
97
+ <div className="verification-code">
98
+ {inputPositions.map((position) => (
99
+ <GeneralInput
100
+ inputId={`verificationCodeInput${position}`}
101
+ inputType={"text"}
102
+ inputPlaceholder={"X"}
103
+ validateInput={validateInput}
104
+ inputsArray={inputCodeVerificationAll}
105
+ position={position}
106
+ maxLength="1"
107
+ />
108
+ ))}
109
+ </div>
110
+ {emptyVerificationCode && (
111
+ <label>Ingrese su código de verificación</label>
112
+ )}
113
+ {sessionStorage.getItem("resetError") && (
114
+ <label>Código de verifiación incorrecto</label>
115
+ )}
116
+ {props.confirmationError === "LimitExceededException" &&
117
+ !emptyVerificationCode && (
118
+ <label>Haz realizado demasiados intentos, intentalo más tarde</label>
119
+ )}
120
+ {props.confirmationError === "CodeMismatchException" &&
121
+ !emptyVerificationCode && (
122
+ <label>Código de verificación incorrecto</label>
123
+ )}
124
+ {props.confirmationError === "ExpiredCodeException" &&
125
+ !emptyVerificationCode && (
126
+ <label>El código ingresado está expirado</label>
127
+ )}
128
+ {props.confirmationError === "InternalErrorException" &&
129
+ !emptyVerificationCode && (
130
+ <label>Algo salió mal, porfavor vuelva a intentarlo</label>
131
+ )}
132
+ {awsError === "LimitExceededException" && (
133
+ <label>Haz realizado demasiados intentos, intentalo más tarde</label>
134
+ )}
135
+ {awsError === "InternalErrorException" && (
136
+ <label>Algo salió mal, porfavor vuelva a intentarlo</label>
137
+ )}
138
+ {resend && awsError === "" && (
139
+ <label className="resendTrue">
140
+ Se reenvió el código de verificación correctamente
141
+ </label>
142
+ )}
143
+ </div>,
144
+ <div className="resend-code" key="4">
145
+ <p onClick={(e) => validateResend(e)}>Reenviar código de verificación</p>
146
+ </div>,
147
+ <div className="button-center" key="5">
148
+ <Button
149
+ buttonType={"general-default-button"}
150
+ label={"Enviar"}
151
+ onClick={(e) => {
152
+ let flag = validate(inputCodeVerificationAll);
153
+ checkCode(e, flag);
154
+ setEmptyVerificationCode(flag);
155
+ }}
156
+ />
157
+ </div>,
158
+ <div className="reset-password" key="6">
159
+ <p onClick={() => props.setPaso(10)}>Regresar...</p>
160
+ </div>,
161
+ ];
162
+ return (
163
+ <Container>
164
+ <GradientPanel
165
+ componentsArray={loginRight}
166
+ panelType={"home-login"}
167
+ panelColor={GlobalColors.white}
168
+ />
169
+ </Container>
170
+ );
171
+ };
@@ -0,0 +1,54 @@
1
+ import styled from "styled-components";
2
+ import { FontFamily, GlobalColors } from "../../../global-files/variables";
3
+
4
+ export const Container = styled.div`
5
+ display: flex;
6
+ height: 100vh;
7
+ width: 50%;
8
+ align-items: center;
9
+ justify-content: center;
10
+ .button-center {
11
+ text-align: center;
12
+ .general-default-button {
13
+ width: 160px;
14
+ }
15
+ }
16
+ .reset-password {
17
+ text-align: center;
18
+ margin: 15px !important;
19
+ color: ${GlobalColors.secondary_magenta};
20
+ cursor: pointer;
21
+ font-weight: bold;
22
+ font-family: ${FontFamily.Raleway};
23
+ font-size: 13px;
24
+ }
25
+ .resend-code {
26
+ margin-top: 8px !important;
27
+ color: ${GlobalColors.magenta_s2};
28
+ font-family: ${FontFamily.AvenirNext};
29
+ font-size: 11px;
30
+ text-decoration: underline rgb(228, 81, 172);
31
+ cursor: pointer;
32
+ & + * {
33
+ margin-top: 30px;
34
+ }
35
+ }
36
+ .verification-code {
37
+ display: flex;
38
+ text-align: center;
39
+ margin: auto;
40
+ margin-top: 10px;
41
+ input[type="number"]::-webkit-inner-spin-button,
42
+ input[type="number"]::-webkit-outer-spin-button {
43
+ -webkit-appearance: none;
44
+ margin: 0;
45
+ }
46
+ input {
47
+ width: 70%;
48
+ text-align: center;
49
+ }
50
+ }
51
+ .resendTrue{
52
+ color: ${GlobalColors.exported};
53
+ }
54
+ `;
@@ -0,0 +1,54 @@
1
+ /**
2
+ *
3
+ * @param {event} e event received triggered by verification code input
4
+ * @param {number} index index position from the verification code(VC) input array (i.e. digit 1,2,3 etc...)
5
+ * @param {array<html nodes>} inputsArray array which contains every VC digit input (used to change focus on input change)
6
+ */
7
+ export const validateInput = (e, index, inputsArray) => {
8
+ let isValid = false;
9
+ const inputNotEmpty = e.target.value.length > 0;
10
+ if (inputNotEmpty) {
11
+ if (validateInputNumber(e) !== null) {
12
+ isValid = true;
13
+ nextInputFocus(inputsArray, index++);
14
+ }
15
+ }
16
+ return isValid ? e.target.value : "";
17
+ };
18
+
19
+ /**
20
+ *
21
+ * @param {event} e event received triggered by verification code input
22
+ * @returns {boolean} if digit is a number
23
+ */
24
+ const validateInputNumber = (e) => {
25
+ return (e.target.value || String.fromCharCode(e.keyCode)).match(/[0-9]{1}/);
26
+ };
27
+
28
+ /**
29
+ *
30
+ * @param {array<html nodes>} inputsArray array which contains every VC digit input (used to change focus on input change)
31
+ * @param {number} index index position from the verification code(VC) input array (i.e. digit 1,2,3 etc...)
32
+ * changes focus to next input if digit typed is a number and there wasn't any before
33
+ */
34
+ const nextInputFocus = (inputsArray, index) => {
35
+ const button = document.getElementsByClassName("general-default-button");
36
+
37
+ inputsArray?.length && index === inputsArray?.length
38
+ ? button[0].focus()
39
+ : inputsArray[index]?.focus();
40
+ };
41
+
42
+ /**
43
+ *
44
+ * @param {array<html nodes>} inputsArray array which contains every VC digit input (used to check if there's any empty)
45
+ * @param {function} setEmptyVerificationCode function to update flag which handles if there's an empty char
46
+ * updates emptyVerificationFlag from father component
47
+ */
48
+ export const validate = (inputsArray) => {
49
+ let contInputEmpty = 0;
50
+ inputsArray.forEach((element) => {
51
+ element.value === "" ? 0 : contInputEmpty++;
52
+ });
53
+ return contInputEmpty !== inputsArray.length
54
+ };
@@ -0,0 +1,11 @@
1
+ import { ChangePassword } from "./index";
2
+
3
+ export default {
4
+ title: "Components/organisms/ChangePassword",
5
+ component: ChangePassword,
6
+ };
7
+ const Template = (args) => <ChangePassword {...args} />;
8
+
9
+ export const ChangePasswordDefault = Template.bind({});
10
+
11
+ ChangePasswordDefault.args = {};
@@ -0,0 +1,77 @@
1
+ import { Container } from "./styles";
2
+ import { LoginPasswordStrength } from "../../molecules/LoginPasswordStrength";
3
+ import { useState } from "react";
4
+ import { Button } from "../../atoms/GeneralButton";
5
+ import { LogoImage } from "../../atoms/LogoImage";
6
+ import { ScreenHeader } from "../../atoms/ScreenHeader";
7
+ import { GlobalColors, FontFamily } from "../../../global-files/variables";
8
+ import { GradientPanel } from "../../atoms/GradientPanel";
9
+
10
+ export const ChangePassword = (props) => {
11
+ const [emptyPassword, setEmptyPassword] = useState(false);
12
+ const [emptyConfirmPassword, setEmptyConfirmPassword] = useState(false);
13
+ const [matchPasswords, setMatchPasswords] = useState(true);
14
+
15
+ const validate = async (e) => {
16
+ e.preventDefault();
17
+ let password = document.querySelector("#newPasswordInput").value;
18
+ password.length < 8 ? setEmptyPassword(true) : setEmptyPassword(false);
19
+ let confirmPassword = document.querySelector("#confirmPasswordInput").value;
20
+ confirmPassword === ""
21
+ ? setEmptyConfirmPassword(true)
22
+ : setEmptyConfirmPassword(false);
23
+ if (password === confirmPassword) {
24
+ setMatchPasswords(true);
25
+ } else {
26
+ setMatchPasswords(false);
27
+ }
28
+ let valid = true;
29
+ if (
30
+ password.length < 8 ||
31
+ confirmPassword === "" ||
32
+ password !== confirmPassword
33
+ ) {
34
+ valid = false;
35
+ }
36
+ if (valid) {
37
+ sessionStorage.setItem("newPassword", JSON.stringify(password));
38
+ !sessionStorage.getItem("resetPasswordProcess")
39
+ ? props.setPaso(9)
40
+ : props.setPaso(11);
41
+ }
42
+ };
43
+
44
+ const loginRight = [
45
+ <LogoImage key="1" />,
46
+ <div className="credenciales" key={"2"}>
47
+ <ScreenHeader
48
+ fontFamily={FontFamily.AvenirNext}
49
+ color={GlobalColors.s5}
50
+ text={"Ingresa tus credenciales"}
51
+ />
52
+ </div>,
53
+ <LoginPasswordStrength
54
+ emptyPassword={emptyPassword}
55
+ emptyConfirmPassword={emptyConfirmPassword}
56
+ matchPasswords={matchPasswords}
57
+ textTittle={"Ingresa tus credenciales"}
58
+ key="3"
59
+ />,
60
+ <div className="button-center" key="4">
61
+ <Button
62
+ buttonType={"general-default-button"}
63
+ label={"Enviar"}
64
+ onClick={(e) => validate(e)}
65
+ />
66
+ </div>,
67
+ ];
68
+ return (
69
+ <Container>
70
+ <GradientPanel
71
+ panelColor={GlobalColors.white}
72
+ componentsArray={loginRight}
73
+ panelType={"home-login"}
74
+ ></GradientPanel>
75
+ </Container>
76
+ );
77
+ };
@@ -0,0 +1,13 @@
1
+ import styled from "styled-components";
2
+
3
+ export const Container = styled.div`
4
+ width: 50%;
5
+ height: 100vh;
6
+ .button-center {
7
+ display: flex;
8
+ justify-content: center;
9
+ .general-default-button {
10
+ width: 160px;
11
+ }
12
+ }
13
+ `;
@@ -3,43 +3,22 @@ import { ProductNameHeader } from "../../molecules/ProductNameHeader";
3
3
  import { FeaturesBar } from "../../molecules/FeaturesBar";
4
4
  import { AvatarAndValidation } from "../../molecules/AvatarAndValidation";
5
5
 
6
- export const FullProductNameHeader = ({
7
- headerData,
8
- percent,
9
- activeRetailer,
10
- setActiveRetailer,
11
- approveRejectButtons,
12
- sendToFacilitator,
13
- auditorAssigned,
14
- userAssigned,
15
- }) => {
6
+ export const FullProductNameHeader = ({ headerData }) => {
16
7
  return (
17
8
  <Container>
18
9
  <ProductNameHeader
19
- productName={headerData?.article?.name}
10
+ productName={headerData?.name}
20
11
  statusType={headerData?.status}
21
- percent={percent?.toFixed(0)}
22
- priority={headerData?.prio}
23
- date={new Date(headerData?.article?.timestamp).toLocaleDateString()}
12
+ percent={headerData?.percent}
13
+ backgroundColor={headerData?.backgroundColor}
14
+ priority={headerData?.priority}
15
+ date={headerData?.date}
24
16
  />
25
17
  <div className="features-bar-container">
26
- <FeaturesBar
27
- features={[
28
- { feature: "Categoría", value: headerData?.article?.category },
29
- { feature: "Prov", value: headerData?.article?.company_name },
30
- { feature: "UPC", value: headerData?.article?.upc },
31
- ]}
32
- />
18
+ <FeaturesBar features={headerData?.features} />
33
19
  <AvatarAndValidation
34
- retailers={headerData?.retailers}
35
20
  avatarData={headerData?.avatarData}
36
21
  validation={headerData?.validation}
37
- activeRetailer={activeRetailer}
38
- setActiveRetailer={setActiveRetailer}
39
- approveRejectButtons={approveRejectButtons}
40
- sendToFacilitator={sendToFacilitator}
41
- auditorAssigned={auditorAssigned}
42
- userAssigned={userAssigned}
43
22
  />
44
23
  </div>
45
24
  </Container>
@@ -5,16 +5,10 @@ import { useState } from "react";
5
5
 
6
6
  export const FullTabsMenu = ({
7
7
  tabsSections,
8
- status = "",
9
- activeTab,
8
+ status,
9
+ profileImage,
10
10
  setActiveTab,
11
11
  setImageLayout,
12
- assig,
13
- setAssignation,
14
- isRetailer,
15
- downloadImages,
16
- askToDeleteImages,
17
- onClickSave,
18
12
  }) => {
19
13
  const [imagesSection, setImagesSection] = useState(false);
20
14
 
@@ -27,15 +21,9 @@ export const FullTabsMenu = ({
27
21
  />
28
22
  <StatusAsignationInfo
29
23
  status={status}
30
- activeTab={activeTab}
24
+ image={profileImage}
31
25
  setImageLayout={setImageLayout}
32
26
  imagesSection={imagesSection}
33
- assignationsImages={assig}
34
- setAssignation={setAssignation}
35
- isRetailer={isRetailer}
36
- downloadImages={downloadImages}
37
- onClickSave={onClickSave}
38
- askToDeleteImages={askToDeleteImages}
39
27
  />
40
28
  </Container>
41
29
  );
@@ -1,102 +1,24 @@
1
1
  import { Container } from "./styles";
2
2
  import { TableHeader } from "../../molecules/TableHeader";
3
- import { Container as Row } from "../../molecules/TableRow/styles";
4
- import { ScreenHeader } from "../../atoms/ScreenHeader";
5
- import LabelToInput from "../../atoms/LabelToInput";
3
+ import { TableRow } from "../../molecules/TableRow";
6
4
 
7
5
  export const ImageDataTable = ({
6
+ headerInfo,
7
+ imageData,
8
8
  activeImage,
9
9
  darkMode,
10
- lists,
11
- retailerSelected,
12
- setImages,
13
- assignationsImages,
14
- imagesStatus,
15
- setAssignation,
16
- isRetailer,
17
- onClickSave,
18
10
  }) => {
19
11
  return (
20
12
  <Container darkMode={darkMode}>
21
- <TableHeader
22
- imagesStatus={imagesStatus}
23
- activeImage={activeImage}
24
- assignationsImages={assignationsImages}
25
- setAssignation={setAssignation}
26
- isRetailer={isRetailer}
27
- onClickSave={onClickSave}
28
- />
29
- <Row>
30
- <ScreenHeader headerType={"table-row-text"} text="Tipo de toma" />
31
- <ScreenHeader
32
- headerType={"table-row-text gray-table-row"}
33
- text={
34
- lists?.inputs?.find((f) => f.id === +activeImage?.image_id)?.name ||
35
- "-"
36
- }
13
+ <TableHeader headerInfo={headerInfo} activeImage={activeImage} />
14
+ {imageData?.map((attribute, index) => (
15
+ <TableRow
16
+ key={index}
17
+ feature={attribute.feature}
18
+ value={attribute.value}
19
+ valueType={index < 2}
37
20
  />
38
- </Row>
39
- <Row>
40
- <ScreenHeader headerType={"table-row-text"} text="Tipo de empaque" />
41
- <ScreenHeader
42
- headerType={"table-row-text gray-table-row"}
43
- text={
44
- lists?.imagePackagingType?.find(
45
- (f) => f.id === +activeImage?.packing_type
46
- )?.name || "-"
47
- }
48
- />
49
- </Row>
50
- <Row>
51
- <ScreenHeader headerType={"table-row-text"} text="Tipo de imagen" />
52
- <ScreenHeader
53
- headerType={"table-row-text gray-table-row"}
54
- text={
55
- lists?.imageType?.find((f) => f.id === +activeImage?.image_type)
56
- ?.name || "-"
57
- }
58
- />
59
- </Row>
60
- <Row>
61
- <ScreenHeader headerType={"table-row-text"} text="Formato" />
62
- <ScreenHeader
63
- headerType={"table-row-text"}
64
- text={activeImage?.ext || "-"}
65
- />
66
- </Row>
67
- <Row>
68
- <ScreenHeader headerType={"table-row-text"} text="Tamaño de imagen" />
69
- <ScreenHeader
70
- headerType={"table-row-text"}
71
- text={
72
- activeImage?.width && activeImage.height
73
- ? `${activeImage?.width}x${activeImage?.height}px`
74
- : "-"
75
- }
76
- />
77
- </Row>
78
- {retailerSelected &&
79
- lists?.attrForImgs &&
80
- lists?.attrForImgs[retailerSelected]?.map((attr, index) => (
81
- <Row key={"row-" + index}>
82
- <ScreenHeader
83
- headerType={"table-row-text"}
84
- text={attr?.name || "-"}
85
- />
86
- <LabelToInput
87
- width="100px"
88
- defaultValue={attr?.value}
89
- onChange={(e) => {
90
- setImages({
91
- action: "changeAttrValue",
92
- retailer: retailerSelected,
93
- index,
94
- value: e.target.value || "-",
95
- });
96
- }}
97
- />
98
- </Row>
99
- ))}
21
+ ))}
100
22
  </Container>
101
23
  );
102
24
  };
@@ -6,13 +6,6 @@ export const InputGroup = ({
6
6
  inputGroup = {},
7
7
  activeSection,
8
8
  dataInputs = {},
9
- updatedDescriptions,
10
- setUpdatedDescriptions,
11
- updatedDatasheets,
12
- setUpdatedDatasheets,
13
- articleId,
14
- version,
15
- dinamicHeight,
16
9
  }) => {
17
10
  const inputTypeValue = (type) => {
18
11
  switch (type) {
@@ -24,6 +17,7 @@ export const InputGroup = ({
24
17
  return "text";
25
18
  }
26
19
  };
20
+
27
21
  return (
28
22
  <Container
29
23
  className={
@@ -32,58 +26,29 @@ export const InputGroup = ({
32
26
  : "descriptions-layout"
33
27
  }
34
28
  >
35
- {inputGroup?.dataGroup && (
36
- <ScreenHeader
37
- headerType={"retailer-name-header"}
38
- text={inputGroup?.dataGroup}
39
- />
40
- )}
29
+ <ScreenHeader
30
+ headerType={"retailer-name-header"}
31
+ text={inputGroup?.dataGroup}
32
+ />
41
33
  <div className="inputs-container">
42
34
  {inputGroup?.inputs?.map((input, index) =>
43
35
  activeSection === "Ficha técnica" ? (
44
36
  <TagAndInput
45
- key={
46
- index +
47
- "-" +
48
- dataInputs[input]?.value +
49
- "-" +
50
- dataInputs[input]?.id
51
- }
52
- inputId={dataInputs[input]?.id}
53
- version={version}
37
+ key={index}
38
+ inputId={"datasheet-" + dataInputs[input]?.id + "-" + index}
54
39
  inputType={inputTypeValue(dataInputs[input]?.type)}
55
- label={
56
- dataInputs[input]?.name +
57
- (dataInputs[input]?.required ? "*" : "")
58
- }
40
+ label={dataInputs[input]?.name}
59
41
  value={dataInputs[input]?.value}
60
42
  inputPlaceHolder={input?.placeholder}
61
- articleId={articleId}
62
- isRequired={dataInputs[input]?.required}
63
- updatedDatasheets={updatedDatasheets}
64
- setUpdatedDatasheets={setUpdatedDatasheets}
65
- maxChar={
66
- dataInputs[input]?.max_chars
67
- ? dataInputs[input]?.max_chars
68
- : 999
69
- }
70
43
  />
71
44
  ) : (
72
45
  <TagAndInput
73
- key={index + "-" + input?.value}
74
- inputId={input.id}
75
- index={index}
46
+ key={index}
47
+ inputId={"description-" + input?.id + "-" + index}
76
48
  inputType={"textarea"}
77
- label={input?.name + (input.required ? "*" : "")}
49
+ label={input?.name}
78
50
  value={input?.value}
79
- isRequired={input.required}
80
- maxChar={input.max_chars}
81
51
  inputPlaceHolder={input?.placeholder}
82
- updatedDescriptions={updatedDescriptions}
83
- setUpdatedDescriptions={setUpdatedDescriptions}
84
- articleId={articleId}
85
- version={version}
86
- dinamicHeight={dinamicHeight}
87
52
  />
88
53
  )
89
54
  )}
@@ -23,9 +23,6 @@ export const Container = styled.div`
23
23
  flex: 1 1 20%;
24
24
  margin-right: 10px;
25
25
  min-width: 227px;
26
- display: flex;
27
- flex-direction: column;
28
- justify-content: space-between;
29
26
  }
30
27
  }
31
28
  }