Merge branch 'frontend' into dev

This commit is contained in:
Imbus 2024-03-14 18:40:07 +01:00
commit df7ca1ab90
19 changed files with 496 additions and 20 deletions

View file

@ -0,0 +1,59 @@
function NewTimeReport(): JSX.Element {
const activities = [
"Development",
"Meeting",
"Administration",
"Own Work",
"Studies",
"Testing",
];
return (
<>
<div className="border-4 border-black bg-white flex flex-col justify-start min-h-[65vh] h-fit w-[50vw] rounded-3xl overflow-scroll space-y-[2vh] p-[30px] items-center">
<input
className="w-fill h-[5vh] font-sans text-[3vh] pl-[1vw] rounded-full text-center pt-[1vh] pb-[1vh] border-2 border-black"
type="week"
placeholder="Week"
onKeyDown={(event) => {
event.preventDefault();
}}
onPaste={(event) => {
event.preventDefault();
}}
/>
<table className="w-full text-center divide-y divide-x divide-white text-[30px]">
<thead>
<tr>
<th className="w-1/2 py-2 border-b-2 border-black">Activity</th>
<th className="w-1/2 py-2 border-b-2 border-black">
Total Time (min)
</th>
</tr>
</thead>
<tbody className="divide-y divide-black">
{activities.map((activity, index) => (
<tr key={index} className="h-[10vh]">
<td>{activity}</td>
<td>
<input
type="number"
min="0"
className="border-2 border-black rounded-md text-center w-1/2"
onKeyDown={(event) => {
const keyValue = event.key;
if (!/\d/.test(keyValue) && keyValue !== "Backspace")
event.preventDefault();
}}
/>
</td>
</tr>
))}
</tbody>
</table>
</div>
</>
);
}
export default NewTimeReport;

View file

@ -0,0 +1,26 @@
import BasicWindow from "../../Components/BasicWindow";
import Button from "../../Components/Button";
function AdminAddProject(): JSX.Element {
const content = <></>;
const buttons = (
<>
<Button
text="Finish"
onClick={(): void => {
return;
}}
/>
<Button
text="Back"
onClick={(): void => {
return;
}}
/>
</>
);
return <BasicWindow username="Admin" content={content} buttons={buttons} />;
}
export default AdminAddProject;

View file

@ -0,0 +1,26 @@
import BasicWindow from "../../Components/BasicWindow";
import Button from "../../Components/Button";
function AdminAddUser(): JSX.Element {
const content = <></>;
const buttons = (
<>
<Button
text="Finish"
onClick={(): void => {
return;
}}
/>
<Button
text="Back"
onClick={(): void => {
return;
}}
/>
</>
);
return <BasicWindow username="Admin" content={content} buttons={buttons} />;
}
export default AdminAddUser;

View file

@ -0,0 +1,26 @@
import BasicWindow from "../../Components/BasicWindow";
import Button from "../../Components/Button";
function AdminChangeUsername(): JSX.Element {
const content = <></>;
const buttons = (
<>
<Button
text="Finish"
onClick={(): void => {
return;
}}
/>
<Button
text="Back"
onClick={(): void => {
return;
}}
/>
</>
);
return <BasicWindow username="Admin" content={content} buttons={buttons} />;
}
export default AdminChangeUsername;

View file

@ -0,0 +1,26 @@
import BasicWindow from "../../Components/BasicWindow";
import Button from "../../Components/Button";
function AdminManageProjects(): JSX.Element {
const content = <></>;
const buttons = (
<>
<Button
text="Add Project"
onClick={(): void => {
return;
}}
/>
<Button
text="Back"
onClick={(): void => {
return;
}}
/>
</>
);
return <BasicWindow username="Admin" content={content} buttons={buttons} />;
}
export default AdminManageProjects;

View file

