From 64d90894dc83c40bc76432e728a531e95ea02370 Mon Sep 17 00:00:00 2001 From: Aryaman Kumar Sharma Date: Tue, 11 Mar 2025 13:01:24 +0530 Subject: [PATCH 01/31] Fix: Login/Register UI Screens --- src/Pages/Auth/Login/Login.jsx | 2 +- src/Pages/Auth/Register/Register.jsx | 10 +++++----- src/Pages/Auth/Register/StepOne/index.jsx | 2 +- src/Pages/Auth/Register/StepThree/index.jsx | 2 +- src/Pages/Auth/Register/StepTwo/index.jsx | 2 +- src/locales/gb.json | 2 ++ 6 files changed, 11 insertions(+), 9 deletions(-) diff --git a/src/Pages/Auth/Login/Login.jsx b/src/Pages/Auth/Login/Login.jsx index 60aaed6ba..c13218018 100644 --- a/src/Pages/Auth/Login/Login.jsx +++ b/src/Pages/Auth/Login/Login.jsx @@ -142,7 +142,7 @@ const Login = () => { overflow="hidden" sx={{ "& h1": { - color: theme.palette.primary.main, + color: theme.palette.primary.contrastText, fontWeight: 600, fontSize: 28, }, diff --git a/src/Pages/Auth/Register/Register.jsx b/src/Pages/Auth/Register/Register.jsx index 021cda18a..e35f70b27 100644 --- a/src/Pages/Auth/Register/Register.jsx +++ b/src/Pages/Auth/Register/Register.jsx @@ -83,7 +83,7 @@ const LandingPage = ({ isSuperAdmin, onSignup }) => { }, }} > - Terms of Service + {t("authRegisterTerms")} {" "} and{" "} { }, }} > - Privacy Policy. + {t("authRegisterPrivacy")} @@ -283,7 +283,7 @@ const Register = ({ isSuperAdmin }) => { overflow="hidden" sx={{ "& h1": { - color: theme.palette.primary.main, + color: theme.palette.primary.contrastText, fontWeight: 600, fontSize: 28, }, @@ -370,7 +370,7 @@ const Register = ({ isSuperAdmin }) => { p={theme.spacing(12)} > - {t("authRegisterAlreadyHaveAccount")} - + {t("authRegisterAlreadyHaveAccount")} { onClick={() => { navigate("/login"); }} - sx={{ userSelect: "none", color: theme.palette.primary.main }} + sx={{ userSelect: "none", color: theme.palette.accent.main }} > {t("authLoginTitle")} diff --git a/src/Pages/Auth/Register/StepOne/index.jsx b/src/Pages/Auth/Register/StepOne/index.jsx index 248f57f69..e55213b8b 100644 --- a/src/Pages/Auth/Register/StepOne/index.jsx +++ b/src/Pages/Auth/Register/StepOne/index.jsx @@ -45,7 +45,7 @@ function StepOne({ form, errors, onSubmit, onChange, onBack }) { textAlign="center" > - {t("signUp")} + {t("signUP")} {t("authRegisterStepOnePersonalDetails")} diff --git a/src/Pages/Auth/Register/StepThree/index.jsx b/src/Pages/Auth/Register/StepThree/index.jsx index eb05f843a..9b5f066d7 100644 --- a/src/Pages/Auth/Register/StepThree/index.jsx +++ b/src/Pages/Auth/Register/StepThree/index.jsx @@ -39,7 +39,7 @@ function StepThree({ onSubmit, onBack }) { textAlign="center" > - {t("signUp")} + {t("signUP")} {t("createPassword")} - {t("signUp")} + {t("signUP")} {t("enterEmail")} diff --git a/src/locales/gb.json b/src/locales/gb.json index 60d0899cb..eeb20a5d7 100644 --- a/src/locales/gb.json +++ b/src/locales/gb.json @@ -38,6 +38,8 @@ "commonAppName": "Checkmate", "authLoginEnterEmail": "Enter your email", "authRegisterTitle": "Create an account", + "authRegisterTerms": "Terms of Service", + "authRegisterPrivacy": "Privacy Policy.", "authRegisterStepOneTitle": "Create your account", "authRegisterStepOnePersonalDetails": "Enter your personal details", "authRegisterStepOneDescription": "Enter your details to get started", From 5df5cf3870054b9f184e102e5f39b1b312d5d3ff Mon Sep 17 00:00:00 2001 From: Br0wnHammer Date: Wed, 12 Mar 2025 00:56:28 +0530 Subject: [PATCH 02/31] Feat: Migrate Hardcoded Strings --- .../DistributedUptimeStatus/Create/index.jsx | 32 +++---- .../Components/TimeframeHeader/index.jsx | 8 +- .../DistributedUptimeStatus/Status/index.jsx | 24 ++--- .../Components/IncidentTable/index.jsx | 17 ++-- .../Components/OptionsHeader/index.jsx | 24 ++--- src/Pages/Infrastructure/Create/index.jsx | 38 ++++---- .../Components/AreaChartBoxes/index.jsx | 14 +-- .../Details/Components/GaugeBoxes/index.jsx | 18 ++-- .../Details/Components/StatusBoxes/index.jsx | 20 +++-- .../Details/Hooks/useHardwareUtils.jsx | 12 +-- src/Pages/Infrastructure/Details/index.jsx | 8 +- .../Components/MonitorsTable/index.jsx | 16 ++-- src/Pages/Infrastructure/Monitors/index.jsx | 8 +- src/Pages/Integrations/index.jsx | 21 +++-- src/locales/gb.json | 88 +++++++++++++++++++ 15 files changed, 231 insertions(+), 117 deletions(-) diff --git a/src/Pages/DistributedUptimeStatus/Create/index.jsx b/src/Pages/DistributedUptimeStatus/Create/index.jsx index c05d4e971..b1e54df6e 100644 --- a/src/Pages/DistributedUptimeStatus/Create/index.jsx +++ b/src/Pages/DistributedUptimeStatus/Create/index.jsx @@ -20,11 +20,13 @@ import { createToast } from "../../../Utils/toastUtils"; import { useNavigate } from "react-router-dom"; import { useMonitorsFetch } from "../../StatusPage/Create/Hooks/useMonitorsFetch"; import { useDUStatusPageFetchByUrl } from "../Status/Hooks/useDUStatusPageFetchByUrl"; +import { useTranslation } from "react-i18next"; const CreateStatus = () => { const theme = useTheme(); const { monitorId, url } = useParams(); const navigate = useNavigate(); + const { t } = useTranslation(); const isCreate = typeof url === "undefined"; const [createStatusPage, isLoading, networkError] = useCreateStatusPage(isCreate); @@ -176,7 +178,7 @@ const CreateStatus = () => { component="span" fontSize="inherit" > - {isCreate ? "Create your" : "Edit your"}{" "} + {isCreate ? t("distributedUptimeStatusCreateYour") : t("distributedUptimeStatusEditYour")}{" "} { fontSize="inherit" fontWeight="inherit" > - status page + {t("distributedUptimeStatusCreateStatusPage")} - Access + {t("distributedUptimeStatusCreateStatusPageAccess")} - If your status page is ready, you can mark it as published. + {t("distributedUptimeStatusCreateStatusPageReady")} @@ -206,9 +208,9 @@ const CreateStatus = () => { - Basic Information + {t("distributedUptimeStatusBasicInfoHeader")} - Define company name and the subdomain that your status page points to. + {t("distributedUptimeStatusBasicInfoDescription")} @@ -216,7 +218,7 @@ const CreateStatus = () => { id="companyName" name="companyName" type="text" - label="Company name" + label={t("distributedUptimeStatusCompanyNameLabel")} placeholder="Company name" value={form.companyName} onChange={handleFormChange} @@ -227,7 +229,7 @@ const CreateStatus = () => { id="url" name="url" type="url" - label="Your status page address" + label={t("distributedUptimeStatusPageAddressLabel")} disabled={!isCreate} value={form.url} onChange={handleFormChange} @@ -238,8 +240,8 @@ const CreateStatus = () => { - Logo - Upload a logo for your status page + {t("distributedUptimeStatusLogoHeader")} + {t("distributedUptimeStatusLogoDescription")} { color="accent" tabIndex={-1} > - Upload logo + {t("distributedUptimeStatusLogoUploadButton")} @@ -270,9 +272,9 @@ const CreateStatus = () => { - Standard Monitors + {t("distributedUptimeStatusStandardMonitorsHeader")} - Attach standard monitors to your status page. + {t("distributedUptimeStatusStandardMonitorsDescription")} @@ -301,7 +303,7 @@ const CreateStatus = () => { color="accent" onClick={handleSubmit} > - Save + {t("settingsSave")} diff --git a/src/Pages/DistributedUptimeStatus/Status/Components/TimeframeHeader/index.jsx b/src/Pages/DistributedUptimeStatus/Status/Components/TimeframeHeader/index.jsx index 5ec509376..7ee4ff292 100644 --- a/src/Pages/DistributedUptimeStatus/Status/Components/TimeframeHeader/index.jsx +++ b/src/Pages/DistributedUptimeStatus/Status/Components/TimeframeHeader/index.jsx @@ -1,8 +1,10 @@ import { Stack, Button, ButtonGroup } from "@mui/material"; import { useTheme } from "@emotion/react"; +import { useTranslation } from "react-i18next"; const TimeFrameHeader = ({ timeFrame, setTimeFrame, sx, ...props }) => { const theme = useTheme(); + const { t } = useTranslation(); return ( { filled={(timeFrame === 30).toString()} onClick={() => setTimeFrame(30)} > - 30 days + {t("distributedUptimeStatus30Days")} diff --git a/src/Pages/DistributedUptimeStatus/Status/index.jsx b/src/Pages/DistributedUptimeStatus/Status/index.jsx index 515bd9be5..44ca68ade 100644 --- a/src/Pages/DistributedUptimeStatus/Status/index.jsx +++ b/src/Pages/DistributedUptimeStatus/Status/index.jsx @@ -124,9 +124,9 @@ const DistributedUptimeStatus = () => { marginY={theme.spacing(4)} color={theme.palette.primary.contrastTextTertiary} > - A status page is not set up. + {t("distributedUptimeStatusPageNotSetUp")} - Please contact your administrator + {t("distributedUptimeStatusContactAdmin")} ); @@ -137,7 +137,7 @@ const DistributedUptimeStatus = () => { return ( - This status page is not public. + {t("distributedUptimeStatusPageNotPublic")} ); @@ -155,9 +155,9 @@ const DistributedUptimeStatus = () => { marginY={theme.spacing(4)} color={theme.palette.primary.contrastTextTertiary} > - Network error + {t("networkError")} - Please check your connection + {t("checkConnection")} ); } @@ -171,7 +171,7 @@ const DistributedUptimeStatus = () => { - There is no check history for this monitor yet. + {t("distributedUptimeDetailsNoMonitorHistory")} ); @@ -246,17 +246,17 @@ const DistributedUptimeStatus = () => { gap={theme.spacing(8)} > @@ -295,7 +295,7 @@ const DistributedUptimeStatus = () => {