From 03f350f303637ecc0d5ce05f1d3af8d2cd21cf22 Mon Sep 17 00:00:00 2001 From: Davenludd Date: Thu, 14 Mar 2024 13:21:19 +0100 Subject: [PATCH 01/19] Made a new component for time reporting --- frontend/src/Components/NewTImeReport.tsx | 60 +++++++++++++++++++ .../Pages/UserPages/UserNewTimeReportPage.tsx | 7 ++- 2 files changed, 66 insertions(+), 1 deletion(-) create mode 100644 frontend/src/Components/NewTImeReport.tsx diff --git a/frontend/src/Components/NewTImeReport.tsx b/frontend/src/Components/NewTImeReport.tsx new file mode 100644 index 0000000..3c0e49d --- /dev/null +++ b/frontend/src/Components/NewTImeReport.tsx @@ -0,0 +1,60 @@ +function NewTimeReport(): JSX.Element { + const activities = [ + "Development", + "Meeting", + "Administration", + "Own Work", + "Studies", + "Testing", + ]; + + return ( + <> +

New Time Report

+
+ { + event.preventDefault(); + }} + onPaste={(event) => { + event.preventDefault(); + }} + /> + + + + + + + + + {activities.map((activity, index) => ( + + + + + ))} + +
Activity + Total Time (min) +
{activity} + { + const keyValue = event.key; + if (!/\d/.test(keyValue) && keyValue !== "Backspace") + event.preventDefault(); + }} + /> +
+
+ + ); +} + +export default NewTimeReport; diff --git a/frontend/src/Pages/UserPages/UserNewTimeReportPage.tsx b/frontend/src/Pages/UserPages/UserNewTimeReportPage.tsx index b4e8436..d432817 100644 --- a/frontend/src/Pages/UserPages/UserNewTimeReportPage.tsx +++ b/frontend/src/Pages/UserPages/UserNewTimeReportPage.tsx @@ -1,8 +1,13 @@ import BasicWindow from "../../Components/BasicWindow"; import Button from "../../Components/Button"; +import NewTimeReport from "../../Components/NewTImeReport"; function UserNewTimeReportPage(): JSX.Element { - const content = <>; + const content = ( + <> + + + ); const buttons = ( <> From c5d5c389dd70a15889ca4f521d54e475b7c86fe0 Mon Sep 17 00:00:00 2001 From: Mattias Date: Thu, 14 Mar 2024 14:29:10 +0100 Subject: [PATCH 02/19] Added new paths in main --- frontend/src/main.tsx | 28 ++++++++++++++++++++++++---- 1 file changed, 24 insertions(+), 4 deletions(-) diff --git a/frontend/src/main.tsx b/frontend/src/main.tsx index 996e78d..f377260 100644 --- a/frontend/src/main.tsx +++ b/frontend/src/main.tsx @@ -13,6 +13,10 @@ import PMChangeRole from "./Pages/ProjectManagerPages/PMChangeRole.tsx"; import PMOtherUsersTR from "./Pages/ProjectManagerPages/PMOtherUsersTR.tsx"; import PMProjectMembers from "./Pages/ProjectManagerPages/PMProjectMembers.tsx"; import PMProjectPage from "./Pages/ProjectManagerPages/PMProjectPage.tsx"; +import PMTotalTimeActivity from "./Pages/ProjectManagerPages/PMTotalTimeActivity.tsx"; +import PMTotalTimeRole from "./Pages/ProjectManagerPages/PMTotalTimeRole.tsx"; +import PMUnsignedReports from "./Pages/ProjectManagerPages/PMUnsignedReports.tsx"; +import PMViewUnsignedReport from "./Pages/ProjectManagerPages/PMViewUnsignedReport.tsx"; // This is where the routes are mounted const router = createBrowserRouter([ @@ -20,10 +24,6 @@ const router = createBrowserRouter([ path: "/", element: , }, - { - path: "/admin-menu", - element: , - }, { path: "/your-projects", element: , @@ -60,6 +60,26 @@ const router = createBrowserRouter([ path: "/PM-project-page", element: , }, + { + path: "/PM-time-activity", + element: , + }, + { + path: "/PM-time-role", + element: , + }, + { + path: "/PM-unsigned-reports", + element: , + }, + { + path: "/PM-view-unsigned-report", + element: , + }, + { + path: "/admin-menu", + element: , + }, ]); // Semi-hacky way to get the root element From 434879c26ce26096fa838d3bb14b408f88da47be Mon Sep 17 00:00:00 2001 From: Davenludd Date: Thu, 14 Mar 2024 14:27:54 +0100 Subject: [PATCH 03/19] Add AdminManageUsers page & buttons --- .../src/Pages/AdminPages/AdminManageUsers.tsx | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 frontend/src/Pages/AdminPages/AdminManageUsers.tsx diff --git a/frontend/src/Pages/AdminPages/AdminManageUsers.tsx b/frontend/src/Pages/AdminPages/AdminManageUsers.tsx new file mode 100644 index 0000000..b25b120 --- /dev/null +++ b/frontend/src/Pages/AdminPages/AdminManageUsers.tsx @@ -0,0 +1,26 @@ +import BasicWindow from "../../Components/BasicWindow"; +import Button from "../../Components/Button"; + +function AdminManageUsers(): JSX.Element { + const content = <>; + + const buttons = ( + <> +