2024-02-13 14:47:36 +01:00
|
|
|
import React from "react";
|
|
|
|
import ReactDOM from "react-dom/client";
|
|
|
|
import "./index.css";
|
2024-03-06 10:09:59 +01:00
|
|
|
import { createBrowserRouter, RouterProvider } from "react-router-dom";
|
2024-03-07 10:05:45 +01:00
|
|
|
import LoginPage from "./Pages/LoginPage.tsx";
|
|
|
|
import YourProjectsPage from "./Pages/YourProjectsPage.tsx";
|
|
|
|
import UserProjectPage from "./Pages/UserPages/UserProjectPage.tsx";
|
2024-03-07 17:48:43 +01:00
|
|
|
import AdminMenuPage from "./Pages/AdminPages/AdminMenuPage.tsx";
|
2024-03-14 10:33:00 +01:00
|
|
|
import UserEditTimeReportPage from "./Pages/UserPages/UserEditTimeReportPage.tsx";
|
2024-03-14 11:00:46 +01:00
|
|
|
import UserNewTimeReportPage from "./Pages/UserPages/UserNewTimeReportPage.tsx";
|
|
|
|
import UserViewTimeReportsPage from "./Pages/UserPages/UserViewTimeReportsPage.tsx";
|
|
|
|
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";
|
2024-03-14 14:29:10 +01:00
|
|
|
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";
|
2024-03-14 14:33:43 +01:00
|
|
|
import AdminManageUsers from "./Pages/AdminPages/AdminManageUsers.tsx";
|
2024-03-06 10:09:59 +01:00
|
|
|
|
2024-03-06 11:14:08 +01:00
|
|
|
// This is where the routes are mounted
|
2024-03-06 10:09:59 +01:00
|
|
|
const router = createBrowserRouter([
|
|
|
|
{
|
|
|
|
path: "/",
|
2024-03-07 10:05:45 +01:00
|
|
|
element: <LoginPage />,
|
2024-03-06 11:14:08 +01:00
|
|
|
},
|
|
|
|
{
|
2024-03-07 10:05:45 +01:00
|
|
|
path: "/your-projects",
|
|
|
|
element: <YourProjectsPage />,
|
|
|
|
},
|
2024-03-14 11:00:46 +01:00
|
|
|
{
|
|
|
|
path: "/edit-time-report",
|
|
|
|
element: <UserEditTimeReportPage />,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
path: "/new-time-report",
|
|
|
|
element: <UserNewTimeReportPage />,
|
|
|
|
},
|
2024-03-07 10:05:45 +01:00
|
|
|
{
|
|
|
|
path: "/project",
|
|
|
|
element: <UserProjectPage />,
|
2024-03-06 10:09:59 +01:00
|
|
|
},
|
2024-03-07 17:48:43 +01:00
|
|
|
{
|
2024-03-14 11:00:46 +01:00
|
|
|
path: "/project-page",
|
|
|
|
element: <UserViewTimeReportsPage />,
|
2024-03-07 17:48:43 +01:00
|
|
|
},
|
2024-03-14 10:33:00 +01:00
|
|
|
{
|
2024-03-14 11:00:46 +01:00
|
|
|
path: "/change-role",
|
|
|
|
element: <PMChangeRole />,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
path: "/other-users-time-reports",
|
|
|
|
element: <PMOtherUsersTR />,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
path: "/project-members",
|
|
|
|
element: <PMProjectMembers />,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
path: "/PM-project-page",
|
|
|
|
element: <PMProjectPage />,
|
2024-03-14 10:33:00 +01:00
|
|
|
},
|
2024-03-14 14:29:10 +01:00
|
|
|
{
|
|
|
|
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-menu",
|
|
|
|
element: <AdminMenuPage />,
|
|
|
|
},
|
2024-03-14 14:33:43 +01:00
|
|
|
{
|
|
|
|
path: "/admin-menu",
|
|
|
|
element: <AdminMenuPage />,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
path: "/admin-manage-users",
|
|
|
|
element: <AdminManageUsers />,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
path: "/admin-menu",
|
|
|
|
element: <AdminMenuPage />,
|
|
|
|
},
|
2024-03-06 10:09:59 +01:00
|
|
|
]);
|
2024-02-12 12:47:46 +01:00
|
|
|
|
2024-03-06 11:14:08 +01:00
|
|
|
// Semi-hacky way to get the root element
|
2024-02-13 14:47:36 +01:00
|
|
|
const root = document.getElementById("root") ?? document.createElement("div");
|
|
|
|
|
2024-03-06 11:14:08 +01:00
|
|
|
// Render the router at the root
|
2024-02-13 14:47:36 +01:00
|
|
|
ReactDOM.createRoot(root).render(
|
2024-02-12 12:47:46 +01:00
|
|
|
<React.StrictMode>
|
2024-03-06 10:09:59 +01:00
|
|
|
<RouterProvider router={router} />
|
2024-02-12 12:47:46 +01:00
|
|
|
</React.StrictMode>,
|
2024-02-13 14:47:36 +01:00
|
|
|
);
|