From ddb0342aab8743028e692d468410ffa60c0a95a8 Mon Sep 17 00:00:00 2001 From: NguyenDonLam Date: Mon, 7 Oct 2024 21:07:55 +1100 Subject: [PATCH 1/2] fix(display ganttchart): fix CI/CD build issue --- frontend/src/components/GanttChart.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/components/GanttChart.tsx b/frontend/src/components/GanttChart.tsx index 0ffefef..841f411 100644 --- a/frontend/src/components/GanttChart.tsx +++ b/frontend/src/components/GanttChart.tsx @@ -1,6 +1,6 @@ import { memo, useEffect, useRef } from "react"; import { Id } from "vis-data/declarations/data-interface"; -import { DataGroupCollectionType, DataItemCollectionType, DataSet, Timeline, TimelineItem } from "vis-timeline/standalone"; +import { DataGroupCollectionType, DataItemCollectionType, DataSet, Timeline } from "vis-timeline/standalone"; import "vis-timeline/styles/vis-timeline-graph2d.min.css"; import "../styles/ganttUnassignable.css"; From 128c44f9ec790031739b4c59d5f542f4eff0495f Mon Sep 17 00:00:00 2001 From: NguyenDonLam Date: Wed, 9 Oct 2024 23:14:31 +1100 Subject: [PATCH 2/2] feat: Add skip button --- frontend/src/components/SkipButton.tsx | 35 ++++++++++++++++++++++++++ frontend/src/pages/Enrolment.tsx | 25 ++++++++++++++++++ 2 files changed, 60 insertions(+) create mode 100644 frontend/src/components/SkipButton.tsx diff --git a/frontend/src/components/SkipButton.tsx b/frontend/src/components/SkipButton.tsx new file mode 100644 index 0000000..3e41ffa --- /dev/null +++ b/frontend/src/components/SkipButton.tsx @@ -0,0 +1,35 @@ +import Button from "@mui/material/Button"; +import { useNavigate } from "react-router-dom"; + +export default function SkipButton() { + const navigate = useNavigate(); + if (sessionStorage.getItem("campusSolutions") === undefined) { + return ( + + ); + } else { + return ( + + ); + } +} diff --git a/frontend/src/pages/Enrolment.tsx b/frontend/src/pages/Enrolment.tsx index 995336e..bb81ce0 100644 --- a/frontend/src/pages/Enrolment.tsx +++ b/frontend/src/pages/Enrolment.tsx @@ -4,6 +4,10 @@ import UploadPopUp from "../components/UploadPopUp.tsx"; import Header from "../components/Header.tsx"; import Footer from "../components/Footer.tsx"; import Photo from "../assets/frontpage.jpg"; +import { useEffect } from "react"; +import { LOCAL_API_URL, TimetableSolution } from "../scripts/api.ts"; +import { useAuthContext } from "../security/AuthContext.tsx"; +import SkipButton from "../components/SkipButton.tsx"; /** * Renders the Starter Page component with specific time and tabler styles. @@ -20,6 +24,26 @@ export default function StarterPage() { const tablerStyle = { color: "black", }; + const { authHeader } = useAuthContext(); + useEffect(() => { + fetch(LOCAL_API_URL + "/timetabling/view", { + headers: { Authorization: authHeader }, + }) + .then((response) => { + if (!response.ok) { + throw new Error("Network response was not ok"); + } + return response.json(); + }) + .then((data) => { + const timetableSolutions: TimetableSolution[] = + data as TimetableSolution[]; + sessionStorage.setItem( + "campusSolutions", + JSON.stringify(timetableSolutions) + ); + }); + }, []); return (
@@ -31,6 +55,7 @@ export default function StarterPage() {

A timetabling website for the Victorian Institute of Technology

-Team JetEdge

+ logo.exe