style: Reformat code
This commit is contained in:
9 files changed
+36
-26
No files matched your search
@@ -115,7 +115,10 @@ const TeamPanel = () => {
|
|||||||
email: newEmail,
|
email: newEmail,
|
||||||
}));
|
}));
|
||||||
|
|
||||||
const validation = newOrChangedCredentials.validate({ email: newEmail }, { abortEarly: false });
|
const validation = newOrChangedCredentials.validate(
|
||||||
|
{ email: newEmail },
|
||||||
|
{ abortEarly: false }
|
||||||
|
);
|
||||||
|
|
||||||
setErrors((prev) => {
|
setErrors((prev) => {
|
||||||
const updatedErrors = { ...prev };
|
const updatedErrors = { ...prev };
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ import SunAndMoonIcon from "./SunAndMoonIcon";
|
|||||||
import { useDispatch, useSelector } from "react-redux";
|
import { useDispatch, useSelector } from "react-redux";
|
||||||
import { setMode } from "../../Features/UI/uiSlice";
|
import { setMode } from "../../Features/UI/uiSlice";
|
||||||
import "./index.css";
|
import "./index.css";
|
||||||
import {useTranslation} from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
|
|
||||||
const ThemeSwitch = ({ width = 48, height = 48, color }) => {
|
const ThemeSwitch = ({ width = 48, height = 48, color }) => {
|
||||||
const mode = useSelector((state) => state.ui.mode);
|
const mode = useSelector((state) => state.ui.mode);
|
||||||
|
|||||||
@@ -75,7 +75,10 @@ const ForgotPassword = () => {
|
|||||||
const { value } = event.target;
|
const { value } = event.target;
|
||||||
setForm({ email: value });
|
setForm({ email: value });
|
||||||
|
|
||||||
const { error } = newOrChangedCredentials.validate({ email: value }, { abortEarly: false });
|
const { error } = newOrChangedCredentials.validate(
|
||||||
|
{ email: value },
|
||||||
|
{ abortEarly: false }
|
||||||
|
);
|
||||||
|
|
||||||
if (error) setErrors({ email: error.details[0].message });
|
if (error) setErrors({ email: error.details[0].message });
|
||||||
else delete errors.email;
|
else delete errors.email;
|
||||||
|
|||||||
@@ -100,7 +100,9 @@ const NewPasswordConfirmed = () => {
|
|||||||
</IconBox>
|
</IconBox>
|
||||||
</Stack>
|
</Stack>
|
||||||
<Typography component="h1">{t("auth.forgotPassword.heading")}</Typography>
|
<Typography component="h1">{t("auth.forgotPassword.heading")}</Typography>
|
||||||
<Typography mb={theme.spacing(2)}>{t("auth.forgotPassword.subheadings.stepFour")}</Typography>
|
<Typography mb={theme.spacing(2)}>
|
||||||
|
{t("auth.forgotPassword.subheadings.stepFour")}
|
||||||
|
</Typography>
|
||||||
</Box>
|
</Box>
|
||||||
<Button
|
<Button
|
||||||
variant="contained"
|
variant="contained"
|
||||||
|
|||||||
@@ -77,9 +77,11 @@ function StepThree({ isSuperAdmin, onSubmit, onBack }) {
|
|||||||
value={form.password}
|
value={form.password}
|
||||||
onChange={handleChange}
|
onChange={handleChange}
|
||||||
error={errors.password && errors.password[0] ? true : false}
|
error={errors.password && errors.password[0] ? true : false}
|
||||||
helperText={errors.password === "auth.common.inputs.password.errors.empty"
|
helperText={
|
||||||
? t(errors.password)
|
errors.password === "auth.common.inputs.password.errors.empty"
|
||||||
: ""} // Other errors are related to required password conditions and are visualized below the input
|
? t(errors.password)
|
||||||
|
: ""
|
||||||
|
} // Other errors are related to required password conditions and are visualized below the input
|
||||||
ref={inputRef}
|
ref={inputRef}
|
||||||
/>
|
/>
|
||||||
<TextInput
|
<TextInput
|
||||||
|
|||||||
@@ -171,9 +171,11 @@ const SetNewPassword = () => {
|
|||||||
value={form.password}
|
value={form.password}
|
||||||
onChange={handleChange}
|
onChange={handleChange}
|
||||||
error={errors.password ? true : false}
|
error={errors.password ? true : false}
|
||||||
helperText={errors.password === "auth.common.inputs.password.errors.empty"
|
helperText={
|
||||||
? t(errors.password)
|
errors.password === "auth.common.inputs.password.errors.empty"
|
||||||
: ""} // Other errors are related to required password conditions and are visualized below the input
|
? t(errors.password)
|
||||||
|
: ""
|
||||||
|
} // Other errors are related to required password conditions and are visualized below the input
|
||||||
endAdornment={<PasswordEndAdornment />}
|
endAdornment={<PasswordEndAdornment />}
|
||||||
/>
|
/>
|
||||||
</Box>
|
</Box>
|
||||||
@@ -217,12 +219,16 @@ const SetNewPassword = () => {
|
|||||||
variant={feedbacks.number}
|
variant={feedbacks.number}
|
||||||
/>
|
/>
|
||||||
<Check
|
<Check
|
||||||
noHighlightText={t("auth.common.inputs.password.rules.uppercase.beginning")}
|
noHighlightText={t(
|
||||||
|
"auth.common.inputs.password.rules.uppercase.beginning"
|
||||||
|
)}
|
||||||
text={t("auth.common.inputs.password.rules.uppercase.highlighted")}
|
text={t("auth.common.inputs.password.rules.uppercase.highlighted")}
|
||||||
variant={feedbacks.uppercase}
|
variant={feedbacks.uppercase}
|
||||||
/>
|
/>
|
||||||
<Check
|
<Check
|
||||||
noHighlightText={t("auth.common.inputs.password.rules.lowercase.beginning")}
|
noHighlightText={t(
|
||||||
|
"auth.common.inputs.password.rules.lowercase.beginning"
|
||||||
|
)}
|
||||||
text={t("auth.common.inputs.password.rules.lowercase.highlighted")}
|
text={t("auth.common.inputs.password.rules.lowercase.highlighted")}
|
||||||
variant={feedbacks.lowercase}
|
variant={feedbacks.lowercase}
|
||||||
/>
|
/>
|
||||||
|
|||||||
@@ -20,7 +20,9 @@ const SettingsAbout = () => {
|
|||||||
</Typography>
|
</Typography>
|
||||||
</Box>
|
</Box>
|
||||||
<Box>
|
<Box>
|
||||||
<Typography component="h2">{t("common.appName")} {2.1}</Typography>
|
<Typography component="h2">
|
||||||
|
{t("common.appName")} {2.1}
|
||||||
|
</Typography>
|
||||||
<Typography sx={{ mt: theme.spacing(2), mb: theme.spacing(6), opacity: 0.6 }}>
|
<Typography sx={{ mt: theme.spacing(2), mb: theme.spacing(6), opacity: 0.6 }}>
|
||||||
{t("settingsDevelopedBy")}
|
{t("settingsDevelopedBy")}
|
||||||
</Typography>
|
</Typography>
|
||||||
|
|||||||
@@ -105,11 +105,9 @@ const loginCredentials = joi.object({
|
|||||||
"string.empty": "auth.common.inputs.email.errors.empty",
|
"string.empty": "auth.common.inputs.email.errors.empty",
|
||||||
"string.email": "auth.common.inputs.email.errors.invalid",
|
"string.email": "auth.common.inputs.email.errors.invalid",
|
||||||
}),
|
}),
|
||||||
password: joi
|
password: joi.string().messages({
|
||||||
.string()
|
"string.empty": "auth.common.inputs.password.errors.empty",
|
||||||
.messages({
|
}),
|
||||||
"string.empty": "auth.common.inputs.password.errors.empty",
|
|
||||||
}),
|
|
||||||
});
|
});
|
||||||
|
|
||||||
const monitorValidation = joi.object({
|
const monitorValidation = joi.object({
|
||||||
|
|||||||
@@ -22,14 +22,8 @@ const passwordPattern =
|
|||||||
/^(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[!?@#$%^&*()\-_=+[\]{};:'",.<>~`|\\/])[A-Za-z0-9!?@#$%^&*()\-_=+[\]{};:'",.<>~`|\\/]+$/;
|
/^(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[!?@#$%^&*()\-_=+[\]{};:'",.<>~`|\\/])[A-Za-z0-9!?@#$%^&*()\-_=+[\]{};:'",.<>~`|\\/]+$/;
|
||||||
|
|
||||||
const loginValidation = joi.object({
|
const loginValidation = joi.object({
|
||||||
email: joi
|
email: joi.string().email().required().lowercase(),
|
||||||
.string()
|
password: joi.string().required(),
|
||||||
.email()
|
|
||||||
.required()
|
|
||||||
.lowercase(),
|
|
||||||
password: joi
|
|
||||||
.string()
|
|
||||||
.required(),
|
|
||||||
});
|
});
|
||||||
const nameValidation = joi
|
const nameValidation = joi
|
||||||
.string()
|
.string()
|
||||||
|
|||||||
Reference in new issue
Block a user