This commit is contained in:
mohadeseh safari committed 2025-05-06 22:15:27 -04:00
1 parent 74b1d3e245
commit 9a5de71158
3 files changed
+21 -8

No files matched your search

@@ -68,7 +68,7 @@ function StepTwo({ form, errors, onSubmit, onChange, onBack }) {
onInput={(e) => (e.target.value = e.target.value.toLowerCase())} onInput={(e) => (e.target.value = e.target.value.toLowerCase())}
onChange={onChange} onChange={onChange}
error={errors.email ? true : false} 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} ref={inputRef}
/> />
<Stack <Stack
+13 -2
View File
@@ -348,6 +348,8 @@ const Settings = () => {
</ConfigBox> </ConfigBox>
)} )}
{isAdmin && ( {isAdmin && (
<>
{/* Demo Monitors Section */}
<ConfigBox> <ConfigBox>
<Box> <Box>
<Typography component="h1">{t("settingsDemoMonitors")}</Typography> <Typography component="h1">{t("settingsDemoMonitors")}</Typography>
@@ -355,7 +357,6 @@ const Settings = () => {
{t("settingsDemoMonitorsDescription")} {t("settingsDemoMonitorsDescription")}
</Typography> </Typography>
</Box> </Box>
<Stack gap={theme.spacing(20)}>
<Box> <Box>
<Typography>{t("settingsAddDemoMonitors")}</Typography> <Typography>{t("settingsAddDemoMonitors")}</Typography>
<Button <Button
@@ -368,6 +369,16 @@ const Settings = () => {
{t("settingsAddDemoMonitorsButton")} {t("settingsAddDemoMonitorsButton")}
</Button> </Button>
</Box> </Box>
</ConfigBox>
{/* System Reset Section */}
<ConfigBox>
<Box>
<Typography component="h1">{t("settingsSystemReset")}</Typography>
<Typography sx={{ mt: theme.spacing(2) }}>
{t("settingsSystemResetDescription")}
</Typography>
</Box>
<Box> <Box>
<Typography>{t("settingsRemoveAllMonitors")}</Typography> <Typography>{t("settingsRemoveAllMonitors")}</Typography>
<Button <Button
@@ -382,7 +393,6 @@ const Settings = () => {
{t("settingsRemoveAllMonitorsButton")} {t("settingsRemoveAllMonitorsButton")}
</Button> </Button>
</Box> </Box>
</Stack>
<Dialog <Dialog
open={isOpen.deleteMonitors} open={isOpen.deleteMonitors}
theme={theme} theme={theme}
@@ -393,6 +403,7 @@ const Settings = () => {
isLoading={isLoading || authIsLoading || checksIsLoading} isLoading={isLoading || authIsLoading || checksIsLoading}
/> />
</ConfigBox> </ConfigBox>
</>
)} )}
<ConfigBox> <ConfigBox>
+7 -5
View File
@@ -10,8 +10,8 @@ const nameSchema = joi
.pattern(/^[\p{L}\p{M}''\- ]+$/u) .pattern(/^[\p{L}\p{M}''\- ]+$/u)
.messages({ .messages({
"string.empty": "Name is required", "string.empty": "Name is required",
"string.max": "Name must be less than 50 characters", "string.max": "Name should be less than 50 characters",
"string.pattern.base": "Name must contain only letters, spaces, apostrophes, or hyphens" "string.pattern.base": "Please use only letters, spaces, apostrophes, or hyphens"
}); });
const passwordSchema = joi const passwordSchema = joi
@@ -66,8 +66,8 @@ const credentials = joi.object({
return lowercasedValue; return lowercasedValue;
}) })
.messages({ .messages({
"string.empty": "Email is required", "string.empty": "authRegisterEmailRequired",
"string.email": "Must be a valid email address", "string.email": "authRegisterEmailInvalid",
}), }),
password: passwordSchema, password: passwordSchema,
newPassword: passwordSchema, newPassword: passwordSchema,
@@ -253,7 +253,9 @@ const statusPageValidation = joi.object({
}); });
const settingsValidation = joi.object({ const settingsValidation = joi.object({
ttl: joi.number().required().messages({ 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"
}), }),
}); });