contentoh-components-library 21.0.31 → 21.0.32

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 (213) hide show
  1. package/.env.development +4 -17
  2. package/.env.production +1 -14
  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/components/atoms/AsignationOption/index.js +5 -9
  8. package/dist/components/atoms/AsignationOption/styles.js +1 -1
  9. package/dist/components/atoms/CheckBox/index.js +2 -4
  10. package/dist/components/atoms/GeneralButton/index.js +0 -5
  11. package/dist/components/atoms/GeneralButton/styles.js +2 -4
  12. package/dist/components/atoms/GeneralInput/index.js +24 -73
  13. package/dist/components/atoms/GeneralInput/styles.js +1 -7
  14. package/dist/components/atoms/GenericModal/index.js +2 -4
  15. package/dist/components/atoms/GenericModal/styles.js +1 -1
  16. package/dist/components/atoms/ListCommercialRetailers/ListCommercialRetailers.stories.js +36 -0
  17. package/dist/components/atoms/ListCommercialRetailers/index.js +64 -0
  18. package/dist/components/atoms/ListCommercialRetailers/styles.js +20 -0
  19. package/dist/components/atoms/Loading/Loading.stories.js +28 -0
  20. package/dist/components/atoms/Loading/index.js +2 -1
  21. package/dist/components/atoms/Loading/styles.js +4 -8
  22. package/dist/components/atoms/MenuCommercialRetailers/MenuCommercialRetailers.stories.js +37 -0
  23. package/dist/components/atoms/MenuCommercialRetailers/index.js +25 -0
  24. package/dist/components/{molecules/RetailerSelector → atoms/MenuCommercialRetailers}/styles.js +1 -1
  25. package/dist/components/atoms/MenuProductImage/MenuProductImage.stories.js +28 -0
  26. package/dist/components/atoms/MenuProductImage/index.js +88 -0
  27. package/dist/components/atoms/MenuProductImage/styles.js +20 -0
  28. package/dist/components/atoms/PriorityFlag/index.js +1 -1
  29. package/dist/components/atoms/ProductImage/styles.js +1 -1
  30. package/dist/components/atoms/ProgressBar/index.js +2 -2
  31. package/dist/components/atoms/ProgressBar/styles.js +5 -3
  32. package/dist/components/atoms/ScreenHeader/index.js +1 -1
  33. package/dist/components/atoms/ScreenHeader/styles.js +1 -1
  34. package/dist/components/atoms/StatusTag/index.js +2 -37
  35. package/dist/components/atoms/StatusTag/styles.js +1 -1
  36. package/dist/components/atoms/ValidationPanel/index.js +3 -4
  37. package/dist/components/atoms/VerticalSideMenuMainPage/VerticalSideMenuMainPage.stories.js +22 -0
  38. package/dist/components/atoms/VerticalSideMenuMainPage/index.js +49 -0
  39. package/dist/components/atoms/{Commentary → VerticalSideMenuMainPage}/styles.js +1 -6
  40. package/dist/components/molecules/ApproveRejetPanel/ApproveRejetPanel.stories.js +25 -0
  41. package/dist/components/molecules/ApproveRejetPanel/index.js +49 -0
  42. package/dist/components/{atoms/CharCounter → molecules/ApproveRejetPanel}/styles.js +1 -3
  43. package/dist/components/molecules/AvatarAndValidation/index.js +7 -17
  44. package/dist/components/molecules/AvatarAndValidation/styles.js +1 -1
  45. package/dist/components/molecules/CarouselImagesLogin/index.js +40 -42
  46. package/dist/components/molecules/EmailResetPasswordLogin/EmailResetPasswordLogin.stories.js +28 -0
  47. package/dist/components/molecules/EmailResetPasswordLogin/index.js +155 -0
  48. package/dist/components/molecules/EmailResetPasswordLogin/styles.js +20 -0
  49. package/dist/components/molecules/FeaturesBar/index.js +1 -1
  50. package/dist/components/molecules/GalleryElement/index.js +21 -80
  51. package/dist/components/molecules/GalleryElement/styles.js +1 -1
  52. package/dist/components/molecules/GalleryHeader/index.js +6 -28
  53. package/dist/components/molecules/GalleryHeader/styles.js +1 -1
  54. package/dist/components/molecules/ImageSelector/index.js +4 -2
  55. package/dist/components/molecules/ProductNameHeader/index.js +2 -1
  56. package/dist/components/molecules/RegistrationFirstStep/RegistrationFirstStep.stories.js +28 -0
  57. package/dist/components/molecules/RegistrationFirstStep/index.js +336 -0
  58. package/dist/components/molecules/RegistrationFirstStep/styles.js +20 -0
  59. package/dist/components/molecules/RegistrationSecondStep/RegistrationSecondStep.stories.js +28 -0
  60. package/dist/components/molecules/RegistrationSecondStep/index.js +156 -0
  61. package/dist/components/molecules/RegistrationSecondStep/styles.js +20 -0
  62. package/dist/components/molecules/RegistrationThirdStep/RegistrationThirdStep.stories.js +28 -0
  63. package/dist/components/molecules/RegistrationThirdStep/index.js +161 -0
  64. package/dist/components/molecules/RegistrationThirdStep/styles.js +20 -0
  65. package/dist/components/{atoms/CharCounter/CharCounter.stories.js → molecules/SignInLogin/SignInLogin.stories.js} +7 -10
  66. package/dist/components/molecules/SignInLogin/index.js +292 -0
  67. package/dist/components/molecules/SignInLogin/styles.js +20 -0
  68. package/dist/components/molecules/StatusAsignationInfo/index.js +25 -46
  69. package/dist/components/molecules/StatusAsignationInfo/styles.js +1 -1
  70. package/dist/components/molecules/TableHeader/index.js +5 -12
  71. package/dist/components/molecules/TableHeader/styles.js +1 -1
  72. package/dist/components/molecules/TagAndInput/index.js +2 -26
  73. package/dist/components/molecules/VerificationCodeResetPasswordLogin/VerificationCodeResetPasswordLogin.stories.js +28 -0
  74. package/dist/components/molecules/VerificationCodeResetPasswordLogin/index.js +104 -0
  75. package/dist/components/molecules/VerificationCodeResetPasswordLogin/styles.js +20 -0
  76. package/dist/components/molecules/VerificationCodeResetPasswordLogin/utils.js +69 -0
  77. package/dist/components/{atoms/InputFormatter/Wysiwyg.stories.js → organisms/ChangePassword/ChangePassword.stories.js} +7 -9
  78. package/dist/components/organisms/ChangePassword/index.js +113 -0
  79. package/dist/components/organisms/ChangePassword/styles.js +18 -0
  80. package/dist/components/organisms/FullProductNameHeader/index.js +8 -32
  81. package/dist/components/organisms/FullTabsMenu/index.js +5 -18
  82. package/dist/components/organisms/ImageDataTable/index.js +14 -90
  83. package/dist/components/organisms/InputGroup/index.js +13 -34
  84. package/dist/components/organisms/InputGroup/styles.js +1 -1
  85. package/dist/components/organisms/ProductImageModal/index.js +11 -15
  86. package/dist/components/organisms/ProductImageModal/styles.js +1 -1
  87. package/dist/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +347 -109
  88. package/dist/components/pages/RetailerProductEdition/index.js +59 -1589
  89. package/dist/components/pages/RetailerProductEdition/styles.js +1 -1
  90. package/dist/global-files/data.js +53 -212
  91. package/dist/global-files/global-styles.css +0 -1
  92. package/dist/global-files/variables.js +0 -1
  93. package/dist/index.js +238 -30
  94. package/package.json +11 -12
  95. package/src/components/atoms/AsignationOption/index.js +5 -7
  96. package/src/components/atoms/AsignationOption/styles.js +1 -9
  97. package/src/components/atoms/CheckBox/index.js +2 -8
  98. package/src/components/atoms/GeneralButton/index.js +2 -9
  99. package/src/components/atoms/GeneralButton/styles.js +0 -23
  100. package/src/components/atoms/GeneralInput/index.js +21 -71
  101. package/src/components/atoms/GeneralInput/styles.js +1 -11
  102. package/src/components/atoms/GenericModal/index.js +2 -2
  103. package/src/components/atoms/GenericModal/styles.js +2 -10
  104. package/src/components/atoms/Loading/Loading.stories.js +10 -0
  105. package/src/components/atoms/Loading/index.js +5 -4
  106. package/src/components/atoms/Loading/styles.js +43 -43
  107. package/src/components/atoms/PriorityFlag/index.js +1 -1
  108. package/src/components/atoms/ProductImage/styles.js +1 -1
  109. package/src/components/atoms/ProgressBar/index.js +2 -2
  110. package/src/components/atoms/ProgressBar/styles.js +3 -54
  111. package/src/components/atoms/ScreenHeader/index.js +3 -7
  112. package/src/components/atoms/ScreenHeader/styles.js +2 -9
  113. package/src/components/atoms/StatusTag/index.js +2 -30
  114. package/src/components/atoms/StatusTag/styles.js +3 -15
  115. package/src/components/atoms/ValidationPanel/index.js +3 -3
  116. package/src/components/molecules/AvatarAndValidation/index.js +6 -24
  117. package/src/components/molecules/AvatarAndValidation/styles.js +1 -1
  118. package/src/components/molecules/CarouselImagesLogin/index.js +34 -37
  119. package/src/components/molecules/EmailResetPasswordLogin/EmailResetPasswordLogin.stories.js +11 -0
  120. package/src/components/molecules/EmailResetPasswordLogin/index.js +86 -0
  121. package/src/components/molecules/EmailResetPasswordLogin/styles.js +23 -0
  122. package/src/components/molecules/FeaturesBar/index.js +7 -10
  123. package/src/components/molecules/GalleryElement/index.js +36 -75
  124. package/src/components/molecules/GalleryElement/styles.js +11 -38
  125. package/src/components/molecules/GalleryHeader/index.js +8 -14
  126. package/src/components/molecules/GalleryHeader/styles.js +0 -16
  127. package/src/components/molecules/ImageSelector/index.js +3 -2
  128. package/src/components/molecules/ProductNameHeader/index.js +2 -1
  129. package/src/components/molecules/RegistrationFirstStep/RegistrationFirstStep.stories.js +11 -0
  130. package/src/components/molecules/RegistrationFirstStep/index.js +242 -0
  131. package/src/components/molecules/RegistrationFirstStep/styles.js +81 -0
  132. package/src/components/molecules/RegistrationSecondStep/RegistrationSecondStep.stories.js +11 -0
  133. package/src/components/molecules/RegistrationSecondStep/index.js +97 -0
  134. package/src/components/molecules/RegistrationSecondStep/styles.js +59 -0
  135. package/src/components/molecules/RegistrationThirdStep/RegistrationThirdStep.stories.js +11 -0
  136. package/src/components/molecules/RegistrationThirdStep/index.js +109 -0
  137. package/src/components/molecules/RegistrationThirdStep/styles.js +44 -0
  138. package/src/components/molecules/SignInLogin/SignInLogin.stories.js +11 -0
  139. package/src/components/molecules/SignInLogin/index.js +205 -0
  140. package/src/components/molecules/SignInLogin/styles.js +78 -0
  141. package/src/components/molecules/StatusAsignationInfo/index.js +38 -62
  142. package/src/components/molecules/StatusAsignationInfo/styles.js +2 -12
  143. package/src/components/molecules/TableHeader/index.js +3 -16
  144. package/src/components/molecules/TableHeader/styles.js +0 -5
  145. package/src/components/molecules/TagAndInput/index.js +0 -24
  146. package/src/components/molecules/VerificationCodeResetPasswordLogin/VerificationCodeResetPasswordLogin.stories.js +11 -0
  147. package/src/components/molecules/VerificationCodeResetPasswordLogin/index.js +78 -0
  148. package/src/components/molecules/VerificationCodeResetPasswordLogin/styles.js +49 -0
  149. package/src/components/molecules/VerificationCodeResetPasswordLogin/utils.js +56 -0
  150. package/src/components/organisms/ChangePassword/ChangePassword.stories.js +11 -0
  151. package/src/components/organisms/ChangePassword/index.js +63 -0
  152. package/src/components/organisms/ChangePassword/styles.js +16 -0
  153. package/src/components/organisms/FullProductNameHeader/index.js +7 -28
  154. package/src/components/organisms/FullTabsMenu/index.js +3 -15
  155. package/src/components/organisms/ImageDataTable/index.js +11 -89
  156. package/src/components/organisms/InputGroup/index.js +11 -46
  157. package/src/components/organisms/InputGroup/styles.js +0 -3
  158. package/src/components/organisms/ProductImageModal/index.js +12 -20
  159. package/src/components/organisms/ProductImageModal/styles.js +0 -3
  160. package/src/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +343 -117
  161. package/src/components/pages/RetailerProductEdition/index.js +46 -1225
  162. package/src/components/pages/RetailerProductEdition/styles.js +4 -67
  163. package/src/global-files/data.js +57 -156
  164. package/src/global-files/global-styles.css +0 -1
  165. package/src/global-files/variables.js +0 -1
  166. package/src/index.js +17 -1
  167. package/dist/assets/images/generalButton/downloadIcon.svg +0 -3
  168. package/dist/assets/images/modalsSVGs/attributesSent.svg +0 -208
  169. package/dist/assets/images/modalsSVGs/descriptionSent.svg +0 -237
  170. package/dist/assets/images/modalsSVGs/providerSent.svg +0 -445
  171. package/dist/assets/images/modalsSVGs/uploadingImages.svg +0 -148
  172. package/dist/components/atoms/CharCounter/index.js +0 -22
  173. package/dist/components/atoms/Commentary/Commentary.stories.js +0 -1
  174. package/dist/components/atoms/Commentary/index.js +0 -23
  175. package/dist/components/atoms/Input/index.js +0 -26
  176. package/dist/components/atoms/Input/style.js +0 -26
  177. package/dist/components/atoms/InputFormatter/index.js +0 -185
  178. package/dist/components/atoms/InputFormatter/styles.js +0 -33
  179. package/dist/components/atoms/LabelToInput/index.js +0 -53
  180. package/dist/components/atoms/LabelToInput/style.js +0 -22
  181. package/dist/components/atoms/Percent/Percent.stories.js +0 -39
  182. package/dist/components/atoms/Percent/index.js +0 -39
  183. package/dist/components/atoms/Percent/styles.js +0 -20
  184. package/dist/components/atoms/Select/index.js +0 -39
  185. package/dist/components/atoms/Select/style.js +0 -32
  186. package/dist/components/molecules/RetailerSelector/RetailerSelector.stories.js +0 -48
  187. package/dist/components/molecules/RetailerSelector/index.js +0 -74
  188. package/dist/components/molecules/TextAndGradient/TextAndGradient.stories.js +0 -31
  189. package/dist/components/molecules/TextAndGradient/index.js +0 -36
  190. package/dist/components/molecules/TextAndGradient/styles.js +0 -18
  191. package/src/assets/images/generalButton/downloadIcon.svg +0 -3
  192. package/src/assets/images/modalsSVGs/attributesSent.svg +0 -208
  193. package/src/assets/images/modalsSVGs/descriptionSent.svg +0 -237
  194. package/src/assets/images/modalsSVGs/providerSent.svg +0 -445
  195. package/src/assets/images/modalsSVGs/uploadingImages.svg +0 -148
  196. package/src/components/atoms/CharCounter/CharCounter.stories.js +0 -11
  197. package/src/components/atoms/CharCounter/index.js +0 -13
  198. package/src/components/atoms/CharCounter/styles.js +0 -10
  199. package/src/components/atoms/Commentary/Commentary.stories.js +0 -0
  200. package/src/components/atoms/Commentary/index.js +0 -9
  201. package/src/components/atoms/Commentary/styles.js +0 -16
  202. package/src/components/atoms/Input/index.js +0 -15
  203. package/src/components/atoms/Input/style.js +0 -31
  204. package/src/components/atoms/InputFormatter/Wysiwyg.stories.js +0 -12
  205. package/src/components/atoms/InputFormatter/index.js +0 -141
  206. package/src/components/atoms/InputFormatter/styles.js +0 -40
  207. package/src/components/atoms/LabelToInput/index.js +0 -26
  208. package/src/components/atoms/LabelToInput/style.js +0 -41
  209. package/src/components/atoms/Select/index.js +0 -35
  210. package/src/components/atoms/Select/style.js +0 -76
  211. package/src/components/molecules/RetailerSelector/RetailerSelector.stories.js +0 -35
  212. package/src/components/molecules/RetailerSelector/index.js +0 -63
  213. package/src/components/molecules/RetailerSelector/styles.js +0 -18
