diff --git a/src/App.jsx b/src/App.jsx index 99d55a675..a66ca0db1 100644 --- a/src/App.jsx +++ b/src/App.jsx @@ -1,88 +1,163 @@ -import { createTheme, MantineProvider } from "@mantine/core"; +import { MantineProvider, createTheme } from "@mantine/core"; +import { Suspense, lazy } from "react"; +import { useSelector } from "react-redux"; import "@mantine/core/styles.css"; import "@mantine/notifications/styles.css"; -import { Route, Routes, Navigate, useLocation } from "react-router-dom"; +import { + Route, + Routes, + Navigate, + useLocation, + useParams, +} from "react-router-dom"; import { Notifications } from "@mantine/notifications"; +import { host } from "./routes/globalRoutes"; import { Layout } from "./components/layout"; -import Dashboard from "./Modules/Dashboard/dashboardNotifications"; -import Profile from "./Modules/Dashboard/StudentProfile/profilePage"; -import LoginPage from "./pages/login"; -import ForgotPassword from "./pages/forgotPassword"; -import AcademicPage from "./Modules/Academic/index"; -import ValidateAuth from "./helper/validateauth"; -import FacultyProfessionalProfile from "./Modules/facultyProfessionalProfile/facultyProfessionalProfile"; -import InactivityHandler from "./helper/inactivityhandler"; -import Examination from "./Modules/Examination/examination"; -import Database from "./Modules/Database/database"; -import ProgrammeCurriculumRoutes from "./Modules/Program_curriculum/programmCurriculum"; -import NotFoundPage from "./components/NotFoundPage"; +import PatentRoutes from "./Modules/Patent/routes/PatentRoutes"; + +// Working module imports +const Dashboard = lazy( + () => import("./Modules/Dashboard/dashboardNotifications"), +); +const Profile = lazy( + () => import("./Modules/Dashboard/StudentProfile/profilePage"), +); +const LoginPage = lazy(() => import("./pages/login")); +const ForgotPassword = lazy(() => import("./pages/forgotPassword")); +const AcademicPage = lazy(() => import("./Modules/Academic/index")); +const ValidateAuth = lazy(() => import("./helper/validateauth")); +const MessPage = lazy(() => import("./Modules/Mess/messContent")); +const FacultyProfessionalProfile = lazy( + () => + import("./Modules/facultyProfessionalProfile/facultyProfessionalProfile"), +); +const InactivityHandler = lazy(() => import("./helper/inactivityhandler.js")); +const Examination = lazy(() => import("./Modules/Examination/examination")); +const ProgrammeCurriculumRoutes = lazy( + () => import("./Modules/Program_curriculum/programmCurriculum"), +); const theme = createTheme({ - breakpoints: { - xxs: "300px", - xs: "375px", - sm: "768px", - md: "992px", - lg: "1200px", - xl: "1408px", - }, + breakpoints: { xs: "30em", sm: "48em", md: "64em", lg: "74em", xl: "90em" }, }); +function ProfileRouteWithUsername() { + const { username } = useParams(); + return ; +} + export default function App() { const location = useLocation(); + const role = useSelector((state) => state.user.role); + return ( - {location.pathname !== "/accounts/login" && } + + {![ + "/accounts/login", + "/reset-password", + ].includes(location.pathname) && } {location.pathname !== "/accounts/login" && } } /> + - + Loading .... }> + + } /> + - + Loading .... }> + + + + } + /> + + + Loading .... }> + + + + } + /> + + + Loading .... }> + + + + } + /> + + + Loading .... }> + + } /> + - + Loading .... }> + + } /> + - + Loading .... }> + + } /> + - - + + Loading .... }> + + + } /> + + } /> + } /> } /> - } /> - } /> - } /> + + {/* Catch-all route for modules not yet implemented */} + } /> ); diff --git a/src/App.jsx.backup b/src/App.jsx.backup new file mode 100644 index 000000000..5a4870525 --- /dev/null +++ b/src/App.jsx.backup @@ -0,0 +1,562 @@ +import { MantineProvider, createTheme } from "@mantine/core"; +import { Suspense, lazy } from "react"; +import { useSelector } from "react-redux"; +import "@mantine/core/styles.css"; +import "@mantine/notifications/styles.css"; +import { + Route, + Routes, + Navigate, + useLocation, + useParams, +} from "react-router-dom"; +import { Notifications } from "@mantine/notifications"; +import { host } from "./routes/globalRoutes"; +import { Layout } from "./components/layout"; +// import InventoryIndex from "./Modules/Inventory/components/InventoryIndex"; // Commented out - module not present +// import PurchaseRoutes from "./Modules/Purchase/PurchaseRoute.jsx"; // Commented out - module not present +import PatentRoutes from "./Modules/Patent/routes/PatentRoutes"; + +// eslint-disable-next-line import/no-unresolved +// import UserBreadcrumbs from "./Modules/Scholarship/user/components/UserBreadcumbs"; // Module not present +// import OtherAcadProcedures from "./Modules/Otheracademic/OtherAcademicProcedures"; // Module not present +// import PendingReqs from "./Modules/Visitors_Hostel/pendingRequests.jsx"; // Module not present +// import { DesignationsProvider } from "./Modules/Iwd/helper/designationContext"; // Module not present +// import { WorkProvider } from "./Modules/Iwd/helper/WorkContext"; // Module not present + +// Missing modules - commented out +// const PlacementCellPage = lazy(() => import("./Modules/PlacementCell")); +// const JobApplicationForm = lazy( +// () => import("./Modules/PlacementCell/ApplyForPlacementForm"), +// ); +// const PlacementEventHandeling = lazy( +// () => import("./Modules/PlacementCell/components/PlacementEventHandeling"), +// ); +// const ApplicationStatusTimeline = lazy( +// () => import("./Modules/PlacementCell/components/Timeline"), +// ); +// const HealthCenter = lazy(() => import("./Modules/Health Center")); +// const ConvenorBreadcumbs = lazy( +// () => import("./Modules/Scholarship/convenor/components/ConvenorBreadcumbs"), +// ); +// const HostelPage = lazy(() => import("./Modules/Hostel-Management/index")); +// const IwdModule = lazy(() => import("./Modules/Iwd/index")); +// const IwdWorkPage = lazy( +// () => import("./Modules/Iwd/components/managebills/index"), +// ); + +const Dashboard = lazy( + () => import("./Modules/Dashboard/dashboardNotifications"), +); +// const ComplaintSystem = lazy( +// () => import("./Modules/ComplaintManagement/index"), +// ); +const Profile = lazy( + () => import("./Modules/Dashboard/StudentProfile/profilePage"), +); +const LoginPage = lazy(() => import("./pages/login")); +const ForgotPassword = lazy(() => import("./pages/forgotPassword")); +const ResetPasswordConfirm = lazy(() => import("./pages/resetPasswordConfirm")); +const AcademicPage = lazy(() => import("./Modules/Academic/index")); +const ValidateAuth = lazy(() => import("./helper/validateauth")); +// const HR = lazy(() => import("./Modules/HR/index")); +const MessPage = lazy(() => import("./Modules/Mess/pages/index")); +// const FileTracking = lazy(() => import("./Modules/FileTracking")); +// const ResearchProjects = lazy(() => import("./Modules/RSPC/researchProjects")); +// const RequestForms = lazy(() => import("./Modules/RSPC/requestForms")); +// const VisitorsContent = lazy( +// () => import("./Modules/Visitors_Hostel/visitorsContent"), +// ); +// const CancellationRequest = lazy( +// () => import("./Modules/Visitors_Hostel/cancellationRequest"), +// ); +// const BookingForm = lazy(() => import("./Modules/Visitors_Hostel/bookingForm")); +// const Bookings = lazy(() => import("./Modules/Visitors_Hostel/bookings")); +// const ActiveBookingsPage = lazy( +// () => import("./Modules/Visitors_Hostel/activeBookings"), +// ); +// const CompletedBookingsPage = lazy( +// () => import("./Modules/Visitors_Hostel/completedBookings"), +// ); +// const VHGuidelinesPage = lazy( +// () => import("./Modules/Visitors_Hostel/vhGuidelines"), +// ); +// const InventoryManagement = lazy( +// () => import("./Modules/Visitors_Hostel/inventory"), +// ); +// const RoomsAvailibility = lazy( +// () => import("./Modules/Visitors_Hostel/roomsAvailability"), +// ); +// const AccountStatemnts = lazy( +// () => import("./Modules/Visitors_Hostel/accountStatements"), +// ); +const FacultyProfessionalProfile = lazy( + () => + import("./Modules/facultyProfessionalProfile/facultyProfessionalProfile"), +); + +const InactivityHandler = lazy(() => import("./helper/inactivityhandler")); +// const DepartmentPage = lazy( +// () => import("./Modules/Department/DepartmentDashboard"), +// ); + +// const GymkhanaDashboard = lazy( +// () => import("./Modules/Gymkhana/GymkhanaDashboard.jsx"), +// ); + +const Examination = lazy(() => import("./Modules/Examination/examination")); + +const ProgrammeCurriculumRoutes = lazy( + () => import("./Modules/Program_curriculum/programmCurriculum"), +); + +// const CourseManagementPage = lazy(() => import("./Modules/CourseManagement")); + +const theme = createTheme({ + breakpoints: { xs: "30em", sm: "48em", md: "64em", lg: "74em", xl: "90em" }, +}); +function ProfileRouteWithUsername() { + const { username } = useParams(); + return ; +} +export default function App() { + const location = useLocation(); + const role = useSelector((state) => state.user.role); + return ( + + + + {![ + "/accounts/login", + "/reset-password", + location.pathname.startsWith("/reset-password-confirm/") + ? location.pathname + : "", + ].includes(location.pathname) && } + {location.pathname !== "/accounts/login" && } + + + } /> + + Loading .... }> + + + + } + /> + + + Loading .... }> + + + + } + /> + + Loading .... }> + + + + } + /> + {/* HR Module - commented out - module not present + + Loading .... }> +
+
+ + } + /> + */} + + Loading .... }> + + + + } + /> + + Loading .... }> + + + + {/* Routes commented out - modules not present + } + /> + + Loading .... }> + + + + } + /> + + Loading .... }> + + + + } + /> + + Loading .... }> + + + + } + /> + + Loading .... }> + + + + + {/* Commented out - Inventory module not present + + + + } + /> + Loading .... }> + + + + } + + + Loading .... }> + + + + } + /> + + Loading .... }> + + + + {/* Routes commented out - modules not present + } + /> + + Loading .... }> + + + + } + /> + + Loading .... }> + + + + + } + /> + + Loading .... }> + + + + + } + /> + + Loading .... }> + + + + + } + /> + + Loading .... }> + + + + + } + /> + + Loading .... }> + + + + + } + /> + + Loading .... }> + {" "} + + + + + } + /> + + Loading .... }> + + + + + } + /> + + Loading .... }> + + + + } + /> + + Loading .... }> + + + + + } + /> + + Loading .... }> + + + + + } + /> + + Loading .... }> + + + + + + Loading .... }> + + + + {/* Routes commented out - modules not present + } + /> + + Loading .... }> + + + + } + /> + + Loading .... }> + + + + } + /> + + Loading .... }> + + + + } + /> + Loading .... }> + + + + + + + } + /> + Loading .... }> + + + + + + + + + } + /> + + Loading .... }> + + + + } + /> + + Loading .... }> + + + + } + + + + Loading .... }> + {role === "spacsconvenor" && } + {role === "student" && } + {role === "spacsassistant" && } + + + } + /> + + + + } + + Health Center module not available} /> + {/* } /> */} + } /> + } /> + } /> + Loading .... + } + > + + + } + {/* Routes commented out - modules not present + /> + + + Loading .... }> + + + + } + /> + + Loading .... }> + + + + } +
+
+ ); +} diff --git a/src/App.jsx.full_backup b/src/App.jsx.full_backup new file mode 100644 index 000000000..5a4870525 --- /dev/null +++ b/src/App.jsx.full_backup @@ -0,0 +1,562 @@ +import { MantineProvider, createTheme } from "@mantine/core"; +import { Suspense, lazy } from "react"; +import { useSelector } from "react-redux"; +import "@mantine/core/styles.css"; +import "@mantine/notifications/styles.css"; +import { + Route, + Routes, + Navigate, + useLocation, + useParams, +} from "react-router-dom"; +import { Notifications } from "@mantine/notifications"; +import { host } from "./routes/globalRoutes"; +import { Layout } from "./components/layout"; +// import InventoryIndex from "./Modules/Inventory/components/InventoryIndex"; // Commented out - module not present +// import PurchaseRoutes from "./Modules/Purchase/PurchaseRoute.jsx"; // Commented out - module not present +import PatentRoutes from "./Modules/Patent/routes/PatentRoutes"; + +// eslint-disable-next-line import/no-unresolved +// import UserBreadcrumbs from "./Modules/Scholarship/user/components/UserBreadcumbs"; // Module not present +// import OtherAcadProcedures from "./Modules/Otheracademic/OtherAcademicProcedures"; // Module not present +// import PendingReqs from "./Modules/Visitors_Hostel/pendingRequests.jsx"; // Module not present +// import { DesignationsProvider } from "./Modules/Iwd/helper/designationContext"; // Module not present +// import { WorkProvider } from "./Modules/Iwd/helper/WorkContext"; // Module not present + +// Missing modules - commented out +// const PlacementCellPage = lazy(() => import("./Modules/PlacementCell")); +// const JobApplicationForm = lazy( +// () => import("./Modules/PlacementCell/ApplyForPlacementForm"), +// ); +// const PlacementEventHandeling = lazy( +// () => import("./Modules/PlacementCell/components/PlacementEventHandeling"), +// ); +// const ApplicationStatusTimeline = lazy( +// () => import("./Modules/PlacementCell/components/Timeline"), +// ); +// const HealthCenter = lazy(() => import("./Modules/Health Center")); +// const ConvenorBreadcumbs = lazy( +// () => import("./Modules/Scholarship/convenor/components/ConvenorBreadcumbs"), +// ); +// const HostelPage = lazy(() => import("./Modules/Hostel-Management/index")); +// const IwdModule = lazy(() => import("./Modules/Iwd/index")); +// const IwdWorkPage = lazy( +// () => import("./Modules/Iwd/components/managebills/index"), +// ); + +const Dashboard = lazy( + () => import("./Modules/Dashboard/dashboardNotifications"), +); +// const ComplaintSystem = lazy( +// () => import("./Modules/ComplaintManagement/index"), +// ); +const Profile = lazy( + () => import("./Modules/Dashboard/StudentProfile/profilePage"), +); +const LoginPage = lazy(() => import("./pages/login")); +const ForgotPassword = lazy(() => import("./pages/forgotPassword")); +const ResetPasswordConfirm = lazy(() => import("./pages/resetPasswordConfirm")); +const AcademicPage = lazy(() => import("./Modules/Academic/index")); +const ValidateAuth = lazy(() => import("./helper/validateauth")); +// const HR = lazy(() => import("./Modules/HR/index")); +const MessPage = lazy(() => import("./Modules/Mess/pages/index")); +// const FileTracking = lazy(() => import("./Modules/FileTracking")); +// const ResearchProjects = lazy(() => import("./Modules/RSPC/researchProjects")); +// const RequestForms = lazy(() => import("./Modules/RSPC/requestForms")); +// const VisitorsContent = lazy( +// () => import("./Modules/Visitors_Hostel/visitorsContent"), +// ); +// const CancellationRequest = lazy( +// () => import("./Modules/Visitors_Hostel/cancellationRequest"), +// ); +// const BookingForm = lazy(() => import("./Modules/Visitors_Hostel/bookingForm")); +// const Bookings = lazy(() => import("./Modules/Visitors_Hostel/bookings")); +// const ActiveBookingsPage = lazy( +// () => import("./Modules/Visitors_Hostel/activeBookings"), +// ); +// const CompletedBookingsPage = lazy( +// () => import("./Modules/Visitors_Hostel/completedBookings"), +// ); +// const VHGuidelinesPage = lazy( +// () => import("./Modules/Visitors_Hostel/vhGuidelines"), +// ); +// const InventoryManagement = lazy( +// () => import("./Modules/Visitors_Hostel/inventory"), +// ); +// const RoomsAvailibility = lazy( +// () => import("./Modules/Visitors_Hostel/roomsAvailability"), +// ); +// const AccountStatemnts = lazy( +// () => import("./Modules/Visitors_Hostel/accountStatements"), +// ); +const FacultyProfessionalProfile = lazy( + () => + import("./Modules/facultyProfessionalProfile/facultyProfessionalProfile"), +); + +const InactivityHandler = lazy(() => import("./helper/inactivityhandler")); +// const DepartmentPage = lazy( +// () => import("./Modules/Department/DepartmentDashboard"), +// ); + +// const GymkhanaDashboard = lazy( +// () => import("./Modules/Gymkhana/GymkhanaDashboard.jsx"), +// ); + +const Examination = lazy(() => import("./Modules/Examination/examination")); + +const ProgrammeCurriculumRoutes = lazy( + () => import("./Modules/Program_curriculum/programmCurriculum"), +); + +// const CourseManagementPage = lazy(() => import("./Modules/CourseManagement")); + +const theme = createTheme({ + breakpoints: { xs: "30em", sm: "48em", md: "64em", lg: "74em", xl: "90em" }, +}); +function ProfileRouteWithUsername() { + const { username } = useParams(); + return ; +} +export default function App() { + const location = useLocation(); + const role = useSelector((state) => state.user.role); + return ( + + + + {![ + "/accounts/login", + "/reset-password", + location.pathname.startsWith("/reset-password-confirm/") + ? location.pathname + : "", + ].includes(location.pathname) && } + {location.pathname !== "/accounts/login" && } + + + } /> + + Loading .... }> + + + + } + /> + + + Loading .... }> + + + + } + /> + + Loading .... }> + + + + } + /> + {/* HR Module - commented out - module not present + + Loading .... }> +
+
+ + } + /> + */} + + Loading .... }> + + + + } + /> + + Loading .... }> + + + + {/* Routes commented out - modules not present + } + /> + + Loading .... }> + + + + } + /> + + Loading .... }> + + + + } + /> + + Loading .... }> + + + + } + /> + + Loading .... }> + + + + + {/* Commented out - Inventory module not present + + + + } + /> + Loading .... }> + + + + } + + + Loading .... }> + + + + } + /> + + Loading .... }> + + + + {/* Routes commented out - modules not present + } + /> + + Loading .... }> + + + + } + /> + + Loading .... }> + + + + + } + /> + + Loading .... }> + + + + + } + /> + + Loading .... }> + + + + + } + /> + + Loading .... }> + + + + + } + /> + + Loading .... }> + + + + + } + /> + + Loading .... }> + {" "} + + + + + } + /> + + Loading .... }> + + + + + } + /> + + Loading .... }> + + + + } + /> + + Loading .... }> + + + + + } + /> + + Loading .... }> + + + + + } + /> + + Loading .... }> + + + + + + Loading .... }> + + + + {/* Routes commented out - modules not present + } + /> + + Loading .... }> + + + + } + /> + + Loading .... }> + + + + } + /> + + Loading .... }> + + + + } + /> + Loading .... }> + + + + + + + } + /> + Loading .... }> + + + + + + + + + } + /> + + Loading .... }> + + + + } + /> + + Loading .... }> + + + + } + + + + Loading .... }> + {role === "spacsconvenor" && } + {role === "student" && } + {role === "spacsassistant" && } + + + } + /> + + + + } + + Health Center module not available} /> + {/* } /> */} + } /> + } /> + } /> + Loading .... + } + > + + + } + {/* Routes commented out - modules not present + /> + + + Loading .... }> + + + + } + /> + + Loading .... }> + + + + } +
+
+ ); +} diff --git a/src/Modules/Patent/components/Applicant/ApplicantMainDashboard.jsx b/src/Modules/Patent/components/Applicant/ApplicantMainDashboard.jsx new file mode 100644 index 000000000..dadfcbe96 --- /dev/null +++ b/src/Modules/Patent/components/Applicant/ApplicantMainDashboard.jsx @@ -0,0 +1,119 @@ +import React, { useEffect, useState } from "react"; +import { Grid, Container, Loader, Flex, Select } from "@mantine/core"; +import { useDispatch } from "react-redux"; +import { SortAscending } from "@phosphor-icons/react"; +import CustomBreadcrumbs from "../../../../components/Breadcrumbs.jsx"; +import ModuleTabs from "../../../../components/moduleTabs.jsx"; +import SubmitNewApplication from "./SubmitNewApplication/ApplicantSubmit.jsx"; +import ApplicantDashboard from "./Dashboard/ApplicantDashboard.jsx"; +import ViewApplicationsPage from "./ViewApplication/ApplicationView.jsx"; +import SavedDraftsPage from "./SavedDrafts/ApplicationDraft.jsx"; +import NotificationsPage from "./Notifications/ApplicantNotifications.jsx"; +import ApplicationForm from "./SubmitNewApplication/ApplicationForm.jsx"; +import SearchApplications from "../Common/Search/SearchApplications.jsx"; +import PendingConsentApplications from "./PendingConsent/PendingConsentApplications.jsx"; + +const categories = ["Most Recent", "Tags", "Title"]; + +function ApplicantMainDashboard() { + const [activeTab, setActiveTab] = useState("0"); + const [sortedBy, setSortedBy] = useState("Most Recent"); + const [loading, setLoading] = useState(false); + const dispatch = useDispatch(); + + // Define your tabs here + const tabItems = [ + { title: "Dashboard" }, + { title: "Submit New Application" }, + { title: "View Applications" }, + { title: "Pending Consents" }, + { title: "Saved Drafts" }, + { title: "Notifications" }, + { title: "Search Applications" }, + ]; + + useEffect(() => { + const fetchData = async () => { + const token = localStorage.getItem("authToken"); + if (!token) return console.error("No authentication token found!"); + + try { + setLoading(true); + // Fetch data logic here if needed + } catch (error) { + console.error("Error fetching data:", error); + } finally { + setLoading(false); + } + }; + + fetchData(); + }, [dispatch]); + + return ( + <> + + + + + + updateFormData("ip_type", value)} + required + mb="md" + /> + +