From 531e9a0535b873188219bff887824e8f08b2d2b1 Mon Sep 17 00:00:00 2001 From: Davenludd Date: Mon, 18 Mar 2024 17:38:45 +0100 Subject: [PATCH 01/19] Fix links in UserProjectPage component --- frontend/src/Pages/UserPages/UserProjectPage.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/frontend/src/Pages/UserPages/UserProjectPage.tsx b/frontend/src/Pages/UserPages/UserProjectPage.tsx index 4760217..eab866b 100644 --- a/frontend/src/Pages/UserPages/UserProjectPage.tsx +++ b/frontend/src/Pages/UserPages/UserProjectPage.tsx @@ -7,12 +7,12 @@ function UserProjectPage(): JSX.Element { <>

{useLocation().state}

- +

Your Time Reports

- +

New Time Report

From a2ad2913e4a65e45cd91f69a155898d4127ec7d4 Mon Sep 17 00:00:00 2001 From: Davenludd Date: Mon, 18 Mar 2024 19:34:15 +0100 Subject: [PATCH 02/19] Add NotFoundPage component --- frontend/src/Pages/NotFoundPage.tsx | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 frontend/src/Pages/NotFoundPage.tsx diff --git a/frontend/src/Pages/NotFoundPage.tsx b/frontend/src/Pages/NotFoundPage.tsx new file mode 100644 index 0000000..cae9861 --- /dev/null +++ b/frontend/src/Pages/NotFoundPage.tsx @@ -0,0 +1,18 @@ +import Button from "../Components/Button"; + +export default function NotFoundPage(): JSX.Element { + return ( +
+

404 Page Not Found

+ +
+ ); +} From 3e9dc87100eed22a6ba1382727cc8041d7c3d6d5 Mon Sep 17 00:00:00 2001 From: Davenludd Date: Mon, 18 Mar 2024 19:36:28 +0100 Subject: [PATCH 03/19] Add NotFoundPage to handle 404 errors --- frontend/src/main.tsx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/frontend/src/main.tsx b/frontend/src/main.tsx index 193b692..a1e466e 100644 --- a/frontend/src/main.tsx +++ b/frontend/src/main.tsx @@ -29,12 +29,14 @@ import AdminProjectManageMembers from "./Pages/AdminPages/AdminProjectManageMemb import AdminProjectStatistics from "./Pages/AdminPages/AdminProjectStatistics.tsx"; import AdminProjectViewMemberInfo from "./Pages/AdminPages/AdminProjectViewMemberInfo.tsx"; import AdminProjectPage from "./Pages/AdminPages/AdminProjectPage.tsx"; +import NotFoundPage from "./Pages/NotFoundPage.tsx"; // This is where the routes are mounted const router = createBrowserRouter([ { path: "/", element: , + errorElement: , }, { path: "/admin", From d64ec708a160ad4fd48293dbe22b9212b48761e7 Mon Sep 17 00:00:00 2001 From: Davenludd Date: Mon, 18 Mar 2024 19:37:37 +0100 Subject: [PATCH 04/19] Minor fixes --- frontend/src/Pages/YourProjectsPage.tsx | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/frontend/src/Pages/YourProjectsPage.tsx b/frontend/src/Pages/YourProjectsPage.tsx index aabc606..e45d237 100644 --- a/frontend/src/Pages/YourProjectsPage.tsx +++ b/frontend/src/Pages/YourProjectsPage.tsx @@ -7,10 +7,10 @@ import BasicWindow from "../Components/BasicWindow"; export const ProjectNameContext = createContext(""); function UserProjectPage(): JSX.Element { - const [projects, setProjects] = useState([]); - const [selectedProject, setSelectedProject] = useState(""); + /* const [projects, setProjects] = useState([]); + */ const [selectedProject, setSelectedProject] = useState(""); - const getProjects = async (): Promise => { + /* const getProjects = async (): Promise => { const username = localStorage.getItem("username") ?? ""; // replace with actual username const token = localStorage.getItem("accessToken") ?? ""; // replace with actual token const response = await api.getUserProjects(username, token); @@ -24,7 +24,15 @@ function UserProjectPage(): JSX.Element { // Call getProjects when the component mounts useEffect(() => { getProjects(); - }, []); + }, []); */ + + // Mock data + const projects: Project[] = [ + { id: "1", name: "Project 1" }, + { id: "2", name: "Project 2" }, + { id: "3", name: "Project 3" }, + // Add more mock projects as needed + ]; const handleProjectClick = (projectName: string): void => { setSelectedProject(projectName); From 25713443e21eed8830c2b33f54470534727659f6 Mon Sep 17 00:00:00 2001 From: Davenludd Date: Mon, 18 Mar 2024 21:33:20 +0100 Subject: [PATCH 05/19] Remove username prop from BasicWindow component --- frontend/src/Components/BasicWindow.tsx | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/frontend/src/Components/BasicWindow.tsx b/frontend/src/Components/BasicWindow.tsx index 1835d6a..d5fd3b6 100644 --- a/frontend/src/Components/BasicWindow.tsx +++ b/frontend/src/Components/BasicWindow.tsx @@ -2,17 +2,15 @@ import Header from "./Header"; import Footer from "./Footer"; function BasicWindow({ - username, content, buttons, }: { - username: string; content: React.ReactNode; buttons: React.ReactNode; }): JSX.Element { return (
-
+
{content}
{buttons}
From b9d7e57f2cfb6c09ce9b60fafdce93f2ca7c253e Mon Sep 17 00:00:00 2001 From: Davenludd Date: Mon, 18 Mar 2024 21:37:31 +0100 Subject: [PATCH 06/19] Update background image in Header component --- frontend/src/Components/Header.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/frontend/src/Components/Header.tsx b/frontend/src/Components/Header.tsx index 819c5de..5cdb421 100644 --- a/frontend/src/Components/Header.tsx +++ b/frontend/src/Components/Header.tsx @@ -1,5 +1,6 @@ import { useState } from "react"; import { Link } from "react-router-dom"; +import backgroundImage from "../assets/1.jpg"; function Header(): JSX.Element { const [isOpen, setIsOpen] = useState(false); @@ -11,7 +12,7 @@ function Header(): JSX.Element { return (
Date: Mon, 18 Mar 2024 21:37:52 +0100 Subject: [PATCH 07/19] Update user navigation route --- frontend/src/Pages/App.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/Pages/App.tsx b/frontend/src/Pages/App.tsx index 4263815..69fd698 100644 --- a/frontend/src/Pages/App.tsx +++ b/frontend/src/Pages/App.tsx @@ -13,7 +13,7 @@ function App(): JSX.Element { } else if (authority === 2) { navigate("/pm"); } else if (authority === 3) { - navigate("/user"); + navigate("/yourProjects"); } }, [authority, navigate]); From 93addc98704f7feac829a97285709b808032c141 Mon Sep 17 00:00:00 2001 From: Davenludd Date: Mon, 18 Mar 2024 21:40:07 +0100 Subject: [PATCH 08/19] Fixes in NewWeeklyReport component --- frontend/src/Components/NewWeeklyReport.tsx | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/frontend/src/Components/NewWeeklyReport.tsx b/frontend/src/Components/NewWeeklyReport.tsx index 4f919aa..86322e7 100644 --- a/frontend/src/Components/NewWeeklyReport.tsx +++ b/frontend/src/Components/NewWeeklyReport.tsx @@ -1,9 +1,8 @@ -import { useState, useContext } from "react"; +import { useState } from "react"; import { NewWeeklyReport } from "../Types/goTypes"; import { api } from "../API/API"; -import { useNavigate } from "react-router-dom"; +import { useNavigate, useParams } from "react-router-dom"; import Button from "./Button"; -import { ProjectNameContext } from "../Pages/YourProjectsPage"; export default function NewWeeklyReport(): JSX.Element { const [week, setWeek] = useState(0); @@ -14,12 +13,12 @@ export default function NewWeeklyReport(): JSX.Element { const [studyTime, setStudyTime] = useState(0); const [testingTime, setTestingTime] = useState(0); - const projectName = useContext(ProjectNameContext); + const { projectName } = useParams(); const token = localStorage.getItem("accessToken") ?? ""; const handleNewWeeklyReport = async (): Promise => { const newWeeklyReport: NewWeeklyReport = { - projectName, + projectName: projectName ?? "", week, developmentTime, meetingTime, @@ -46,7 +45,7 @@ export default function NewWeeklyReport(): JSX.Element { } e.preventDefault(); void handleNewWeeklyReport(); - navigate("/project"); + navigate(-1); }} >
From 31c5a78dae812238a65ff71b448d1102296903f1 Mon Sep 17 00:00:00 2001 From: Davenludd Date: Mon, 18 Mar 2024 21:52:34 +0100 Subject: [PATCH 09/19] Refactor routing paths in main.tsx --- frontend/src/main.tsx | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/frontend/src/main.tsx b/frontend/src/main.tsx index a1e466e..1c39ae9 100644 --- a/frontend/src/main.tsx +++ b/frontend/src/main.tsx @@ -46,30 +46,26 @@ const router = createBrowserRouter([ path: "/pm", element: , }, - { - path: "/user", - element: , - }, { path: "/yourProjects", element: , }, { - path: "/editTimeReport", - element: , - }, - { - path: "/newTimeReport", - element: , - }, - { - path: "/project", + path: "/project/:projectName", element: , }, { - path: "/projectPage", + path: "/newTimeReport/:projectName", + element: , + }, + { + path: "/projectPage/:projectName", element: , }, + { + path: "/editTimeReport", + element: , + }, { path: "/changeRole", element: , From f16dc1722cb073659e984464dd7faf2c0a2c1056 Mon Sep 17 00:00:00 2001 From: Davenludd Date: Mon, 18 Mar 2024 21:53:16 +0100 Subject: [PATCH 10/19] Update project name in YourProjectsPage.tsx URL --- frontend/src/Pages/YourProjectsPage.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/frontend/src/Pages/YourProjectsPage.tsx b/frontend/src/Pages/YourProjectsPage.tsx index e45d237..9e33696 100644 --- a/frontend/src/Pages/YourProjectsPage.tsx +++ b/frontend/src/Pages/YourProjectsPage.tsx @@ -28,7 +28,7 @@ function UserProjectPage(): JSX.Element { // Mock data const projects: Project[] = [ - { id: "1", name: "Project 1" }, + { id: "1", name: "Project Test App" }, { id: "2", name: "Project 2" }, { id: "3", name: "Project 3" }, // Add more mock projects as needed @@ -44,7 +44,7 @@ function UserProjectPage(): JSX.Element {
{projects.map((project, index) => ( { handleProjectClick(project.name); }} From 6982d2101666aaacee94485436fb5c6b247ca82c Mon Sep 17 00:00:00 2001 From: Davenludd Date: Mon, 18 Mar 2024 21:55:15 +0100 Subject: [PATCH 11/19] Add project name to URL in UserProjectPage --- frontend/src/Pages/UserPages/UserProjectPage.tsx | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/frontend/src/Pages/UserPages/UserProjectPage.tsx b/frontend/src/Pages/UserPages/UserProjectPage.tsx index eab866b..51effff 100644 --- a/frontend/src/Pages/UserPages/UserProjectPage.tsx +++ b/frontend/src/Pages/UserPages/UserProjectPage.tsx @@ -1,18 +1,20 @@ -import { Link, useLocation } from "react-router-dom"; +import { Link, useLocation, useParams } from "react-router-dom"; import BasicWindow from "../../Components/BasicWindow"; import BackButton from "../../Components/BackButton"; function UserProjectPage(): JSX.Element { + const { projectName } = useParams(); + const content = ( <>

{useLocation().state}

- +

Your Time Reports

- +

New Time Report

From 59add3b6b3912094862c0db49ca03f03acf6ee0c Mon Sep 17 00:00:00 2001 From: Davenludd Date: Mon, 18 Mar 2024 21:55:47 +0100 Subject: [PATCH 12/19] Remove username prop from BasicWindow component --- frontend/src/Pages/UserPages/UserProjectPage.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/Pages/UserPages/UserProjectPage.tsx b/frontend/src/Pages/UserPages/UserProjectPage.tsx index 51effff..80a0035 100644 --- a/frontend/src/Pages/UserPages/UserProjectPage.tsx +++ b/frontend/src/Pages/UserPages/UserProjectPage.tsx @@ -29,6 +29,6 @@ function UserProjectPage(): JSX.Element { ); - return ; + return ; } export default UserProjectPage; From 5a4049eaf3f77356816d2b026443dfe2816c6a8f Mon Sep 17 00:00:00 2001 From: Davenludd Date: Mon, 18 Mar 2024 21:56:37 +0100 Subject: [PATCH 13/19] Remove username prop from BasicWindow component --- frontend/src/Pages/YourProjectsPage.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/Pages/YourProjectsPage.tsx b/frontend/src/Pages/YourProjectsPage.tsx index 9e33696..d64df81 100644 --- a/frontend/src/Pages/YourProjectsPage.tsx +++ b/frontend/src/Pages/YourProjectsPage.tsx @@ -61,7 +61,7 @@ function UserProjectPage(): JSX.Element { const buttons = <>; - return ; + return ; } export default UserProjectPage; From 55fd42090d640e9c8aebde10eea3f474a3cda600 Mon Sep 17 00:00:00 2001 From: Davenludd Date: Mon, 18 Mar 2024 22:00:58 +0100 Subject: [PATCH 14/19] Remove username prop from BasicWindow component on all pages --- frontend/src/Pages/AdminPages/AdminAddProject.tsx | 2 +- frontend/src/Pages/AdminPages/AdminAddUser.tsx | 2 +- frontend/src/Pages/AdminPages/AdminChangeUsername.tsx | 2 +- frontend/src/Pages/AdminPages/AdminManageProjects.tsx | 2 +- frontend/src/Pages/AdminPages/AdminManageUsers.tsx | 2 +- frontend/src/Pages/AdminPages/AdminMenuPage.tsx | 2 +- frontend/src/Pages/AdminPages/AdminProjectAddMember.tsx | 2 +- frontend/src/Pages/AdminPages/AdminProjectChangeUserRole.tsx | 2 +- frontend/src/Pages/AdminPages/AdminProjectManageMembers.tsx | 2 +- frontend/src/Pages/AdminPages/AdminProjectPage.tsx | 2 +- frontend/src/Pages/AdminPages/AdminProjectStatistics.tsx | 2 +- frontend/src/Pages/AdminPages/AdminProjectViewMemberInfo.tsx | 2 +- frontend/src/Pages/AdminPages/AdminViewUserInfo.tsx | 2 +- frontend/src/Pages/ProjectManagerPages/PMChangeRole.tsx | 2 +- frontend/src/Pages/ProjectManagerPages/PMOtherUsersTR.tsx | 2 +- frontend/src/Pages/ProjectManagerPages/PMProjectMembers.tsx | 2 +- frontend/src/Pages/ProjectManagerPages/PMProjectPage.tsx | 2 +- .../src/Pages/ProjectManagerPages/PMTotalTimeActivity.tsx | 4 ++-- frontend/src/Pages/ProjectManagerPages/PMTotalTimeRole.tsx | 2 +- frontend/src/Pages/ProjectManagerPages/PMUnsignedReports.tsx | 2 +- .../src/Pages/ProjectManagerPages/PMViewUnsignedReport.tsx | 3 ++- frontend/src/Pages/UserPages/UserEditTimeReportPage.tsx | 2 +- frontend/src/Pages/UserPages/UserNewTimeReportPage.tsx | 2 +- frontend/src/Pages/UserPages/UserViewTimeReportsPage.tsx | 2 +- 24 files changed, 26 insertions(+), 25 deletions(-) diff --git a/frontend/src/Pages/AdminPages/AdminAddProject.tsx b/frontend/src/Pages/AdminPages/AdminAddProject.tsx index 6df8851..aedbd3f 100644 --- a/frontend/src/Pages/AdminPages/AdminAddProject.tsx +++ b/frontend/src/Pages/AdminPages/AdminAddProject.tsx @@ -11,6 +11,6 @@ function AdminAddProject(): JSX.Element { ); - return ; + return ; } export default AdminAddProject; diff --git a/frontend/src/Pages/AdminPages/AdminAddUser.tsx b/frontend/src/Pages/AdminPages/AdminAddUser.tsx index c0f9492..38f00d5 100644 --- a/frontend/src/Pages/AdminPages/AdminAddUser.tsx +++ b/frontend/src/Pages/AdminPages/AdminAddUser.tsx @@ -21,6 +21,6 @@ function AdminAddUser(): JSX.Element { ); - return ; + return ; } export default AdminAddUser; diff --git a/frontend/src/Pages/AdminPages/AdminChangeUsername.tsx b/frontend/src/Pages/AdminPages/AdminChangeUsername.tsx index 2e03a8c..1756433 100644 --- a/frontend/src/Pages/AdminPages/AdminChangeUsername.tsx +++ b/frontend/src/Pages/AdminPages/AdminChangeUsername.tsx @@ -23,6 +23,6 @@ function AdminChangeUsername(): JSX.Element { ); - return ; + return ; } export default AdminChangeUsername; diff --git a/frontend/src/Pages/AdminPages/AdminManageProjects.tsx b/frontend/src/Pages/AdminPages/AdminManageProjects.tsx index c5cba2e..177f55b 100644 --- a/frontend/src/Pages/AdminPages/AdminManageProjects.tsx +++ b/frontend/src/Pages/AdminPages/AdminManageProjects.tsx @@ -21,6 +21,6 @@ function AdminManageProjects(): JSX.Element { ); - return ; + return ; } export default AdminManageProjects; diff --git a/frontend/src/Pages/AdminPages/AdminManageUsers.tsx b/frontend/src/Pages/AdminPages/AdminManageUsers.tsx index e62a54c..0939d77 100644 --- a/frontend/src/Pages/AdminPages/AdminManageUsers.tsx +++ b/frontend/src/Pages/AdminPages/AdminManageUsers.tsx @@ -36,6 +36,6 @@ function AdminManageUsers(): JSX.Element { ); - return ; + return ; } export default AdminManageUsers; diff --git a/frontend/src/Pages/AdminPages/AdminMenuPage.tsx b/frontend/src/Pages/AdminPages/AdminMenuPage.tsx index a8da80e..ed2118d 100644 --- a/frontend/src/Pages/AdminPages/AdminMenuPage.tsx +++ b/frontend/src/Pages/AdminPages/AdminMenuPage.tsx @@ -22,6 +22,6 @@ function AdminMenuPage(): JSX.Element { const buttons = <>; - return ; + return ; } export default AdminMenuPage; diff --git a/frontend/src/Pages/AdminPages/AdminProjectAddMember.tsx b/frontend/src/Pages/AdminPages/AdminProjectAddMember.tsx index 63fdb4b..96167cb 100644 --- a/frontend/src/Pages/AdminPages/AdminProjectAddMember.tsx +++ b/frontend/src/Pages/AdminPages/AdminProjectAddMember.tsx @@ -23,6 +23,6 @@ function AdminProjectAddMember(): JSX.Element { ); - return ; + return ; } export default AdminProjectAddMember; diff --git a/frontend/src/Pages/AdminPages/AdminProjectChangeUserRole.tsx b/frontend/src/Pages/AdminPages/AdminProjectChangeUserRole.tsx index dd80fa9..dd355e8 100644 --- a/frontend/src/Pages/AdminPages/AdminProjectChangeUserRole.tsx +++ b/frontend/src/Pages/AdminPages/AdminProjectChangeUserRole.tsx @@ -23,6 +23,6 @@ function AdminProjectChangeUserRole(): JSX.Element { ); - return ; + return ; } export default AdminProjectChangeUserRole; diff --git a/frontend/src/Pages/AdminPages/AdminProjectManageMembers.tsx b/frontend/src/Pages/AdminPages/AdminProjectManageMembers.tsx index 717e8c5..c89e4c4 100644 --- a/frontend/src/Pages/AdminPages/AdminProjectManageMembers.tsx +++ b/frontend/src/Pages/AdminPages/AdminProjectManageMembers.tsx @@ -23,6 +23,6 @@ function AdminProjectManageMembers(): JSX.Element { ); - return ; + return ; } export default AdminProjectManageMembers; diff --git a/frontend/src/Pages/AdminPages/AdminProjectPage.tsx b/frontend/src/Pages/AdminPages/AdminProjectPage.tsx index 0b15aeb..a1266ad 100644 --- a/frontend/src/Pages/AdminPages/AdminProjectPage.tsx +++ b/frontend/src/Pages/AdminPages/AdminProjectPage.tsx @@ -23,6 +23,6 @@ function AdminProjectPage(): JSX.Element { ); - return ; + return ; } export default AdminProjectPage; diff --git a/frontend/src/Pages/AdminPages/AdminProjectStatistics.tsx b/frontend/src/Pages/AdminPages/AdminProjectStatistics.tsx index a5d9f95..dbf3428 100644 --- a/frontend/src/Pages/AdminPages/AdminProjectStatistics.tsx +++ b/frontend/src/Pages/AdminPages/AdminProjectStatistics.tsx @@ -16,6 +16,6 @@ function AdminProjectStatistics(): JSX.Element { ); - return ; + return ; } export default AdminProjectStatistics; diff --git a/frontend/src/Pages/AdminPages/AdminProjectViewMemberInfo.tsx b/frontend/src/Pages/AdminPages/AdminProjectViewMemberInfo.tsx index e15ef35..1c9f28c 100644 --- a/frontend/src/Pages/AdminPages/AdminProjectViewMemberInfo.tsx +++ b/frontend/src/Pages/AdminPages/AdminProjectViewMemberInfo.tsx @@ -23,6 +23,6 @@ function AdminProjectViewMemberInfo(): JSX.Element { ); - return ; + return ; } export default AdminProjectViewMemberInfo; diff --git a/frontend/src/Pages/AdminPages/AdminViewUserInfo.tsx b/frontend/src/Pages/AdminPages/AdminViewUserInfo.tsx index 44cd2fa..8b7cd8a 100644 --- a/frontend/src/Pages/AdminPages/AdminViewUserInfo.tsx +++ b/frontend/src/Pages/AdminPages/AdminViewUserInfo.tsx @@ -26,6 +26,6 @@ function AdminViewUserInfo(): JSX.Element { ); - return ; + return ; } export default AdminViewUserInfo; diff --git a/frontend/src/Pages/ProjectManagerPages/PMChangeRole.tsx b/frontend/src/Pages/ProjectManagerPages/PMChangeRole.tsx index 606e474..9f233a1 100644 --- a/frontend/src/Pages/ProjectManagerPages/PMChangeRole.tsx +++ b/frontend/src/Pages/ProjectManagerPages/PMChangeRole.tsx @@ -18,6 +18,6 @@ function ChangeRole(): JSX.Element { ); - return ; + return ; } export default ChangeRole; diff --git a/frontend/src/Pages/ProjectManagerPages/PMOtherUsersTR.tsx b/frontend/src/Pages/ProjectManagerPages/PMOtherUsersTR.tsx index 19ebbd9..c76947b 100644 --- a/frontend/src/Pages/ProjectManagerPages/PMOtherUsersTR.tsx +++ b/frontend/src/Pages/ProjectManagerPages/PMOtherUsersTR.tsx @@ -10,6 +10,6 @@ function PMOtherUsersTR(): JSX.Element { ); - return ; + return ; } export default PMOtherUsersTR; diff --git a/frontend/src/Pages/ProjectManagerPages/PMProjectMembers.tsx b/frontend/src/Pages/ProjectManagerPages/PMProjectMembers.tsx index bbafd6a..9fe96cf 100644 --- a/frontend/src/Pages/ProjectManagerPages/PMProjectMembers.tsx +++ b/frontend/src/Pages/ProjectManagerPages/PMProjectMembers.tsx @@ -30,6 +30,6 @@ function PMProjectMembers(): JSX.Element { ); - return ; + return ; } export default PMProjectMembers; diff --git a/frontend/src/Pages/ProjectManagerPages/PMProjectPage.tsx b/frontend/src/Pages/ProjectManagerPages/PMProjectPage.tsx index 8e724f3..bd4e6ef 100644 --- a/frontend/src/Pages/ProjectManagerPages/PMProjectPage.tsx +++ b/frontend/src/Pages/ProjectManagerPages/PMProjectPage.tsx @@ -31,6 +31,6 @@ function PMProjectPage(): JSX.Element { ); - return ; + return ; } export default PMProjectPage; diff --git a/frontend/src/Pages/ProjectManagerPages/PMTotalTimeActivity.tsx b/frontend/src/Pages/ProjectManagerPages/PMTotalTimeActivity.tsx index 35ed6ac..44d2cda 100644 --- a/frontend/src/Pages/ProjectManagerPages/PMTotalTimeActivity.tsx +++ b/frontend/src/Pages/ProjectManagerPages/PMTotalTimeActivity.tsx @@ -1,6 +1,6 @@ import BasicWindow from "../../Components/BasicWindow"; -import Button from "../../Components/Button"; import TimeReport from "../../Components/NewWeeklyReport"; +import BackButton from "../../Components/BackButton"; function PMTotalTimeActivity(): JSX.Element { const content = ( @@ -18,6 +18,6 @@ function PMTotalTimeActivity(): JSX.Element { ); - return ; + return ; } export default PMTotalTimeActivity; diff --git a/frontend/src/Pages/ProjectManagerPages/PMTotalTimeRole.tsx b/frontend/src/Pages/ProjectManagerPages/PMTotalTimeRole.tsx index 05d902f..c0161f8 100644 --- a/frontend/src/Pages/ProjectManagerPages/PMTotalTimeRole.tsx +++ b/frontend/src/Pages/ProjectManagerPages/PMTotalTimeRole.tsx @@ -10,6 +10,6 @@ function PMTotalTimeRole(): JSX.Element { ); - return ; + return ; } export default PMTotalTimeRole; diff --git a/frontend/src/Pages/ProjectManagerPages/PMUnsignedReports.tsx b/frontend/src/Pages/ProjectManagerPages/PMUnsignedReports.tsx index fae3842..713efec 100644 --- a/frontend/src/Pages/ProjectManagerPages/PMUnsignedReports.tsx +++ b/frontend/src/Pages/ProjectManagerPages/PMUnsignedReports.tsx @@ -10,6 +10,6 @@ function PMUnsignedReports(): JSX.Element { ); - return ; + return ; } export default PMUnsignedReports; diff --git a/frontend/src/Pages/ProjectManagerPages/PMViewUnsignedReport.tsx b/frontend/src/Pages/ProjectManagerPages/PMViewUnsignedReport.tsx index 9ca963c..6e28071 100644 --- a/frontend/src/Pages/ProjectManagerPages/PMViewUnsignedReport.tsx +++ b/frontend/src/Pages/ProjectManagerPages/PMViewUnsignedReport.tsx @@ -1,6 +1,7 @@ import BasicWindow from "../../Components/BasicWindow"; import Button from "../../Components/Button"; import TimeReport from "../../Components/NewWeeklyReport"; +import BackButton from "../../Components/BackButton"; function PMViewUnsignedReport(): JSX.Element { const content = ( @@ -32,6 +33,6 @@ function PMViewUnsignedReport(): JSX.Element { ); - return ; + return ; } export default PMViewUnsignedReport; diff --git a/frontend/src/Pages/UserPages/UserEditTimeReportPage.tsx b/frontend/src/Pages/UserPages/UserEditTimeReportPage.tsx index e1b1d66..317cec8 100644 --- a/frontend/src/Pages/UserPages/UserEditTimeReportPage.tsx +++ b/frontend/src/Pages/UserPages/UserEditTimeReportPage.tsx @@ -16,6 +16,6 @@ function UserEditTimeReportPage(): JSX.Element { ); - return ; + return ; } export default UserEditTimeReportPage; diff --git a/frontend/src/Pages/UserPages/UserNewTimeReportPage.tsx b/frontend/src/Pages/UserPages/UserNewTimeReportPage.tsx index e54b207..2cdeb15 100644 --- a/frontend/src/Pages/UserPages/UserNewTimeReportPage.tsx +++ b/frontend/src/Pages/UserPages/UserNewTimeReportPage.tsx @@ -25,6 +25,6 @@ function UserNewTimeReportPage(): JSX.Element { ); - return ; + return ; } export default UserNewTimeReportPage; diff --git a/frontend/src/Pages/UserPages/UserViewTimeReportsPage.tsx b/frontend/src/Pages/UserPages/UserViewTimeReportsPage.tsx index 1d2c3f4..ca326a0 100644 --- a/frontend/src/Pages/UserPages/UserViewTimeReportsPage.tsx +++ b/frontend/src/Pages/UserPages/UserViewTimeReportsPage.tsx @@ -15,6 +15,6 @@ function UserViewTimeReportsPage(): JSX.Element { ); - return ; + return ; } export default UserViewTimeReportsPage; From 8df3311f5a41003264fdbf35f647be069b1e02b1 Mon Sep 17 00:00:00 2001 From: Davenludd Date: Mon, 18 Mar 2024 22:59:16 +0100 Subject: [PATCH 15/19] Remove duplicate code in UserProjectPage --- frontend/src/Pages/YourProjectsPage.tsx | 1 - 1 file changed, 1 deletion(-) diff --git a/frontend/src/Pages/YourProjectsPage.tsx b/frontend/src/Pages/YourProjectsPage.tsx index adf4482..973baa3 100644 --- a/frontend/src/Pages/YourProjectsPage.tsx +++ b/frontend/src/Pages/YourProjectsPage.tsx @@ -62,7 +62,6 @@ function UserProjectPage(): JSX.Element { const buttons = <>; return ; - return ; } export default UserProjectPage; From cc09eb0ead42a79912c32e052823a5295231b643 Mon Sep 17 00:00:00 2001 From: Davenludd Date: Mon, 18 Mar 2024 23:01:30 +0100 Subject: [PATCH 16/19] Remove duplicate import statements --- frontend/src/Pages/ProjectManagerPages/PMTotalTimeActivity.tsx | 1 - frontend/src/Pages/ProjectManagerPages/PMViewUnsignedReport.tsx | 1 - 2 files changed, 2 deletions(-) diff --git a/frontend/src/Pages/ProjectManagerPages/PMTotalTimeActivity.tsx b/frontend/src/Pages/ProjectManagerPages/PMTotalTimeActivity.tsx index 5e0b6c7..676ea28 100644 --- a/frontend/src/Pages/ProjectManagerPages/PMTotalTimeActivity.tsx +++ b/frontend/src/Pages/ProjectManagerPages/PMTotalTimeActivity.tsx @@ -1,7 +1,6 @@ import BackButton from "../../Components/BackButton"; import BasicWindow from "../../Components/BasicWindow"; import TimeReport from "../../Components/NewWeeklyReport"; -import BackButton from "../../Components/BackButton"; function PMTotalTimeActivity(): JSX.Element { const content = ( diff --git a/frontend/src/Pages/ProjectManagerPages/PMViewUnsignedReport.tsx b/frontend/src/Pages/ProjectManagerPages/PMViewUnsignedReport.tsx index 6276d16..aea25fb 100644 --- a/frontend/src/Pages/ProjectManagerPages/PMViewUnsignedReport.tsx +++ b/frontend/src/Pages/ProjectManagerPages/PMViewUnsignedReport.tsx @@ -2,7 +2,6 @@ import BackButton from "../../Components/BackButton"; import BasicWindow from "../../Components/BasicWindow"; import Button from "../../Components/Button"; import TimeReport from "../../Components/NewWeeklyReport"; -import BackButton from "../../Components/BackButton"; function PMViewUnsignedReport(): JSX.Element { const content = ( From 83f8097c2b8e7fcd07f10c2be5b813b02fc40d69 Mon Sep 17 00:00:00 2001 From: al8763be Date: Tue, 19 Mar 2024 00:20:08 +0100 Subject: [PATCH 17/19] API getUserProjects Fucked --- frontend/src/API/API.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/API/API.ts b/frontend/src/API/API.ts index 6078513..a06f804 100644 --- a/frontend/src/API/API.ts +++ b/frontend/src/API/API.ts @@ -176,7 +176,7 @@ export const api: API = { } catch (e) { return Promise.resolve({ success: false, - message: "Failed to get user projects", + message: "API fucked", }); } }, From 59c4dab2e26ccb942ab38d7621d27d69654f2754 Mon Sep 17 00:00:00 2001 From: al8763be Date: Tue, 19 Mar 2024 00:26:17 +0100 Subject: [PATCH 18/19] quick fix for getUserProjects API --- frontend/src/API/API.ts | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/frontend/src/API/API.ts b/frontend/src/API/API.ts index a06f804..cab3b6b 100644 --- a/frontend/src/API/API.ts +++ b/frontend/src/API/API.ts @@ -150,10 +150,7 @@ export const api: API = { } }, - async getUserProjects( - username: string, - token: string, - ): Promise> { + async getUserProjects(token: string): Promise> { try { const response = await fetch("/api/getUserProjects", { method: "GET", @@ -161,7 +158,6 @@ export const api: API = { "Content-Type": "application/json", Authorization: "Bearer " + token, }, - body: JSON.stringify({ username }), }); if (!response.ok) { From d7e14f18860c41e5a0416e1584bba63d9daace14 Mon Sep 17 00:00:00 2001 From: al8763be Date: Tue, 19 Mar 2024 00:27:35 +0100 Subject: [PATCH 19/19] quick fix for getUserProjects API --- frontend/src/API/API.ts | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/frontend/src/API/API.ts b/frontend/src/API/API.ts index cab3b6b..8fd66d3 100644 --- a/frontend/src/API/API.ts +++ b/frontend/src/API/API.ts @@ -42,10 +42,7 @@ interface API { token: string, ): Promise>; /** Gets all the projects of a user*/ - getUserProjects( - username: string, - token: string, - ): Promise>; + getUserProjects(token: string): Promise>; /** Gets a project from id*/ getProject(id: number): Promise>; }