@@ -0,0 +1,205 @@
1
+ import { Container } from "./styles";
2
+ import { LogoImage } from "../../atoms/LogoImage/index";
3
+ import { ScreenHeader } from "../../atoms/ScreenHeader/index";
4
+ import { Button } from "../../atoms/GeneralButton/index";
5
+ import { CheckBox } from "../../atoms/CheckBox/index";
6
+ import { TagAndInput } from "../TagAndInput";
7
+ import { FontFamily, GlobalColors } from "../../../global-files/variables";
8
+ import { useState, useEffect } from "react";
9
+ import { Loading } from "../../atoms/Loading";
10
+ import { Navigate } from "react-router-dom";
11
+ import { Auth } from "aws-amplify";
12
+ import axios from "axios";
13
+
14
+ export const SignInLogin = (props) => {
15
+ const [emptyEmail, setEmptyEmail] = useState(false);
16
+ const [invalidEmail, setInvalidEmail] = useState(false);
17
+ const [emptyPassword, setEmptyPassword] = useState(false);
18
+ const [showErrors, setShowErrors] = useState(true);
19
+ const [signInError, setSignInError] = useState("");
20
+ const [loading, setLoading] = useState(false);
21
+ const [upgradePlanRedirect, setUpgradePlanRedirect] = useState(false);
22
+ const validate = async (e) => {
23
+ setSignInError("");
24
+ setShowErrors(true);
25
+ e.preventDefault();
26
+ let valid = true;
27
+ const email = document.querySelector("#emailInput").value;
28
+ const password = document.querySelector("#passwordInput").value;
29
+ !/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*$/.test(
30
+ email
31
+ )
32
+ ? setInvalidEmail(true)
33
+ : setInvalidEmail(false);
34
+ if (email === "") {
35
+ valid = false;
36
+ setEmptyEmail(true);
37
+ } else {
38
+ setEmptyEmail(false);
39
+ }
40
+ if (password === "") {
41
+ valid = false;
42
+ setEmptyPassword(true);
43
+ } else {
44
+ setEmptyPassword(false);
45
+ }
46
+ if (valid) {
47
+ try {
48
+ setLoading(true);
49
+ const session = await Auth.signIn(email, password);
50
+ if (session.challengeName === "NEW_PASSWORD_REQUIRED") {
51
+ props.setUser(session);
52
+ props.setPaso(8);
53
+ } else {
54
+ const userGroup =
55
+ session.signInUserSession.accessToken.payload["cognito:groups"];
56
+ const response = await axios.get(
57
+ process.env.REACT_APP_USER_ENDPOINT,
58
+ {
59
+ headers: {
60
+ Authorization: session.signInUserSession.idToken.jwtToken,
61
+ },
62
+ }
63
+ );
64
+ const userGroupValue =
65
+ typeof userGroup === "string" ? userGroup : userGroup[0];
66
+ if (userGroupValue === "usuario_contentoh") {
67
+ sessionStorage.setItem("auth", true);
68
+ sessionStorage.setItem(
69
+ "jwt",
70
+ session.signInUserSession.idToken.jwtToken
71
+ );
72
+ const user = JSON.parse(response.data.body).data[0];
73
+ const company = JSON.parse(response.data.body).data[1];
74
+ caches.keys().then((names) => {
75
+ names.forEach((name) => {
76
+ caches.delete(name);
77
+ });
78
+ });
79
+ user.src = `https://${
80
+ process.env.REACT_APP_IMAGES_PROFILE_BUCKET
81
+ }.s3.amazonaws.com/id-${user.id_user}/${
82
+ user.id_user
83
+ }.png?${new Date().getTime()}`;
84
+ sessionStorage.setItem("user", JSON.stringify(user));
85
+ sessionStorage.setItem("company", JSON.stringify(company));
86
+ setUpgradePlanRedirect(true);
87
+ } else {
88
+ setSignInError("NotAuthorizedException");
89
+ setLoading(false);
90
+ }
91
+ }
92
+ } catch (error) {
93
+ console.log(error);
94
+ setLoading(false);
95
+ if (error.code === "NotAuthorizedException") {
96
+ setSignInError("NotAuthorizedException");
97
+ } else if (error.code === "UserNotConfirmedException") {
98
+ sessionStorage.setItem(
99
+ "email",
100
+ JSON.stringify(
101
+ document.querySelector("#usernameInput").value.trim()
102
+ )
103
+ );
104
+ sessionStorage.setItem("email", JSON.stringify(email));
105
+ props.setPaso(5);
106
+ } else {
107
+ setSignInError("Error");
108
+ }
109
+ }
110
+ }
111
+ };
112
+ useEffect(() => {
113
+ sessionStorage.getItem("resetPasswordProcess") &&
114
+ sessionStorage.removeItem("resetPasswordProcess");
115
+ }, []);
116
+ return loading ? (
117
+ <Loading />
118
+ ) : (
119
+ <>
120
+ <Container className={"home-login"}>
121
+ <div className="main-container">
122
+ <LogoImage />
123
+ <div className="credenciales">
124
+ <ScreenHeader
125
+ fontFamily={FontFamily.AvenirNext}
126
+ color={GlobalColors.s5}
127
+ text={"Ingresa tus credenciales"}
128
+ />
129
+ </div>
130
+ <div className="user">
131
+ <TagAndInput
132
+ inputType={"text"}
133
+ label={"Nombre de usuario"}
134
+ inputPlaceHolder={"username@contentoh.com"}
135
+ inputId={"emailInput"}
136
+ />
137
+ </div>
138
+ {showErrors && emptyEmail && <label>Ingrese su correo</label>}
139
+ {invalidEmail && !emptyEmail && (
140
+ <label>Ingrese un correo válido</label>
141
+ )}
142
+ <div className="password">
143
+ <TagAndInput
144
+ inputType={"password"}
145
+ label={"Contraseña"}
146
+ inputPlaceHolder={"Escribe tu contraseña"}
147
+ inputId={"passwordInput"}
148
+ />
149
+ </div>
150
+ {showErrors && emptyPassword && <label>Ingrese su contraseña</label>}
151
+ <div className="select">
152
+ <CheckBox
153
+ label={"Mantener sesión activada"}
154
+ id={"chk-default"}
155
+ className="active-left"
156
+ />
157
+ <p onClick={() => props.setPaso(10)} className="active-right">
158
+ Olvide mi contraseña
159
+ </p>
160
+ </div>
161
+ {showErrors && signInError === "NotAuthorizedException" && (
162
+ <label>Correo o contraseña incorrectos</label>
163
+ )}
164
+ {showErrors && signInError === "Error" && (
165
+ <label>Ha habido un problema al iniciar sesión</label>
166
+ )}
167
+ <div className="button-right">
168
+ <Button
169
+ buttonType={"general-default-button"}
170
+ label={"Iniciar sesión"}
171
+ onClick={(e) => validate(e)}
172
+ />
173
+ </div>
174
+ <div className="new-login">
175
+ <p
176
+ className="pre-registro"
177
+ onClick={() => {
178
+ props.setPaso(1);
179
+ sessionStorage.setItem(
180
+ "nuevoRegistro",
181
+ JSON.stringify({
182
+ name: "",
183
+ lastName: "",
184
+ email: "",
185
+ position: "",
186
+ country: "",
187
+ phone: "",
188
+ commercialName: "",
189
+ companyName: "",
190
+ rfc: "",
191
+ adress: "",
192
+ })
193
+ );
194
+ sessionStorage.setItem("countryCode", JSON.stringify("+52"));
195
+ }}
196
+ >
197
+ ¿Aún no tienes cuenta?<span> Regístrate</span>
198
+ </p>
199
+ </div>
200
+ </div>
201
+ </Container>
202
+ {upgradePlanRedirect && <Navigate to={{ pathname: "/dashboard" }} />}
203
+ </>
204
+ );
205
+ };
@@ -0,0 +1,78 @@
1
+ import styled from "styled-components";
2
+ import { FontFamily, GlobalColors } from "../../../global-files/variables";
3
+
4
+ export const Container = styled.div`
5
+ background: "white";
6
+ display: flex;
7
+ height: 100%;
8
+ width: 50%;
9
+ justify-content: center;
10
+ align-items: center;
11
+ label {
12
+ color: red;
13
+ margin-top: 3px;
14
+ margin-left: 15px;
15
+ font-family: ${FontFamily.Raleway_700};
16
+ font-size: 11px;
17
+ & + * {
18
+ margin-top: 12px;
19
+ }
20
+ }
21
+
22
+ &.home-login {
23
+ .credenciales {
24
+ & + * {
25
+ margin-top: 30px;
26
+ }
27
+ }
28
+ .user {
29
+ & + * {
30
+ margin-top: 20px;
31
+ }
32
+ }
33
+ .password {
34
+ & + * {
35
+ margin-top: 20px;
36
+ }
37
+ }
38
+ .select {
39
+ display: flex;
40
+ justify-content: space-between;
41
+ .active-right {
42
+ font-family: ${FontFamily.AvenirNext};
43
+ font-weight: 500;
44
+ font-size: 13px;
45
+ line-height: 24px;
46
+ letter-spacing: -0.015em;
47
+ color: ${GlobalColors.s5};
48
+ cursor: pointer;
49
+ }
50
+ & + * {
51
+ margin-top: 50px;
52
+ }
53
+ }
54
+ .button-right {
55
+ text-align: right;
56
+ & + * {
57
+ margin-top: 55px;
58
+ }
59
+ }
60
+ .new-login {
61
+ p {
62
+ font-family: ${FontFamily.AvenirNext};
63
+ text-align: right;
64
+ font-weight: 500;
65
+ font-size: 13px;
66
+ line-height: 24px;
67
+ color: ${GlobalColors.s5};
68
+ span {
69
+ color: ${GlobalColors.secondary_magenta};
70
+ }
71
+ }
72
+ }
73
+ }
74
+ .main-container {
75
+ max-width: 80%;
76
+ max-height: 80%;
77
+ }
78
+ `;
@@ -5,24 +5,20 @@ import { StatusTag } from "../../atoms/StatusTag/index";
5
5
  import { Button } from "../../atoms/GeneralButton";
