diff --git a/Client/src/Components/Inputs/TextInput/Adornments/index.jsx b/Client/src/Components/Inputs/TextInput/Adornments/index.jsx index 4d7b09d0f..3c69d35a2 100644 --- a/Client/src/Components/Inputs/TextInput/Adornments/index.jsx +++ b/Client/src/Components/Inputs/TextInput/Adornments/index.jsx @@ -100,3 +100,8 @@ export const ServerEndAdornment = ({ id, removeItem }) => { ); }; + +ServerEndAdornment.propTypes = { + id: PropTypes.string.isRequired, + removeItem: PropTypes.func.isRequired, +}; \ No newline at end of file diff --git a/Client/src/Components/TabPanels/Status/Card/Server/index.jsx b/Client/src/Components/TabPanels/Status/Card/Server/index.jsx index c21f6963f..e49d347aa 100644 --- a/Client/src/Components/TabPanels/Status/Card/Server/index.jsx +++ b/Client/src/Components/TabPanels/Status/Card/Server/index.jsx @@ -2,7 +2,17 @@ import { ServerStartAdornment, ServerEndAdornment } from "../../../../Inputs/Tex import Search from "../../../../Inputs/Search"; import {useState} from "react" -const Server = ({ id, removeItem, onChange, monitors, value, label }) => { +/** + * + * @param {*} id The Id of the Server component + * @param {*} removeItem The function used to remove a single server + * @param {*} onChange The Change handler function to handle when the server value is changed + * used to update the server(monitor) lists + * @param {*} monitors The server monitors options + * @param {*} value the option label of the server/monitor, namely the monitor name field + * @returns + */ +const Server = ({ id, removeItem, onChange, monitors, value }) => { const [search, setSearch] = useState(""); const handleSearch = (val) => { setSearch(val); diff --git a/Client/src/Components/TabPanels/Status/Card/index.jsx b/Client/src/Components/TabPanels/Status/Card/index.jsx index 35c7cf2b0..2d2c49fd1 100644 --- a/Client/src/Components/TabPanels/Status/Card/index.jsx +++ b/Client/src/Components/TabPanels/Status/Card/index.jsx @@ -5,6 +5,11 @@ import Card from "@mui/material/Card"; import Server from "./Server" import { CardContent } from "@mui/material"; +/** + * CustomCard is a React Forward Ref component that + * passes properties to its wrapped component with + * ref that carrys the drag and drop feature etc + */ const CustomCard = React.forwardRef((props, ref) => ( @@ -19,6 +24,19 @@ const CustomCard = React.forwardRef((props, ref) => ( )); +/** + * @param {*} id The Id of the Server component + * @param {*} index The index of the Card in its natural order of placement + * @param {*} moveCard The function to actually move a card + * @param {*} removeCard The function to remote the card + * @param {*} onChange The Change handler function to handle when the server value is changed + * used to update the server(monitor) lists + * @param {*} monitors The server monitors options + * @param {*} value the option label of the server/monitor, namely the monitor name field + * @returns The Card component representing a singler server/monitor that is capable of being + * dragged and droped + */ + const MyCard = ({ id, index, moveCard, removeCard, value, onChange, monitors }) => { const ref = useRef(null); const [, drop] = useDrop({ diff --git a/Client/src/Components/TabPanels/Status/ContentPanel.jsx b/Client/src/Components/TabPanels/Status/ContentPanel.jsx index 7af66ff07..19aab7f90 100644 --- a/Client/src/Components/TabPanels/Status/ContentPanel.jsx +++ b/Client/src/Components/TabPanels/Status/ContentPanel.jsx @@ -11,6 +11,12 @@ import { logger } from "../../../Utils/Logger" import { createToast } from "../../../Utils/toastUtils"; import { networkService } from "../../../main"; +/** + * Content Panel is used to compose the second part of the status page + * for the servers/monitors to watch for in its public page presence and some + * other server related configurations etc + * + */ const ContentPanel = () => { const theme = useTheme(); const { form, setForm, errors, setErrors } = useContext(StatusFormContext); diff --git a/Client/src/Components/TabPanels/Status/GeneralSettingsPanel.jsx b/Client/src/Components/TabPanels/Status/GeneralSettingsPanel.jsx index f037e47c3..9c55034dd 100644 --- a/Client/src/Components/TabPanels/Status/GeneralSettingsPanel.jsx +++ b/Client/src/Components/TabPanels/Status/GeneralSettingsPanel.jsx @@ -18,6 +18,10 @@ import ImageIcon from "@mui/icons-material/Image"; import { HttpAdornment } from "../../Inputs/TextInput/Adornments"; import { StatusFormContext } from "../../../Pages/Status/CreateStatusContext"; +/** + * General settings panel is ued to compose part of the public static page + * for general informations like company name, subdomain url, logo and color etc + */ const GeneralSettingsPanel = () => { const theme = useTheme(); const [logo, setLogo] = useState(); diff --git a/Client/src/Pages/Status/index.jsx b/Client/src/Pages/Status/index.jsx index eefcf347d..f1fa20f4d 100644 --- a/Client/src/Pages/Status/index.jsx +++ b/Client/src/Pages/Status/index.jsx @@ -6,9 +6,13 @@ import CreateStatus from "./CreateStatus"; import { useEffect, useState } from "react"; import { networkService } from "../../main"; import { useSelector } from "react-redux"; -import { createToast } from "../../Utils/toastUtils" import { logger } from "../../Utils/Logger"; +/** + * The configuration page for public page that contains a general settings and + * content tabs, It will display a static page if there is no status page configured + * or the status page if one is already configured + */ const Status = () => { const theme = useTheme(); const navigate = useNavigate(); @@ -23,7 +27,6 @@ const Status = () => { if(res && res.data) setInitForm( res.data.data) }catch (error) { - createToast({ body: "Failed to fetch status page data" }); logger.error("Failed to fetch status page", error); }