Added doc comments to admin/PM/User/App/Login/404 Not Found/ Unauthorized pages
This commit is contained in:
parent
22f4fba36a
commit
4c5c4f2189
29 changed files with 128 additions and 0 deletions
|
@ -2,6 +2,12 @@ import AddProject from "../../Components/AddProject";
|
||||||
import BackButton from "../../Components/BackButton";
|
import BackButton from "../../Components/BackButton";
|
||||||
import BasicWindow from "../../Components/BasicWindow";
|
import BasicWindow from "../../Components/BasicWindow";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Renders a window for the admin to add a new project.
|
||||||
|
* This window includes the AddProject component for adding a project,
|
||||||
|
* as well as a BackButton component for navigation.
|
||||||
|
* @returns {JSX.Element} The JSX element representing the admin add project window.
|
||||||
|
*/
|
||||||
function AdminAddProject(): JSX.Element {
|
function AdminAddProject(): JSX.Element {
|
||||||
const content = <AddProject />;
|
const content = <AddProject />;
|
||||||
|
|
||||||
|
|
|
@ -2,6 +2,12 @@ import BackButton from "../../Components/BackButton";
|
||||||
import BasicWindow from "../../Components/BasicWindow";
|
import BasicWindow from "../../Components/BasicWindow";
|
||||||
import Register from "../../Components/Register";
|
import Register from "../../Components/Register";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Renders a window for the admin to add a new user.
|
||||||
|
* This window includes the Register component for user registration,
|
||||||
|
* as well as a BackButton component for navigation.
|
||||||
|
* @returns {JSX.Element} The JSX element representing the admin add user window.
|
||||||
|
*/
|
||||||
function AdminAddUser(): JSX.Element {
|
function AdminAddUser(): JSX.Element {
|
||||||
const content = (
|
const content = (
|
||||||
<>
|
<>
|
||||||
|
|
|
@ -3,6 +3,11 @@ import BasicWindow from "../../Components/BasicWindow";
|
||||||
import Button from "../../Components/Button";
|
import Button from "../../Components/Button";
|
||||||
import ChangeUsername from "../../Components/ChangeUsername";
|
import ChangeUsername from "../../Components/ChangeUsername";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Renders an admin interface for changing a user's username.
|
||||||
|
* Allows the admin to change the username and navigate back.
|
||||||
|
* @returns JSX.Element representing the admin interface for changing username.
|
||||||
|
*/
|
||||||
function AdminChangeUsername(): JSX.Element {
|
function AdminChangeUsername(): JSX.Element {
|
||||||
const content = (
|
const content = (
|
||||||
<>
|
<>
|
||||||
|
|
|
@ -3,6 +3,11 @@ import BackButton from "../../Components/BackButton";
|
||||||
import BasicWindow from "../../Components/BasicWindow";
|
import BasicWindow from "../../Components/BasicWindow";
|
||||||
import Button from "../../Components/Button";
|
import Button from "../../Components/Button";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Renders an admin interface for managing projects.
|
||||||
|
* Allows the admin to add a new project and navigate back.
|
||||||
|
* @returns JSX.Element representing the admin interface for managing projects.
|
||||||
|
*/
|
||||||
function AdminManageProjects(): JSX.Element {
|
function AdminManageProjects(): JSX.Element {
|
||||||
const content = <></>;
|
const content = <></>;
|
||||||
|
|
||||||
|
|
|
@ -6,6 +6,11 @@ import { useNavigate } from "react-router-dom";
|
||||||
import GetAllUsers from "../../Components/GetAllUsers";
|
import GetAllUsers from "../../Components/GetAllUsers";
|
||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Renders an admin interface for managing users.
|
||||||
|
* Allows the admin to view and add users.
|
||||||
|
* @returns JSX.Element representing the admin interface for managing users.
|
||||||
|
*/
|
||||||
function AdminManageUsers(): JSX.Element {
|
function AdminManageUsers(): JSX.Element {
|
||||||
const [users, setUsers] = useState<string[]>([]);
|
const [users, setUsers] = useState<string[]>([]);
|
||||||
GetAllUsers({ setUsersProp: setUsers });
|
GetAllUsers({ setUsersProp: setUsers });
|
||||||
|
|
|
@ -1,6 +1,11 @@
|
||||||
import { Link } from "react-router-dom";
|
import { Link } from "react-router-dom";
|
||||||
import BasicWindow from "../../Components/BasicWindow";
|
import BasicWindow from "../../Components/BasicWindow";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Renders the administrator menu page.
|
||||||
|
* Provides links to manage users and projects.
|
||||||
|
* @returns JSX.Element representing the administrator menu page.
|
||||||
|
*/
|
||||||
function AdminMenuPage(): JSX.Element {
|
function AdminMenuPage(): JSX.Element {
|
||||||
const content = (
|
const content = (
|
||||||
<>
|
<>
|
||||||
|
|
|
@ -1,6 +1,10 @@
|
||||||
import BasicWindow from "../../Components/BasicWindow";
|
import BasicWindow from "../../Components/BasicWindow";
|
||||||
import Button from "../../Components/Button";
|
import Button from "../../Components/Button";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Renders the page for adding members to a project by an admin.
|
||||||
|
* @returns JSX.Element representing the project member addition page.
|
||||||
|
*/
|
||||||
function AdminProjectAddMember(): JSX.Element {
|
function AdminProjectAddMember(): JSX.Element {
|
||||||
const content = <></>;
|
const content = <></>;
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,10 @@
|
||||||
import BasicWindow from "../../Components/BasicWindow";
|
import BasicWindow from "../../Components/BasicWindow";
|
||||||
import Button from "../../Components/Button";
|
import Button from "../../Components/Button";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Renders the page for changing user roles within a project by an admin.
|
||||||
|
* @returns JSX.Element representing the page for changing user roles.
|
||||||
|
*/
|
||||||
function AdminProjectChangeUserRole(): JSX.Element {
|
function AdminProjectChangeUserRole(): JSX.Element {
|
||||||
const content = <></>;
|
const content = <></>;
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,10 @@
|
||||||
import BasicWindow from "../../Components/BasicWindow";
|
import BasicWindow from "../../Components/BasicWindow";
|
||||||
import Button from "../../Components/Button";
|
import Button from "../../Components/Button";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Renders the page for managing members within a project by an admin.
|
||||||
|
* @returns JSX.Element representing the page for managing project members.
|
||||||
|
*/
|
||||||
function AdminProjectManageMembers(): JSX.Element {
|
function AdminProjectManageMembers(): JSX.Element {
|
||||||
const content = <></>;
|
const content = <></>;
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,10 @@
|
||||||
import BasicWindow from "../../Components/BasicWindow";
|
import BasicWindow from "../../Components/BasicWindow";
|
||||||
import Button from "../../Components/Button";
|
import Button from "../../Components/Button";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Renders the page for managing a project by an admin.
|
||||||
|
* @returns JSX.Element representing the page for managing a project.
|
||||||
|
*/
|
||||||
function AdminProjectPage(): JSX.Element {
|
function AdminProjectPage(): JSX.Element {
|
||||||
const content = <></>;
|
const content = <></>;
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,10 @@
|
||||||
import BasicWindow from "../../Components/BasicWindow";
|
import BasicWindow from "../../Components/BasicWindow";
|
||||||
import Button from "../../Components/Button";
|
import Button from "../../Components/Button";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Renders the page for viewing project statistics by an admin.
|
||||||
|
* @returns JSX.Element representing the page for project statistics.
|
||||||
|
*/
|
||||||
function AdminProjectStatistics(): JSX.Element {
|
function AdminProjectStatistics(): JSX.Element {
|
||||||
const content = <></>;
|
const content = <></>;
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,10 @@
|
||||||
import BasicWindow from "../../Components/BasicWindow";
|
import BasicWindow from "../../Components/BasicWindow";
|
||||||
import Button from "../../Components/Button";
|
import Button from "../../Components/Button";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Renders the page for viewing member information within a project by an admin.
|
||||||
|
* @returns JSX.Element representing the page for viewing member information.
|
||||||
|
*/
|
||||||
function AdminProjectViewMemberInfo(): JSX.Element {
|
function AdminProjectViewMemberInfo(): JSX.Element {
|
||||||
const content = <></>;
|
const content = <></>;
|
||||||
|
|
||||||
|
|
|
@ -3,6 +3,10 @@ import Button from "../../Components/Button";
|
||||||
import BackButton from "../../Components/BackButton";
|
import BackButton from "../../Components/BackButton";
|
||||||
import UserProjectListAdmin from "../../Components/UserProjectListAdmin";
|
import UserProjectListAdmin from "../../Components/UserProjectListAdmin";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Renders the page for viewing user information by an admin.
|
||||||
|
* @returns JSX.Element representing the page for viewing user information.
|
||||||
|
*/
|
||||||
function AdminViewUserInfo(): JSX.Element {
|
function AdminViewUserInfo(): JSX.Element {
|
||||||
const content = (
|
const content = (
|
||||||
<>
|
<>
|
||||||
|
|
|
@ -3,6 +3,11 @@ import { useState, useEffect } from "react";
|
||||||
import LoginPage from "./LoginPage";
|
import LoginPage from "./LoginPage";
|
||||||
import { useNavigate } from "react-router-dom";
|
import { useNavigate } from "react-router-dom";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Main component of the application.
|
||||||
|
* Handles user authority and redirects accordingly.
|
||||||
|
* @returns {JSX.Element} The JSX element representing the main application component.
|
||||||
|
*/
|
||||||
function App(): JSX.Element {
|
function App(): JSX.Element {
|
||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
const [authority, setAuthority] = useState(0);
|
const [authority, setAuthority] = useState(0);
|
||||||
|
|
|
@ -5,6 +5,12 @@ import BackgroundAnimation from "../Components/BackgroundAnimation";
|
||||||
import LoginField from "../Components/LoginField";
|
import LoginField from "../Components/LoginField";
|
||||||
import LoginCheck from "../Components/LoginCheck";
|
import LoginCheck from "../Components/LoginCheck";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Represents the login page of the application.
|
||||||
|
* @param {Object} props - The properties passed to the component.
|
||||||
|
* @param {Dispatch<SetStateAction<number>>} props.setAuthority - The function to update user authority.
|
||||||
|
* @returns {JSX.Element} The JSX element representing the login page.
|
||||||
|
*/
|
||||||
function LoginPage(props: {
|
function LoginPage(props: {
|
||||||
setAuthority: Dispatch<SetStateAction<number>>;
|
setAuthority: Dispatch<SetStateAction<number>>;
|
||||||
}): JSX.Element {
|
}): JSX.Element {
|
||||||
|
|
|
@ -1,5 +1,9 @@
|
||||||
import Button from "../Components/Button";
|
import Button from "../Components/Button";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Represents the 404 Not Found page.
|
||||||
|
* @returns {JSX.Element} The JSX element representing the 404 Not Found page.
|
||||||
|
*/
|
||||||
export default function NotFoundPage(): JSX.Element {
|
export default function NotFoundPage(): JSX.Element {
|
||||||
return (
|
return (
|
||||||
<div className="flex flex-col items-center justify-center min-h-screen bg-white">
|
<div className="flex flex-col items-center justify-center min-h-screen bg-white">
|
||||||
|
|
|
@ -2,6 +2,10 @@ import BasicWindow from "../../Components/BasicWindow";
|
||||||
import BackButton from "../../Components/BackButton";
|
import BackButton from "../../Components/BackButton";
|
||||||
import ChangeRoles from "../../Components/ChangeRoles";
|
import ChangeRoles from "../../Components/ChangeRoles";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Renders the page for changing user roles.
|
||||||
|
* @returns JSX.Element representing the page for changing user roles.
|
||||||
|
*/
|
||||||
function ChangeRole(): JSX.Element {
|
function ChangeRole(): JSX.Element {
|
||||||
const content = (
|
const content = (
|
||||||
<>
|
<>
|
||||||
|
|
|
@ -1,6 +1,10 @@
|
||||||
import BasicWindow from "../../Components/BasicWindow";
|
import BasicWindow from "../../Components/BasicWindow";
|
||||||
import BackButton from "../../Components/BackButton";
|
import BackButton from "../../Components/BackButton";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Renders the page for project manager to view time reports of other users.
|
||||||
|
* @returns JSX.Element representing the page for project manager to view time reports of other users.
|
||||||
|
*/
|
||||||
function PMOtherUsersTR(): JSX.Element {
|
function PMOtherUsersTR(): JSX.Element {
|
||||||
const content = <></>;
|
const content = <></>;
|
||||||
|
|
||||||
|
|
|
@ -4,6 +4,10 @@ import BackButton from "../../Components/BackButton";
|
||||||
import { Link, useParams } from "react-router-dom";
|
import { Link, useParams } from "react-router-dom";
|
||||||
import ProjectMembers from "../../Components/ProjectMembers";
|
import ProjectMembers from "../../Components/ProjectMembers";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Renders the page for project manager to view all members in a project.
|
||||||
|
* @returns JSX.Element representing the page for project manager to view all members in a project.
|
||||||
|
*/
|
||||||
function PMProjectMembers(): JSX.Element {
|
function PMProjectMembers(): JSX.Element {
|
||||||
const { projectName } = useParams();
|
const { projectName } = useParams();
|
||||||
const content = (
|
const content = (
|
||||||
|
|
|
@ -3,6 +3,10 @@ import { JSX } from "react/jsx-runtime";
|
||||||
import PMProjectMenu from "../../Components/PMProjectMenu";
|
import PMProjectMenu from "../../Components/PMProjectMenu";
|
||||||
import BackButton from "../../Components/BackButton";
|
import BackButton from "../../Components/BackButton";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Renders the page for project manager's project menu.
|
||||||
|
* @returns JSX.Element representing the page for project manager's project menu.
|
||||||
|
*/
|
||||||
function PMProjectPage(): JSX.Element {
|
function PMProjectPage(): JSX.Element {
|
||||||
const content = (
|
const content = (
|
||||||
<>
|
<>
|
||||||
|
|
|
@ -2,6 +2,10 @@ import BackButton from "../../Components/BackButton";
|
||||||
import BasicWindow from "../../Components/BasicWindow";
|
import BasicWindow from "../../Components/BasicWindow";
|
||||||
import TimeReport from "../../Components/NewWeeklyReport";
|
import TimeReport from "../../Components/NewWeeklyReport";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Renders the page for project manager's total time per activity.
|
||||||
|
* @returns JSX.Element representing the page for project manager's total time per activity.
|
||||||
|
*/
|
||||||
function PMTotalTimeActivity(): JSX.Element {
|
function PMTotalTimeActivity(): JSX.Element {
|
||||||
const content = (
|
const content = (
|
||||||
<>
|
<>
|
||||||
|
|
|
@ -1,6 +1,10 @@
|
||||||
import BasicWindow from "../../Components/BasicWindow";
|
import BasicWindow from "../../Components/BasicWindow";
|
||||||
import BackButton from "../../Components/BackButton";
|
import BackButton from "../../Components/BackButton";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Renders the page for project manager's unsigned reports.
|
||||||
|
* @returns JSX.Element representing the page for project manager's unsigned reports.
|
||||||
|
*/
|
||||||
function PMUnsignedReports(): JSX.Element {
|
function PMUnsignedReports(): JSX.Element {
|
||||||
const content = <></>;
|
const content = <></>;
|
||||||
|
|
||||||
|
|
|
@ -3,6 +3,10 @@ import BasicWindow from "../../Components/BasicWindow";
|
||||||
import Button from "../../Components/Button";
|
import Button from "../../Components/Button";
|
||||||
import TimeReport from "../../Components/NewWeeklyReport";
|
import TimeReport from "../../Components/NewWeeklyReport";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Renders the page for project manager's unsigned reports.
|
||||||
|
* @returns JSX.Element representing the page for project manager's unsigned reports.
|
||||||
|
*/
|
||||||
function PMViewUnsignedReport(): JSX.Element {
|
function PMViewUnsignedReport(): JSX.Element {
|
||||||
const content = (
|
const content = (
|
||||||
<>
|
<>
|
||||||
|
|
|
@ -1,5 +1,9 @@
|
||||||
import Button from "../Components/Button";
|
import Button from "../Components/Button";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Represents the Unauthorized page.
|
||||||
|
* @returns {JSX.Element} The JSX element representing the Unauthorized page.
|
||||||
|
*/
|
||||||
export default function UnauthorizedPage(): JSX.Element {
|
export default function UnauthorizedPage(): JSX.Element {
|
||||||
return (
|
return (
|
||||||
<div className="flex flex-col items-center justify-center min-h-screen bg-white">
|
<div className="flex flex-col items-center justify-center min-h-screen bg-white">
|
||||||
|
|
|
@ -2,6 +2,10 @@ import BasicWindow from "../../Components/BasicWindow";
|
||||||
import BackButton from "../../Components/BackButton";
|
import BackButton from "../../Components/BackButton";
|
||||||
import EditWeeklyReport from "../../Components/EditWeeklyReport";
|
import EditWeeklyReport from "../../Components/EditWeeklyReport";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Renders the page for the user to edit a time report.
|
||||||
|
* @returns JSX.Element representing the page for the user to edit a time report.
|
||||||
|
*/
|
||||||
function UserEditTimeReportPage(): JSX.Element {
|
function UserEditTimeReportPage(): JSX.Element {
|
||||||
const content = (
|
const content = (
|
||||||
<>
|
<>
|
||||||
|
|
|
@ -2,6 +2,10 @@ import BackButton from "../../Components/BackButton";
|
||||||
import BasicWindow from "../../Components/BasicWindow";
|
import BasicWindow from "../../Components/BasicWindow";
|
||||||
import NewWeeklyReport from "../../Components/NewWeeklyReport";
|
import NewWeeklyReport from "../../Components/NewWeeklyReport";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Renders the page for the user to create a new time report.
|
||||||
|
* @returns JSX.Element representing the page for the user to create a new time report.
|
||||||
|
*/
|
||||||
function UserNewTimeReportPage(): JSX.Element {
|
function UserNewTimeReportPage(): JSX.Element {
|
||||||
const content = (
|
const content = (
|
||||||
<>
|
<>
|
||||||
|
|
|
@ -2,6 +2,11 @@ import BasicWindow from "../../Components/BasicWindow";
|
||||||
import BackButton from "../../Components/BackButton";
|
import BackButton from "../../Components/BackButton";
|
||||||
import UserProjectMenu from "../../Components/UserProjectMenu";
|
import UserProjectMenu from "../../Components/UserProjectMenu";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Renders a page for the user to interact with project-related menu options.
|
||||||
|
* Includes options for viewing project information, managing activities, etc.
|
||||||
|
* @returns {JSX.Element} The JSX element representing the user project page.
|
||||||
|
*/
|
||||||
function UserProjectPage(): JSX.Element {
|
function UserProjectPage(): JSX.Element {
|
||||||
const content = (
|
const content = (
|
||||||
<>
|
<>
|
||||||
|
|
|
@ -3,6 +3,10 @@ import BackButton from "../../Components/BackButton";
|
||||||
import { useParams } from "react-router-dom";
|
import { useParams } from "react-router-dom";
|
||||||
import AllTimeReportsInProject from "../../Components/AllTimeReportsInProject";
|
import AllTimeReportsInProject from "../../Components/AllTimeReportsInProject";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Renders a page for the user to view all time reports related to a specific project.
|
||||||
|
* @returns {JSX.Element} The JSX element representing the user view time reports page.
|
||||||
|
*/
|
||||||
function UserViewTimeReportsPage(): JSX.Element {
|
function UserViewTimeReportsPage(): JSX.Element {
|
||||||
const { projectName } = useParams();
|
const { projectName } = useParams();
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,10 @@
|
||||||
import BasicWindow from "../Components/BasicWindow";
|
import BasicWindow from "../Components/BasicWindow";
|
||||||
import DisplayUserProjects from "../Components/DisplayUserProjects";
|
import DisplayUserProjects from "../Components/DisplayUserProjects";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Represents the User Project Page.
|
||||||
|
* @returns {JSX.Element} The JSX element representing the User Project Page.
|
||||||
|
*/
|
||||||
function UserProjectPage(): JSX.Element {
|
function UserProjectPage(): JSX.Element {
|
||||||
const content = (
|
const content = (
|
||||||
<>
|
<>
|
||||||
|
|
Loading…
Add table
Reference in a new issue