@ -0,0 +1,26 @@
import BasicWindow from "../../Components/BasicWindow";
import Button from "../../Components/Button";
function AdminManageUsers(): JSX.Element {
const content = <></>;
const buttons = (
<>
<Button
text="Add User"
onClick={(): void => {
return;
}}
/>
<Button
text="Back"
onClick={(): void => {
return;
}}
/>
</>
);
return <BasicWindow username="Admin" content={content} buttons={buttons} />;
}
export default AdminManageUsers;

View file

@ -0,0 +1,26 @@
import BasicWindow from "../../Components/BasicWindow";
import Button from "../../Components/Button";
function AdminProjectAddMember(): JSX.Element {
const content = <></>;
const buttons = (
<>
<Button
text="Add"
onClick={(): void => {
return;
}}
/>
<Button
text="Back"
onClick={(): void => {
return;
}}
/>
</>
);
return <BasicWindow username="Admin" content={content} buttons={buttons} />;
}
export default AdminProjectAddMember;

View file

@ -0,0 +1,26 @@
import BasicWindow from "../../Components/BasicWindow";
import Button from "../../Components/Button";
function AdminProjectChangeUserRole(): JSX.Element {
const content = <></>;
const buttons = (
<>
<Button
text="Change"
onClick={(): void => {
return;
}}
/>
<Button
text="Back"
onClick={(): void => {
return;
}}
/>
</>
);
return <BasicWindow username="Admin" content={content} buttons={buttons} />;
}
export default AdminProjectChangeUserRole;

View file

@ -0,0 +1,26 @@
import BasicWindow from "../../Components/BasicWindow";
import Button from "../../Components/Button";
function AdminProjectManageMembers(): JSX.Element {
const content = <></>;
const buttons = (
<>
<Button
text="Add Member"
onClick={(): void => {
return;
}}
/>
<Button
text="Back"
onClick={(): void => {
return;
}}
/>
</>
);
return <BasicWindow username="Admin" content={content} buttons={buttons} />;
}
export default AdminProjectManageMembers;

View file

@ -0,0 +1,26 @@
import BasicWindow from "../../Components/BasicWindow";
import Button from "../../Components/Button";
function AdminProjectPage(): JSX.Element {
const content = <></>;
const buttons = (
<>
<Button
text="Delete"
onClick={(): void => {
return;
}}
/>
<Button
text="Back"
onClick={(): void => {
return;
}}
/>
</>
);
return <BasicWindow username="Admin" content={content} buttons={buttons} />;
}
export default AdminProjectPage;

View file

@ -0,0 +1,20 @@
import BasicWindow from "../../Components/BasicWindow";
import Button from "../../Components/Button";
function AdminProjectStatistics(): JSX.Element {
const content = <></>;
const buttons = (
<>
<Button
text="Back"
onClick={(): void => {
return;
}}
/>
</>
);
return <BasicWindow username="Admin" content={content} buttons={buttons} />;
}
export default AdminProjectStatistics;

View file

@ -0,0 +1,26 @@
import BasicWindow from "../../Components/BasicWindow";
import Button from "../../Components/Button";
function AdminProjectViewMemberInfo(): JSX.Element {
const content = <></>;
const buttons = (
<>
<Button
text="Remove"
onClick={(): void => {
return;
}}
/>
<Button
text="Back"
onClick={(): void => {
return;
}}
/>
</>
);
return <BasicWindow username="Admin" content={content} buttons={buttons} />;
}
export default AdminProjectViewMemberInfo;

View file

@ -0,0 +1,26 @@
import BasicWindow from "../../Components/BasicWindow";
import Button from "../../Components/Button";
function AdminViewUserInfo(): JSX.Element {
const content = <></>;
const buttons = (
<>
<Button
text="Delete"
onClick={(): void => {
return;
}}
/>
<Button
text="Back"
onClick={(): void => {
return;
}}
/>
</>
);
return <BasicWindow username="Admin" content={content} buttons={buttons} />;
}
export default AdminViewUserInfo;

View file