6
6
  import { useEffect, useState } from "react";
7
7
  import { AsignationOption } from "../../atoms/AsignationOption/index";
8
- import { getProfilePicture } from "../../../global-files/data";
9
8
 
10
9
  export const StatusAsignationInfo = ({
11
10
  status = "-",
11
+ src,
12
12
  imagesSection,
13
13
  setImageLayout,
14
+ asignationsList,
14
15
  percent = 0,
15
- assignationsImages,
16
- setAssignation,
17
- isRetailer,
18
- downloadImages,
19
- askToDeleteImages,
16
+ saveImages,
17
+ deleteImages,
20
18
  id = "default-id",
21
- onClickSave,
22
19
  }) => {
23
20
  const [showAsignationPanel, setShowAsignationPanel] = useState(false);
24
- const [layout, setLayout] = useState(false);
25
- const [assignationType, setAssignationType] = useState("facilitator");
21
+ const [layout, setLayout] = useState(true);
26
22
 
27
23
  const closeAsignations = (e) => {
28
24
  if (!e.target.closest("#default-id") && showAsignationPanel) {
@@ -39,22 +35,18 @@ export const StatusAsignationInfo = ({
39
35
 
40
36
  return (
41
37
  <Container id={id}>
42
- <Button
43
- buttonType={"circular-button save-button"}
44
- onClick={onClickSave}
45
- />
46
38
  {imagesSection && (
47
39
  <div className="images-buttons">
48
40
  <Button
49
- buttonType={"circular-button delete-button"}
41
+ buttonType={"circular-button save-button"}
50
42
  onClick={() => {
51
- askToDeleteImages && askToDeleteImages();
43
+ saveImages && saveImages();
52
44
  }}
53
45
  />
54
46
  <Button
55
- buttonType={"circular-button download-button"}
47
+ buttonType={"circular-button delete-button"}
56
48
  onClick={() => {
57
- downloadImages();
49
+ deleteImages && deleteImages();
58
50
  }}
59
51
  />
60
52
  <Button
@@ -67,20 +59,14 @@ export const StatusAsignationInfo = ({
67
59
  </div>
68
60
  )}
69
61
  <StatusTag statusType={status} ovalForm={true} />
70
- <div className="assignations-container">
71
- {assignationsImages?.assignations?.map((assignation, index) => (
72
- <Avatar
73
- key={index + "-" + assignation.id}
74
- imageType={"small-image"}
75
- image={getProfilePicture(assignation.id, 20, 20)}
76
- altText="user profile image"
77
- onClick={() => {
78
- setShowAsignationPanel(true);
79
- setAssignationType(assignation?.collaboratorType);
80
- }}
81
- />
82
- ))}
83
- </div>
62
+ <Avatar
63
+ imageType={"small-image"}
64
+ image={src}
65
+ altText="user profile image"
66
+ onClick={() => {
67
+ setShowAsignationPanel(true);
68
+ }}
69
+ />
84
70
  <ScreenHeader
85
71
  text={"Asig."}
86
72
  color={"#969696"}
@@ -100,41 +86,31 @@ export const StatusAsignationInfo = ({
100
86
  </div>
101
87
  </div>
102
88
  <div className="asignations-list">
103
- {assignationsImages?.collaborators !== undefined ? (
104
- assignationsImages?.collaborators[assignationType]?.map(
105
- (asignation, index) => (
106
- <AsignationOption
107
- key={index + "-" + asignation.name}
108
- profileImage={getProfilePicture(
109
- asignation?.id_user,
110
- 40,
111
- 40
112
- )}
113
- onClick={() => {
114
- setAssignation(assignationType, asignation?.id_user);
115
- }}
116
- name={asignation.name}
117
- />
118
- )
119
- )
89
+ {asignationsList !== undefined ? (
90
+ asignationsList.map((asigantion, index) => (
91
+ <AsignationOption
92
+ profileImage={asignation.image}
93
+ asignationType={asignation.asignationType}
94
+ name={asignation.name}
95
+ team={asigantion.team}
96
+ />
97
+ ))
120
98
  ) : (
121
99
  <p className="no-asignations">Sin personas para asignar</p>
122
100
  )}
123
101
  </div>
124
- {isRetailer === 1 && (
125
- <div className="default-asignations-list">
126
- <AsignationOption
127
- asignationType={"provider"}
128
- name={"Solicitar a"}
129
- team={"Proveedor"}
130
- />
131
- <AsignationOption
132
- asignationType={"team"}
133
- name={"Solicitar a"}
134
- team={"Content-oh!"}
135
- />
136
- </div>
137
- )}
102
+ <div className="default-asignations-list">
103
+ <AsignationOption
104
+ asignationType={"provider"}
105
+ name={"Solicitar a"}
106
+ team={"Proveedor"}
107
+ />
108
+ <AsignationOption
109
+ asignationType={"team"}
110
+ name={"Solicitar a"}
111
+ team={"Content-oh!"}
112
+ />
113
+ </div>
138
114
  </div>
139
115
  )}
140
116
  </Container>
@@ -16,22 +16,16 @@ export const Container = styled.div`
16
16
  }
17
17
  }
18
18
 
19
- .assignations-container {
20
- display: flex;
21
- cursor: pointer;
22
- }
23
-
24
19
  .asignation-panel {
25
20
  background: ${GlobalColors.s2};
26
21
  border: 1px solid ${GlobalColors.s3};
27
22
  box-sizing: border-box;
28
23
  box-shadow: 0px 2px 5px rgba(0, 0, 0, 0.25);
29
24
  border-radius: 4px;
30
- padding: 10px 8px;
25
+ padding: 10px;
31
26
  position: absolute;
32
27
  top: calc(100% + 10px);
33
28
  right: 0;
34
- z-index: 10;
35
29
 
36
30
  .asignation-header {
37
31
  display: flex;
@@ -59,6 +53,7 @@ export const Container = styled.div`
59
53
 
60
54
  .asignations-list {
61
55
  min-height: 40px;
56
+ border-bottom: 1px solid ${GlobalColors.s3};
62
57
 
63
58
  .no-asignations {
64
59
  padding: 5px;
@@ -71,12 +66,7 @@ export const Container = styled.div`
71
66
 
72
67
  & + * {
73
68
  margin-top: 10px;
74
- border-top: 1px solid ${GlobalColors.s3};
75
69
  }
76
70
  }
77
-
78
- .default-asignations-list {
79
- padding-top: 10px;
80
- }
81
71
  }
82
72
  `;
@@ -3,28 +3,15 @@ import { ScreenHeader } from "../../atoms/ScreenHeader";
3
3
  import { StatusAsignationInfo } from "../StatusAsignationInfo";
4
4
  import { GlobalColors } from "../../../global-files/variables";
5
5
 
6
- export const TableHeader = ({
7
- imagesStatus,
8
- activeImage,
9
- assignationsImages,
10
- setAssignation,
11
- isRetailer,
12
- onClickSave,
13
- }) => {
6
+ export const TableHeader = ({ headerInfo, activeImage }) => {
14
7
  return (
15
8
  <Container>
16
9
  <ScreenHeader
17
- text={activeImage?.name || "-"}
10
+ text={activeImage?.imageName}
18
11
  color={GlobalColors.s5}
19
12
  headerType={"input-name-header"}
20
13
  />
21
- <StatusAsignationInfo
22
- status={imagesStatus}
23
- assignationsImages={assignationsImages}
24
- setAssignation={setAssignation}
25
- isRetailer={isRetailer}
26
- onClickSave={onClickSave}
27
- />
14
+ <StatusAsignationInfo status={headerInfo?.status} src={headerInfo?.src} />
28
15
  </Container>
29
16
  );
30
17
  };
@@ -7,11 +7,6 @@ export const Container = styled.div`
7
7
  padding-bottom: 5px;
8
8
  border-bottom: 1px solid ${GlobalColors.s2};
9
9
 
10
- .input-name-header {
11
- overflow: auto;
12
- max-width: 40%;
13
- white-space: nowrap;
14
- }
15
10
  .status-asignation-info {
16
11
  display: flex;
17
12
  align-items: center;
@@ -8,18 +8,6 @@ export const TagAndInput = ({
8
8
  value,
9
9
  inputPlaceHolder,
10
10
  inputId,
11
- updatedDescriptions,
12
- setUpdatedDescriptions,
13
- updatedDatasheets,
14
- setUpdatedDatasheets,
15
- articleId,
16
- version,
17
- index,
18
- isRequired,
19
- dinamicHeight,
20
- inputCols,
21
- inputRows,
22
- maxChar,
23
11
  }) => {
24
12
  return (
25
13
  <Container
@@ -32,19 +20,7 @@ export const TagAndInput = ({
32
20
  inputId={inputId}
33
21
  inputType={inputType}
34
22
  inputValue={value}
35
- index={index}
36
- isRequired={isRequired}
37
23
  inputPlaceholder={inputPlaceHolder}
38
- updatedDescriptions={updatedDescriptions}
39
- setUpdatedDescriptions={setUpdatedDescriptions}
40
- updatedDatasheets={updatedDatasheets}
41
- setUpdatedDatasheets={setUpdatedDatasheets}
42
- articleId={articleId}
43
- version={version}
44
- dinamicHeight={dinamicHeight}
45
- inputCols={inputCols}
46
- inputRows={inputRows}
47
- maxChar={maxChar}
48
24
  />
49
25
  </Container>
50
26
  );
@@ -0,0 +1,11 @@
1
+ import { VerificationCodeResetPasswordLogin } from "./index";
2
+
3
+ export default {
4
+ title: "Components/molecules/VerificationCodeResetPasswordLogin",
5
+ component: VerificationCodeResetPasswordLogin,
6
+ };
7
+ const Template = (args) => <VerificationCodeResetPasswordLogin {...args} />;
8
+
9
+ export const VerificationCodeResetPasswordLoginDefault = Template.bind({});
10
+
11
+ VerificationCodeResetPasswordLoginDefault.args = {};
@@ -0,0 +1,78 @@
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 = () => {
12
+ const [emptyVerificationCode, setEmptyVerificationCode] = useState(false);
13
+ const [inputCodeVerificationAll, setInputCodeVerificationAll] = useState();
14
+ const inputPositions = [1, 2, 3, 4, 5, 6];
15
+
16
+ useEffect(() => {
17
+ setInputCodeVerificationAll(
18
+ document.querySelectorAll("[id^='verificationCodeInput']")
19
+ );
20
+ }, []);
21
+
22
+ const loginRight = [
23
+ <LogoImage key="1" />,
24
+ <div className="credenciales" key={"2"}>
25
+ <ScreenHeader
26
+ fontFamily={FontFamily.AvenirNext}
27
+ color={GlobalColors.s5}
28
+ text={"Ingresa tus credenciales"}
29
+ />
30
+ </div>,
31
+ <div className="user" key="3">
32
+ <ScreenHeader
33
+ text={"Ingresa el código de verificación enviado a:"}
34
+ headerType={"input-name-header"}
35
+ />
36
+ <div className="verification-code">
37
+ {inputPositions.map((position) => (
38
+ <GeneralInput
39
+ inputId={`verificationCodeInput${position}`}
40
+ inputType={"text"}
41
+ inputPlaceholder={"X"}
42
+ validateInput={validateInput}
43
+ inputsArray={inputCodeVerificationAll}
44
+ position={position}
45
+ maxLength="1"
46
+ />
47
+ ))}
48
+ </div>
49
+ {emptyVerificationCode && (
50
+ <label>Ingrese su código de verificación</label>
51
+ )}
52
+ </div>,
53
+ <div className="resend-code" key="4">
54
+ <p>Reenviar código de verificación</p>
55
+ </div>,
56
+ <div className="button-center" key="5">
57
+ <Button
58
+ buttonType={"general-default-button"}
59
+ label={"Enviar"}
60
+ onClick={(e) =>
61
+ validate(inputCodeVerificationAll, setEmptyVerificationCode)
62
+ }
63
+ />
64
+ </div>,
65
+ <div className="reset-password" key="6">
66
+ <p>Regresar...</p>
67
+ </div>,
68
+ ];
69
+ return (
70
+ <Container>
71
+ <GradientPanel
72
+ componentsArray={loginRight}
73
+ panelType={"home-login"}
74
+ panelColor={GlobalColors.white}
75
+ />
76
+ </Container>
77
+ );
78
+ };