From 9a5de71158f68be93976a6954df548d21e1f7981 Mon Sep 17 00:00:00 2001 From: mohadeseh safari Date: Tue, 6 May 2025 22:15:27 -0400 Subject: [PATCH] Fix --- .../src/Pages/Auth/Register/StepTwo/index.jsx | 2 +- client/src/Pages/Settings/index.jsx | 49 ++++++++++++------- client/src/Validation/validation.js | 12 +++-- 3 files changed, 38 insertions(+), 25 deletions(-) diff --git a/client/src/Pages/Auth/Register/StepTwo/index.jsx b/client/src/Pages/Auth/Register/StepTwo/index.jsx index d40ff161f..fbd7e70c1 100644 --- a/client/src/Pages/Auth/Register/StepTwo/index.jsx +++ b/client/src/Pages/Auth/Register/StepTwo/index.jsx @@ -68,7 +68,7 @@ function StepTwo({ form, errors, onSubmit, onChange, onBack }) { onInput={(e) => (e.target.value = e.target.value.toLowerCase())} onChange={onChange} error={errors.email ? true : false} - helperText={errors.email && t("authRegisterEmailRequired")} + helperText={errors.email && (errors.email === "Email is required" ? t("authRegisterEmailRequired") : errors.email === "Must be a valid email address" ? t("authRegisterEmailInvalid") : errors.email)} ref={inputRef} /> { )} {isAdmin && ( - - - {t("settingsDemoMonitors")} - - {t("settingsDemoMonitorsDescription")} - - - + <> + {/* Demo Monitors Section */} + + + {t("settingsDemoMonitors")} + + {t("settingsDemoMonitorsDescription")} + + {t("settingsAddDemoMonitors")} + + + {/* System Reset Section */} + + + {t("settingsSystemReset")} + + {t("settingsSystemResetDescription")} + + {t("settingsRemoveAllMonitors")} - - setIsOpen(deleteStatsMonitorsInitState)} - confirmationButtonLabel={t("settingsRemoveAllMonitorsDialogConfirm")} - onConfirm={handleDeleteAllMonitors} - isLoading={isLoading || authIsLoading || checksIsLoading} - /> - + setIsOpen(deleteStatsMonitorsInitState)} + confirmationButtonLabel={t("settingsRemoveAllMonitorsDialogConfirm")} + onConfirm={handleDeleteAllMonitors} + isLoading={isLoading || authIsLoading || checksIsLoading} + /> + + )} diff --git a/client/src/Validation/validation.js b/client/src/Validation/validation.js index 38092c9e6..23e14b84b 100644 --- a/client/src/Validation/validation.js +++ b/client/src/Validation/validation.js @@ -10,8 +10,8 @@ const nameSchema = joi .pattern(/^[\p{L}\p{M}''\- ]+$/u) .messages({ "string.empty": "Name is required", - "string.max": "Name must be less than 50 characters", - "string.pattern.base": "Name must contain only letters, spaces, apostrophes, or hyphens" + "string.max": "Name should be less than 50 characters", + "string.pattern.base": "Please use only letters, spaces, apostrophes, or hyphens" }); const passwordSchema = joi @@ -66,8 +66,8 @@ const credentials = joi.object({ return lowercasedValue; }) .messages({ - "string.empty": "Email is required", - "string.email": "Must be a valid email address", + "string.empty": "authRegisterEmailRequired", + "string.email": "authRegisterEmailInvalid", }), password: passwordSchema, newPassword: passwordSchema, @@ -253,7 +253,9 @@ const statusPageValidation = joi.object({ }); const settingsValidation = joi.object({ ttl: joi.number().required().messages({ - "string.empty": "TTL is required", + "string.empty": "Please enter a value", + "number.base": "Please enter a valid number", + "any.required": "Please enter a value" }), });