Compare commits
2 commits
master
...
johanna-te
Author | SHA1 | Date | |
---|---|---|---|
|
f43ad10dd9 | ||
|
4c5c4f2189 |
33 changed files with 148 additions and 3 deletions
|
@ -1,6 +1,11 @@
|
|||
import { Link, useParams } from "react-router-dom";
|
||||
import { JSX } from "react/jsx-runtime";
|
||||
|
||||
/**
|
||||
* Handles the rendering of the PM Project Menu.
|
||||
* @param {string} projectName - The name of the project.
|
||||
* @returns {JSX.Element} The JSX element representing the PM Project Menu.
|
||||
*/
|
||||
function PMProjectMenu(): JSX.Element {
|
||||
const { projectName } = useParams();
|
||||
return (
|
||||
|
|
|
@ -3,6 +3,14 @@ import Button from "./Button";
|
|||
import DeleteUser from "./DeleteUser";
|
||||
import UserProjectListAdmin from "./UserProjectListAdmin";
|
||||
|
||||
/**
|
||||
* Component representing a modal to display user information.
|
||||
* @param {object} props - Component properties.
|
||||
* @param {boolean} props.isVisible - Determines if the modal is visible.
|
||||
* @param {string} props.username - The username to display.
|
||||
* @param {() => void} props.onClose - Function to handle closing the modal.
|
||||
* @returns {JSX.Element} The JSX element representing the UserInfoModal.
|
||||
*/
|
||||
function UserInfoModal(props: {
|
||||
isVisible: boolean;
|
||||
username: string;
|
||||
|
|
|
@ -2,6 +2,10 @@ import { useEffect, useState } from "react";
|
|||
import { api } from "../API/API";
|
||||
import { Project } from "../Types/goTypes";
|
||||
|
||||
/**
|
||||
* Component for displaying a list of projects associated with the current user.
|
||||
* @returns {JSX.Element} The JSX element representing the UserProjectListAdmin component.
|
||||
*/
|
||||
function UserProjectListAdmin(): JSX.Element {
|
||||
const [projects, setProjects] = useState<Project[]>([]);
|
||||
|
||||
|
|
|
@ -4,9 +4,9 @@ import { useParams, Link } from "react-router-dom";
|
|||
import { JSX } from "react/jsx-runtime";
|
||||
|
||||
/**
|
||||
* Renders the user project menu component.
|
||||
*
|
||||
* @returns JSX.Element representing the user project menu.
|
||||
* Renders the menu for a specific project for the user.
|
||||
* It provides options to view existing time reports and create new ones.
|
||||
* @returns {JSX.Element} The JSX element representing the user project menu.
|
||||
*/
|
||||
function UserProjectMenu(): JSX.Element {
|
||||
const { projectName } = useParams();
|
||||
|
|
|
@ -2,6 +2,12 @@ import AddProject from "../../Components/AddProject";
|
|||
import BackButton from "../../Components/BackButton";
|
||||
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 {
|
||||
const content = <AddProject />;
|
||||
|
||||
|
|
|
@ -2,6 +2,12 @@ import BackButton from "../../Components/BackButton";
|
|||
import BasicWindow from "../../Components/BasicWindow";
|
||||
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 {
|
||||
const content = (
|
||||
<>
|
||||
|
|
|
@ -3,6 +3,11 @@ import BasicWindow from "../../Components/BasicWindow";
|
|||
import Button from "../../Components/Button";
|
||||
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 {
|
||||
const content = (
|
||||
<>
|
||||
|
|
|
@ -3,6 +3,11 @@ import BackButton from "../../Components/BackButton";
|
|||
import BasicWindow from "../../Components/BasicWindow";
|
||||
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 {
|
||||
const content = <></>;
|
||||
|
||||
|
|
|
@ -6,6 +6,11 @@ import { useNavigate } from "react-router-dom";
|
|||
import GetAllUsers from "../../Components/GetAllUsers";
|
||||
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 {
|
||||
const [users, setUsers] = useState<string[]>([]);
|
||||
GetAllUsers({ setUsersProp: setUsers });
|
||||
|
|
|
@ -1,6 +1,11 @@
|
|||
import { Link } from "react-router-dom";
|
||||
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 {
|
||||
const content = (
|
||||
<>
|
||||
|
|
|
@ -1,6 +1,10 @@
|
|||
import BasicWindow from "../../Components/BasicWindow";
|
||||
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 {
|
||||
const content = <></>;
|
||||
|
||||
|
|
|
@ -1,6 +1,10 @@
|
|||
import BasicWindow from "../../Components/BasicWindow";
|
||||
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 {
|
||||
const content = <></>;
|
||||
|
||||
|
|
|
@ -1,6 +1,10 @@
|
|||
import BasicWindow from "../../Components/BasicWindow";
|
||||
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 {
|
||||
const content = <></>;
|
||||
|
||||
|
|
|
@ -1,6 +1,10 @@
|
|||
import BasicWindow from "../../Components/BasicWindow";
|
||||
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 {
|
||||
const content = <></>;
|
||||
|
||||
|
|
|
@ -1,6 +1,10 @@
|
|||
import BasicWindow from "../../Components/BasicWindow";
|
||||
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 {
|
||||
const content = <></>;
|
||||
|
||||
|
|
|
@ -1,6 +1,10 @@
|
|||
import BasicWindow from "../../Components/BasicWindow";
|
||||
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 {
|
||||
const content = <></>;
|
||||
|
||||
|
|
|
@ -3,6 +3,10 @@ import Button from "../../Components/Button";
|
|||
import BackButton from "../../Components/BackButton";
|
||||
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 {
|
||||
const content = (
|
||||
<>
|
||||
|
|
|
@ -3,6 +3,11 @@ import { useState, useEffect } from "react";
|
|||
import LoginPage from "./LoginPage";
|
||||
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 {
|
||||
const navigate = useNavigate();
|
||||
const [authority, setAuthority] = useState(0);
|
||||
|
|
|
@ -5,6 +5,12 @@ import BackgroundAnimation from "../Components/BackgroundAnimation";
|
|||
import LoginField from "../Components/LoginField";
|
||||
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: {
|
||||
setAuthority: Dispatch<SetStateAction<number>>;
|
||||
}): JSX.Element {
|
||||
|
|
|
@ -1,5 +1,9 @@
|
|||
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 {
|
||||
return (
|
||||
<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 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 {
|
||||
const content = (
|
||||
<>
|
||||
|
|
|
@ -1,6 +1,10 @@
|
|||
import BasicWindow from "../../Components/BasicWindow";
|
||||
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 {
|
||||
const content = <></>;
|
||||
|
||||
|
|
|
@ -4,6 +4,10 @@ import BackButton from "../../Components/BackButton";
|
|||
import { Link, useParams } from "react-router-dom";
|
||||
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 {
|
||||
const { projectName } = useParams();
|
||||
const content = (
|
||||
|
|
|
@ -3,6 +3,10 @@ import { JSX } from "react/jsx-runtime";
|
|||
import PMProjectMenu from "../../Components/PMProjectMenu";
|
||||
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 {
|
||||
const content = (
|
||||
<>
|
||||
|
|
|
@ -2,6 +2,10 @@ import BackButton from "../../Components/BackButton";
|
|||
import BasicWindow from "../../Components/BasicWindow";
|
||||
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 {
|
||||
const content = (
|
||||
<>
|
||||
|
|
|
@ -1,6 +1,10 @@
|
|||
import BasicWindow from "../../Components/BasicWindow";
|
||||
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 {
|
||||
const content = <></>;
|
||||
|
||||
|
|
|
@ -3,6 +3,10 @@ import BasicWindow from "../../Components/BasicWindow";
|
|||
import Button from "../../Components/Button";
|
||||
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 {
|
||||
const content = (
|
||||
<>
|
||||
|
|
|
@ -1,5 +1,9 @@
|
|||
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 {
|
||||
return (
|
||||
<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 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 {
|
||||
const content = (
|
||||
<>
|
||||
|
|
|
@ -2,6 +2,10 @@ import BackButton from "../../Components/BackButton";
|
|||
import BasicWindow from "../../Components/BasicWindow";
|
||||
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 {
|
||||
const content = (
|
||||
<>
|
||||
|
|
|
@ -2,6 +2,11 @@ import BasicWindow from "../../Components/BasicWindow";
|
|||
import BackButton from "../../Components/BackButton";
|
||||
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 {
|
||||
const content = (
|
||||
<>
|
||||
|
|
|
@ -3,6 +3,10 @@ import BackButton from "../../Components/BackButton";
|
|||
import { useParams } from "react-router-dom";
|
||||
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 {
|
||||
const { projectName } = useParams();
|
||||
|
||||
|
|
|
@ -1,6 +1,10 @@
|
|||
import BasicWindow from "../Components/BasicWindow";
|
||||
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 {
|
||||
const content = (
|
||||
<>
|
||||
|
|
Loading…
Reference in a new issue