@ -1,8 +1,16 @@
import BasicWindow from "../../Components/BasicWindow"; import BasicWindow from "../../Components/BasicWindow";
import Button from "../../Components/Button"; import Button from "../../Components/Button";
import TimeReport from "../../Components/TimeReport";
function PMTotalTimeActivity(): JSX.Element { function PMTotalTimeActivity(): JSX.Element {
const content = <></>; const content = (
<>
<h1 className="font-bold text-[30px] mb-[20px]">
Total Time Per Activity
</h1>
<TimeReport />
</>
);
const buttons = ( const buttons = (
<> <>

View file

@ -1,8 +1,16 @@
import BasicWindow from "../../Components/BasicWindow"; import BasicWindow from "../../Components/BasicWindow";
import Button from "../../Components/Button"; import Button from "../../Components/Button";
import TimeReport from "../../Components/TimeReport";
function PMViewUnsignedReport(): JSX.Element { function PMViewUnsignedReport(): JSX.Element {
const content = <></>; const content = (
<>
<h1 className="font-bold text-[30px] mb-[20px]">
Username&apos;s Time Report
</h1>
<TimeReport />
</>
);
const buttons = ( const buttons = (
<> <>

View file

@ -1,8 +1,14 @@
import BasicWindow from "../../Components/BasicWindow"; import BasicWindow from "../../Components/BasicWindow";
import Button from "../../Components/Button"; import Button from "../../Components/Button";
import NewTimeReport from "../../Components/TimeReport";
function UserEditTimeReportPage(): JSX.Element { function UserEditTimeReportPage(): JSX.Element {
const content = <></>; const content = (
<>
<h1 className="font-bold text-[30px] mb-[20px]">Edit Time Report</h1>
<NewTimeReport />
</>
);
const buttons = ( const buttons = (
<> <>

View file

@ -1,8 +1,15 @@
import BasicWindow from "../../Components/BasicWindow"; import BasicWindow from "../../Components/BasicWindow";
import Button from "../../Components/Button"; import Button from "../../Components/Button";
import NewTimeReport from "../../Components/TimeReport";
import { Link } from "react-router-dom";
function UserNewTimeReportPage(): JSX.Element { function UserNewTimeReportPage(): JSX.Element {
const content = <></>; const content = (
<>
<h1 className="font-bold text-[30px] mb-[20px]">New Time Report</h1>
<NewTimeReport />
</>
);
const buttons = ( const buttons = (
<> <>
@ -12,12 +19,14 @@ function UserNewTimeReportPage(): JSX.Element {
return; return;
}} }}
/> />
<Link to="/project">
<Button <Button
text="Back" text="Back"
onClick={(): void => { onClick={(): void => {
return; return;
}} }}
/> />
</Link>
</> </>
); );

View file

@ -5,16 +5,16 @@ import Button from "../../Components/Button";
function UserProjectPage(): JSX.Element { function UserProjectPage(): JSX.Element {
const content = ( const content = (
<> <>
<Link to="/settingsPage">
<h1 className="font-bold text-[30px] mb-[20px]">ProjectNameExample</h1> <h1 className="font-bold text-[30px] mb-[20px]">ProjectNameExample</h1>
</Link>
<div className="border-4 border-black bg-white flex flex-col items-center justify-center min-h-[65vh] h-fit w-[50vw] rounded-3xl content-center overflow-scroll space-y-[10vh] p-[30px]"> <div className="border-4 border-black bg-white flex flex-col items-center justify-center min-h-[65vh] h-fit w-[50vw] rounded-3xl content-center overflow-scroll space-y-[10vh] p-[30px]">
<h1 className="font-bold underline text-[30px] cursor-pointer"> <h1 className="font-bold underline text-[30px] cursor-pointer">
Your Time Reports Your Time Reports
</h1> </h1>
<Link to="/new-time-report">
<h1 className="font-bold underline text-[30px] cursor-pointer"> <h1 className="font-bold underline text-[30px] cursor-pointer">
New Time Report New Time Report
</h1> </h1>
</Link>
</div> </div>
</> </>
); );

View file

@ -14,6 +14,22 @@ import PMChangeRole from "./Pages/ProjectManagerPages/PMChangeRole.tsx";
import PMOtherUsersTR from "./Pages/ProjectManagerPages/PMOtherUsersTR.tsx"; import PMOtherUsersTR from "./Pages/ProjectManagerPages/PMOtherUsersTR.tsx";
import PMProjectMembers from "./Pages/ProjectManagerPages/PMProjectMembers.tsx"; import PMProjectMembers from "./Pages/ProjectManagerPages/PMProjectMembers.tsx";
import PMProjectPage from "./Pages/ProjectManagerPages/PMProjectPage.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";
import AdminManageUsers from "./Pages/AdminPages/AdminManageUsers.tsx";
import AdminViewUserInfo from "./Pages/AdminPages/AdminViewUserInfo.tsx";
import AdminManageProjects from "./Pages/AdminPages/AdminManageProjects.tsx";
import AdminAddProject from "./Pages/AdminPages/AdminAddProject.tsx";
import AdminAddUser from "./Pages/AdminPages/AdminAddUser.tsx";
import AdminChangeUsername from "./Pages/AdminPages/AdminChangeUsername.tsx";
import AdminProjectAddMember from "./Pages/AdminPages/AdminProjectAddMember.tsx";
import AdminProjectChangeUserRole from "./Pages/AdminPages/AdminProjectChangeUserRole.tsx";
import AdminProjectManageMembers from "./Pages/AdminPages/AdminProjectManageMembers.tsx";
import AdminProjectStatistics from "./Pages/AdminPages/AdminProjectStatistics.tsx";
import AdminProjectViewMemberInfo from "./Pages/AdminPages/AdminProjectViewMemberInfo.tsx";
import AdminProjectPage from "./Pages/AdminPages/AdminProjectPage.tsx";
// This is where the routes are mounted // This is where the routes are mounted
const router = createBrowserRouter([ const router = createBrowserRouter([
@ -21,10 +37,6 @@ const router = createBrowserRouter([
path: "/", path: "/",
element: <LoginPage />, element: <LoginPage />,
}, },
{
path: "/admin-menu",
element: <AdminMenuPage />,
},
{ {
path: "/your-projects", path: "/your-projects",
element: <YourProjectsPage />, element: <YourProjectsPage />,
@ -69,6 +81,74 @@ const router = createBrowserRouter([
path: "/PM-project-page", path: "/PM-project-page",
element: <PMProjectPage />, element: <PMProjectPage />,
}, },
{
path: "/PM-time-activity",
element: <PMTotalTimeActivity />,
},
{
path: "/PM-time-role",
element: <PMTotalTimeRole />,
},
{
path: "/PM-unsigned-reports",
element: <PMUnsignedReports />,
},
{
path: "/PM-view-unsigned-report",
element: <PMViewUnsignedReport />,
},
{
path: "/admin-add-project",
element: <AdminAddProject />,
},
{
path: "/admin-add-user",
element: <AdminAddUser />,
},
{
path: "/admin-change-username",
element: <AdminChangeUsername />,
},
{
path: "/admin-manage-projects",
element: <AdminManageProjects />,
},
{
path: "/admin-manage-users",
element: <AdminManageUsers />,
},
{
path: "/admin-menu",
element: <AdminMenuPage />,
},
{
path: "/admin-project-add-member",
element: <AdminProjectAddMember />,
},
{
path: "/admin-project-change-user-role",
element: <AdminProjectChangeUserRole />,
},
{
path: "/admin-project-manage-members",
element: <AdminProjectManageMembers />,
},
{
path: "/admin-project-page",
element: <AdminProjectPage />,
},
{
path: "/admin-project-statistics",
element: <AdminProjectStatistics />,
},
{
path: "/admin-project-view-members",
element: <AdminProjectViewMemberInfo />,
},
{
path: "/admin-view-user",
element: <AdminViewUserInfo />,
},
]); ]);
// Semi-hacky way to get the root element // Semi-hacky way to get the root element