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,44 @@
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
+ width: 50%;
7
+ height: 100%;
8
+ .user {
9
+ .input-name-header {
10
+ margin-top: 10px;
11
+ }
12
+ }
13
+ .button-end {
14
+ text-align: end;
15
+ .general-default-button {
16
+ width: 160px;
17
+ }
18
+ & + * {
19
+ margin-top: 10px;
20
+ }
21
+ }
22
+ .progress-bar {
23
+ width: 100%;
24
+ height: 8px;
25
+ display: flex;
26
+ justify-content: space-between;
27
+ .progress-bar-step-check {
28
+ width: 66.66%;
29
+ background-color: ${GlobalColors.exported};
30
+ }
31
+ .progress-bar-registration {
32
+ background-color: rgb(196, 196, 196);
33
+ width: 33.33%;
34
+ }
35
+ }
36
+ .date-header {
37
+ margin-left: 66.66%;
38
+ .new-login {
39
+ & + * {
40
+ margin-top: 20px;
41
+ }
42
+ }
43
+ }
44
+ `;
@@ -0,0 +1,11 @@
1
+ import { SignInLogin } from "./index";
2
+
3
+ export default {
4
+ title: "Components/molecules/SignInLogin",
5
+ component: SignInLogin,
6
+ };
7
+
8
+ const Template = (args) => <SignInLogin {...args} />;
9
+
10
+ export const SignInLoginDefault = Template.bind({});
11
+ SignInLoginDefault.args = {};
@@ -0,0 +1,201 @@
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 { LogoLoading } from "../LogoLoading";
10
+ import { Redirect } 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.trim();
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
+ if (userGroup[0] === props.users) {
64
+ sessionStorage.setItem("auth", true);
65
+ sessionStorage.setItem(
66
+ "jwt",
67
+ session.signInUserSession.idToken.jwtToken
68
+ );
69
+ const user = JSON.parse(response.data.body).data[0];
70
+ const company = JSON.parse(response.data.body).data[1];
71
+ caches.keys().then((names) => {
72
+ names.forEach((name) => {
73
+ caches.delete(name);
74
+ });
75
+ });
76
+ user.src = `https://${
77
+ process.env.REACT_APP_IMAGES_PROFILE_BUCKET
78
+ }.s3.amazonaws.com/id-${user.id_user}/${
79
+ user.id_user
80
+ }.png?${new Date().getTime()}`;
81
+ sessionStorage.setItem("user", JSON.stringify(user));
82
+ sessionStorage.setItem("company", JSON.stringify(company));
83
+ setUpgradePlanRedirect(true);
84
+ } else {
85
+ setSignInError("NotAuthorizedException");
86
+ setLoading(false);
87
+ }
88
+ }
89
+ } catch (error) {
90
+ console.log(error.code);
91
+ setLoading(false);
92
+ if (error.code === "NotAuthorizedException") {
93
+ setSignInError("NotAuthorizedException");
94
+ } else if (error.code === "UserNotConfirmedException") {
95
+ sessionStorage.setItem("email", JSON.stringify(email));
96
+ props.setPaso(5);
97
+ } else {
98
+ setSignInError("Error");
99
+ }
100
+ }
101
+ }
102
+ };
103
+ useEffect(() => {
104
+ sessionStorage.getItem("resetPasswordProcess") &&
105
+ sessionStorage.removeItem("resetPasswordProcess");
106
+ }, []);
107
+ useEffect(() => {
108
+ if (upgradePlanRedirect) setLoading(false);
109
+ }, [upgradePlanRedirect]);
110
+ return loading ? (
111
+ <LogoLoading />
112
+ ) : (
113
+ <>
114
+ <Container className={"home-login"}>
115
+ <div className="main-container">
116
+ <LogoImage />
117
+ <div className="credenciales">
118
+ <ScreenHeader
119
+ fontFamily={FontFamily.AvenirNext}
120
+ color={GlobalColors.s5}
121
+ text={"Ingresa tus credenciales"}
122
+ />
123
+ </div>
124
+ <div className="user">
125
+ <TagAndInput
126
+ inputType={"text"}
127
+ label={"Nombre de usuario"}
128
+ inputPlaceHolder={"username@contentoh.com"}
129
+ inputId={"emailInput"}
130
+ />
131
+ </div>
132
+ {showErrors && emptyEmail && <label>Ingrese su correo</label>}
133
+ {invalidEmail && !emptyEmail && (
134
+ <label>Ingrese un correo válido</label>
135
+ )}
136
+ <div className="password">
137
+ <TagAndInput
138
+ inputType={"password"}
139
+ label={"Contraseña"}
140
+ inputPlaceHolder={"Escribe tu contraseña"}
141
+ inputId={"passwordInput"}
142
+ />
143
+ </div>
144
+ {showErrors && emptyPassword && <label>Ingrese su contraseña</label>}
145
+ <div className="select">
146
+ <CheckBox
147
+ label={"Mantener sesión activada"}
148
+ id={"chk-default"}
149
+ className="active-left"
150
+ />
151
+ <p onClick={() => props.setPaso(10)} className="active-right">
152
+ Olvide mi contraseña
153
+ </p>
154
+ </div>
155
+ {showErrors && signInError === "NotAuthorizedException" && (
156
+ <label>Correo o contraseña incorrectos</label>
157
+ )}
158
+ {showErrors && signInError === "Error" && (
159
+ <label>Ha habido un problema al iniciar sesión</label>
160
+ )}
161
+ <div className="button-right">
162
+ <Button
163
+ buttonType={"general-default-button"}
164
+ label={"Iniciar sesión"}
165
+ onClick={(e) => validate(e)}
166
+ />
167
+ </div>
168
+ {props.registration && (
169
+ <div className="new-login">
170
+ <p
171
+ className="pre-registro"
172
+ onClick={() => {
173
+ props.setPaso(1);
174
+ sessionStorage.setItem(
175
+ "nuevoRegistro",
176
+ JSON.stringify({
177
+ name: "",
178
+ lastName: "",
179
+ email: "",
180
+ position: "",
181
+ country: "",
182
+ phone: "",
183
+ commercialName: "",
184
+ companyName: "",
185
+ rfc: "",
186
+ adress: "",
187
+ })
188
+ );
189
+ sessionStorage.setItem("countryCode", JSON.stringify("+52"));
190
+ }}
191
+ >
192
+ ¿Aún no tienes cuenta?<span> Regístrate</span>
193
+ </p>
194
+ </div>
195
+ )}
196
+ </div>
197
+ </Container>
198
+ {upgradePlanRedirect && <Redirect to={{ pathname: "/dashboard" }} />}
199
+ </>
200
+ );
201
+ };
@@ -0,0 +1,79 @@
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: 100vh;
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
+ cursor: pointer;
69
+ span {
70
+ color: ${GlobalColors.secondary_magenta};
71
+ }
72
+ }
73
+ }
74
+ }
75
+ .main-container {
76
+ max-width: 80%;
77
+ max-height: 80%;
78
+ }
79
+ `;
@@ -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,7 @@ 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,
11
+ required,
23
12
  }) => {
24
13
  return (
25
14
  <Container
@@ -32,19 +21,8 @@ export const TagAndInput = ({
32
21
  inputId={inputId}
33
22
  inputType={inputType}
34
23
  inputValue={value}
35
- index={index}
36
- isRequired={isRequired}
37
24
  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}
25
+ required={required}
48
26
  />
49
27
  </Container>
50
28
  );
@@ -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 = {};