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

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
+30 -19
View File
@@ -348,14 +348,15 @@ const Settings = () => {
</ConfigBox> </ConfigBox>
)} )}
{isAdmin && ( {isAdmin && (
<ConfigBox> <>
<Box> {/* Demo Monitors Section */}
<Typography component="h1">{t("settingsDemoMonitors")}</Typography> <ConfigBox>
<Typography sx={{ mt: theme.spacing(2) }}> <Box>
{t("settingsDemoMonitorsDescription")} <Typography component="h1">{t("settingsDemoMonitors")}</Typography>
</Typography> <Typography sx={{ mt: theme.spacing(2) }}>
</Box> {t("settingsDemoMonitorsDescription")}
<Stack gap={theme.spacing(20)}> </Typography>
</Box>
<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,17 +393,17 @@ const Settings = () => {
{t("settingsRemoveAllMonitorsButton")} {t("settingsRemoveAllMonitorsButton")}
</Button> </Button>
</Box> </Box>
</Stack> <Dialog
<Dialog open={isOpen.deleteMonitors}
open={isOpen.deleteMonitors} theme={theme}
theme={theme} title={t("settingsRemoveAllMonitorsDialogTitle")}
title={t("settingsRemoveAllMonitorsDialogTitle")} onCancel={() => setIsOpen(deleteStatsMonitorsInitState)}
onCancel={() => setIsOpen(deleteStatsMonitorsInitState)} confirmationButtonLabel={t("settingsRemoveAllMonitorsDialogConfirm")}
confirmationButtonLabel={t("settingsRemoveAllMonitorsDialogConfirm")} onConfirm={handleDeleteAllMonitors}
onConfirm={handleDeleteAllMonitors} 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"
}), }),
}); });