diff --git a/Client/src/Pages/Auth/CheckEmail.jsx b/Client/src/Pages/Auth/CheckEmail.jsx index 0ede66831..4a0daf68a 100644 --- a/Client/src/Pages/Auth/CheckEmail.jsx +++ b/Client/src/Pages/Auth/CheckEmail.jsx @@ -145,7 +145,7 @@ const CheckEmail = () => { }} /> - Didn't receive the email?{" "} + Didn't receive the email?{" "} { Forgot password? - No worries, we'll send you reset instructions. + No worries, we'll send you reset instructions. diff --git a/Client/src/Pages/Auth/Login.jsx b/Client/src/Pages/Auth/Login.jsx index 79e8d7e12..00de688f6 100644 --- a/Client/src/Pages/Auth/Login.jsx +++ b/Client/src/Pages/Auth/Login.jsx @@ -427,7 +427,9 @@ const Login = () => { )} - Don't have an account? — + + Don't have an account? — + { ); }; +LandingPage.propTypes = { + isAdmin: PropTypes.bool, + onSignup: PropTypes.func, +}; + /** * Renders the first step of the sign up process. * @@ -152,6 +157,14 @@ const StepOne = ({ form, errors, onSubmit, onChange, onBack }) => { ); }; +StepOne.propTypes = { + form: PropTypes.object, + errors: PropTypes.object, + onSubmit: PropTypes.func, + onChange: PropTypes.func, + onBack: PropTypes.func, +}; + /** * Renders the second step of the sign up process. * @@ -224,6 +237,14 @@ const StepTwo = ({ form, errors, onSubmit, onChange, onBack }) => { ); }; +StepTwo.propTypes = { + form: PropTypes.object, + errors: PropTypes.object, + onSubmit: PropTypes.func, + onChange: PropTypes.func, + onBack: PropTypes.func, +}; + /** * Renders the third step of the sign up process. * @@ -369,6 +390,14 @@ const StepThree = ({ form, errors, onSubmit, onChange, onBack }) => { ); }; +StepThree.propTypes = { + form: PropTypes.object, + errors: PropTypes.object, + onSubmit: PropTypes.func, + onChange: PropTypes.func, + onBack: PropTypes.func, +}; + const Register = ({ isAdmin }) => { const dispatch = useDispatch(); const navigate = useNavigate(); @@ -407,7 +436,7 @@ const Register = ({ isAdmin }) => { } }; fetchInvite(); - }, [token]); + }, [token, form]); /** * Validates the form data against the validation schema. diff --git a/Client/src/Pages/Home/index.css b/Client/src/Pages/Home/index.css deleted file mode 100644 index fdb4ddd1b..000000000 --- a/Client/src/Pages/Home/index.css +++ /dev/null @@ -1 +0,0 @@ -/* Home Page Styles*/ \ No newline at end of file diff --git a/Client/src/Pages/Home/index.jsx b/Client/src/Pages/Home/index.jsx deleted file mode 100644 index 161650512..000000000 --- a/Client/src/Pages/Home/index.jsx +++ /dev/null @@ -1,16 +0,0 @@ -import DropdownTeamMember from "../../Components/DropdownTeamMember"; -import Search from "../../Components/Search"; -import "./index.css"; -import DashboardMenu from "../../Components/DashboardMenu"; -import Integrations from "../../Components/Integrations"; - -const Home = () => { - const token = localStorage.getItem("token"); - return ( - <> -
Home
- - ); -}; - -export default Home; diff --git a/Client/src/Pages/Incidents/IncidentTable/index.jsx b/Client/src/Pages/Incidents/IncidentTable/index.jsx index 705daa70c..7a77208f8 100644 --- a/Client/src/Pages/Incidents/IncidentTable/index.jsx +++ b/Client/src/Pages/Incidents/IncidentTable/index.jsx @@ -32,10 +32,10 @@ const IncidentTable = ({ monitors, selectedMonitor, filter }) => { }); useEffect(() => { - setPaginationController({ - ...paginationController, + setPaginationController((prevPaginationController) => ({ + ...prevPaginationController, page: 0, - }); + })); }, [filter, selectedMonitor]); useEffect(() => { diff --git a/Client/src/Pages/Maintenance/CreateMaintenanceWindow/index.jsx b/Client/src/Pages/Maintenance/CreateMaintenanceWindow/index.jsx index 8fff6e4a1..d207bfc98 100644 --- a/Client/src/Pages/Maintenance/CreateMaintenanceWindow/index.jsx +++ b/Client/src/Pages/Maintenance/CreateMaintenanceWindow/index.jsx @@ -1,6 +1,6 @@ import { Box, Stack, Typography } from "@mui/material"; import "./index.css"; -import React, { useState } from "react"; +import { useState } from "react"; import Button from "../../../Components/Button"; import Back from "../../../assets/icons/left-arrow-long.svg?react"; import Select from "../../../Components/Inputs/Select"; diff --git a/Client/src/Pages/Maintenance/index.jsx b/Client/src/Pages/Maintenance/index.jsx index c589552f7..e9c28d905 100644 --- a/Client/src/Pages/Maintenance/index.jsx +++ b/Client/src/Pages/Maintenance/index.jsx @@ -1,10 +1,7 @@ -import { useTheme } from "@emotion/react"; import Fallback from "../../Components/Fallback"; import "./index.css"; const Maintenance = () => { - const theme = useTheme(); - return (
{ }); useEffect(() => { - setPaginationController({ - ...paginationController, + setPaginationController((prevPaginationController) => ({ + ...prevPaginationController, page: 0, - }); + })); }, [dateRange]); useEffect(() => { diff --git a/Client/src/Pages/Monitors/Details/index.jsx b/Client/src/Pages/Monitors/Details/index.jsx index 7a04a24e2..b636444bd 100644 --- a/Client/src/Pages/Monitors/Details/index.jsx +++ b/Client/src/Pages/Monitors/Details/index.jsx @@ -1,4 +1,4 @@ -import React, { useEffect, useState, useCallback } from "react"; +import { useEffect, useState, useCallback } from "react"; import PropTypes from "prop-types"; import { Box, Skeleton, Stack, Typography, useTheme } from "@mui/material"; import { useSelector } from "react-redux"; @@ -144,15 +144,14 @@ const DetailsPage = () => { useEffect(() => { const fetchCertificate = async () => { try { - const res = await networkService.getCertificateExpiry( - authToken, - monitorId - ); - setCertificateExpiry(res?.data?.data?.certificateDate ?? "N/A"); + const res = await networkService.getCertificateExpiry( + authToken, + monitorId + ); + setCertificateExpiry(res?.data?.data?.certificateDate ?? "N/A"); } catch (error) { console.error(error); } - }; fetchCertificate(); }, [authToken, monitorId]); diff --git a/Client/src/Pages/Monitors/index.jsx b/Client/src/Pages/Monitors/index.jsx index 7857aaefa..dc293ef49 100644 --- a/Client/src/Pages/Monitors/index.jsx +++ b/Client/src/Pages/Monitors/index.jsx @@ -28,7 +28,6 @@ import { import Settings from "../../assets/icons/settings-bold.svg?react"; import PropTypes from "prop-types"; -import { logger } from "../../Utils/Logger"; const ActionsMenu = ({ monitor }) => { const [anchorEl, setAnchorEl] = useState(null); diff --git a/Client/src/Pages/PageSpeed/Configure/index.jsx b/Client/src/Pages/PageSpeed/Configure/index.jsx index 1cb164fcf..bc759db17 100644 --- a/Client/src/Pages/PageSpeed/Configure/index.jsx +++ b/Client/src/Pages/PageSpeed/Configure/index.jsx @@ -99,7 +99,7 @@ const PageSpeedConfigure = () => { setMonitor({ ...data, }); - }, [monitorId]); + }, [monitorId, monitors, navigate]); const handleChange = (event, id) => { let { value } = event.target; diff --git a/Client/src/Pages/PageSpeed/index.jsx b/Client/src/Pages/PageSpeed/index.jsx index 771a692c1..368ae2062 100644 --- a/Client/src/Pages/PageSpeed/index.jsx +++ b/Client/src/Pages/PageSpeed/index.jsx @@ -11,6 +11,7 @@ import "./index.css"; import Button from "../../Components/Button"; import { useNavigate } from "react-router"; import { getLastChecked } from "../../Utils/monitorUtils"; +import PropTypes from "prop-types"; const Card = ({ data }) => { const theme = useTheme(); @@ -57,6 +58,10 @@ const Card = ({ data }) => { ); }; +Card.propTypes = { + data: PropTypes.object.isRequired, +}; + /** * Renders a skeleton layout. * @@ -129,7 +134,7 @@ const PageSpeed = () => { ); useEffect(() => { dispatch(getPageSpeedByUserId(authToken)); - }, []); + }, [authToken, dispatch]); // will show skeletons only on initial load // since monitor state is being added to redux persist, there's no reason to display skeletons on every render diff --git a/Client/src/Pages/Status/index.jsx b/Client/src/Pages/Status/index.jsx index 474375ede..d280132c4 100644 --- a/Client/src/Pages/Status/index.jsx +++ b/Client/src/Pages/Status/index.jsx @@ -1,9 +1,6 @@ import Fallback from "../../Components/Fallback"; -import { useTheme } from "@emotion/react"; const Status = () => { - const theme = useTheme(); - return (
response, (error) => { - console.error(error); + logger.error(error); if (error.response && error.response.status === 401) { - console.log("Invalid token revoked"); - networkService; + logger.error("Invalid token received"); } return Promise.reject(error); }