From 89bc2a9293ca15a099375bb68132f285d0400fd6 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michal=20=C5=A0mahel?=
<48548230+ceskyDJ@users.noreply.github.com>
Date: Sun, 8 Jun 2025 16:33:12 +0200
Subject: [PATCH] style: Reformat code
---
.../Components/TabPanels/Account/TeamPanel.jsx | 5 ++++-
client/src/Components/ThemeSwitch/index.jsx | 2 +-
client/src/Pages/Auth/ForgotPassword.jsx | 5 ++++-
client/src/Pages/Auth/NewPasswordConfirmed.jsx | 4 +++-
.../src/Pages/Auth/Register/StepThree/index.jsx | 8 +++++---
client/src/Pages/Auth/SetNewPassword.jsx | 16 +++++++++++-----
client/src/Pages/Settings/SettingsAbout.jsx | 4 +++-
client/src/Validation/validation.js | 8 +++-----
server/validation/joi.js | 10 ++--------
9 files changed, 36 insertions(+), 26 deletions(-)
diff --git a/client/src/Components/TabPanels/Account/TeamPanel.jsx b/client/src/Components/TabPanels/Account/TeamPanel.jsx
index 52e3ea9ee..341f84ba7 100644
--- a/client/src/Components/TabPanels/Account/TeamPanel.jsx
+++ b/client/src/Components/TabPanels/Account/TeamPanel.jsx
@@ -115,7 +115,10 @@ const TeamPanel = () => {
email: newEmail,
}));
- const validation = newOrChangedCredentials.validate({ email: newEmail }, { abortEarly: false });
+ const validation = newOrChangedCredentials.validate(
+ { email: newEmail },
+ { abortEarly: false }
+ );
setErrors((prev) => {
const updatedErrors = { ...prev };
diff --git a/client/src/Components/ThemeSwitch/index.jsx b/client/src/Components/ThemeSwitch/index.jsx
index d1a7661bc..5efb17419 100644
--- a/client/src/Components/ThemeSwitch/index.jsx
+++ b/client/src/Components/ThemeSwitch/index.jsx
@@ -14,7 +14,7 @@ import SunAndMoonIcon from "./SunAndMoonIcon";
import { useDispatch, useSelector } from "react-redux";
import { setMode } from "../../Features/UI/uiSlice";
import "./index.css";
-import {useTranslation} from "react-i18next";
+import { useTranslation } from "react-i18next";
const ThemeSwitch = ({ width = 48, height = 48, color }) => {
const mode = useSelector((state) => state.ui.mode);
diff --git a/client/src/Pages/Auth/ForgotPassword.jsx b/client/src/Pages/Auth/ForgotPassword.jsx
index 3ab6913dd..2a887756e 100644
--- a/client/src/Pages/Auth/ForgotPassword.jsx
+++ b/client/src/Pages/Auth/ForgotPassword.jsx
@@ -75,7 +75,10 @@ const ForgotPassword = () => {
const { value } = event.target;
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 });
else delete errors.email;
diff --git a/client/src/Pages/Auth/NewPasswordConfirmed.jsx b/client/src/Pages/Auth/NewPasswordConfirmed.jsx
index aba1fefea..db03f7de3 100644
--- a/client/src/Pages/Auth/NewPasswordConfirmed.jsx
+++ b/client/src/Pages/Auth/NewPasswordConfirmed.jsx
@@ -100,7 +100,9 @@ const NewPasswordConfirmed = () => {
{t("auth.forgotPassword.heading")}
- {t("auth.forgotPassword.subheadings.stepFour")}
+
+ {t("auth.forgotPassword.subheadings.stepFour")}
+
{
value={form.password}
onChange={handleChange}
error={errors.password ? true : false}
- helperText={errors.password === "auth.common.inputs.password.errors.empty"
- ? t(errors.password)
- : ""} // Other errors are related to required password conditions and are visualized below the input
+ helperText={
+ errors.password === "auth.common.inputs.password.errors.empty"
+ ? t(errors.password)
+ : ""
+ } // Other errors are related to required password conditions and are visualized below the input
endAdornment={}
/>
@@ -217,12 +219,16 @@ const SetNewPassword = () => {
variant={feedbacks.number}
/>
diff --git a/client/src/Pages/Settings/SettingsAbout.jsx b/client/src/Pages/Settings/SettingsAbout.jsx
index fd11df3ad..6acadd444 100644
--- a/client/src/Pages/Settings/SettingsAbout.jsx
+++ b/client/src/Pages/Settings/SettingsAbout.jsx
@@ -20,7 +20,9 @@ const SettingsAbout = () => {
- {t("common.appName")} {2.1}
+
+ {t("common.appName")} {2.1}
+
{t("settingsDevelopedBy")}
diff --git a/client/src/Validation/validation.js b/client/src/Validation/validation.js
index 1074f3bb2..2826605c8 100644
--- a/client/src/Validation/validation.js
+++ b/client/src/Validation/validation.js
@@ -105,11 +105,9 @@ const loginCredentials = joi.object({
"string.empty": "auth.common.inputs.email.errors.empty",
"string.email": "auth.common.inputs.email.errors.invalid",
}),
- password: joi
- .string()
- .messages({
- "string.empty": "auth.common.inputs.password.errors.empty",
- }),
+ password: joi.string().messages({
+ "string.empty": "auth.common.inputs.password.errors.empty",
+ }),
});
const monitorValidation = joi.object({
diff --git a/server/validation/joi.js b/server/validation/joi.js
index 9a3c61a7c..9024c26a4 100755
--- a/server/validation/joi.js
+++ b/server/validation/joi.js
@@ -22,14 +22,8 @@ const passwordPattern =
/^(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[!?@#$%^&*()\-_=+[\]{};:'",.<>~`|\\/])[A-Za-z0-9!?@#$%^&*()\-_=+[\]{};:'",.<>~`|\\/]+$/;
const loginValidation = joi.object({
- email: joi
- .string()
- .email()
- .required()
- .lowercase(),
- password: joi
- .string()
- .required(),
+ email: joi.string().email().required().lowercase(),
+ password: joi.string().required(),
});
const nameValidation = joi
.string()