contentoh-components-library 21.0.49 → 21.0.52
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.
- package/dist/components/molecules/EmailResetPasswordLogin/index.js +1 -1
- package/dist/components/molecules/RegistrationThirdStep/index.js +11 -3
- package/dist/components/molecules/SignInLogin/index.js +1 -1
- package/dist/components/molecules/SignInLoginCreationApp/index.js +10 -12
- package/dist/components/organisms/ChangePassword/styles.js +1 -1
- package/package.json +1 -1
- package/src/components/molecules/EmailResetPasswordLogin/index.js +1 -1
- package/src/components/molecules/RegistrationThirdStep/index.js +11 -3
- package/src/components/molecules/SignInLogin/index.js +1 -1
- package/src/components/molecules/SignInLoginCreationApp/index.js +7 -10
- package/src/components/organisms/ChangePassword/styles.js +1 -1
|
@@ -62,7 +62,7 @@ var EmailResetPasswordLogin = function EmailResetPasswordLogin(props) {
|
|
|
62
62
|
valid = true;
|
|
63
63
|
setShowErrors(true);
|
|
64
64
|
e.preventDefault();
|
|
65
|
-
email = document.querySelector("#emailInput").value;
|
|
65
|
+
email = document.querySelector("#emailInput").value.trim();
|
|
66
66
|
email === "" ? setEmptyEmail(true) : setEmptyEmail(false);
|
|
67
67
|
!/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*$/.test(email) ? setInvalidEmail(true) : setInvalidEmail(false);
|
|
68
68
|
emptyEmail && (valid = false);
|
|
@@ -27,7 +27,7 @@ var _GeneralButton = require("../../atoms/GeneralButton");
|
|
|
27
27
|
|
|
28
28
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
29
29
|
|
|
30
|
-
var RegistrationThirdStep = function RegistrationThirdStep() {
|
|
30
|
+
var RegistrationThirdStep = function RegistrationThirdStep(props) {
|
|
31
31
|
var _useState = (0, _react.useState)(false),
|
|
32
32
|
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
33
33
|
emptyCommercialName = _useState2[0],
|
|
@@ -48,6 +48,8 @@ var RegistrationThirdStep = function RegistrationThirdStep() {
|
|
|
48
48
|
emptyFiscalAddress = _useState8[0],
|
|
49
49
|
setEmptyFiscalAddress = _useState8[1];
|
|
50
50
|
|
|
51
|
+
var nuevoRegistro = JSON.parse(sessionStorage.getItem("nuevoRegistro"));
|
|
52
|
+
|
|
51
53
|
var validate = function validate(e) {
|
|
52
54
|
e.preventDefault();
|
|
53
55
|
var valid = true;
|
|
@@ -64,8 +66,14 @@ var RegistrationThirdStep = function RegistrationThirdStep() {
|
|
|
64
66
|
valid = false;
|
|
65
67
|
}
|
|
66
68
|
|
|
67
|
-
|
|
68
|
-
|
|
69
|
+
if (valid) {
|
|
70
|
+
nuevoRegistro.commercialName = commercialName;
|
|
71
|
+
nuevoRegistro.companyName = bussinesName;
|
|
72
|
+
nuevoRegistro.rfc = RFC;
|
|
73
|
+
nuevoRegistro.adress = FiscalAddress;
|
|
74
|
+
sessionStorage.setItem("nuevoRegistro", JSON.stringify(nuevoRegistro));
|
|
75
|
+
props.setPaso(props.paso + 1);
|
|
76
|
+
}
|
|
69
77
|
};
|
|
70
78
|
|
|
71
79
|
var loginRight = [/*#__PURE__*/(0, _jsxRuntime.jsx)(_LogoImage.LogoImage, {}, "1"), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
@@ -84,7 +84,7 @@ var SignInLogin = function SignInLogin(props) {
|
|
|
84
84
|
setShowErrors(true);
|
|
85
85
|
e.preventDefault();
|
|
86
86
|
valid = true;
|
|
87
|
-
email = document.querySelector("#emailInput").value;
|
|
87
|
+
email = document.querySelector("#emailInput").value.trim();
|
|
88
88
|
password = document.querySelector("#passwordInput").value;
|
|
89
89
|
!/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*$/.test(email) ? setInvalidEmail(true) : setInvalidEmail(false);
|
|
90
90
|
|
|
@@ -80,11 +80,11 @@ var SignInLoginCreationApp = function SignInLoginCreationApp(props) {
|
|
|
80
80
|
while (1) {
|
|
81
81
|
switch (_context.prev = _context.next) {
|
|
82
82
|
case 0:
|
|
83
|
+
e.preventDefault();
|
|
83
84
|
setSignInError("");
|
|
84
85
|
setShowErrors(true);
|
|
85
|
-
e.preventDefault();
|
|
86
86
|
valid = true;
|
|
87
|
-
email = document.querySelector("#emailInput").value;
|
|
87
|
+
email = document.querySelector("#emailInput").value.trim();
|
|
88
88
|
password = document.querySelector("#passwordInput").value;
|
|
89
89
|
!/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*$/.test(email) ? setInvalidEmail(true) : setInvalidEmail(false);
|
|
90
90
|
|
|
@@ -103,14 +103,14 @@ var SignInLoginCreationApp = function SignInLoginCreationApp(props) {
|
|
|
103
103
|
}
|
|
104
104
|
|
|
105
105
|
if (!valid) {
|
|
106
|
-
_context.next =
|
|
106
|
+
_context.next = 33;
|
|
107
107
|
break;
|
|
108
108
|
}
|
|
109
109
|
|
|
110
110
|
_context.prev = 10;
|
|
111
111
|
setLoading(true);
|
|
112
112
|
_context.next = 14;
|
|
113
|
-
return
|
|
113
|
+
return Auth.signIn(email, password);
|
|
114
114
|
|
|
115
115
|
case 14:
|
|
116
116
|
session = _context.sent;
|
|
@@ -138,11 +138,12 @@ var SignInLoginCreationApp = function SignInLoginCreationApp(props) {
|
|
|
138
138
|
response = _context.sent;
|
|
139
139
|
userGroupValue = typeof userGroup === "string" ? userGroup : userGroup[0];
|
|
140
140
|
|
|
141
|
-
if (userGroupValue === "
|
|
141
|
+
if (userGroupValue === "colaboradores_contentoh") {
|
|
142
142
|
sessionStorage.setItem("auth", true);
|
|
143
143
|
sessionStorage.setItem("jwt", session.signInUserSession.idToken.jwtToken);
|
|
144
144
|
user = JSON.parse(response.data.body).data[0];
|
|
145
|
-
company = JSON.parse(response.data.body).data[1];
|
|
145
|
+
company = JSON.parse(response.data.body).data[1]; // const picture = getProfilePicture(user.id_user, 83, 83);
|
|
146
|
+
|
|
146
147
|
caches.keys().then(function (names) {
|
|
147
148
|
names.forEach(function (name) {
|
|
148
149
|
caches.delete(name);
|
|
@@ -158,7 +159,7 @@ var SignInLoginCreationApp = function SignInLoginCreationApp(props) {
|
|
|
158
159
|
}
|
|
159
160
|
|
|
160
161
|
case 26:
|
|
161
|
-
_context.next =
|
|
162
|
+
_context.next = 33;
|
|
162
163
|
break;
|
|
163
164
|
|
|
164
165
|
case 28:
|
|
@@ -166,20 +167,17 @@ var SignInLoginCreationApp = function SignInLoginCreationApp(props) {
|
|
|
166
167
|
_context.t0 = _context["catch"](10);
|
|
167
168
|
console.log(_context.t0);
|
|
168
169
|
setLoading(false);
|
|
169
|
-
console.log("error 1");
|
|
170
170
|
|
|
171
171
|
if (_context.t0.code === "NotAuthorizedException") {
|
|
172
172
|
setSignInError("NotAuthorizedException");
|
|
173
173
|
} else if (_context.t0.code === "UserNotConfirmedException") {
|
|
174
|
-
sessionStorage.setItem("email", JSON.stringify(document.querySelector("#usernameInput").value
|
|
175
|
-
sessionStorage.setItem("email", JSON.stringify(email));
|
|
174
|
+
sessionStorage.setItem("email", JSON.stringify(document.querySelector("#usernameInput").value));
|
|
176
175
|
props.setPaso(5);
|
|
177
176
|
} else {
|
|
178
177
|
setSignInError("Error");
|
|
179
|
-
console.log("error 2");
|
|
180
178
|
}
|
|
181
179
|
|
|
182
|
-
case
|
|
180
|
+
case 33:
|
|
183
181
|
case "end":
|
|
184
182
|
return _context.stop();
|
|
185
183
|
}
|
|
@@ -13,6 +13,6 @@ var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
|
13
13
|
|
|
14
14
|
var _templateObject;
|
|
15
15
|
|
|
16
|
-
var Container = _styledComponents.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n width: 50%;\n height: 100vh;\n .button-center {\n position: absolute;\n bottom: 13%;\n left:
|
|
16
|
+
var Container = _styledComponents.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n width: 50%;\n height: 100vh;\n .button-center {\n position: absolute;\n bottom: 13%;\n left: 67%;\n .general-default-button {\n width: 160px;\n }\n }\n"])));
|
|
17
17
|
|
|
18
18
|
exports.Container = Container;
|
package/package.json
CHANGED
|
@@ -17,7 +17,7 @@ export const EmailResetPasswordLogin = (props) => {
|
|
|
17
17
|
let valid = true;
|
|
18
18
|
setShowErrors(true);
|
|
19
19
|
e.preventDefault();
|
|
20
|
-
const email = document.querySelector("#emailInput").value;
|
|
20
|
+
const email = document.querySelector("#emailInput").value.trim();
|
|
21
21
|
email === "" ? setEmptyEmail(true) : setEmptyEmail(false);
|
|
22
22
|
!/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*$/.test(
|
|
23
23
|
email
|
|
@@ -7,12 +7,14 @@ import { GlobalColors, FontFamily } from "../../../global-files/variables";
|
|
|
7
7
|
import { TagAndInput } from "../../molecules/TagAndInput";
|
|
8
8
|
import { Button } from "../../atoms/GeneralButton";
|
|
9
9
|
|
|
10
|
-
export const RegistrationThirdStep = () => {
|
|
10
|
+
export const RegistrationThirdStep = (props) => {
|
|
11
11
|
const [emptyCommercialName, setEmptyCommercialName] = useState(false);
|
|
12
12
|
const [emptyBussinesName, setEmptyBussinesName] = useState(false);
|
|
13
13
|
const [emptyRFC, setEmptyRFC] = useState(false);
|
|
14
14
|
const [emptyFiscalAddress, setEmptyFiscalAddress] = useState(false);
|
|
15
15
|
|
|
16
|
+
let nuevoRegistro = JSON.parse(sessionStorage.getItem("nuevoRegistro"));
|
|
17
|
+
|
|
16
18
|
const validate = (e) => {
|
|
17
19
|
e.preventDefault();
|
|
18
20
|
let valid = true;
|
|
@@ -38,8 +40,14 @@ export const RegistrationThirdStep = () => {
|
|
|
38
40
|
) {
|
|
39
41
|
valid = false;
|
|
40
42
|
}
|
|
41
|
-
|
|
42
|
-
|
|
43
|
+
if (valid) {
|
|
44
|
+
nuevoRegistro.commercialName = commercialName;
|
|
45
|
+
nuevoRegistro.companyName = bussinesName;
|
|
46
|
+
nuevoRegistro.rfc = RFC;
|
|
47
|
+
nuevoRegistro.adress = FiscalAddress;
|
|
48
|
+
sessionStorage.setItem("nuevoRegistro", JSON.stringify(nuevoRegistro));
|
|
49
|
+
props.setPaso(props.paso + 1);
|
|
50
|
+
}
|
|
43
51
|
};
|
|
44
52
|
|
|
45
53
|
const loginRight = [
|
|
@@ -23,7 +23,7 @@ export const SignInLogin = (props) => {
|
|
|
23
23
|
setShowErrors(true);
|
|
24
24
|
e.preventDefault();
|
|
25
25
|
let valid = true;
|
|
26
|
-
const email = document.querySelector("#emailInput").value;
|
|
26
|
+
const email = document.querySelector("#emailInput").value.trim();
|
|
27
27
|
const password = document.querySelector("#passwordInput").value;
|
|
28
28
|
!/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*$/.test(
|
|
29
29
|
email
|
|
@@ -19,11 +19,11 @@ export const SignInLoginCreationApp = (props) => {
|
|
|
19
19
|
const [loading, setLoading] = useState(false);
|
|
20
20
|
const [upgradePlanRedirect, setUpgradePlanRedirect] = useState(false);
|
|
21
21
|
const validate = async (e) => {
|
|
22
|
+
e.preventDefault();
|
|
22
23
|
setSignInError("");
|
|
23
24
|
setShowErrors(true);
|
|
24
|
-
e.preventDefault();
|
|
25
25
|
let valid = true;
|
|
26
|
-
const email = document.querySelector("#emailInput").value;
|
|
26
|
+
const email = document.querySelector("#emailInput").value.trim();
|
|
27
27
|
const password = document.querySelector("#passwordInput").value;
|
|
28
28
|
!/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*$/.test(
|
|
29
29
|
email
|
|
@@ -45,7 +45,7 @@ export const SignInLoginCreationApp = (props) => {
|
|
|
45
45
|
if (valid) {
|
|
46
46
|
try {
|
|
47
47
|
setLoading(true);
|
|
48
|
-
const session = await
|
|
48
|
+
const session = await Auth.signIn(email, password);
|
|
49
49
|
if (session.challengeName === "NEW_PASSWORD_REQUIRED") {
|
|
50
50
|
props.setUser(session);
|
|
51
51
|
props.setPaso(8);
|
|
@@ -60,9 +60,10 @@ export const SignInLoginCreationApp = (props) => {
|
|
|
60
60
|
},
|
|
61
61
|
}
|
|
62
62
|
);
|
|
63
|
+
|
|
63
64
|
const userGroupValue =
|
|
64
65
|
typeof userGroup === "string" ? userGroup : userGroup[0];
|
|
65
|
-
if (userGroupValue === "
|
|
66
|
+
if (userGroupValue === "colaboradores_contentoh") {
|
|
66
67
|
sessionStorage.setItem("auth", true);
|
|
67
68
|
sessionStorage.setItem(
|
|
68
69
|
"jwt",
|
|
@@ -70,6 +71,7 @@ export const SignInLoginCreationApp = (props) => {
|
|
|
70
71
|
);
|
|
71
72
|
const user = JSON.parse(response.data.body).data[0];
|
|
72
73
|
const company = JSON.parse(response.data.body).data[1];
|
|
74
|
+
// const picture = getProfilePicture(user.id_user, 83, 83);
|
|
73
75
|
caches.keys().then((names) => {
|
|
74
76
|
names.forEach((name) => {
|
|
75
77
|
caches.delete(name);
|
|
@@ -91,21 +93,16 @@ export const SignInLoginCreationApp = (props) => {
|
|
|
91
93
|
} catch (error) {
|
|
92
94
|
console.log(error);
|
|
93
95
|
setLoading(false);
|
|
94
|
-
console.log("error 1");
|
|
95
96
|
if (error.code === "NotAuthorizedException") {
|
|
96
97
|
setSignInError("NotAuthorizedException");
|
|
97
98
|
} else if (error.code === "UserNotConfirmedException") {
|
|
98
99
|
sessionStorage.setItem(
|
|
99
100
|
"email",
|
|
100
|
-
JSON.stringify(
|
|
101
|
-
document.querySelector("#usernameInput").value.trim()
|
|
102
|
-
)
|
|
101
|
+
JSON.stringify(document.querySelector("#usernameInput").value)
|
|
103
102
|
);
|
|
104
|
-
sessionStorage.setItem("email", JSON.stringify(email));
|
|
105
103
|
props.setPaso(5);
|
|
106
104
|
} else {
|
|
107
105
|
setSignInError("Error");
|
|
108
|
-
console.log("error 2");
|
|
109
106
|
}
|
|
110
107
|
}
|
|
111
108
|
}
|