contentoh-components-library 21.0.31 → 21.0.34

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 +5 -16
  2. package/.env.production +3 -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 +260 -31
  94. package/package.json +14 -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 +206 -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 +33 -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,206 @@
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 axios from "axios";
12
+
13
+ export const SignInLogin = (props) => {
14
+ const [emptyEmail, setEmptyEmail] = useState(false);
15
+ const [invalidEmail, setInvalidEmail] = useState(false);
16
+ const [emptyPassword, setEmptyPassword] = useState(false);
17
+ const [showErrors, setShowErrors] = useState(true);
18
+ const [signInError, setSignInError] = useState("");
19
+ const [loading, setLoading] = useState(false);
20
+ const [upgradePlanRedirect, setUpgradePlanRedirect] = useState(false);
21
+ const validate = async (e) => {
22
+ setSignInError("");
23
+ setShowErrors(true);
24
+ e.preventDefault();
25
+ let valid = true;
26
+ const email = document.querySelector("#emailInput").value;
27
+ const password = document.querySelector("#passwordInput").value;
28
+ !/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*$/.test(
29
+ email
30
+ )
31
+ ? setInvalidEmail(true)
32
+ : setInvalidEmail(false);
33
+ if (email === "") {
34
+ valid = false;
35
+ setEmptyEmail(true);
36
+ } else {
37
+ setEmptyEmail(false);
38
+ }
39
+ if (password === "") {
40
+ valid = false;
41
+ setEmptyPassword(true);
42
+ } else {
43
+ setEmptyPassword(false);
44
+ }
45
+ if (valid) {
46
+ try {
47
+ setLoading(true);
48
+ const session = await props.Auth.signIn(email, password);
49
+ if (session.challengeName === "NEW_PASSWORD_REQUIRED") {
50
+ props.setUser(session);
51
+ props.setPaso(8);
52
+ } else {
53
+ const userGroup =
54
+ session.signInUserSession.accessToken.payload["cognito:groups"];
55
+ const response = await axios.get(
56
+ process.env.REACT_APP_USER_ENDPOINT,
57
+ {
58
+ headers: {
59
+ Authorization: session.signInUserSession.idToken.jwtToken,
60
+ },
61
+ }
62
+ );
63
+ const userGroupValue =
64
+ typeof userGroup === "string" ? userGroup : userGroup[0];
65
+ if (userGroupValue === "usuario_contentoh") {
66
+ sessionStorage.setItem("auth", true);
67
+ sessionStorage.setItem(
68
+ "jwt",
69
+ session.signInUserSession.idToken.jwtToken
70
+ );
71
+ const user = JSON.parse(response.data.body).data[0];
72
+ const company = JSON.parse(response.data.body).data[1];
73
+ caches.keys().then((names) => {
74
+ names.forEach((name) => {
75
+ caches.delete(name);
76
+ });
77
+ });
78
+ user.src = `https://${
79
+ process.env.REACT_APP_IMAGES_PROFILE_BUCKET
80
+ }.s3.amazonaws.com/id-${user.id_user}/${
81
+ user.id_user
82
+ }.png?${new Date().getTime()}`;
83
+ sessionStorage.setItem("user", JSON.stringify(user));
84
+ sessionStorage.setItem("company", JSON.stringify(company));
85
+ setUpgradePlanRedirect(true);
86
+ } else {
87
+ setSignInError("NotAuthorizedException");
88
+ setLoading(false);
89
+ }
90
+ }
91
+ } catch (error) {
92
+ console.log(error);
93
+ setLoading(false);
94
+ console.log("error 1")
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
+ console.log("error 2")
109
+ }
110
+ }
111
+ }
112
+ };
113
+ useEffect(() => {
114
+ sessionStorage.getItem("resetPasswordProcess") &&
115
+ sessionStorage.removeItem("resetPasswordProcess");
116
+ }, []);
117
+ return loading ? (
118
+ <Loading />
119
+ ) : (
120
+ <>
121
+ <Container className={"home-login"}>
122
+ <div className="main-container">
123
+ <LogoImage />
124
+ <div className="credenciales">
125
+ <ScreenHeader
126
+ fontFamily={FontFamily.AvenirNext}
127
+ color={GlobalColors.s5}
128
+ text={"Ingresa tus credenciales"}
129
+ />
130
+ </div>
131
+ <div className="user">
132
+ <TagAndInput
133
+ inputType={"text"}
134
+ label={"Nombre de usuario"}
135
+ inputPlaceHolder={"username@contentoh.com"}
136
+ inputId={"emailInput"}
137
+ />
138
+ </div>
139
+ {showErrors && emptyEmail && <label>Ingrese su correo</label>}
140
+ {invalidEmail && !emptyEmail && (
141
+ <label>Ingrese un correo válido</label>
142
+ )}
143
+ <div className="password">
144
+ <TagAndInput
145
+ inputType={"password"}
146
+ label={"Contraseña"}
147
+ inputPlaceHolder={"Escribe tu contraseña"}
148
+ inputId={"passwordInput"}
149
+ />
150
+ </div>
151
+ {showErrors && emptyPassword && <label>Ingrese su contraseña</label>}
152
+ <div className="select">
153
+ <CheckBox
154
+ label={"Mantener sesión activada"}
155
+ id={"chk-default"}
156
+ className="active-left"
157
+ />
158
+ <p onClick={() => props.setPaso(10)} className="active-right">
159
+ Olvide mi contraseña
160
+ </p>
161
+ </div>
162
+ {showErrors && signInError === "NotAuthorizedException" && (
163
+ <label>Correo o contraseña incorrectos</label>
164
+ )}
165
+ {showErrors && signInError === "Error" && (
166
+ <label>Ha habido un problema al iniciar sesión</label>
167
+ )}
168
+ <div className="button-right">
169
+ <Button
170
+ buttonType={"general-default-button"}
171
+ label={"Iniciar sesión"}
172
+ onClick={(e) => validate(e)}
173
+ />
174
+ </div>
175
+ <div className="new-login">
176
+ <p
177
+ className="pre-registro"
178
+ onClick={() => {
179
+ props.setPaso(1);
180
+ sessionStorage.setItem(
181
+ "nuevoRegistro",
182
+ JSON.stringify({
183
+ name: "",
184
+ lastName: "",
185
+ email: "",
186
+ position: "",
187
+ country: "",
188
+ phone: "",
189
+ commercialName: "",
190
+ companyName: "",
191
+ rfc: "",
192
+ adress: "",
193
+ })
194
+ );
195
+ sessionStorage.setItem("countryCode", JSON.stringify("+52"));
196
+ }}
197
+ >
198
+ ¿Aún no tienes cuenta?<span> Regístrate</span>
199
+ </p>
200
+ </div>
201
+ </div>
202
+ </Container>
203
+ {upgradePlanRedirect && <Navigate to={{ pathname: "/dashboard" }} />}
204
+ </>
205
+ );
206
+ };
@@ -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
+ };