Merge pull request #689 from bluewave-labs/fix/fe/minor-bugfixes

Fix/fe/minor bugfixes
This commit is contained in:
Alexander Holliday authored and GitHub committed 2024-08-20 17:41:22 -07:00
commit eab250efc2
17 files changed
+59 -50

No files matched your search

+1 -1
View File
@@ -145,7 +145,7 @@ const CheckEmail = () => {
}} }}
/> />
<Typography sx={{ alignSelf: "center", mb: theme.gap.medium }}> <Typography sx={{ alignSelf: "center", mb: theme.gap.medium }}>
Didn't receive the email?{" "} Didn&apos;t receive the email?{" "}
<Typography <Typography
component="span" component="span"
onClick={resendToken} onClick={resendToken}
+1 -1
View File
@@ -131,7 +131,7 @@ const ForgotPassword = () => {
<Key alt="password key icon" /> <Key alt="password key icon" />
<Typography component="h1">Forgot password?</Typography> <Typography component="h1">Forgot password?</Typography>
<Typography> <Typography>
No worries, we'll send you reset instructions. No worries, we&apos;ll send you reset instructions.
</Typography> </Typography>
</Box> </Box>
<Box width="100%" textAlign="left"> <Box width="100%" textAlign="left">
+3 -1
View File
@@ -427,7 +427,9 @@ const Login = () => {
)} )}
</Stack> </Stack>
<Box textAlign="center" p={theme.gap.large}> <Box textAlign="center" p={theme.gap.large}>
<Typography display="inline-block">Don't have an account? —</Typography> <Typography display="inline-block">
Don&apos;t have an account? —
</Typography>
<Typography <Typography
component="span" component="span"
ml={theme.gap.xs} ml={theme.gap.xs}
+30 -1
View File
@@ -69,6 +69,11 @@ const LandingPage = ({ isAdmin, onSignup }) => {
); );
}; };
LandingPage.propTypes = {
isAdmin: PropTypes.bool,
onSignup: PropTypes.func,
};
/** /**
* Renders the first step of the sign up process. * 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. * 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. * 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 Register = ({ isAdmin }) => {
const dispatch = useDispatch(); const dispatch = useDispatch();
const navigate = useNavigate(); const navigate = useNavigate();
@@ -407,7 +436,7 @@ const Register = ({ isAdmin }) => {
} }
}; };
fetchInvite(); fetchInvite();
}, [token]); }, [token, form]);
/** /**
* Validates the form data against the validation schema. * Validates the form data against the validation schema.
-1
View File
@@ -1 +0,0 @@
/* Home Page Styles*/
-16
View File
@@ -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 (
<>
<div>Home</div>
</>
);
};
export default Home;
@@ -32,10 +32,10 @@ const IncidentTable = ({ monitors, selectedMonitor, filter }) => {
}); });
useEffect(() => { useEffect(() => {
setPaginationController({ setPaginationController((prevPaginationController) => ({
...paginationController, ...prevPaginationController,
page: 0, page: 0,
}); }));
}, [filter, selectedMonitor]); }, [filter, selectedMonitor]);
useEffect(() => { useEffect(() => {
@@ -1,6 +1,6 @@
import { Box, Stack, Typography } from "@mui/material"; import { Box, Stack, Typography } from "@mui/material";
import "./index.css"; import "./index.css";
import React, { useState } from "react"; import { useState } from "react";
import Button from "../../../Components/Button"; import Button from "../../../Components/Button";
import Back from "../../../assets/icons/left-arrow-long.svg?react"; import Back from "../../../assets/icons/left-arrow-long.svg?react";
import Select from "../../../Components/Inputs/Select"; import Select from "../../../Components/Inputs/Select";
-3
View File
@@ -1,10 +1,7 @@
import { useTheme } from "@emotion/react";
import Fallback from "../../Components/Fallback"; import Fallback from "../../Components/Fallback";
import "./index.css"; import "./index.css";
const Maintenance = () => { const Maintenance = () => {
const theme = useTheme();
return ( return (
<div className="maintenance"> <div className="maintenance">
<Fallback <Fallback
@@ -1,5 +1,5 @@
import "./index.css"; import "./index.css";
import React, { useState } from "react"; import { useState } from "react";
import RadioButton from "../../../Components/RadioButton"; import RadioButton from "../../../Components/RadioButton";
import Button from "../../../Components/Button"; import Button from "../../../Components/Button";
import { Box, ButtonGroup, Stack, Typography } from "@mui/material"; import { Box, ButtonGroup, Stack, Typography } from "@mui/material";
@@ -29,10 +29,10 @@ const PaginationTable = ({ monitorId, dateRange }) => {
}); });
useEffect(() => { useEffect(() => {
setPaginationController({ setPaginationController((prevPaginationController) => ({
...paginationController, ...prevPaginationController,
page: 0, page: 0,
}); }));
}, [dateRange]); }, [dateRange]);
useEffect(() => { useEffect(() => {
+6 -7
View File
@@ -1,4 +1,4 @@
import React, { useEffect, useState, useCallback } from "react"; import { useEffect, useState, useCallback } from "react";
import PropTypes from "prop-types"; import PropTypes from "prop-types";
import { Box, Skeleton, Stack, Typography, useTheme } from "@mui/material"; import { Box, Skeleton, Stack, Typography, useTheme } from "@mui/material";
import { useSelector } from "react-redux"; import { useSelector } from "react-redux";
@@ -144,15 +144,14 @@ const DetailsPage = () => {
useEffect(() => { useEffect(() => {
const fetchCertificate = async () => { const fetchCertificate = async () => {
try { try {
const res = await networkService.getCertificateExpiry( const res = await networkService.getCertificateExpiry(
authToken, authToken,
monitorId monitorId
); );
setCertificateExpiry(res?.data?.data?.certificateDate ?? "N/A"); setCertificateExpiry(res?.data?.data?.certificateDate ?? "N/A");
} catch (error) { } catch (error) {
console.error(error); console.error(error);
} }
}; };
fetchCertificate(); fetchCertificate();
}, [authToken, monitorId]); }, [authToken, monitorId]);
-1
View File
@@ -28,7 +28,6 @@ import {
import Settings from "../../assets/icons/settings-bold.svg?react"; import Settings from "../../assets/icons/settings-bold.svg?react";
import PropTypes from "prop-types"; import PropTypes from "prop-types";
import { logger } from "../../Utils/Logger";
const ActionsMenu = ({ monitor }) => { const ActionsMenu = ({ monitor }) => {
const [anchorEl, setAnchorEl] = useState(null); const [anchorEl, setAnchorEl] = useState(null);
@@ -99,7 +99,7 @@ const PageSpeedConfigure = () => {
setMonitor({ setMonitor({
...data, ...data,
}); });
}, [monitorId]); }, [monitorId, monitors, navigate]);
const handleChange = (event, id) => { const handleChange = (event, id) => {
let { value } = event.target; let { value } = event.target;
+6 -1
View File
@@ -11,6 +11,7 @@ import "./index.css";
import Button from "../../Components/Button"; import Button from "../../Components/Button";
import { useNavigate } from "react-router"; import { useNavigate } from "react-router";
import { getLastChecked } from "../../Utils/monitorUtils"; import { getLastChecked } from "../../Utils/monitorUtils";
import PropTypes from "prop-types";
const Card = ({ data }) => { const Card = ({ data }) => {
const theme = useTheme(); const theme = useTheme();
@@ -57,6 +58,10 @@ const Card = ({ data }) => {
); );
}; };
Card.propTypes = {
data: PropTypes.object.isRequired,
};
/** /**
* Renders a skeleton layout. * Renders a skeleton layout.
* *
@@ -129,7 +134,7 @@ const PageSpeed = () => {
); );
useEffect(() => { useEffect(() => {
dispatch(getPageSpeedByUserId(authToken)); dispatch(getPageSpeedByUserId(authToken));
}, []); }, [authToken, dispatch]);
// will show skeletons only on initial load // 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 // since monitor state is being added to redux persist, there's no reason to display skeletons on every render
-3
View File
@@ -1,9 +1,6 @@
import Fallback from "../../Components/Fallback"; import Fallback from "../../Components/Fallback";
import { useTheme } from "@emotion/react";
const Status = () => { const Status = () => {
const theme = useTheme();
return ( return (
<div className="status"> <div className="status">
<Fallback <Fallback
+3 -5
View File
@@ -1,7 +1,6 @@
import axios from "axios"; import axios from "axios";
import { clearAuthState } from "../Features/Auth/authSlice";
const BASE_URL = import.meta.env.VITE_APP_API_BASE_URL; const BASE_URL = import.meta.env.VITE_APP_API_BASE_URL;
import { logger } from "./Logger";
class NetworkService { class NetworkService {
constructor(store) { constructor(store) {
this.store = store; this.store = store;
@@ -9,10 +8,9 @@ class NetworkService {
this.axiosInstance.interceptors.response.use( this.axiosInstance.interceptors.response.use(
(response) => response, (response) => response,
(error) => { (error) => {
console.error(error); logger.error(error);
if (error.response && error.response.status === 401) { if (error.response && error.response.status === 401) {
console.log("Invalid token revoked"); logger.error("Invalid token received");
networkService;
} }
return Promise.reject(error); return Promise.reject(error);
} }