From 0c9fca814ae7f4218b0603c02959cdb4558c1135 Mon Sep 17 00:00:00 2001 From: Gus Vanpoucke Date: Tue, 5 Mar 2024 10:46:31 +0100 Subject: [PATCH 01/19] begin subjects page student --- frontend/frontend/src/i18n/config.ts | 2 ++ frontend/frontend/src/main.tsx | 2 +- .../SubjectsPage/ArchivedProjectsView.tsx | 7 +++++++ .../src/pages/SubjectsPage/ProjectsView.tsx | 7 +++++++ .../SubjectsPage/SubjectsStudentPage.tsx | 19 +++++++++++++++++++ 5 files changed, 36 insertions(+), 1 deletion(-) create mode 100644 frontend/frontend/src/pages/SubjectsPage/ArchivedProjectsView.tsx create mode 100644 frontend/frontend/src/pages/SubjectsPage/ProjectsView.tsx create mode 100644 frontend/frontend/src/pages/SubjectsPage/SubjectsStudentPage.tsx diff --git a/frontend/frontend/src/i18n/config.ts b/frontend/frontend/src/i18n/config.ts index 9ab92b38..a4e94fbf 100644 --- a/frontend/frontend/src/i18n/config.ts +++ b/frontend/frontend/src/i18n/config.ts @@ -11,6 +11,7 @@ const english = { archived: "Archived", students: "Students: ", no_deadline: "No deadline", + current_projects: "Current projects", }; const dutch = { logo: "./src/assets/logo_UGent_NL_RGB_2400_wit.png", @@ -21,6 +22,7 @@ const dutch = { archived: "Gearchiveerd", students: "Studenten: ", no_deadline: "Geen deadline", + current_projects: "Huidige projecten", }; i18n.use(initReactI18next).use(LanguageDetector).init({ fallbackLng: "en", diff --git a/frontend/frontend/src/main.tsx b/frontend/frontend/src/main.tsx index 4afb80d1..853e72a9 100644 --- a/frontend/frontend/src/main.tsx +++ b/frontend/frontend/src/main.tsx @@ -8,7 +8,7 @@ import ErrorPage from "./pages/ErrorPage.tsx"; import {MainPage} from "./pages/mainPage/MainPage.tsx"; import {Helmet, HelmetProvider} from "react-helmet-async"; -import { SubjectsStudentPage } from "./pages/subjects_page/SubjectsStudentPage.tsx"; +import { SubjectsStudentPage } from "./pages/subjectsPage/SubjectsStudentPage.tsx"; const router = createBrowserRouter([ diff --git a/frontend/frontend/src/pages/SubjectsPage/ArchivedProjectsView.tsx b/frontend/frontend/src/pages/SubjectsPage/ArchivedProjectsView.tsx new file mode 100644 index 00000000..0f4cded8 --- /dev/null +++ b/frontend/frontend/src/pages/SubjectsPage/ArchivedProjectsView.tsx @@ -0,0 +1,7 @@ +export function ArchivedProjectsView() { + return ( + <> + + + ); +} \ No newline at end of file diff --git a/frontend/frontend/src/pages/SubjectsPage/ProjectsView.tsx b/frontend/frontend/src/pages/SubjectsPage/ProjectsView.tsx new file mode 100644 index 00000000..7ec914a5 --- /dev/null +++ b/frontend/frontend/src/pages/SubjectsPage/ProjectsView.tsx @@ -0,0 +1,7 @@ +export function ProjectsView() { + return ( + <> + + + ); +} \ No newline at end of file diff --git a/frontend/frontend/src/pages/SubjectsPage/SubjectsStudentPage.tsx b/frontend/frontend/src/pages/SubjectsPage/SubjectsStudentPage.tsx new file mode 100644 index 00000000..9f9fe193 --- /dev/null +++ b/frontend/frontend/src/pages/SubjectsPage/SubjectsStudentPage.tsx @@ -0,0 +1,19 @@ +import { Header } from "../../components/Header"; +import { Box, Stack } from "@mui/material"; +import TabSwitcher from "../../components/TabSwitcher.tsx"; +import {ArchivedProjectsView} from "./ArchivedProjectsView.tsx"; +import {ProjectsView} from "./ProjectsView.tsx"; + +export function SubjectsStudentPage() { + return ( + <> + +
+ + ,]}/> + + + + ); +} \ No newline at end of file From 944d068af3a34272845272b2ca02453853e65aeb Mon Sep 17 00:00:00 2001 From: Gus Vanpoucke Date: Tue, 5 Mar 2024 14:55:23 +0100 Subject: [PATCH 02/19] continuation subjects student page --- .../AssignmentListItemSubjectsPage.tsx | 54 ++++++++++++ .../src/pages/SubjectsPage/ProjectsView.tsx | 87 ++++++++++++++++++- 2 files changed, 139 insertions(+), 2 deletions(-) create mode 100644 frontend/frontend/src/components/AssignmentListItemSubjectsPage.tsx diff --git a/frontend/frontend/src/components/AssignmentListItemSubjectsPage.tsx b/frontend/frontend/src/components/AssignmentListItemSubjectsPage.tsx new file mode 100644 index 00000000..146000a8 --- /dev/null +++ b/frontend/frontend/src/components/AssignmentListItemSubjectsPage.tsx @@ -0,0 +1,54 @@ +import {ListItem, ListItemButton, ListItemIcon, ListItemText, Divider} from "@mui/material"; +import CheckCircleOutlineIcon from '@mui/icons-material/CheckCircleOutline'; +import HighlightOffIcon from '@mui/icons-material/HighlightOff'; +import {useNavigate} from "react-router-dom"; +import {t} from "i18next"; +interface AssignmentListItemSubjectsPageProps { + key: string; + projectName: string; + dueDate?: Date; + submissions: number; + score: number; + isStudent:boolean; +} + +/* +* This component is used to display a single assignment in the list of assignments +* @param key: string - the key of the assignment +* @param projectName: string - the name of the project +* @param dueDate: Date - the due date of the project +* @param submissions: number - number of submissions for the project +* @param score: number - assigned score on the project +* @param isStudent: boolean - if the user is a student or a teacher +*/ + +export function AssignmentListItemSubjectsPage({key,projectName, dueDate, submissions, score, isStudent}:AssignmentListItemSubjectsPageProps) { + const navigate = useNavigate(); + const handleProjectClick = () => { + console.log("Project clicked"); + navigate(`/${key}`) + } + + return ( + <> + + + + + + + + + + + ); +} \ No newline at end of file diff --git a/frontend/frontend/src/pages/SubjectsPage/ProjectsView.tsx b/frontend/frontend/src/pages/SubjectsPage/ProjectsView.tsx index 7ec914a5..0576fa9b 100644 --- a/frontend/frontend/src/pages/SubjectsPage/ProjectsView.tsx +++ b/frontend/frontend/src/pages/SubjectsPage/ProjectsView.tsx @@ -1,7 +1,90 @@ -export function ProjectsView() { +import {Box, Typography} from "@mui/material"; +import List from '@mui/material/List'; +import {AssignmentListItemSubjectsPage} from "../../components/AssignmentListItemSubjectsPage.tsx"; + +interface ProjectViewProps { + courseId: string; +} + +interface Course { + id: string; + name: string; + teacher: string; + students: string[]; + //list of assignment ids + assignments: string[]; + archived: boolean; +} + +interface Assignment { + id: string; + name: string; + deadline?: Date; + submissions: number; + score: number; +} + +export function ProjectsView({courseId}: ProjectViewProps) { + const course = getCourse(courseId) + const assignments = course.assignments.map((assignmentId) => getAssignment(assignmentId)) + return ( <> - + + Project + Deadline + Submissions + Score + + + + + + {assignments.map((assignment) => ( + + ))} + + + + ); +} + +//TODO: use api to get data, for now use mock data +function getCourse(courseId: string): Course { + return { + id: courseId, + name: "courseName", + teacher: "teacher", + students: ["student1", "student2"], + archived: false, + assignments: ["assignment1", "assignment2", "assignment3", "assignment4", "assignment5", "assignment6", "assignment7", "assignment8", "assignment9"] + } +} + +function getAssignment(assignmentId: string): Assignment { + return { + id: assignmentId, + name: "assignmentName", + deadline: new Date(2022, 11, 17), + submissions: 2, + score: 10 + } } \ No newline at end of file From 7c5e2cc604bff3989331191439cb09f8a8b08c05 Mon Sep 17 00:00:00 2001 From: Gus Vanpoucke Date: Tue, 5 Mar 2024 15:38:39 +0100 Subject: [PATCH 03/19] v1 subjects student page and start of subjects teacher page --- .../AssignmentListItemSubjectsPage.tsx | 20 +++++++--- frontend/frontend/src/main.tsx | 5 +++ .../src/pages/SubjectsPage/ProjectsView.tsx | 25 +++++++++---- .../SubjectsPage/SubjectsStudentPage.tsx | 8 +++- .../SubjectsPage/SubjectsTeacherPage.tsx | 23 ++++++++++++ .../subjects_page/SubjectsStudentPage.tsx | 37 ------------------- 6 files changed, 67 insertions(+), 51 deletions(-) create mode 100644 frontend/frontend/src/pages/SubjectsPage/SubjectsTeacherPage.tsx delete mode 100644 frontend/frontend/src/pages/subjects_page/SubjectsStudentPage.tsx diff --git a/frontend/frontend/src/components/AssignmentListItemSubjectsPage.tsx b/frontend/frontend/src/components/AssignmentListItemSubjectsPage.tsx index 146000a8..0e594119 100644 --- a/frontend/frontend/src/components/AssignmentListItemSubjectsPage.tsx +++ b/frontend/frontend/src/components/AssignmentListItemSubjectsPage.tsx @@ -9,7 +9,7 @@ interface AssignmentListItemSubjectsPageProps { dueDate?: Date; submissions: number; score: number; - isStudent:boolean; + isStudent: boolean; } /* @@ -42,10 +42,20 @@ export function AssignmentListItemSubjectsPage({key,projectName, dueDate, submis paddingY: 3, borderRadius:2, }}> - - - - + {isStudent? + <> + + + + + + : + <> + + + + + } diff --git a/frontend/frontend/src/main.tsx b/frontend/frontend/src/main.tsx index 853e72a9..bc9ee3cc 100644 --- a/frontend/frontend/src/main.tsx +++ b/frontend/frontend/src/main.tsx @@ -9,6 +9,7 @@ import ErrorPage from "./pages/ErrorPage.tsx"; import {MainPage} from "./pages/mainPage/MainPage.tsx"; import {Helmet, HelmetProvider} from "react-helmet-async"; import { SubjectsStudentPage } from "./pages/subjectsPage/SubjectsStudentPage.tsx"; +import { SubjectsTeacherPage } from "./pages/subjectsPage/SubjectsTeacherPage.tsx"; const router = createBrowserRouter([ @@ -21,6 +22,10 @@ const router = createBrowserRouter([ path: "/subjects_student", element: , }, + { + path: "/subjects_teacher", + element: , + }, ]); ReactDOM.createRoot(document.getElementById("root")!).render( diff --git a/frontend/frontend/src/pages/SubjectsPage/ProjectsView.tsx b/frontend/frontend/src/pages/SubjectsPage/ProjectsView.tsx index 0576fa9b..b06d9534 100644 --- a/frontend/frontend/src/pages/SubjectsPage/ProjectsView.tsx +++ b/frontend/frontend/src/pages/SubjectsPage/ProjectsView.tsx @@ -2,8 +2,9 @@ import {Box, Typography} from "@mui/material"; import List from '@mui/material/List'; import {AssignmentListItemSubjectsPage} from "../../components/AssignmentListItemSubjectsPage.tsx"; -interface ProjectViewProps { +interface ProjectsViewProps { courseId: string; + isStudent: boolean; } interface Course { @@ -24,7 +25,7 @@ interface Assignment { score: number; } -export function ProjectsView({courseId}: ProjectViewProps) { +export function ProjectsView({courseId, isStudent}: ProjectsViewProps) { const course = getCourse(courseId) const assignments = course.assignments.map((assignmentId) => getAssignment(assignmentId)) @@ -39,10 +40,20 @@ export function ProjectsView({courseId}: ProjectViewProps) { justifyContent: "space-between", padding:3, }}> - Project - Deadline - Submissions - Score + {isStudent? + <> + Project + Deadline + Submissions + Score + + : + <> + Project + Deadline + Edit + + } {assignments.map((assignment) => ( - + ))} diff --git a/frontend/frontend/src/pages/SubjectsPage/SubjectsStudentPage.tsx b/frontend/frontend/src/pages/SubjectsPage/SubjectsStudentPage.tsx index 9f9fe193..023e7f0f 100644 --- a/frontend/frontend/src/pages/SubjectsPage/SubjectsStudentPage.tsx +++ b/frontend/frontend/src/pages/SubjectsPage/SubjectsStudentPage.tsx @@ -4,14 +4,18 @@ import TabSwitcher from "../../components/TabSwitcher.tsx"; import {ArchivedProjectsView} from "./ArchivedProjectsView.tsx"; import {ProjectsView} from "./ProjectsView.tsx"; -export function SubjectsStudentPage() { +interface SubjectsStudentProps { + courseId: string; +} + +export function SubjectsStudentPage({courseId}: SubjectsStudentProps) { return ( <>
,]}/> + nodes={[,]}/> diff --git a/frontend/frontend/src/pages/SubjectsPage/SubjectsTeacherPage.tsx b/frontend/frontend/src/pages/SubjectsPage/SubjectsTeacherPage.tsx new file mode 100644 index 00000000..744b81a6 --- /dev/null +++ b/frontend/frontend/src/pages/SubjectsPage/SubjectsTeacherPage.tsx @@ -0,0 +1,23 @@ +import { Header } from "../../components/Header"; +import { Box, Stack } from "@mui/material"; +import TabSwitcher from "../../components/TabSwitcher.tsx"; +import {ArchivedProjectsView} from "./ArchivedProjectsView.tsx"; +import {ProjectsView} from "./ProjectsView.tsx"; + +interface SubjectsTeacherProps { + courseId: string; +} + +export function SubjectsTeacherPage({courseId}: SubjectsTeacherProps) { + return ( + <> + +
+ + ,]}/> + + + + ); +} \ No newline at end of file diff --git a/frontend/frontend/src/pages/subjects_page/SubjectsStudentPage.tsx b/frontend/frontend/src/pages/subjects_page/SubjectsStudentPage.tsx deleted file mode 100644 index 6397c620..00000000 --- a/frontend/frontend/src/pages/subjects_page/SubjectsStudentPage.tsx +++ /dev/null @@ -1,37 +0,0 @@ -import { Header } from "../../components/Header"; -import { ItemList } from "../../components/ItemList"; -import { Box } from "@mui/material"; - -const items = [ - { opdracht: 'Task 1', deadline: '2024-03-15', status: 'In progress', score: '80%' }, - { opdracht: 'Task 2', deadline: '2024-03-20', status: 'Completed', score: '100%' }, - { opdracht: 'Task 3', deadline: '2024-03-25', status: 'Not started', score: 'N/A' }, - { opdracht: 'Task 1', deadline: '2024-03-15', status: 'In progress', score: '80%' }, - { opdracht: 'Task 2', deadline: '2024-03-20', status: 'Completed', score: '100%' }, - { opdracht: 'Task 3', deadline: '2024-03-25', status: 'Not started', score: 'N/A' }, - { opdracht: 'Task 1', deadline: '2024-03-15', status: 'In progress', score: '80%' }, - { opdracht: 'Task 2', deadline: '2024-03-20', status: 'Completed', score: '100%' }, - { opdracht: 'Task 3', deadline: '2024-03-25', status: 'Not started', score: 'N/A' }, - { opdracht: 'Task 1', deadline: '2024-03-15', status: 'In progress', score: '80%' }, - { opdracht: 'Task 2', deadline: '2024-03-20', status: 'Completed', score: '100%' }, - { opdracht: 'Task 3', deadline: '2024-03-25', status: 'Not started', score: 'N/A' }, - { opdracht: 'Task 1', deadline: '2024-03-15', status: 'In progress', score: '80%' }, - { opdracht: 'Task 2', deadline: '2024-03-20', status: 'Completed', score: '100%' }, - { opdracht: 'Task 3', deadline: '2024-03-25', status: 'Not started', score: 'N/A' }, - { opdracht: 'Task 1', deadline: '2024-03-15', status: 'In progress', score: '80%' }, - { opdracht: 'Task 2', deadline: '2024-03-20', status: 'Completed', score: '100%' }, - { opdracht: 'Task 3', deadline: '2024-03-25', status: 'Not started', score: 'N/A' }, -]; - -export function SubjectsStudentPage() { - return ( - <> -
- - - - - - - ); -} From 3dd692ddf045c811b788ea632ab19636ac0d841f Mon Sep 17 00:00:00 2001 From: Gus Vanpoucke Date: Fri, 8 Mar 2024 16:52:15 +0100 Subject: [PATCH 04/19] v1 subjects pages done --- .../src/components/AssignmentListItemSubjectsPage.tsx | 6 ++---- frontend/frontend/src/main.tsx | 4 ++-- .../src/pages/SubjectsPage/SubjectsStudentPage.tsx | 9 ++++----- .../src/pages/SubjectsPage/SubjectsTeacherPage.tsx | 9 ++++----- 4 files changed, 12 insertions(+), 16 deletions(-) diff --git a/frontend/frontend/src/components/AssignmentListItemSubjectsPage.tsx b/frontend/frontend/src/components/AssignmentListItemSubjectsPage.tsx index 0e594119..6ad833a0 100644 --- a/frontend/frontend/src/components/AssignmentListItemSubjectsPage.tsx +++ b/frontend/frontend/src/components/AssignmentListItemSubjectsPage.tsx @@ -1,6 +1,4 @@ -import {ListItem, ListItemButton, ListItemIcon, ListItemText, Divider} from "@mui/material"; -import CheckCircleOutlineIcon from '@mui/icons-material/CheckCircleOutline'; -import HighlightOffIcon from '@mui/icons-material/HighlightOff'; +import {ListItem, ListItemButton, ListItemText, Divider} from "@mui/material"; import {useNavigate} from "react-router-dom"; import {t} from "i18next"; interface AssignmentListItemSubjectsPageProps { @@ -53,7 +51,7 @@ export function AssignmentListItemSubjectsPage({key,projectName, dueDate, submis <> - + } diff --git a/frontend/frontend/src/main.tsx b/frontend/frontend/src/main.tsx index bc9ee3cc..5ea67cdf 100644 --- a/frontend/frontend/src/main.tsx +++ b/frontend/frontend/src/main.tsx @@ -19,11 +19,11 @@ const router = createBrowserRouter([ errorElement: , }, { - path: "/subjects_student", + path: "/subjects_student/:courseId", element: , }, { - path: "/subjects_teacher", + path: "/subjects_teacher/:courseId", element: , }, ]); diff --git a/frontend/frontend/src/pages/SubjectsPage/SubjectsStudentPage.tsx b/frontend/frontend/src/pages/SubjectsPage/SubjectsStudentPage.tsx index 023e7f0f..512c33a7 100644 --- a/frontend/frontend/src/pages/SubjectsPage/SubjectsStudentPage.tsx +++ b/frontend/frontend/src/pages/SubjectsPage/SubjectsStudentPage.tsx @@ -3,12 +3,11 @@ import { Box, Stack } from "@mui/material"; import TabSwitcher from "../../components/TabSwitcher.tsx"; import {ArchivedProjectsView} from "./ArchivedProjectsView.tsx"; import {ProjectsView} from "./ProjectsView.tsx"; +import { useParams } from "react-router-dom"; -interface SubjectsStudentProps { - courseId: string; -} - -export function SubjectsStudentPage({courseId}: SubjectsStudentProps) { +export function SubjectsStudentPage() { + let { courseId } = useParams(); + courseId = String(courseId); return ( <> diff --git a/frontend/frontend/src/pages/SubjectsPage/SubjectsTeacherPage.tsx b/frontend/frontend/src/pages/SubjectsPage/SubjectsTeacherPage.tsx index 744b81a6..1858afe4 100644 --- a/frontend/frontend/src/pages/SubjectsPage/SubjectsTeacherPage.tsx +++ b/frontend/frontend/src/pages/SubjectsPage/SubjectsTeacherPage.tsx @@ -3,12 +3,11 @@ import { Box, Stack } from "@mui/material"; import TabSwitcher from "../../components/TabSwitcher.tsx"; import {ArchivedProjectsView} from "./ArchivedProjectsView.tsx"; import {ProjectsView} from "./ProjectsView.tsx"; +import { useParams } from "react-router-dom"; -interface SubjectsTeacherProps { - courseId: string; -} - -export function SubjectsTeacherPage({courseId}: SubjectsTeacherProps) { +export function SubjectsTeacherPage() { + let { courseId } = useParams(); + courseId = String(courseId); return ( <> From 0b78b066b120625920cd14feb743aaca6450a2be Mon Sep 17 00:00:00 2001 From: Gus Vanpoucke Date: Fri, 8 Mar 2024 18:32:53 +0100 Subject: [PATCH 05/19] quick fix --- frontend/frontend/src/pages/SubjectsPage/ProjectsView.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/frontend/frontend/src/pages/SubjectsPage/ProjectsView.tsx b/frontend/frontend/src/pages/SubjectsPage/ProjectsView.tsx index b06d9534..70266f32 100644 --- a/frontend/frontend/src/pages/SubjectsPage/ProjectsView.tsx +++ b/frontend/frontend/src/pages/SubjectsPage/ProjectsView.tsx @@ -26,8 +26,8 @@ interface Assignment { } export function ProjectsView({courseId, isStudent}: ProjectsViewProps) { - const course = getCourse(courseId) - const assignments = course.assignments.map((assignmentId) => getAssignment(assignmentId)) + const course = getCourse(courseId); + const assignments = course.assignments.map((assignmentId) => getAssignment(assignmentId)); return ( <> From 74eeeefaedd946f45237ab7af15155dd8ebebada Mon Sep 17 00:00:00 2001 From: Gus Vanpoucke Date: Fri, 8 Mar 2024 18:34:04 +0100 Subject: [PATCH 06/19] start scores page --- .../src/components/StudentScoreListItem.tsx | 49 ++++++++ frontend/frontend/src/main.tsx | 5 + .../pages/scoresPage/ProjectScoresPage.tsx | 19 +++ .../src/pages/scoresPage/StudentsView.tsx | 109 ++++++++++++++++++ 4 files changed, 182 insertions(+) create mode 100644 frontend/frontend/src/components/StudentScoreListItem.tsx create mode 100644 frontend/frontend/src/pages/scoresPage/ProjectScoresPage.tsx create mode 100644 frontend/frontend/src/pages/scoresPage/StudentsView.tsx diff --git a/frontend/frontend/src/components/StudentScoreListItem.tsx b/frontend/frontend/src/components/StudentScoreListItem.tsx new file mode 100644 index 00000000..e39d46ef --- /dev/null +++ b/frontend/frontend/src/components/StudentScoreListItem.tsx @@ -0,0 +1,49 @@ +import {ListItem, ListItemButton, ListItemText, Divider} from "@mui/material"; +import {useNavigate} from "react-router-dom"; +import {t} from "i18next"; + +interface StudentScoreListItemProps { + key: string; + studentName: string; + submissionFiles: string[]; +} + +/* +* This component is used to display a single assignment in the list of assignments +* @param key: string - the key of the studentOnProject +* @param studentName: string - the name of the student +* @param submissionFiles: string[] - a list of all files submitted by this student +*/ + +export function StudentScoreListItem({key, studentName, submissionFiles}:StudentScoreListItemProps) { + const navigate = useNavigate(); + const handleProjectClick = () => { + console.log("Project clicked"); + navigate(`/${key}`) + } + + return ( + <> + + + <> + + + + + + + + + + ); +} \ No newline at end of file diff --git a/frontend/frontend/src/main.tsx b/frontend/frontend/src/main.tsx index 5ea67cdf..3c622b03 100644 --- a/frontend/frontend/src/main.tsx +++ b/frontend/frontend/src/main.tsx @@ -10,6 +10,7 @@ import {MainPage} from "./pages/mainPage/MainPage.tsx"; import {Helmet, HelmetProvider} from "react-helmet-async"; import { SubjectsStudentPage } from "./pages/subjectsPage/SubjectsStudentPage.tsx"; import { SubjectsTeacherPage } from "./pages/subjectsPage/SubjectsTeacherPage.tsx"; +import { ProjectScoresPage } from "./pages/scoresPage/ProjectScoresPage.tsx"; const router = createBrowserRouter([ @@ -26,6 +27,10 @@ const router = createBrowserRouter([ path: "/subjects_teacher/:courseId", element: , }, + { + path: "/scores", + element: , + }, ]); ReactDOM.createRoot(document.getElementById("root")!).render( diff --git a/frontend/frontend/src/pages/scoresPage/ProjectScoresPage.tsx b/frontend/frontend/src/pages/scoresPage/ProjectScoresPage.tsx new file mode 100644 index 00000000..1b3eacb5 --- /dev/null +++ b/frontend/frontend/src/pages/scoresPage/ProjectScoresPage.tsx @@ -0,0 +1,19 @@ +import { Header } from "../../components/Header"; +import { Box, Stack } from "@mui/material"; +import { useParams } from "react-router-dom"; +import { StudentsView } from "./StudentsView.tsx"; + +export function ProjectScoresPage() { + let { projectId } = useParams(); + projectId = String(projectId); + return ( + <> + +
+ + + + + + ); +} \ No newline at end of file diff --git a/frontend/frontend/src/pages/scoresPage/StudentsView.tsx b/frontend/frontend/src/pages/scoresPage/StudentsView.tsx new file mode 100644 index 00000000..d1c08aa4 --- /dev/null +++ b/frontend/frontend/src/pages/scoresPage/StudentsView.tsx @@ -0,0 +1,109 @@ +import {Box, Typography, Divider} from "@mui/material"; +import List from '@mui/material/List'; +import { StudentScoreListItem } from "../../components/StudentScoreListItem.tsx"; + +interface StudentsViewProps { + projectId: string; +} + +interface Assignment { + id: string; + name: string; + teacher: string; + //list of student ids + students: string[]; +} + +interface Student { + id: string; + name: string; +} + +interface StudentProject { + id: string; + studentId: string; + submissions: string[]; +} + +interface Submission { + id: string; + file: string; +} + +export function StudentsView({projectId}: StudentsViewProps) { + const project = getProject(projectId); + const students = project.students.map((studentProjectId) => getStudentOnProject(studentProjectId)); + + return ( + <> + + <> + Student + Time + Score + Download + + + + + + + + {students.map((studentOnProject) => ( + getSubmission(submissionId).file)}/> + ))} + + + + + + ); +} + +//TODO: use api to get data, for now use mock data +function getProject(projectId: string): Assignment { + return { + id: projectId, + name: "courseName", + teacher: "teacher", + students: ["student1", "student2", "student3"], + } +} + +function getStudentOnProject(studentProjectId: string): StudentProject { + return { + id: studentProjectId, + studentId: "student", + submissions: ["submission1", "submission2"], + } +} + +function getStudent(studentId: string): Student { + return { + id: studentId, + name: "studentName", + } +} + +function getSubmission(submissionId: string): Submission { + return { + id: submissionId, + file: "file", + } +} \ No newline at end of file From 7a7273ece143d50916dd9814b8b6b38ad688b2a3 Mon Sep 17 00:00:00 2001 From: Ben De Meurichy Date: Fri, 8 Mar 2024 21:52:53 +0100 Subject: [PATCH 07/19] finished full main page both archived and current courses, calendar works as supposed to --- frontend/frontend/package-lock.json | 565 ++++++++++-------- frontend/frontend/package.json | 9 +- frontend/frontend/src/Theme.ts | 35 +- .../src/components/AssignmentListItem.tsx | 22 +- .../frontend/src/components/CourseCard.tsx | 167 +++--- .../src/components/DeadlineCalendar.tsx | 128 ++++ frontend/frontend/src/main.tsx | 51 +- .../src/pages/mainPage/ArchivedView.tsx | 29 +- .../src/pages/mainPage/CoursesView.tsx | 16 +- .../frontend/src/pages/mainPage/MainPage.tsx | 24 +- 10 files changed, 638 insertions(+), 408 deletions(-) create mode 100644 frontend/frontend/src/components/DeadlineCalendar.tsx diff --git a/frontend/frontend/package-lock.json b/frontend/frontend/package-lock.json index 2c201475..fdc877af 100644 --- a/frontend/frontend/package-lock.json +++ b/frontend/frontend/package-lock.json @@ -8,12 +8,14 @@ "name": "frontend", "version": "0.0.0", "dependencies": { - "@emotion/react": "^11.11.3", + "@emotion/react": "^11.11.4", "@emotion/styled": "^11.11.0", "@fontsource/roboto": "^5.0.8", "@mui/icons-material": "^5.15.11", - "@mui/material": "^5.15.11", + "@mui/material": "^5.15.12", + "@mui/x-date-pickers": "^6.19.6", "axios": "^1.6.7", + "dayjs": "^1.11.10", "i18next": "^23.10.0", "i18next-browser-languagedetector": "^7.2.0", "i18next-http-backend": "^2.5.0", @@ -24,8 +26,7 @@ "react-helmet": "^6.1.0", "react-helmet-async": "^2.0.4", "react-i18next": "^14.0.5", - "react-router-dom": "^6.22.2", - "sort-by": "^1.2.0" + "react-router-dom": "^6.22.2" }, "devDependencies": { "@types/react": "^18.2.56", @@ -51,13 +52,13 @@ } }, "node_modules/@ampproject/remapping": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/@ampproject/remapping/-/remapping-2.2.1.tgz", - "integrity": "sha512-lFMjJTrFL3j7L9yBxwYfCq2k6qqwHyzuUl/XBnif78PWTJYyL/dfowQHWE3sp6U6ZzqWiiIZnpTMO96zhkjwtg==", + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/@ampproject/remapping/-/remapping-2.3.0.tgz", + "integrity": "sha512-30iZtAPgz+LTIYoeivqYo853f02jBYSd5uGnGpkFV0M3xOt9aN73erkgYAmZU43x4VfqcnLxW9Kpg3R5LC4YYw==", "dev": true, "dependencies": { - "@jridgewell/gen-mapping": "^0.3.0", - "@jridgewell/trace-mapping": "^0.3.9" + "@jridgewell/gen-mapping": "^0.3.5", + "@jridgewell/trace-mapping": "^0.3.24" }, "engines": { "node": ">=6.0.0" @@ -85,9 +86,9 @@ } }, "node_modules/@babel/core": { - "version": "7.23.9", - "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.23.9.tgz", - "integrity": "sha512-5q0175NOjddqpvvzU+kDiSOAk4PfdO6FvwCWoQ6RO7rTzEe8vlo+4HVfcnAREhD4npMs0e9uZypjTwzZPCf/cw==", + "version": "7.24.0", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.24.0.tgz", + "integrity": "sha512-fQfkg0Gjkza3nf0c7/w6Xf34BW4YvzNfACRLmmb7XRLa6XHdR+K9AlJlxneFfWYf6uhOzuzZVTjF/8KfndZANw==", "dev": true, "dependencies": { "@ampproject/remapping": "^2.2.0", @@ -95,11 +96,11 @@ "@babel/generator": "^7.23.6", "@babel/helper-compilation-targets": "^7.23.6", "@babel/helper-module-transforms": "^7.23.3", - "@babel/helpers": "^7.23.9", - "@babel/parser": "^7.23.9", - "@babel/template": "^7.23.9", - "@babel/traverse": "^7.23.9", - "@babel/types": "^7.23.9", + "@babel/helpers": "^7.24.0", + "@babel/parser": "^7.24.0", + "@babel/template": "^7.24.0", + "@babel/traverse": "^7.24.0", + "@babel/types": "^7.24.0", "convert-source-map": "^2.0.0", "debug": "^4.1.0", "gensync": "^1.0.0-beta.2", @@ -114,6 +115,12 @@ "url": "https://opencollective.com/babel" } }, + "node_modules/@babel/core/node_modules/convert-source-map": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-2.0.0.tgz", + "integrity": "sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==", + "dev": true + }, "node_modules/@babel/core/node_modules/semver": { "version": "6.3.1", "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", @@ -228,9 +235,9 @@ } }, "node_modules/@babel/helper-plugin-utils": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.22.5.tgz", - "integrity": "sha512-uLls06UVKgFG9QD4OeFYLEGteMIAa5kpTPcFL28yuCIIzsf6ZyKZMllKVOCZFhiZ5ptnwX4mtKdWCBE/uT4amg==", + "version": "7.24.0", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.24.0.tgz", + "integrity": "sha512-9cUznXMG0+FxRuJfvL82QlTqIzhVW9sL0KjMPHhAOOvpQGL8QtdxnBKILjBqxlHyliz0yCa1G903ZXI/FuHy2w==", "dev": true, "engines": { "node": ">=6.9.0" @@ -286,14 +293,14 @@ } }, "node_modules/@babel/helpers": { - "version": "7.23.9", - "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.23.9.tgz", - "integrity": "sha512-87ICKgU5t5SzOT7sBMfCOZQ2rHjRU+Pcb9BoILMYz600W6DkVRLFBPwQ18gwUVvggqXivaUakpnxWQGbpywbBQ==", + "version": "7.24.0", + "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.24.0.tgz", + "integrity": "sha512-ulDZdc0Aj5uLc5nETsa7EPx2L7rM0YJM8r7ck7U73AXi7qOV44IHHRAYZHY6iU1rr3C5N4NtTmMRUJP6kwCWeA==", "dev": true, "dependencies": { - "@babel/template": "^7.23.9", - "@babel/traverse": "^7.23.9", - "@babel/types": "^7.23.9" + "@babel/template": "^7.24.0", + "@babel/traverse": "^7.24.0", + "@babel/types": "^7.24.0" }, "engines": { "node": ">=6.9.0" @@ -313,9 +320,9 @@ } }, "node_modules/@babel/parser": { - "version": "7.23.9", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.23.9.tgz", - "integrity": "sha512-9tcKgqKbs3xGJ+NtKF2ndOBBLVwPjl1SHxPQkd36r3Dlirw3xWUeGaTbqr7uGZcTaxkVNwc+03SVP7aCdWrTlA==", + "version": "7.24.0", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.24.0.tgz", + "integrity": "sha512-QuP/FxEAzMSjXygs8v4N9dvdXzEHN4W1oF3PxuWAtPo08UdM17u89RDMgjLn/mlc56iM0HlLmVkO/wgR+rDgHg==", "dev": true, "bin": { "parser": "bin/babel-parser.js" @@ -355,9 +362,9 @@ } }, "node_modules/@babel/runtime": { - "version": "7.23.9", - "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.23.9.tgz", - "integrity": "sha512-0CX6F+BI2s9dkUqr08KFrAIZgNFj75rdBU/DjCyYLIaV/quFjkk6T+EJ2LkZHyZTbEV4L5p97mNkUsHl2wLFAw==", + "version": "7.24.0", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.24.0.tgz", + "integrity": "sha512-Chk32uHMg6TnQdvw2e9IlqPpFX/6NLuK0Ys2PqLb7/gL5uFn9mXvK715FGLlOLQrcO4qIkNHkvPGktzzXexsFw==", "dependencies": { "regenerator-runtime": "^0.14.0" }, @@ -366,23 +373,23 @@ } }, "node_modules/@babel/template": { - "version": "7.23.9", - "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.23.9.tgz", - "integrity": "sha512-+xrD2BWLpvHKNmX2QbpdpsBaWnRxahMwJjO+KZk2JOElj5nSmKezyS1B4u+QbHMTX69t4ukm6hh9lsYQ7GHCKA==", + "version": "7.24.0", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.24.0.tgz", + "integrity": "sha512-Bkf2q8lMB0AFpX0NFEqSbx1OkTHf0f+0j82mkw+ZpzBnkk7e9Ql0891vlfgi+kHwOk8tQjiQHpqh4LaSa0fKEA==", "dev": true, "dependencies": { "@babel/code-frame": "^7.23.5", - "@babel/parser": "^7.23.9", - "@babel/types": "^7.23.9" + "@babel/parser": "^7.24.0", + "@babel/types": "^7.24.0" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/traverse": { - "version": "7.23.9", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.23.9.tgz", - "integrity": "sha512-I/4UJ9vs90OkBtY6iiiTORVMyIhJ4kAVmsKo9KFc8UOxMeUfi2hvtIBsET5u9GizXE6/GFSuKCTNfgCswuEjRg==", + "version": "7.24.0", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.24.0.tgz", + "integrity": "sha512-HfuJlI8qq3dEDmNU5ChzzpZRWq+oxCZQyMzIMEqLho+AQnhMnKQUzH6ydo3RBl/YjPCuk68Y6s0Gx0AeyULiWw==", "dev": true, "dependencies": { "@babel/code-frame": "^7.23.5", @@ -391,8 +398,8 @@ "@babel/helper-function-name": "^7.23.0", "@babel/helper-hoist-variables": "^7.22.5", "@babel/helper-split-export-declaration": "^7.22.6", - "@babel/parser": "^7.23.9", - "@babel/types": "^7.23.9", + "@babel/parser": "^7.24.0", + "@babel/types": "^7.24.0", "debug": "^4.3.1", "globals": "^11.1.0" }, @@ -401,9 +408,9 @@ } }, "node_modules/@babel/types": { - "version": "7.23.9", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.23.9.tgz", - "integrity": "sha512-dQjSq/7HaSjRM43FFGnv5keM2HsxpmyV1PfaSVm0nzzjwwTmjOe6J4bC8e3+pTEIgHaHj+1ZlLThRJ2auc/w1Q==", + "version": "7.24.0", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.24.0.tgz", + "integrity": "sha512-+j7a5c253RfKh8iABBhywc8NSfP5LURe7Uh4qpsh6jc+aLJguvmIUBdjSdEMQv2bENrCR5MfRdjGo7vzS/ob7w==", "dependencies": { "@babel/helper-string-parser": "^7.23.4", "@babel/helper-validator-identifier": "^7.22.20", @@ -431,22 +438,6 @@ "stylis": "4.2.0" } }, - "node_modules/@emotion/babel-plugin/node_modules/convert-source-map": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.9.0.tgz", - "integrity": "sha512-ASFBup0Mz1uyiIjANan1jzLQami9z1PoYSZCiiYW2FczPbenXc45FZdBZLzOT+r6+iciuEModtmCti+hjaAk0A==" - }, - "node_modules/@emotion/babel-plugin/node_modules/escape-string-regexp": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", - "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/@emotion/cache": { "version": "11.11.0", "resolved": "https://registry.npmjs.org/@emotion/cache/-/cache-11.11.0.tgz", @@ -465,9 +456,9 @@ "integrity": "sha512-gJB6HLm5rYwSLI6PQa+X1t5CFGrv1J1TWG+sOyMCeKz2ojaj6Fnl/rZEspogG+cvqbt4AE/2eIyD2QfLKTBNlQ==" }, "node_modules/@emotion/is-prop-valid": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/@emotion/is-prop-valid/-/is-prop-valid-1.2.1.tgz", - "integrity": "sha512-61Mf7Ufx4aDxx1xlDeOm8aFFigGHE4z+0sKCa+IHCeZKiyP9RLD0Mmx7m8b9/Cf37f7NAvQOOJAbQQGVr5uERw==", + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/@emotion/is-prop-valid/-/is-prop-valid-1.2.2.tgz", + "integrity": "sha512-uNsoYd37AFmaCdXlg6EYD1KaPOaRWRByMCYzbKUX4+hhMfrxdVSelShywL4JVaAeM/eHUOSprYBQls+/neX3pw==", "dependencies": { "@emotion/memoize": "^0.8.1" } @@ -478,9 +469,9 @@ "integrity": "sha512-W2P2c/VRW1/1tLox0mVUalvnWXxavmv/Oum2aPsRcoDJuob75FC3Y8FbpfLwUegRcxINtGUMPq0tFCvYNTBXNA==" }, "node_modules/@emotion/react": { - "version": "11.11.3", - "resolved": "https://registry.npmjs.org/@emotion/react/-/react-11.11.3.tgz", - "integrity": "sha512-Cnn0kuq4DoONOMcnoVsTOR8E+AdnKFf//6kUWc4LCdnxj31pZWn7rIULd6Y7/Js1PiPHzn7SKCM9vB/jBni8eA==", + "version": "11.11.4", + "resolved": "https://registry.npmjs.org/@emotion/react/-/react-11.11.4.tgz", + "integrity": "sha512-t8AjMlF0gHpvvxk5mAtCqR4vmxiGHCeJBaQO6gncUSdklELOgtwjerNY2yuJNfwnc6vi16U/+uMF+afIawJ9iw==", "dependencies": { "@babel/runtime": "^7.18.3", "@emotion/babel-plugin": "^11.11.0", @@ -1058,9 +1049,9 @@ "integrity": "sha512-9TANp6GPoMtYzQdt54kfAyMmz1+osLlXdg2ENroU7zzrtflTLrrC/lgrIfaSe+Wu0b89GKccT7vxXA0MoAIO+Q==" }, "node_modules/@fontsource/roboto": { - "version": "5.0.8", - "resolved": "https://registry.npmjs.org/@fontsource/roboto/-/roboto-5.0.8.tgz", - "integrity": "sha512-XxPltXs5R31D6UZeLIV1td3wTXU3jzd3f2DLsXI8tytMGBkIsGcc9sIyiupRtA8y73HAhuSCeweOoBqf6DbWCA==" + "version": "5.0.12", + "resolved": "https://registry.npmjs.org/@fontsource/roboto/-/roboto-5.0.12.tgz", + "integrity": "sha512-x0o17jvgoSSbS9OZnUX2+xJmVRvVCfeaYJjkS7w62iN7CuJWtMf5vJj8LqgC7ibqIkitOHVW+XssRjgrcHn62g==" }, "node_modules/@humanwhocodes/config-array": { "version": "0.11.14", @@ -1118,14 +1109,14 @@ "dev": true }, "node_modules/@jridgewell/gen-mapping": { - "version": "0.3.4", - "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.4.tgz", - "integrity": "sha512-Oud2QPM5dHviZNn4y/WhhYKSXksv+1xLEIsNrAbGcFzUN3ubqWRFT5gwPchNc5NuzILOU4tPBDTZ4VwhL8Y7cw==", + "version": "0.3.5", + "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.5.tgz", + "integrity": "sha512-IzL8ZoEDIBRWEzlCcRhOaCupYyN5gdIK+Q6fbFdPDg6HqX6jpkItn7DFIpW9LQzXG6Df9sA7+OKnq0qlz/GaQg==", "dev": true, "dependencies": { - "@jridgewell/set-array": "^1.0.1", + "@jridgewell/set-array": "^1.2.1", "@jridgewell/sourcemap-codec": "^1.4.10", - "@jridgewell/trace-mapping": "^0.3.9" + "@jridgewell/trace-mapping": "^0.3.24" }, "engines": { "node": ">=6.0.0" @@ -1141,9 +1132,9 @@ } }, "node_modules/@jridgewell/set-array": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.1.2.tgz", - "integrity": "sha512-xnkseuNADM0gt2bs+BvhO0p78Mk762YnZdsuzFV018NoG1Sj1SCQvpSqa7XUaTam5vAGasABV9qXASMKnFMwMw==", + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.2.1.tgz", + "integrity": "sha512-R8gLRTZeyp03ymzP/6Lil/28tGeGEzhx1q2k703KGWRAI1VdvPIXdG70VJc2pAMw3NA6JKL5hhFu1sJX0Mnn/A==", "dev": true, "engines": { "node": ">=6.0.0" @@ -1156,9 +1147,9 @@ "dev": true }, "node_modules/@jridgewell/trace-mapping": { - "version": "0.3.23", - "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.23.tgz", - "integrity": "sha512-9/4foRoUKp8s96tSkh8DlAAc5A0Ty8vLXld+l9gjKKY6ckwI8G15f0hskGmuLZu78ZlGa1vtsfOa+lnB4vG6Jg==", + "version": "0.3.25", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.25.tgz", + "integrity": "sha512-vNk6aEwybGtawWmy/PzwnGDOjCkLWSD2wqvjGGAgOAwCGWySYXfYoxt00IJkTF+8Lb57DwOb3Aa0o9CApepiYQ==", "dev": true, "dependencies": { "@jridgewell/resolve-uri": "^3.1.0", @@ -1166,14 +1157,14 @@ } }, "node_modules/@mui/base": { - "version": "5.0.0-beta.37", - "resolved": "https://registry.npmjs.org/@mui/base/-/base-5.0.0-beta.37.tgz", - "integrity": "sha512-/o3anbb+DeCng8jNsd3704XtmmLDZju1Fo8R2o7ugrVtPQ/QpcqddwKNzKPZwa0J5T8YNW3ZVuHyQgbTnQLisQ==", + "version": "5.0.0-beta.38", + "resolved": "https://registry.npmjs.org/@mui/base/-/base-5.0.0-beta.38.tgz", + "integrity": "sha512-AsjD6Y1X5A1qndxz8xCcR8LDqv31aiwlgWMPxFAX/kCKiIGKlK65yMeVZ62iQr/6LBz+9hSKLiD1i4TZdAHKcQ==", "dependencies": { "@babel/runtime": "^7.23.9", "@floating-ui/react-dom": "^2.0.8", "@mui/types": "^7.2.13", - "@mui/utils": "^5.15.11", + "@mui/utils": "^5.15.12", "@popperjs/core": "^2.11.8", "clsx": "^2.1.0", "prop-types": "^15.8.1" @@ -1197,18 +1188,18 @@ } }, "node_modules/@mui/core-downloads-tracker": { - "version": "5.15.11", - "resolved": "https://registry.npmjs.org/@mui/core-downloads-tracker/-/core-downloads-tracker-5.15.11.tgz", - "integrity": "sha512-JVrJ9Jo4gyU707ujnRzmE8ABBWpXd6FwL9GYULmwZRtfPg89ggXs/S3MStQkpJ1JRWfdLL6S5syXmgQGq5EDAw==", + "version": "5.15.12", + "resolved": "https://registry.npmjs.org/@mui/core-downloads-tracker/-/core-downloads-tracker-5.15.12.tgz", + "integrity": "sha512-brRO+tMFLpGyjEYHrX97bzqeF6jZmKpqqe1rY0LyIHAwP6xRVzh++zSecOQorDOCaZJg4XkGT9xfD+RWOWxZBA==", "funding": { "type": "opencollective", "url": "https://opencollective.com/mui-org" } }, "node_modules/@mui/icons-material": { - "version": "5.15.11", - "resolved": "https://registry.npmjs.org/@mui/icons-material/-/icons-material-5.15.11.tgz", - "integrity": "sha512-R5ZoQqnKpd+5Ew7mBygTFLxgYsQHPhgR3TDXSgIHYIjGzYuyPLmGLSdcPUoMdi6kxiYqHlpPj4NJxlbaFD0UHA==", + "version": "5.15.12", + "resolved": "https://registry.npmjs.org/@mui/icons-material/-/icons-material-5.15.12.tgz", + "integrity": "sha512-3BXiDlOd3AexZoEXa/VqpIpVIvosCzjLHsdMWzKMXbZdnBiJjmb9ECdqfjn5SpTClO49qvkKLhkTqdBH3fSFGw==", "dependencies": { "@babel/runtime": "^7.23.9" }, @@ -1231,16 +1222,16 @@ } }, "node_modules/@mui/material": { - "version": "5.15.11", - "resolved": "https://registry.npmjs.org/@mui/material/-/material-5.15.11.tgz", - "integrity": "sha512-FA3eEuEZaDaxgN3CgfXezMWbCZ4VCeU/sv0F0/PK5n42qIgsPVD6q+j71qS7/62sp6wRFMHtDMpXRlN+tT/7NA==", + "version": "5.15.12", + "resolved": "https://registry.npmjs.org/@mui/material/-/material-5.15.12.tgz", + "integrity": "sha512-vXJGg6KNKucsvbW6l7w9zafnpOp0CWc0Wx4mDykuABTpQ5QQBnZxP7+oB4yAS1hDZQ1WobbeIl0CjxK4EEahkA==", "dependencies": { "@babel/runtime": "^7.23.9", - "@mui/base": "5.0.0-beta.37", - "@mui/core-downloads-tracker": "^5.15.11", - "@mui/system": "^5.15.11", + "@mui/base": "5.0.0-beta.38", + "@mui/core-downloads-tracker": "^5.15.12", + "@mui/system": "^5.15.12", "@mui/types": "^7.2.13", - "@mui/utils": "^5.15.11", + "@mui/utils": "^5.15.12", "@types/react-transition-group": "^4.4.10", "clsx": "^2.1.0", "csstype": "^3.1.3", @@ -1275,12 +1266,12 @@ } }, "node_modules/@mui/private-theming": { - "version": "5.15.11", - "resolved": "https://registry.npmjs.org/@mui/private-theming/-/private-theming-5.15.11.tgz", - "integrity": "sha512-jY/696SnSxSzO1u86Thym7ky5T9CgfidU3NFJjguldqK4f3Z5S97amZ6nffg8gTD0HBjY9scB+4ekqDEUmxZOA==", + "version": "5.15.12", + "resolved": "https://registry.npmjs.org/@mui/private-theming/-/private-theming-5.15.12.tgz", + "integrity": "sha512-cqoSo9sgA5HE+8vZClbLrq9EkyOnYysooepi5eKaKvJ41lReT2c5wOZAeDDM1+xknrMDos+0mT2zr3sZmUiRRA==", "dependencies": { "@babel/runtime": "^7.23.9", - "@mui/utils": "^5.15.11", + "@mui/utils": "^5.15.12", "prop-types": "^15.8.1" }, "engines": { @@ -1332,15 +1323,15 @@ } }, "node_modules/@mui/system": { - "version": "5.15.11", - "resolved": "https://registry.npmjs.org/@mui/system/-/system-5.15.11.tgz", - "integrity": "sha512-9j35suLFq+MgJo5ktVSHPbkjDLRMBCV17NMBdEQurh6oWyGnLM4uhU4QGZZQ75o0vuhjJghOCA1jkO3+79wKsA==", + "version": "5.15.12", + "resolved": "https://registry.npmjs.org/@mui/system/-/system-5.15.12.tgz", + "integrity": "sha512-/pq+GO6yN3X7r3hAwFTrzkAh7K1bTF5r8IzS79B9eyKJg7v6B/t4/zZYMR6OT9qEPtwf6rYN2Utg1e6Z7F1OgQ==", "dependencies": { "@babel/runtime": "^7.23.9", - "@mui/private-theming": "^5.15.11", + "@mui/private-theming": "^5.15.12", "@mui/styled-engine": "^5.15.11", "@mui/types": "^7.2.13", - "@mui/utils": "^5.15.11", + "@mui/utils": "^5.15.12", "clsx": "^2.1.0", "csstype": "^3.1.3", "prop-types": "^15.8.1" @@ -1384,9 +1375,9 @@ } }, "node_modules/@mui/utils": { - "version": "5.15.11", - "resolved": "https://registry.npmjs.org/@mui/utils/-/utils-5.15.11.tgz", - "integrity": "sha512-D6bwqprUa9Stf8ft0dcMqWyWDKEo7D+6pB1k8WajbqlYIRA8J8Kw9Ra7PSZKKePGBGWO+/xxrX1U8HpG/aXQCw==", + "version": "5.15.12", + "resolved": "https://registry.npmjs.org/@mui/utils/-/utils-5.15.12.tgz", + "integrity": "sha512-8SDGCnO2DY9Yy+5bGzu00NZowSDtuyHP4H8gunhHGQoIlhlY2Z3w64wBzAOLpYw/ZhJNzksDTnS/i8qdJvxuow==", "dependencies": { "@babel/runtime": "^7.23.9", "@types/prop-types": "^15.7.11", @@ -1410,6 +1401,71 @@ } } }, + "node_modules/@mui/x-date-pickers": { + "version": "6.19.6", + "resolved": "https://registry.npmjs.org/@mui/x-date-pickers/-/x-date-pickers-6.19.6.tgz", + "integrity": "sha512-QW9AFcPi0vLpkUhmquhhyhLaBvB0AZJuu3NTrE173qNKx3Z3n51aCLY9bc7c6i4ltZMMsVRHlvzQjsve04TC8A==", + "dependencies": { + "@babel/runtime": "^7.23.2", + "@mui/base": "^5.0.0-beta.22", + "@mui/utils": "^5.14.16", + "@types/react-transition-group": "^4.4.8", + "clsx": "^2.0.0", + "prop-types": "^15.8.1", + "react-transition-group": "^4.4.5" + }, + "engines": { + "node": ">=14.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/mui" + }, + "peerDependencies": { + "@emotion/react": "^11.9.0", + "@emotion/styled": "^11.8.1", + "@mui/material": "^5.8.6", + "@mui/system": "^5.8.0", + "date-fns": "^2.25.0 || ^3.2.0", + "date-fns-jalali": "^2.13.0-0", + "dayjs": "^1.10.7", + "luxon": "^3.0.2", + "moment": "^2.29.4", + "moment-hijri": "^2.1.2", + "moment-jalaali": "^0.7.4 || ^0.8.0 || ^0.9.0 || ^0.10.0", + "react": "^17.0.0 || ^18.0.0", + "react-dom": "^17.0.0 || ^18.0.0" + }, + "peerDependenciesMeta": { + "@emotion/react": { + "optional": true + }, + "@emotion/styled": { + "optional": true + }, + "date-fns": { + "optional": true + }, + "date-fns-jalali": { + "optional": true + }, + "dayjs": { + "optional": true + }, + "luxon": { + "optional": true + }, + "moment": { + "optional": true + }, + "moment-hijri": { + "optional": true + }, + "moment-jalaali": { + "optional": true + } + } + }, "node_modules/@nodelib/fs.scandir": { "version": "2.1.5", "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", @@ -1463,9 +1519,9 @@ } }, "node_modules/@rollup/rollup-android-arm-eabi": { - "version": "4.12.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.12.0.tgz", - "integrity": "sha512-+ac02NL/2TCKRrJu2wffk1kZ+RyqxVUlbjSagNgPm94frxtr+XDL12E5Ll1enWskLrtrZ2r8L3wED1orIibV/w==", + "version": "4.12.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.12.1.tgz", + "integrity": "sha512-iU2Sya8hNn1LhsYyf0N+L4Gf9Qc+9eBTJJJsaOGUp+7x4n2M9dxTt8UvhJl3oeftSjblSlpCfvjA/IfP3g5VjQ==", "cpu": [ "arm" ], @@ -1476,9 +1532,9 @@ ] }, "node_modules/@rollup/rollup-android-arm64": { - "version": "4.12.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.12.0.tgz", - "integrity": "sha512-OBqcX2BMe6nvjQ0Nyp7cC90cnumt8PXmO7Dp3gfAju/6YwG0Tj74z1vKrfRz7qAv23nBcYM8BCbhrsWqO7PzQQ==", + "version": "4.12.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.12.1.tgz", + "integrity": "sha512-wlzcWiH2Ir7rdMELxFE5vuM7D6TsOcJ2Yw0c3vaBR3VOsJFVTx9xvwnAvhgU5Ii8Gd6+I11qNHwndDscIm0HXg==", "cpu": [ "arm64" ], @@ -1489,9 +1545,9 @@ ] }, "node_modules/@rollup/rollup-darwin-arm64": { - "version": "4.12.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.12.0.tgz", - "integrity": "sha512-X64tZd8dRE/QTrBIEs63kaOBG0b5GVEd3ccoLtyf6IdXtHdh8h+I56C2yC3PtC9Ucnv0CpNFJLqKFVgCYe0lOQ==", + "version": "4.12.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.12.1.tgz", + "integrity": "sha512-YRXa1+aZIFN5BaImK+84B3uNK8C6+ynKLPgvn29X9s0LTVCByp54TB7tdSMHDR7GTV39bz1lOmlLDuedgTwwHg==", "cpu": [ "arm64" ], @@ -1502,9 +1558,9 @@ ] }, "node_modules/@rollup/rollup-darwin-x64": { - "version": "4.12.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.12.0.tgz", - "integrity": "sha512-cc71KUZoVbUJmGP2cOuiZ9HSOP14AzBAThn3OU+9LcA1+IUqswJyR1cAJj3Mg55HbjZP6OLAIscbQsQLrpgTOg==", + "version": "4.12.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.12.1.tgz", + "integrity": "sha512-opjWJ4MevxeA8FhlngQWPBOvVWYNPFkq6/25rGgG+KOy0r8clYwL1CFd+PGwRqqMFVQ4/Qd3sQu5t7ucP7C/Uw==", "cpu": [ "x64" ], @@ -1515,9 +1571,9 @@ ] }, "node_modules/@rollup/rollup-linux-arm-gnueabihf": { - "version": "4.12.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.12.0.tgz", - "integrity": "sha512-a6w/Y3hyyO6GlpKL2xJ4IOh/7d+APaqLYdMf86xnczU3nurFTaVN9s9jOXQg97BE4nYm/7Ga51rjec5nfRdrvA==", + "version": "4.12.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.12.1.tgz", + "integrity": "sha512-uBkwaI+gBUlIe+EfbNnY5xNyXuhZbDSx2nzzW8tRMjUmpScd6lCQYKY2V9BATHtv5Ef2OBq6SChEP8h+/cxifQ==", "cpu": [ "arm" ], @@ -1528,9 +1584,9 @@ ] }, "node_modules/@rollup/rollup-linux-arm64-gnu": { - "version": "4.12.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.12.0.tgz", - "integrity": "sha512-0fZBq27b+D7Ar5CQMofVN8sggOVhEtzFUwOwPppQt0k+VR+7UHMZZY4y+64WJ06XOhBTKXtQB/Sv0NwQMXyNAA==", + "version": "4.12.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.12.1.tgz", + "integrity": "sha512-0bK9aG1kIg0Su7OcFTlexkVeNZ5IzEsnz1ept87a0TUgZ6HplSgkJAnFpEVRW7GRcikT4GlPV0pbtVedOaXHQQ==", "cpu": [ "arm64" ], @@ -1541,9 +1597,9 @@ ] }, "node_modules/@rollup/rollup-linux-arm64-musl": { - "version": "4.12.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.12.0.tgz", - "integrity": "sha512-eTvzUS3hhhlgeAv6bfigekzWZjaEX9xP9HhxB0Dvrdbkk5w/b+1Sxct2ZuDxNJKzsRStSq1EaEkVSEe7A7ipgQ==", + "version": "4.12.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.12.1.tgz", + "integrity": "sha512-qB6AFRXuP8bdkBI4D7UPUbE7OQf7u5OL+R94JE42Z2Qjmyj74FtDdLGeriRyBDhm4rQSvqAGCGC01b8Fu2LthQ==", "cpu": [ "arm64" ], @@ -1554,9 +1610,9 @@ ] }, "node_modules/@rollup/rollup-linux-riscv64-gnu": { - "version": "4.12.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.12.0.tgz", - "integrity": "sha512-ix+qAB9qmrCRiaO71VFfY8rkiAZJL8zQRXveS27HS+pKdjwUfEhqo2+YF2oI+H/22Xsiski+qqwIBxVewLK7sw==", + "version": "4.12.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.12.1.tgz", + "integrity": "sha512-sHig3LaGlpNgDj5o8uPEoGs98RII8HpNIqFtAI8/pYABO8i0nb1QzT0JDoXF/pxzqO+FkxvwkHZo9k0NJYDedg==", "cpu": [ "riscv64" ], @@ -1567,9 +1623,9 @@ ] }, "node_modules/@rollup/rollup-linux-x64-gnu": { - "version": "4.12.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.12.0.tgz", - "integrity": "sha512-TenQhZVOtw/3qKOPa7d+QgkeM6xY0LtwzR8OplmyL5LrgTWIXpTQg2Q2ycBf8jm+SFW2Wt/DTn1gf7nFp3ssVA==", + "version": "4.12.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.12.1.tgz", + "integrity": "sha512-nD3YcUv6jBJbBNFvSbp0IV66+ba/1teuBcu+fBBPZ33sidxitc6ErhON3JNavaH8HlswhWMC3s5rgZpM4MtPqQ==", "cpu": [ "x64" ], @@ -1580,9 +1636,9 @@ ] }, "node_modules/@rollup/rollup-linux-x64-musl": { - "version": "4.12.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.12.0.tgz", - "integrity": "sha512-LfFdRhNnW0zdMvdCb5FNuWlls2WbbSridJvxOvYWgSBOYZtgBfW9UGNJG//rwMqTX1xQE9BAodvMH9tAusKDUw==", + "version": "4.12.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.12.1.tgz", + "integrity": "sha512-7/XVZqgBby2qp/cO0TQ8uJK+9xnSdJ9ct6gSDdEr4MfABrjTyrW6Bau7HQ73a2a5tPB7hno49A0y1jhWGDN9OQ==", "cpu": [ "x64" ], @@ -1593,9 +1649,9 @@ ] }, "node_modules/@rollup/rollup-win32-arm64-msvc": { - "version": "4.12.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.12.0.tgz", - "integrity": "sha512-JPDxovheWNp6d7AHCgsUlkuCKvtu3RB55iNEkaQcf0ttsDU/JZF+iQnYcQJSk/7PtT4mjjVG8N1kpwnI9SLYaw==", + "version": "4.12.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.12.1.tgz", + "integrity": "sha512-CYc64bnICG42UPL7TrhIwsJW4QcKkIt9gGlj21gq3VV0LL6XNb1yAdHVp1pIi9gkts9gGcT3OfUYHjGP7ETAiw==", "cpu": [ "arm64" ], @@ -1606,9 +1662,9 @@ ] }, "node_modules/@rollup/rollup-win32-ia32-msvc": { - "version": "4.12.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.12.0.tgz", - "integrity": "sha512-fjtuvMWRGJn1oZacG8IPnzIV6GF2/XG+h71FKn76OYFqySXInJtseAqdprVTDTyqPxQOG9Exak5/E9Z3+EJ8ZA==", + "version": "4.12.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.12.1.tgz", + "integrity": "sha512-LN+vnlZ9g0qlHGlS920GR4zFCqAwbv2lULrR29yGaWP9u7wF5L7GqWu9Ah6/kFZPXPUkpdZwd//TNR+9XC9hvA==", "cpu": [ "ia32" ], @@ -1619,9 +1675,9 @@ ] }, "node_modules/@rollup/rollup-win32-x64-msvc": { - "version": "4.12.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.12.0.tgz", - "integrity": "sha512-ZYmr5mS2wd4Dew/JjT0Fqi2NPB/ZhZ2VvPp7SmvPZb4Y1CG/LRcS6tcRo2cYU7zLK5A7cdbhWnnWmUjoI4qapg==", + "version": "4.12.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.12.1.tgz", + "integrity": "sha512-n+vkrSyphvmU0qkQ6QBNXCGr2mKjhP08mPRM/Xp5Ck2FV4NrHU+y6axzDeixUrCBHVUS51TZhjqrKBBsHLKb2Q==", "cpu": [ "x64" ], @@ -1695,9 +1751,9 @@ "integrity": "sha512-ga8y9v9uyeiLdpKddhxYQkxNDrfvuPrlFb0N1qnZZByvcElJaXthF1UhvCh9TLWJBEHeNtdnbysW7Y6Uq8CVng==" }, "node_modules/@types/react": { - "version": "18.2.58", - "resolved": "https://registry.npmjs.org/@types/react/-/react-18.2.58.tgz", - "integrity": "sha512-TaGvMNhxvG2Q0K0aYxiKfNDS5m5ZsoIBBbtfUorxdH4NGSXIlYvZxLJI+9Dd3KjeB3780bciLyAb7ylO8pLhPw==", + "version": "18.2.63", + "resolved": "https://registry.npmjs.org/@types/react/-/react-18.2.63.tgz", + "integrity": "sha512-ppaqODhs15PYL2nGUOaOu2RSCCB4Difu4UFrP4I3NHLloXC/ESQzQMi9nvjfT1+rudd0d2L3fQPJxRSey+rGlQ==", "dependencies": { "@types/prop-types": "*", "@types/scheduler": "*", @@ -1705,9 +1761,9 @@ } }, "node_modules/@types/react-dom": { - "version": "18.2.19", - "resolved": "https://registry.npmjs.org/@types/react-dom/-/react-dom-18.2.19.tgz", - "integrity": "sha512-aZvQL6uUbIJpjZk4U8JZGbau9KDeAwMfmhyWorxgBkqDIEf6ROjRozcmPIicqsUwPUjbkDfHKgGee1Lq65APcA==", + "version": "18.2.20", + "resolved": "https://registry.npmjs.org/@types/react-dom/-/react-dom-18.2.20.tgz", + "integrity": "sha512-HXN/biJY8nv20Cn9ZbCFq3liERd4CozVZmKbaiZ9KiKTrWqsP7eoGDO6OOGvJQwoVFuiXaiJ7nBBjiFFbRmQMQ==", "dev": true, "dependencies": { "@types/react": "*" @@ -1742,16 +1798,16 @@ "dev": true }, "node_modules/@typescript-eslint/eslint-plugin": { - "version": "7.0.2", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-7.0.2.tgz", - "integrity": "sha512-/XtVZJtbaphtdrWjr+CJclaCVGPtOdBpFEnvtNf/jRV0IiEemRrL0qABex/nEt8isYcnFacm3nPHYQwL+Wb7qg==", + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-7.1.1.tgz", + "integrity": "sha512-zioDz623d0RHNhvx0eesUmGfIjzrk18nSBC8xewepKXbBvN/7c1qImV7Hg8TI1URTxKax7/zxfxj3Uph8Chcuw==", "dev": true, "dependencies": { "@eslint-community/regexpp": "^4.5.1", - "@typescript-eslint/scope-manager": "7.0.2", - "@typescript-eslint/type-utils": "7.0.2", - "@typescript-eslint/utils": "7.0.2", - "@typescript-eslint/visitor-keys": "7.0.2", + "@typescript-eslint/scope-manager": "7.1.1", + "@typescript-eslint/type-utils": "7.1.1", + "@typescript-eslint/utils": "7.1.1", + "@typescript-eslint/visitor-keys": "7.1.1", "debug": "^4.3.4", "graphemer": "^1.4.0", "ignore": "^5.2.4", @@ -1777,15 +1833,15 @@ } }, "node_modules/@typescript-eslint/parser": { - "version": "7.0.2", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-7.0.2.tgz", - "integrity": "sha512-GdwfDglCxSmU+QTS9vhz2Sop46ebNCXpPPvsByK7hu0rFGRHL+AusKQJ7SoN+LbLh6APFpQwHKmDSwN35Z700Q==", + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-7.1.1.tgz", + "integrity": "sha512-ZWUFyL0z04R1nAEgr9e79YtV5LbafdOtN7yapNbn1ansMyaegl2D4bL7vHoJ4HPSc4CaLwuCVas8CVuneKzplQ==", "dev": true, "dependencies": { - "@typescript-eslint/scope-manager": "7.0.2", - "@typescript-eslint/types": "7.0.2", - "@typescript-eslint/typescript-estree": "7.0.2", - "@typescript-eslint/visitor-keys": "7.0.2", + "@typescript-eslint/scope-manager": "7.1.1", + "@typescript-eslint/types": "7.1.1", + "@typescript-eslint/typescript-estree": "7.1.1", + "@typescript-eslint/visitor-keys": "7.1.1", "debug": "^4.3.4" }, "engines": { @@ -1805,13 +1861,13 @@ } }, "node_modules/@typescript-eslint/scope-manager": { - "version": "7.0.2", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-7.0.2.tgz", - "integrity": "sha512-l6sa2jF3h+qgN2qUMjVR3uCNGjWw4ahGfzIYsCtFrQJCjhbrDPdiihYT8FnnqFwsWX+20hK592yX9I2rxKTP4g==", + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-7.1.1.tgz", + "integrity": "sha512-cirZpA8bJMRb4WZ+rO6+mnOJrGFDd38WoXCEI57+CYBqta8Yc8aJym2i7vyqLL1vVYljgw0X27axkUXz32T8TA==", "dev": true, "dependencies": { - "@typescript-eslint/types": "7.0.2", - "@typescript-eslint/visitor-keys": "7.0.2" + "@typescript-eslint/types": "7.1.1", + "@typescript-eslint/visitor-keys": "7.1.1" }, "engines": { "node": "^16.0.0 || >=18.0.0" @@ -1822,13 +1878,13 @@ } }, "node_modules/@typescript-eslint/type-utils": { - "version": "7.0.2", - "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-7.0.2.tgz", - "integrity": "sha512-IKKDcFsKAYlk8Rs4wiFfEwJTQlHcdn8CLwLaxwd6zb8HNiMcQIFX9sWax2k4Cjj7l7mGS5N1zl7RCHOVwHq2VQ==", + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-7.1.1.tgz", + "integrity": "sha512-5r4RKze6XHEEhlZnJtR3GYeCh1IueUHdbrukV2KSlLXaTjuSfeVF8mZUVPLovidCuZfbVjfhi4c0DNSa/Rdg5g==", "dev": true, "dependencies": { - "@typescript-eslint/typescript-estree": "7.0.2", - "@typescript-eslint/utils": "7.0.2", + "@typescript-eslint/typescript-estree": "7.1.1", + "@typescript-eslint/utils": "7.1.1", "debug": "^4.3.4", "ts-api-utils": "^1.0.1" }, @@ -1849,9 +1905,9 @@ } }, "node_modules/@typescript-eslint/types": { - "version": "7.0.2", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-7.0.2.tgz", - "integrity": "sha512-ZzcCQHj4JaXFjdOql6adYV4B/oFOFjPOC9XYwCaZFRvqN8Llfvv4gSxrkQkd2u4Ci62i2c6W6gkDwQJDaRc4nA==", + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-7.1.1.tgz", + "integrity": "sha512-KhewzrlRMrgeKm1U9bh2z5aoL4s7K3tK5DwHDn8MHv0yQfWFz/0ZR6trrIHHa5CsF83j/GgHqzdbzCXJ3crx0Q==", "dev": true, "engines": { "node": "^16.0.0 || >=18.0.0" @@ -1862,13 +1918,13 @@ } }, "node_modules/@typescript-eslint/typescript-estree": { - "version": "7.0.2", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-7.0.2.tgz", - "integrity": "sha512-3AMc8khTcELFWcKcPc0xiLviEvvfzATpdPj/DXuOGIdQIIFybf4DMT1vKRbuAEOFMwhWt7NFLXRkbjsvKZQyvw==", + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-7.1.1.tgz", + "integrity": "sha512-9ZOncVSfr+sMXVxxca2OJOPagRwT0u/UHikM2Rd6L/aB+kL/QAuTnsv6MeXtjzCJYb8PzrXarypSGIPx3Jemxw==", "dev": true, "dependencies": { - "@typescript-eslint/types": "7.0.2", - "@typescript-eslint/visitor-keys": "7.0.2", + "@typescript-eslint/types": "7.1.1", + "@typescript-eslint/visitor-keys": "7.1.1", "debug": "^4.3.4", "globby": "^11.1.0", "is-glob": "^4.0.3", @@ -1890,17 +1946,17 @@ } }, "node_modules/@typescript-eslint/utils": { - "version": "7.0.2", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-7.0.2.tgz", - "integrity": "sha512-PZPIONBIB/X684bhT1XlrkjNZJIEevwkKDsdwfiu1WeqBxYEEdIgVDgm8/bbKHVu+6YOpeRqcfImTdImx/4Bsw==", + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-7.1.1.tgz", + "integrity": "sha512-thOXM89xA03xAE0lW7alstvnyoBUbBX38YtY+zAUcpRPcq9EIhXPuJ0YTv948MbzmKh6e1AUszn5cBFK49Umqg==", "dev": true, "dependencies": { "@eslint-community/eslint-utils": "^4.4.0", "@types/json-schema": "^7.0.12", "@types/semver": "^7.5.0", - "@typescript-eslint/scope-manager": "7.0.2", - "@typescript-eslint/types": "7.0.2", - "@typescript-eslint/typescript-estree": "7.0.2", + "@typescript-eslint/scope-manager": "7.1.1", + "@typescript-eslint/types": "7.1.1", + "@typescript-eslint/typescript-estree": "7.1.1", "semver": "^7.5.4" }, "engines": { @@ -1915,12 +1971,12 @@ } }, "node_modules/@typescript-eslint/visitor-keys": { - "version": "7.0.2", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-7.0.2.tgz", - "integrity": "sha512-8Y+YiBmqPighbm5xA2k4wKTxRzx9EkBu7Rlw+WHqMvRJ3RPz/BMBO9b2ru0LUNmXg120PHUXD5+SWFy2R8DqlQ==", + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-7.1.1.tgz", + "integrity": "sha512-yTdHDQxY7cSoCcAtiBzVzxleJhkGB9NncSIyMYe2+OGON1ZsP9zOPws/Pqgopa65jvknOjlk/w7ulPlZ78PiLQ==", "dev": true, "dependencies": { - "@typescript-eslint/types": "7.0.2", + "@typescript-eslint/types": "7.1.1", "eslint-visitor-keys": "^3.4.1" }, "engines": { @@ -2125,9 +2181,9 @@ } }, "node_modules/caniuse-lite": { - "version": "1.0.30001589", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001589.tgz", - "integrity": "sha512-vNQWS6kI+q6sBlHbh71IIeC+sRwK2N3EDySc/updIGhIee2x5z00J4c1242/5/d6EpEMdOnk/m+6tuk4/tcsqg==", + "version": "1.0.30001594", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001594.tgz", + "integrity": "sha512-VblSX6nYqyJVs8DKFMldE2IVCJjZ225LW00ydtUWwh5hk9IfkTOffO6r8gJNsH0qqqeAF8KrbMYA2VEwTlGW5g==", "dev": true, "funding": [ { @@ -2157,6 +2213,14 @@ "node": ">=4" } }, + "node_modules/chalk/node_modules/escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", + "engines": { + "node": ">=0.8.0" + } + }, "node_modules/clsx": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/clsx/-/clsx-2.1.0.tgz", @@ -2196,10 +2260,9 @@ "dev": true }, "node_modules/convert-source-map": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-2.0.0.tgz", - "integrity": "sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==", - "dev": true + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.9.0.tgz", + "integrity": "sha512-ASFBup0Mz1uyiIjANan1jzLQami9z1PoYSZCiiYW2FczPbenXc45FZdBZLzOT+r6+iciuEModtmCti+hjaAk0A==" }, "node_modules/cosmiconfig": { "version": "7.1.0", @@ -2243,6 +2306,11 @@ "resolved": "https://registry.npmjs.org/csstype/-/csstype-3.1.3.tgz", "integrity": "sha512-M1uQkMl8rQK/szD0LNhtqxIPLpimGm8sOBwU7lLnCpSbTyY3yeU1Vc7l4KT5zT4s/yOxHH5O7tIuuLOCnLADRw==" }, + "node_modules/dayjs": { + "version": "1.11.10", + "resolved": "https://registry.npmjs.org/dayjs/-/dayjs-1.11.10.tgz", + "integrity": "sha512-vjAczensTgRcqDERK0SR2XMwsF/tSvnvlv6VcF2GIhg6Sx4yOIt/irsr1RDJsKiIyBzJDpCoXiWWq28MqH2cnQ==" + }, "node_modules/debug": { "version": "4.3.4", "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", @@ -2308,9 +2376,9 @@ } }, "node_modules/electron-to-chromium": { - "version": "1.4.681", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.681.tgz", - "integrity": "sha512-1PpuqJUFWoXZ1E54m8bsLPVYwIVCRzvaL+n5cjigGga4z854abDnFRc+cTa2th4S79kyGqya/1xoR7h+Y5G5lg==", + "version": "1.4.693", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.693.tgz", + "integrity": "sha512-/if4Ueg0GUQlhCrW2ZlXwDAm40ipuKo+OgeHInlL8sbjt+hzISxZK949fZeJaVsheamrzANXvw1zQTvbxTvSHw==", "dev": true }, "node_modules/error-ex": { @@ -2369,11 +2437,14 @@ } }, "node_modules/escape-string-regexp": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", - "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", + "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", "engines": { - "node": ">=0.8.0" + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/eslint": { @@ -2539,18 +2610,6 @@ "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", "dev": true }, - "node_modules/eslint/node_modules/escape-string-regexp": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", - "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", - "dev": true, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/eslint/node_modules/globals": { "version": "13.24.0", "resolved": "https://registry.npmjs.org/globals/-/globals-13.24.0.tgz", @@ -3413,14 +3472,6 @@ "node": ">=0.10.0" } }, - "node_modules/object-path": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/object-path/-/object-path-0.6.0.tgz", - "integrity": "sha512-fxrwsCFi3/p+LeLOAwo/wyRMODZxdGBtUlWRzsEpsUVrisZbEfZ21arxLGfaWfcnqb8oHPNihIb4XPE8CQPN5A==", - "engines": { - "node": ">=0.8.0" - } - }, "node_modules/once": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", @@ -3706,9 +3757,9 @@ } }, "node_modules/react-i18next": { - "version": "14.0.5", - "resolved": "https://registry.npmjs.org/react-i18next/-/react-i18next-14.0.5.tgz", - "integrity": "sha512-5+bQSeEtgJrMBABBL5lO7jPdSNAbeAZ+MlFWDw//7FnVacuVu3l9EeWFzBQvZsKy+cihkbThWOAThEdH8YjGEw==", + "version": "14.0.7", + "resolved": "https://registry.npmjs.org/react-i18next/-/react-i18next-14.0.7.tgz", + "integrity": "sha512-8VN7IUaTB5t6ut/1LZtdHstQl1KSFStZRw3UGAERfkToVKLF4yvQVMz/Tq/YG3VR2zaWHEU8WrvIbVGhCqv90Q==", "dependencies": { "@babel/runtime": "^7.23.9", "html-parse-stringify": "^3.0.1" @@ -3853,9 +3904,9 @@ } }, "node_modules/rollup": { - "version": "4.12.0", - "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.12.0.tgz", - "integrity": "sha512-wz66wn4t1OHIJw3+XU7mJJQV/2NAfw5OAk6G6Hoo3zcvz/XOfQ52Vgi+AN4Uxoxi0KBBwk2g8zPrTDA4btSB/Q==", + "version": "4.12.1", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.12.1.tgz", + "integrity": "sha512-ggqQKvx/PsB0FaWXhIvVkSWh7a/PCLQAsMjBc+nA2M8Rv2/HG0X6zvixAB7KyZBRtifBUhy5k8voQX/mRnABPg==", "dev": true, "dependencies": { "@types/estree": "1.0.5" @@ -3868,19 +3919,19 @@ "npm": ">=8.0.0" }, "optionalDependencies": { - "@rollup/rollup-android-arm-eabi": "4.12.0", - "@rollup/rollup-android-arm64": "4.12.0", - "@rollup/rollup-darwin-arm64": "4.12.0", - "@rollup/rollup-darwin-x64": "4.12.0", - "@rollup/rollup-linux-arm-gnueabihf": "4.12.0", - "@rollup/rollup-linux-arm64-gnu": "4.12.0", - "@rollup/rollup-linux-arm64-musl": "4.12.0", - "@rollup/rollup-linux-riscv64-gnu": "4.12.0", - "@rollup/rollup-linux-x64-gnu": "4.12.0", - "@rollup/rollup-linux-x64-musl": "4.12.0", - "@rollup/rollup-win32-arm64-msvc": "4.12.0", - "@rollup/rollup-win32-ia32-msvc": "4.12.0", - "@rollup/rollup-win32-x64-msvc": "4.12.0", + "@rollup/rollup-android-arm-eabi": "4.12.1", + "@rollup/rollup-android-arm64": "4.12.1", + "@rollup/rollup-darwin-arm64": "4.12.1", + "@rollup/rollup-darwin-x64": "4.12.1", + "@rollup/rollup-linux-arm-gnueabihf": "4.12.1", + "@rollup/rollup-linux-arm64-gnu": "4.12.1", + "@rollup/rollup-linux-arm64-musl": "4.12.1", + "@rollup/rollup-linux-riscv64-gnu": "4.12.1", + "@rollup/rollup-linux-x64-gnu": "4.12.1", + "@rollup/rollup-linux-x64-musl": "4.12.1", + "@rollup/rollup-win32-arm64-msvc": "4.12.1", + "@rollup/rollup-win32-ia32-msvc": "4.12.1", + "@rollup/rollup-win32-x64-msvc": "4.12.1", "fsevents": "~2.3.2" } }, @@ -3983,14 +4034,6 @@ "node": ">=8" } }, - "node_modules/sort-by": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/sort-by/-/sort-by-1.2.0.tgz", - "integrity": "sha512-aRyW65r3xMnf4nxJRluCg0H/woJpksU1dQxRtXYzau30sNBOmf5HACpDd9MZDhKh7ALQ5FgSOfMPwZEtUmMqcg==", - "dependencies": { - "object-path": "0.6.0" - } - }, "node_modules/source-map": { "version": "0.5.7", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", @@ -4179,9 +4222,9 @@ } }, "node_modules/vite": { - "version": "5.1.4", - "resolved": "https://registry.npmjs.org/vite/-/vite-5.1.4.tgz", - "integrity": "sha512-n+MPqzq+d9nMVTKyewqw6kSt+R3CkvF9QAKY8obiQn8g1fwTscKxyfaYnC632HtBXAQGc1Yjomphwn1dtwGAHg==", + "version": "5.1.5", + "resolved": "https://registry.npmjs.org/vite/-/vite-5.1.5.tgz", + "integrity": "sha512-BdN1xh0Of/oQafhU+FvopafUp6WaYenLU/NFoL5WyJL++GxkNfieKzBhM24H3HVsPQrlAqB7iJYTHabzaRed5Q==", "dev": true, "dependencies": { "esbuild": "^0.19.3", diff --git a/frontend/frontend/package.json b/frontend/frontend/package.json index 884b961c..e53efebe 100644 --- a/frontend/frontend/package.json +++ b/frontend/frontend/package.json @@ -10,12 +10,14 @@ "preview": "vite preview" }, "dependencies": { - "@emotion/react": "^11.11.3", + "@emotion/react": "^11.11.4", "@emotion/styled": "^11.11.0", "@fontsource/roboto": "^5.0.8", "@mui/icons-material": "^5.15.11", - "@mui/material": "^5.15.11", + "@mui/material": "^5.15.12", + "@mui/x-date-pickers": "^6.19.6", "axios": "^1.6.7", + "dayjs": "^1.11.10", "i18next": "^23.10.0", "i18next-browser-languagedetector": "^7.2.0", "i18next-http-backend": "^2.5.0", @@ -26,8 +28,7 @@ "react-helmet": "^6.1.0", "react-helmet-async": "^2.0.4", "react-i18next": "^14.0.5", - "react-router-dom": "^6.22.2", - "sort-by": "^1.2.0" + "react-router-dom": "^6.22.2" }, "devDependencies": { "@types/react": "^18.2.56", diff --git a/frontend/frontend/src/Theme.ts b/frontend/frontend/src/Theme.ts index 783c5f2f..a47d5b31 100644 --- a/frontend/frontend/src/Theme.ts +++ b/frontend/frontend/src/Theme.ts @@ -1,29 +1,30 @@ import {createTheme} from "@mui/material"; const theme = createTheme({ - palette:{ - primary:{ - main:'#1E64C8', - contrastText:'#FCF8FD' + palette: { + primary: { + main: '#1E64C8', + contrastText: '#FCF8FD' }, - secondary:{ - main:'#D0E4FF', - contrastText:'#47464A' + secondary: { + main: '#D0E4FF', + contrastText: '#47464A' }, - background:{ - default:'#FCF8FD', + background: { + default: '#FCF8FD', }, - text:{ - primary:'#47464A', - secondary:'#FCF8FD' + text: { + primary: '#47464A', + secondary: '#FCF8FD' }, - error:{ - main:'#FF5445' + error: { + main: '#FF5445' + }, + success: { + main: '#81A476' }, - success:{ - main:'#81A476' - } }, + }); export default theme; \ No newline at end of file diff --git a/frontend/frontend/src/components/AssignmentListItem.tsx b/frontend/frontend/src/components/AssignmentListItem.tsx index 2e222f42..d1b63a66 100644 --- a/frontend/frontend/src/components/AssignmentListItem.tsx +++ b/frontend/frontend/src/components/AssignmentListItem.tsx @@ -3,12 +3,13 @@ import CheckCircleOutlineIcon from '@mui/icons-material/CheckCircleOutline'; import HighlightOffIcon from '@mui/icons-material/HighlightOff'; import {useNavigate} from "react-router-dom"; import {t} from "i18next"; + interface AssignmentListItemProps { - key: string; + id: string; projectName: string; dueDate?: Date; status: boolean; - isStudent:boolean; + isStudent: boolean; } /* @@ -20,16 +21,16 @@ interface AssignmentListItemProps { * @param isStudent: boolean - if the user is a student or a teacher */ -export function AssignmentListItem({key,projectName, dueDate, status,isStudent}:AssignmentListItemProps) { +export function AssignmentListItem({id, projectName, dueDate, status, isStudent}: AssignmentListItemProps) { const navigate = useNavigate(); const handleProjectClick = () => { console.log("Project clicked"); - navigate(`/${key}`) + navigate(`/${id}`) } return ( <> - + - - - {isStudent && {status?:}} + + + {isStudent && {status ? + : + }} diff --git a/frontend/frontend/src/components/CourseCard.tsx b/frontend/frontend/src/components/CourseCard.tsx index c61cc633..c7d6e18c 100644 --- a/frontend/frontend/src/components/CourseCard.tsx +++ b/frontend/frontend/src/components/CourseCard.tsx @@ -1,7 +1,7 @@ import {Box, Card, CardActionArea, CardContent, Divider, IconButton, Typography} from "@mui/material"; import {t} from "i18next"; import List from '@mui/material/List'; -import { AssignmentListItem } from "./AssignmentListItem"; +import {AssignmentListItem} from "./AssignmentListItem"; import {useNavigate} from "react-router-dom"; import ArchiveOutlinedIcon from '@mui/icons-material/ArchiveOutlined'; /* @@ -53,106 +53,117 @@ export function CourseCard({courseId, archived, isStudent}: CourseCardProps) { return ( <> - + - - - {course.name} - {course.teacher} - - - {t("students")}{course.students.length} + + + {course.name} + {course.teacher} + + + {t("students")}{course.students.length} + - - {isStudent? - - Project - Deadline - Status - : + {isStudent ? + + Project + Deadline + Status + : <> - {archived? - - Project - Deadline - + {archived ? + + Project + Deadline + : - - Project - Deadline - - } + + Project + Deadline + + } } - {isStudent? - - - {assignments.map((assignment) => ( - - ))} - - : - <>{!archived? - + {isStudent ? + {assignments.map((assignment) => ( - ))} : - - - {assignments.map((assignment) => ( - - ))} - - + <>{!archived ? + + + {assignments.map((assignment) => ( + + ))} + + : + + + {assignments.map((assignment) => ( + + ))} + + } - {!archived && - - - } + {!archived && + + + } } diff --git a/frontend/frontend/src/components/DeadlineCalendar.tsx b/frontend/frontend/src/components/DeadlineCalendar.tsx new file mode 100644 index 00000000..9d00b54f --- /dev/null +++ b/frontend/frontend/src/components/DeadlineCalendar.tsx @@ -0,0 +1,128 @@ +import {DateCalendar, DayCalendarSkeleton, PickersDay, PickersDayProps} from "@mui/x-date-pickers"; +import dayjs, {Dayjs} from "dayjs"; +import {Badge, SxProps} from "@mui/material"; +import {useEffect, useRef, useState} from "react"; +import AssignmentIcon from '@mui/icons-material/Assignment'; + +//TODO: fix highlights for day with deadlines in the displayed month + +function fakeFetch(date: Dayjs, {signal}: { signal: AbortSignal }, deadlines: Dayjs[]) { + return new Promise<{ deadlinesToDisplay: Dayjs[] }>((resolve, reject) => { + const timeout = setTimeout(() => { + const deadlinesToDisplay = deadlines.filter(deadline => + deadline.month() === date.month() && deadline.year() === date.year() + ); + resolve({deadlinesToDisplay}); + }, 500); + + signal.onabort = () => { + clearTimeout(timeout); + reject(new DOMException('aborted', 'AbortError')); + }; + }); +} + + +function ServerDay(props: PickersDayProps & { highlightedDays?: number[] }) { + const {highlightedDays = [], day, outsideCurrentMonth, ...other} = props; + + const isSelected = + !props.outsideCurrentMonth && highlightedDays.indexOf(props.day.date()) >= 0; + + return ( + : undefined} + > + + + ); +} + +/* +* This component is a calendar that displays deadlines. +* It uses the DateCalendar component from @mui/x-date-pickers to display the calendar. +* The calendar is read-only and the user can't select a date. +* The deadlines are passed as an array of Dayjs objects. +* The deadlines are displayed as a badge on the day of the deadline. + */ + +interface DeadlineCalendarProps { + deadlines: Dayjs[]; +} + +export function DeadlineCalendar({deadlines}: DeadlineCalendarProps) { + const requestAbortController = useRef(null); + const [isLoading, setIsLoading] = useState(false); + const [highlightedDays, setHighlightedDays] = useState([1, 2, 15]); + const [value, setValue] = useState(dayjs()); + + const fetchHighlightedDays = (date: Dayjs) => { + const controller = new AbortController(); + fakeFetch(date, { + signal: controller.signal, + }, deadlines) + .then(({deadlinesToDisplay}) => { + setHighlightedDays(deadlinesToDisplay.map(deadline => deadline.date())); + setIsLoading(false); + }) + .catch((error: Error) => { + // ignore the error if it's caused by `controller.abort` + if (error.name !== 'AbortError') { + throw error; + } + }); + + requestAbortController.current = controller; + }; + + useEffect(() => { + fetchHighlightedDays(dayjs()); + // abort request on unmount + return () => requestAbortController.current?.abort(); + }, []); + + const handleMonthChange = (date: Dayjs) => { + if (requestAbortController.current) { + // make sure that you are aborting useless requests + // because it is possible to switch between months pretty quickly + requestAbortController.current.abort(); + } + + setIsLoading(true); + setHighlightedDays([]); + fetchHighlightedDays(date); + }; + + return ( + <> + setValue(newValue)} + onMonthChange={handleMonthChange} + renderLoading={() => } + loading={isLoading} + sx={dateStyle} + slots={{ + day: ServerDay, + }} + slotProps={{ + day: { + highlightedDays, + } as any, + }} + /> + + ); +} + +const dateStyle: SxProps = { + "& .MuiPickersDay-root.Mui-selected": { + color: "text.primary", + backgroundColor: "secondary.main", + }, + "& .MuiPickersDay-root.Mui-selected:hover": { + backgroundColor: "secondary.main", + }, + +}; \ No newline at end of file diff --git a/frontend/frontend/src/main.tsx b/frontend/frontend/src/main.tsx index 4afb80d1..60a4eaf1 100644 --- a/frontend/frontend/src/main.tsx +++ b/frontend/frontend/src/main.tsx @@ -3,38 +3,41 @@ import ReactDOM from "react-dom/client"; import {ThemeProvider} from "@mui/material"; import theme from "./Theme.ts"; import "./i18n/config.ts"; -import { createBrowserRouter, RouterProvider } from "react-router-dom"; +import {createBrowserRouter, RouterProvider} from "react-router-dom"; import ErrorPage from "./pages/ErrorPage.tsx"; import {MainPage} from "./pages/mainPage/MainPage.tsx"; import {Helmet, HelmetProvider} from "react-helmet-async"; -import { SubjectsStudentPage } from "./pages/subjects_page/SubjectsStudentPage.tsx"; - +import {SubjectsStudentPage} from "./pages/subjects_page/SubjectsStudentPage.tsx"; +import {LocalizationProvider} from "@mui/x-date-pickers"; +import {AdapterDayjs} from '@mui/x-date-pickers/AdapterDayjs/AdapterDayjs'; const router = createBrowserRouter([ - { - path: "/", - element: , - errorElement: , - }, - { - path: "/subjects_student", - element: , - }, + { + path: "/", + element: , + errorElement: , + }, + { + path: "/subjects_student", + element: , + }, ]); ReactDOM.createRoot(document.getElementById("root")!).render( - - - - - + + + + + + Loading...}> + + + + + + + - Loading...}> - - - - - - + ); diff --git a/frontend/frontend/src/pages/mainPage/ArchivedView.tsx b/frontend/frontend/src/pages/mainPage/ArchivedView.tsx index c04c1477..10ef6272 100644 --- a/frontend/frontend/src/pages/mainPage/ArchivedView.tsx +++ b/frontend/frontend/src/pages/mainPage/ArchivedView.tsx @@ -1,7 +1,32 @@ -export function ArchivedView() { +import {Stack} from "@mui/material"; +import {CourseCard} from "../../components/CourseCard.tsx"; + +interface CourseCardProps { + isStudent: boolean; +} + +export function ArchivedView({isStudent}: CourseCardProps) { + //TODO: get courses from state + const courses = getCourses(); return ( <> - + + + + + + + + ); +} + +//fix courses with state +function getCourses(): string[] { + return [] } \ No newline at end of file diff --git a/frontend/frontend/src/pages/mainPage/CoursesView.tsx b/frontend/frontend/src/pages/mainPage/CoursesView.tsx index bed5eeab..a4fc313c 100644 --- a/frontend/frontend/src/pages/mainPage/CoursesView.tsx +++ b/frontend/frontend/src/pages/mainPage/CoursesView.tsx @@ -1,30 +1,32 @@ -import {Box, Stack} from "@mui/material"; +import {Stack} from "@mui/material"; import {CourseCard} from "../../components/CourseCard.tsx"; interface CourseCardProps { isStudent: boolean; } + export function CoursesView({isStudent}: CourseCardProps) { //TODO: get courses from state const courses = getCourses(); return ( <> - - + + - - - ); } //fix courses with state -function getCourses():string[]{ +function getCourses(): string[] { return [] } \ No newline at end of file diff --git a/frontend/frontend/src/pages/mainPage/MainPage.tsx b/frontend/frontend/src/pages/mainPage/MainPage.tsx index 1650d13f..6a6d4f62 100644 --- a/frontend/frontend/src/pages/mainPage/MainPage.tsx +++ b/frontend/frontend/src/pages/mainPage/MainPage.tsx @@ -3,15 +3,27 @@ import {Box, Stack} from "@mui/material"; import TabSwitcher from "../../components/TabSwitcher.tsx"; import {ArchivedView} from "./ArchivedView.tsx"; import {CoursesView} from "./CoursesView.tsx"; +import {DeadlineCalendar} from "../../components/DeadlineCalendar.tsx"; +import dayjs from "dayjs"; export function MainPage() { return ( <> - -
- - ,]}/> + +
+ + , ]}/> + + + @@ -19,6 +31,6 @@ export function MainPage() { } //TODO: use api to check user role -function getRole(id:string):string{ +function getRole(id: string): string { return "teacher"; } \ No newline at end of file From 882133c625b72995b822180b7e586eb693803150 Mon Sep 17 00:00:00 2001 From: Ben De Meurichy Date: Sat, 9 Mar 2024 22:00:37 +0100 Subject: [PATCH 08/19] begin indienings pagina --- frontend/frontend/src/i18n/config.ts | 14 ++++--- .../pages/submissionPage/SubmissionPage.tsx | 38 +++++++++++++++++++ 2 files changed, 47 insertions(+), 5 deletions(-) create mode 100644 frontend/frontend/src/pages/submissionPage/SubmissionPage.tsx diff --git a/frontend/frontend/src/i18n/config.ts b/frontend/frontend/src/i18n/config.ts index 9ab92b38..b2a0a887 100644 --- a/frontend/frontend/src/i18n/config.ts +++ b/frontend/frontend/src/i18n/config.ts @@ -6,25 +6,29 @@ const english = { logo: "./src/assets/logo_UGent_EN_RGB_2400_white.png", logo_blue: "./src/assets/logo_UGent_EN_RGB_2400_color.png", login: "Log in with your UGent account", - back : "Back", + back: "Back", current_courses: "Current courses", archived: "Archived", students: "Students: ", no_deadline: "No deadline", + submission: "Submission", }; const dutch = { logo: "./src/assets/logo_UGent_NL_RGB_2400_wit.png", logo_blue: "./src/assets/logo_UGent_NL_RGB_2400_kleur.png", login: "Log in met je UGent account", - back : "Terug", + back: "Terug", current_courses: "Huidige vakken", archived: "Gearchiveerd", students: "Studenten: ", no_deadline: "Geen deadline", + submission: "Indiening", }; -i18n.use(initReactI18next).use(LanguageDetector).init({ fallbackLng: "en", - debug:true, interpolation: {escapeValue: false}, - resources: {en: {translation: english}, nl: {translation: dutch}}}); +i18n.use(initReactI18next).use(LanguageDetector).init({ + fallbackLng: "en", + debug: true, interpolation: {escapeValue: false}, + resources: {en: {translation: english}, nl: {translation: dutch}} +}); export default i18n; \ No newline at end of file diff --git a/frontend/frontend/src/pages/submissionPage/SubmissionPage.tsx b/frontend/frontend/src/pages/submissionPage/SubmissionPage.tsx new file mode 100644 index 00000000..32e8417f --- /dev/null +++ b/frontend/frontend/src/pages/submissionPage/SubmissionPage.tsx @@ -0,0 +1,38 @@ +import Grid2 from "@mui/material/Unstable_Grid2"; +import {Header} from "../../components/Header.tsx"; +import {useParams} from "react-router-dom"; +import {t} from "i18next"; +import {useEffect, useState} from "react"; +import {Paper} from "@mui/material"; +import {Dayjs} from "dayjs"; + +interface Submission { + //Dayjs is present in pull request for mainpage + deadline: Dayjs; + projectName: string; + assignment: string; + filename: string; + + +} + +export function SubmissionPage() { + const {project} = useParams(); + const [submission, setSubmission] = useState({} as Submission); + + useEffect(() => { + fetch(`/api/submissions/${project}`) + .then(res => res.json()) + .then(data => setSubmission(data)); + }, [project]); + + + return ( + <> + +
+ + + + ); +} \ No newline at end of file From fe51832b522eef36c0b78c43b728e518f7dd2e05 Mon Sep 17 00:00:00 2001 From: Ben De Meurichy Date: Sat, 9 Mar 2024 23:17:31 +0100 Subject: [PATCH 09/19] knoppen om admins toe te voegen en vakken zijn toegevoegd --- frontend/frontend/src/Theme.ts | 2 ++ .../frontend/src/components/CourseCard.tsx | 4 +-- frontend/frontend/src/i18n/config.ts | 14 +++++--- .../src/pages/mainPage/CoursesView.tsx | 29 +++++++++------ .../frontend/src/pages/mainPage/MainPage.tsx | 36 +++++++++++++++---- 5 files changed, 61 insertions(+), 24 deletions(-) diff --git a/frontend/frontend/src/Theme.ts b/frontend/frontend/src/Theme.ts index a47d5b31..b9cffc20 100644 --- a/frontend/frontend/src/Theme.ts +++ b/frontend/frontend/src/Theme.ts @@ -4,6 +4,8 @@ const theme = createTheme({ palette: { primary: { main: '#1E64C8', + light: '#D0E4FF', + dark: '#1E64C8', contrastText: '#FCF8FD' }, secondary: { diff --git a/frontend/frontend/src/components/CourseCard.tsx b/frontend/frontend/src/components/CourseCard.tsx index c7d6e18c..0faa2998 100644 --- a/frontend/frontend/src/components/CourseCard.tsx +++ b/frontend/frontend/src/components/CourseCard.tsx @@ -55,12 +55,12 @@ export function CourseCard({courseId, archived, isStudent}: CourseCardProps) { diff --git a/frontend/frontend/src/i18n/config.ts b/frontend/frontend/src/i18n/config.ts index 9ab92b38..8a1313cb 100644 --- a/frontend/frontend/src/i18n/config.ts +++ b/frontend/frontend/src/i18n/config.ts @@ -6,25 +6,29 @@ const english = { logo: "./src/assets/logo_UGent_EN_RGB_2400_white.png", logo_blue: "./src/assets/logo_UGent_EN_RGB_2400_color.png", login: "Log in with your UGent account", - back : "Back", + back: "Back", current_courses: "Current courses", archived: "Archived", students: "Students: ", no_deadline: "No deadline", + add_admin: "Add admin", }; const dutch = { logo: "./src/assets/logo_UGent_NL_RGB_2400_wit.png", logo_blue: "./src/assets/logo_UGent_NL_RGB_2400_kleur.png", login: "Log in met je UGent account", - back : "Terug", + back: "Terug", current_courses: "Huidige vakken", archived: "Gearchiveerd", students: "Studenten: ", no_deadline: "Geen deadline", + add_admin: "Voeg admin toe", }; -i18n.use(initReactI18next).use(LanguageDetector).init({ fallbackLng: "en", - debug:true, interpolation: {escapeValue: false}, - resources: {en: {translation: english}, nl: {translation: dutch}}}); +i18n.use(initReactI18next).use(LanguageDetector).init({ + fallbackLng: "en", + debug: true, interpolation: {escapeValue: false}, + resources: {en: {translation: english}, nl: {translation: dutch}} +}); export default i18n; \ No newline at end of file diff --git a/frontend/frontend/src/pages/mainPage/CoursesView.tsx b/frontend/frontend/src/pages/mainPage/CoursesView.tsx index a4fc313c..96fbb7f7 100644 --- a/frontend/frontend/src/pages/mainPage/CoursesView.tsx +++ b/frontend/frontend/src/pages/mainPage/CoursesView.tsx @@ -1,5 +1,6 @@ -import {Stack} from "@mui/material"; +import {IconButton, Stack} from "@mui/material"; import {CourseCard} from "../../components/CourseCard.tsx"; +import AddIcon from "@mui/icons-material/Add"; interface CourseCardProps { isStudent: boolean; @@ -11,15 +12,23 @@ export function CoursesView({isStudent}: CourseCardProps) { return ( <> - - - - - + + + + + + + + {!isStudent && + + + + + } diff --git a/frontend/frontend/src/pages/mainPage/MainPage.tsx b/frontend/frontend/src/pages/mainPage/MainPage.tsx index 6a6d4f62..0f399517 100644 --- a/frontend/frontend/src/pages/mainPage/MainPage.tsx +++ b/frontend/frontend/src/pages/mainPage/MainPage.tsx @@ -1,30 +1,52 @@ import {Header} from "../../components/Header.tsx"; -import {Box, Stack} from "@mui/material"; +import {Box, Button, Stack} from "@mui/material"; import TabSwitcher from "../../components/TabSwitcher.tsx"; import {ArchivedView} from "./ArchivedView.tsx"; import {CoursesView} from "./CoursesView.tsx"; import {DeadlineCalendar} from "../../components/DeadlineCalendar.tsx"; import dayjs from "dayjs"; +import {t} from "i18next"; +import {useEffect, useState} from "react"; export function MainPage() { + const [role, setRole] = useState(getRole("1")); + + useEffect(() => { + setRole(getRole("1")); + console.log("current user is: " + role); + }, []); + return ( <> - +
, ]}/> - + + {role === "admin" && + + + } ); @@ -33,4 +55,4 @@ export function MainPage() { //TODO: use api to check user role function getRole(id: string): string { return "teacher"; -} \ No newline at end of file +} From 98b1ee5351c745569d0bf19373686e269532948b Mon Sep 17 00:00:00 2001 From: elias Date: Sun, 10 Mar 2024 13:46:29 +0100 Subject: [PATCH 10/19] added routing for assignment student page --- frontend/frontend/.vite/deps/_metadata.json | 8 ++++++++ frontend/frontend/.vite/deps/package.json | 3 +++ frontend/frontend/src/main.tsx | 6 +++++- .../assignmentPage/assignmentStudentPage.tsx | 18 ++++++++++++++++++ 4 files changed, 34 insertions(+), 1 deletion(-) create mode 100644 frontend/frontend/.vite/deps/_metadata.json create mode 100644 frontend/frontend/.vite/deps/package.json create mode 100644 frontend/frontend/src/pages/assignmentPage/assignmentStudentPage.tsx diff --git a/frontend/frontend/.vite/deps/_metadata.json b/frontend/frontend/.vite/deps/_metadata.json new file mode 100644 index 00000000..6bc63e74 --- /dev/null +++ b/frontend/frontend/.vite/deps/_metadata.json @@ -0,0 +1,8 @@ +{ + "hash": "ea10a7bd", + "configHash": "baf76694", + "lockfileHash": "e3b0c442", + "browserHash": "89947c23", + "optimized": {}, + "chunks": {} +} \ No newline at end of file diff --git a/frontend/frontend/.vite/deps/package.json b/frontend/frontend/.vite/deps/package.json new file mode 100644 index 00000000..3dbc1ca5 --- /dev/null +++ b/frontend/frontend/.vite/deps/package.json @@ -0,0 +1,3 @@ +{ + "type": "module" +} diff --git a/frontend/frontend/src/main.tsx b/frontend/frontend/src/main.tsx index 4afb80d1..c6932804 100644 --- a/frontend/frontend/src/main.tsx +++ b/frontend/frontend/src/main.tsx @@ -9,7 +9,7 @@ import ErrorPage from "./pages/ErrorPage.tsx"; import {MainPage} from "./pages/mainPage/MainPage.tsx"; import {Helmet, HelmetProvider} from "react-helmet-async"; import { SubjectsStudentPage } from "./pages/subjects_page/SubjectsStudentPage.tsx"; - +import { AssignmentStudentPage } from "./pages/assignmentPage/assignmentStudentPage"; const router = createBrowserRouter([ { @@ -21,6 +21,10 @@ const router = createBrowserRouter([ path: "/subjects_student", element: , }, + { + path: "/assignment_student", + element: , + }, ]); ReactDOM.createRoot(document.getElementById("root")!).render( diff --git a/frontend/frontend/src/pages/assignmentPage/assignmentStudentPage.tsx b/frontend/frontend/src/pages/assignmentPage/assignmentStudentPage.tsx new file mode 100644 index 00000000..2c829ed1 --- /dev/null +++ b/frontend/frontend/src/pages/assignmentPage/assignmentStudentPage.tsx @@ -0,0 +1,18 @@ +import {Header} from "../../components/Header.tsx"; +import {Box, Stack, Typography} from "@mui/material"; + +export function AssignmentStudentPage() { + return ( + <> + +
+ + Opgave: +Lorem ipsum dolor sit amet consectetur. Nisi magna dolor et nisi nibh et velit phasellus. Aliquam semper justo posuere suspendisse amet amet nam nec. Tellus magna in proin tempor hac sit. Faucibus laoreet nulla commodo quis. Porttitor sit facilisis sit dignissim quis. Malesuada etiam tempor donec et ante. Aliquam massa donec augue aliquam semper amet blandit sed faucibus. Et elementum duis adipiscing turpis mi. Senectus eu rutrum accumsan convallis metus mattis risus. +Quam eget sapien tellus aliquam facilisi sit volutpat. Scelerisque auctor purus nam sit lacus amet ullamcorper amet. Turpis nulla quis in pretium. Maecenas aliquam ac ullamcorper suspendisse morbi cras. Mi nibh aliquet massa sit eget tristique a. Posuere pretium auctor tellus massa et eu egestas. Sit lorem proin aenean tortor morbi condimentum. Leo eu enim cursus tempus sed viverra laoreet. Nisl ornare velit molestie suspendisse. Hendrerit nibh mauris vulputate sit vitae. Tellus quisque non nibh proin nunc lacus scelerisque dui. +Aliquam fermentum libero aliquet volutpat at. Vestibulum ultrices nec felis leo nibh viverra. Hendrerit ut nunc porta egestas sit velit dictumst dis porta. Donec quam aliquam commodo mattis purus. Tellus nulla lectus fusce in fames scelerisque at. + + + + ); +} \ No newline at end of file From d2ee881330bd5d0bffd6b0385dfa70e7ab755348 Mon Sep 17 00:00:00 2001 From: elias Date: Sun, 10 Mar 2024 17:03:04 +0100 Subject: [PATCH 11/19] assignment student page done (buttons not functional) --- .../assignmentPage/assignmentStudentPage.tsx | 123 ++++++++++++++++-- 1 file changed, 113 insertions(+), 10 deletions(-) diff --git a/frontend/frontend/src/pages/assignmentPage/assignmentStudentPage.tsx b/frontend/frontend/src/pages/assignmentPage/assignmentStudentPage.tsx index 2c829ed1..e47987c2 100644 --- a/frontend/frontend/src/pages/assignmentPage/assignmentStudentPage.tsx +++ b/frontend/frontend/src/pages/assignmentPage/assignmentStudentPage.tsx @@ -1,18 +1,121 @@ import {Header} from "../../components/Header.tsx"; -import {Box, Stack, Typography} from "@mui/material"; +import { AssignmentListItem } from "../../components/AssignmentListItem.tsx"; +import {List, Button, Stack, Typography, Card, Divider} from "@mui/material"; + +const text = "Lorem ipsum dolor sit amet consectetur. Nisi magna dolor et nisi nibh et velit phasellus. Aliquam semper justo posuere suspendisse amet amet nam nec. Tellus magna in proin tempor hac sit. Faucibus laoreet nulla commodo quis. Porttitor sit facilisis sit dignissim quis. Malesuada etiam tempor donec et ante. Aliquam massa donec augue aliquam semper amet blandit sed faucibus. Et elementum duis adipiscing turpis mi. Senectus eu rutrum accumsan convallis metus mattis risus. Quam eget sapien tellus aliquam facilisi sit volutpat. Scelerisque auctor purus nam sit lacus amet ullamcorper amet. Turpis nulla quis in pretium. Maecenas aliquam ac ullamcorper suspendisse morbi cras. Mi nibh aliquet massa sit eget tristique a. Posuere pretium auctor tellus massa et eu egestas. Sit lorem proin aenean tortor morbi condimentum. Leo eu enim cursus tempus sed viverra laoreet. Nisl ornare velit molestie suspendisse. Hendrerit nibh mauris vulputate sit vitae. Tellus quisque non nibh proin nunc lacus scelerisque dui. Aliquam fermentum libero aliquet volutpat at. Vestibulum ultrices nec felis leo nibh viverra. Hendrerit ut nunc porta egestas sit velit dictumst dis porta. Donec quam aliquam commodo mattis purus. Tellus nulla lectus fusce in fames scelerisque at." + +const assignments = [ + { + id: '1', + name: 'Ben Newfield', + deadline: new Date(2024, 11, 17) + }, + { + id: '2', + name: 'Alice Smith', + deadline: new Date(2024, 10, 25) + }, + { + id: '3', + name: 'John Doe', + deadline: new Date(2024, 9, 30) + }, + { + id: '4', + name: 'Emily Johnson', + deadline: new Date(2024, 8, 12) + }, + { + id: '5', + name: 'Michael Brown', + deadline: new Date(2024, 7, 8) + }, + { + id: '6', + name: 'Sarah Williams', + deadline: new Date(2024, 6, 15) + }, + { + id: '7', + name: 'David Wilson', + deadline: new Date(2024, 5, 20) + }, + { + id: '8', + name: 'Emma Garcia', + deadline: new Date(2024, 4, 10) + }, + { + id: '9', + name: 'James Martinez', + deadline: new Date(2024, 3, 28) + } +]; + + export function AssignmentStudentPage() { return ( <> - -
- - Opgave: -Lorem ipsum dolor sit amet consectetur. Nisi magna dolor et nisi nibh et velit phasellus. Aliquam semper justo posuere suspendisse amet amet nam nec. Tellus magna in proin tempor hac sit. Faucibus laoreet nulla commodo quis. Porttitor sit facilisis sit dignissim quis. Malesuada etiam tempor donec et ante. Aliquam massa donec augue aliquam semper amet blandit sed faucibus. Et elementum duis adipiscing turpis mi. Senectus eu rutrum accumsan convallis metus mattis risus. -Quam eget sapien tellus aliquam facilisi sit volutpat. Scelerisque auctor purus nam sit lacus amet ullamcorper amet. Turpis nulla quis in pretium. Maecenas aliquam ac ullamcorper suspendisse morbi cras. Mi nibh aliquet massa sit eget tristique a. Posuere pretium auctor tellus massa et eu egestas. Sit lorem proin aenean tortor morbi condimentum. Leo eu enim cursus tempus sed viverra laoreet. Nisl ornare velit molestie suspendisse. Hendrerit nibh mauris vulputate sit vitae. Tellus quisque non nibh proin nunc lacus scelerisque dui. -Aliquam fermentum libero aliquet volutpat at. Vestibulum ultrices nec felis leo nibh viverra. Hendrerit ut nunc porta egestas sit velit dictumst dis porta. Donec quam aliquam commodo mattis purus. Tellus nulla lectus fusce in fames scelerisque at. - +
+ + + {/*deadline and groep button */ } + + Deadline: 02/04/2024 +
+ + + {/*Opgave*/ } + + + Opgave + {text} + + + + {/*Indieningen*/ } + + + {assignments.map((assignment) => ( + <> + + + + ))} + + + + {/*Upload knop*/ } + + +
+ + + + ); -} \ No newline at end of file +} From 71c47caa6b4e23d00a6541c1b9f71f889b18b5e2 Mon Sep 17 00:00:00 2001 From: elias Date: Sun, 10 Mar 2024 17:13:45 +0100 Subject: [PATCH 12/19] changed names to upload ids --- .../assignmentPage/assignmentStudentPage.tsx | 27 +++++++++++-------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/frontend/frontend/src/pages/assignmentPage/assignmentStudentPage.tsx b/frontend/frontend/src/pages/assignmentPage/assignmentStudentPage.tsx index e47987c2..d4ee8111 100644 --- a/frontend/frontend/src/pages/assignmentPage/assignmentStudentPage.tsx +++ b/frontend/frontend/src/pages/assignmentPage/assignmentStudentPage.tsx @@ -1,53 +1,53 @@ import {Header} from "../../components/Header.tsx"; import { AssignmentListItem } from "../../components/AssignmentListItem.tsx"; -import {List, Button, Stack, Typography, Card, Divider} from "@mui/material"; +import {Box,List, Button, Stack, Typography, Card, Divider} from "@mui/material"; const text = "Lorem ipsum dolor sit amet consectetur. Nisi magna dolor et nisi nibh et velit phasellus. Aliquam semper justo posuere suspendisse amet amet nam nec. Tellus magna in proin tempor hac sit. Faucibus laoreet nulla commodo quis. Porttitor sit facilisis sit dignissim quis. Malesuada etiam tempor donec et ante. Aliquam massa donec augue aliquam semper amet blandit sed faucibus. Et elementum duis adipiscing turpis mi. Senectus eu rutrum accumsan convallis metus mattis risus. Quam eget sapien tellus aliquam facilisi sit volutpat. Scelerisque auctor purus nam sit lacus amet ullamcorper amet. Turpis nulla quis in pretium. Maecenas aliquam ac ullamcorper suspendisse morbi cras. Mi nibh aliquet massa sit eget tristique a. Posuere pretium auctor tellus massa et eu egestas. Sit lorem proin aenean tortor morbi condimentum. Leo eu enim cursus tempus sed viverra laoreet. Nisl ornare velit molestie suspendisse. Hendrerit nibh mauris vulputate sit vitae. Tellus quisque non nibh proin nunc lacus scelerisque dui. Aliquam fermentum libero aliquet volutpat at. Vestibulum ultrices nec felis leo nibh viverra. Hendrerit ut nunc porta egestas sit velit dictumst dis porta. Donec quam aliquam commodo mattis purus. Tellus nulla lectus fusce in fames scelerisque at." const assignments = [ { id: '1', - name: 'Ben Newfield', + name: '#1', deadline: new Date(2024, 11, 17) }, { id: '2', - name: 'Alice Smith', + name: '#2', deadline: new Date(2024, 10, 25) }, { id: '3', - name: 'John Doe', + name: '#3', deadline: new Date(2024, 9, 30) }, { id: '4', - name: 'Emily Johnson', + name: '#4', deadline: new Date(2024, 8, 12) }, { id: '5', - name: 'Michael Brown', + name: '#5', deadline: new Date(2024, 7, 8) }, { id: '6', - name: 'Sarah Williams', + name: '#6', deadline: new Date(2024, 6, 15) }, { id: '7', - name: 'David Wilson', + name: '#7', deadline: new Date(2024, 5, 20) }, { id: '8', - name: 'Emma Garcia', + name: '#8', deadline: new Date(2024, 4, 10) }, { id: '9', - name: 'James Martinez', + name: '#9', deadline: new Date(2024, 3, 28) } ]; @@ -91,14 +91,19 @@ export function AssignmentStudentPage() { padding: '20px' }} > + + Indiening + Datum + {assignments.map((assignment) => ( <> + - + ))} From 1fc581c2e8ab4549738346f2a28f5a3f309e44e6 Mon Sep 17 00:00:00 2001 From: Gus Vanpoucke Date: Sun, 10 Mar 2024 18:48:30 +0100 Subject: [PATCH 13/19] scores page v1 --- .../src/components/StudentScoreListItem.tsx | 25 ++++++++++--------- .../pages/scoresPage/ProjectScoresPage.tsx | 15 +++++++++-- .../src/pages/scoresPage/StudentsView.tsx | 4 +-- 3 files changed, 28 insertions(+), 16 deletions(-) diff --git a/frontend/frontend/src/components/StudentScoreListItem.tsx b/frontend/frontend/src/components/StudentScoreListItem.tsx index e39d46ef..74d6bccd 100644 --- a/frontend/frontend/src/components/StudentScoreListItem.tsx +++ b/frontend/frontend/src/components/StudentScoreListItem.tsx @@ -1,5 +1,5 @@ -import {ListItem, ListItemButton, ListItemText, Divider} from "@mui/material"; -import {useNavigate} from "react-router-dom"; +import {ListItem, ListItemText, Divider, TextField, IconButton} from "@mui/material"; +import DownloadIcon from '@mui/icons-material/Download'; import {t} from "i18next"; interface StudentScoreListItemProps { @@ -16,16 +16,10 @@ interface StudentScoreListItemProps { */ export function StudentScoreListItem({key, studentName, submissionFiles}:StudentScoreListItemProps) { - const navigate = useNavigate(); - const handleProjectClick = () => { - console.log("Project clicked"); - navigate(`/${key}`) - } - return ( <> - - - + + + + + + + + + - + diff --git a/frontend/frontend/src/pages/scoresPage/ProjectScoresPage.tsx b/frontend/frontend/src/pages/scoresPage/ProjectScoresPage.tsx index 1b3eacb5..d8ba97fe 100644 --- a/frontend/frontend/src/pages/scoresPage/ProjectScoresPage.tsx +++ b/frontend/frontend/src/pages/scoresPage/ProjectScoresPage.tsx @@ -1,7 +1,9 @@ import { Header } from "../../components/Header"; -import { Box, Stack } from "@mui/material"; +import { Box, Button, Stack } from "@mui/material"; import { useParams } from "react-router-dom"; import { StudentsView } from "./StudentsView.tsx"; +import SaveIcon from '@mui/icons-material/Save'; +import CloseIcon from '@mui/icons-material/Close'; export function ProjectScoresPage() { let { projectId } = useParams(); @@ -10,9 +12,18 @@ export function ProjectScoresPage() { <>
- + + + + + + +
}> - - - - - - + Loading...
}> + + + + + + ); diff --git a/frontend/frontend/src/pages/ErrorPage.tsx b/frontend/frontend/src/pages/ErrorPage.tsx index 6afd2b0f..0efc778b 100644 --- a/frontend/frontend/src/pages/ErrorPage.tsx +++ b/frontend/frontend/src/pages/ErrorPage.tsx @@ -1,18 +1,122 @@ -import { useRouteError } from "react-router-dom"; +import {isRouteErrorResponse, useRouteError} from "react-router-dom"; +import {Box, Typography} from "@mui/material"; +import {t} from "i18next"; -//TODO:: fix a decent error page export default function ErrorPage() { const error = useRouteError(); console.error(error); + let errorMessage: string; + + if (isRouteErrorResponse(error)) { + // error is type `ErrorResponse` + errorMessage = error.error?.message || error.statusText; + } else if (error instanceof Error) { + errorMessage = error.message; + } else if (typeof error === 'string') { + errorMessage = error; + } else { + console.error(error); + errorMessage = 'Unknown error'; + } return ( -
-

Oops!

-

Sorry, an unexpected error has occurred.

-

- error -

-
+ <> + + + + + + + + {t("error")} + + + {errorMessage} + + + + + + ); } \ No newline at end of file diff --git a/frontend/frontend/src/pages/loginPage/LoginPage.tsx b/frontend/frontend/src/pages/loginPage/LoginPage.tsx index e4aa5bfa..72d3c320 100644 --- a/frontend/frontend/src/pages/loginPage/LoginPage.tsx +++ b/frontend/frontend/src/pages/loginPage/LoginPage.tsx @@ -1,5 +1,5 @@ -import { Box, Button, Typography } from "@mui/material"; -import { t } from "i18next"; +import {Box, Button, Typography} from "@mui/material"; +import {t} from "i18next"; import {useNavigate} from "react-router-dom"; /* @@ -16,106 +16,106 @@ export function LoginPage() { //navigate("main") //relative path, so it will redirect to localhost:3000/login/main } - return ( - <> - - - - + return ( + <> - - Naam Platform - - - - - - - - - ); + + + + + + Naam Platform + + + + + + + + + ); } diff --git a/frontend/frontend/src/pages/submissionPage/SubmissionPage.tsx b/frontend/frontend/src/pages/submissionPage/SubmissionPage.tsx index 32e8417f..160b44ed 100644 --- a/frontend/frontend/src/pages/submissionPage/SubmissionPage.tsx +++ b/frontend/frontend/src/pages/submissionPage/SubmissionPage.tsx @@ -3,8 +3,8 @@ import {Header} from "../../components/Header.tsx"; import {useParams} from "react-router-dom"; import {t} from "i18next"; import {useEffect, useState} from "react"; -import {Paper} from "@mui/material"; -import {Dayjs} from "dayjs"; +import {Box, Card, Paper, Typography} from "@mui/material"; +import dayjs, {Dayjs} from "dayjs"; interface Submission { //Dayjs is present in pull request for mainpage @@ -18,20 +18,61 @@ interface Submission { export function SubmissionPage() { const {project} = useParams(); - const [submission, setSubmission] = useState({} as Submission); + const [submission, setSubmission] = useState({ + deadline: dayjs(), + projectName: "", + assignment: "", + filename: "" + } as Submission); + //TODO: fetch submission data from backend useEffect(() => { - fetch(`/api/submissions/${project}`) - .then(res => res.json()) - .then(data => setSubmission(data)); + // fetch(`/api/submissions/${project}`) + // .then(res => res.json()) + // .then(data => setSubmission(data)); + setSubmission({ + deadline: dayjs(), + projectName: "project", + assignment: "assignment", + filename: "filename" + }); }, [project]); return ( <> -
- +
+ + + Deadline: + {submission.deadline.format("DD/MM/YYYY")} + + + + {t("assignment")} + + + + + + + + ); From 2831d96713fcd35b50162ffc6341cee1a8781412 Mon Sep 17 00:00:00 2001 From: Ben De Meurichy Date: Tue, 12 Mar 2024 20:08:39 +0100 Subject: [PATCH 15/19] indiening student is klaar: alles wat relevant kan zijn voor de indieningen van een student is zichtbaar en bevat gemakkelijke uitbreidbaarheid voor echte api, enkel nog downloadfunctionaliteit nodig --- frontend/frontend/src/i18n/config.ts | 4 + .../pages/submissionPage/SubmissionPage.tsx | 130 ++++++++++++++++-- 2 files changed, 122 insertions(+), 12 deletions(-) diff --git a/frontend/frontend/src/i18n/config.ts b/frontend/frontend/src/i18n/config.ts index b6413984..1cc06635 100644 --- a/frontend/frontend/src/i18n/config.ts +++ b/frontend/frontend/src/i18n/config.ts @@ -14,6 +14,8 @@ const english = { submission: "Submission", error: "Something went wrong.", assignment: "Assignment:", + filename: "Submitted file:", + restrictions: "Restrictions:", }; const dutch = { logo: "/assets/logo_UGent_NL_RGB_2400_wit.png", @@ -27,6 +29,8 @@ const dutch = { submission: "Indiening", error: "Er is iets misgegaan.", assignment: "Opgave:", + filename: "Ingediend bestand:", + restrictions: "Restricties:", }; i18n.use(initReactI18next).use(LanguageDetector).init({ diff --git a/frontend/frontend/src/pages/submissionPage/SubmissionPage.tsx b/frontend/frontend/src/pages/submissionPage/SubmissionPage.tsx index 160b44ed..f69c7c01 100644 --- a/frontend/frontend/src/pages/submissionPage/SubmissionPage.tsx +++ b/frontend/frontend/src/pages/submissionPage/SubmissionPage.tsx @@ -3,8 +3,10 @@ import {Header} from "../../components/Header.tsx"; import {useParams} from "react-router-dom"; import {t} from "i18next"; import {useEffect, useState} from "react"; -import {Box, Card, Paper, Typography} from "@mui/material"; +import {Box, Button, Card, Divider, ListItem, Paper, Typography} from "@mui/material"; import dayjs, {Dayjs} from "dayjs"; +import DownloadIcon from '@mui/icons-material/Download'; +import List from "@mui/material/List"; interface Submission { //Dayjs is present in pull request for mainpage @@ -12,19 +14,34 @@ interface Submission { projectName: string; assignment: string; filename: string; - - + restrictions: { name: string, value: string, artifact?: string }[]; } + export function SubmissionPage() { const {project} = useParams(); const [submission, setSubmission] = useState({ deadline: dayjs(), projectName: "", assignment: "", - filename: "" + filename: "", + restrictions: [] } as Submission); + const downloadArtifact = (artifact: string) => { + fetch(`/api/submissions/${project}/${artifact}`) + .then(res => res.blob()) + .then(blob => { + const url = window.URL.createObjectURL(blob); + const a = document.createElement('a'); + a.href = url; + a.download = artifact; + document.body.appendChild(a); + a.click(); + a.remove(); + }); + } + //TODO: fetch submission data from backend useEffect(() => { // fetch(`/api/submissions/${project}`) @@ -33,8 +50,39 @@ export function SubmissionPage() { setSubmission({ deadline: dayjs(), projectName: "project", - assignment: "assignment", - filename: "filename" + assignment: "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Nullam vehicula ipsum a arcu cursus vitae congue mauris rhoncus. Pretium lectus quam id leo in vitae. A scelerisque purus semper eget. Porttitor leo a diam sollicitudin. Ornare massa eget egestas purus viverra accumsan in nisl nisi. Nunc lobortis mattis aliquam faucibus purus in. Orci dapibus ultrices in iaculis nunc sed. Morbi enim nunc faucibus a pellentesque sit amet. Quam quisque id diam vel quam elementum pulvinar. Quis commodo odio aenean sed adipiscing diam donec adipiscing tristique. Egestas maecenas pharetra convallis posuere morbi leo urna. At varius vel pharetra vel turpis nunc eget lorem. Eleifend donec pretium vulputate sapien. Sit amet cursus sit amet. Lectus quam id leo in. Neque vitae tempus quam pellentesque nec nam. Metus aliquam eleifend mi in nulla. Faucibus turpis in eu mi. Sed vulputate odio ut enim blandit volutpat.\n" + + "\n" + + "Quis varius quam quisque id diam vel quam elementum pulvinar. Viverra vitae congue eu consequat. Amet aliquam id diam maecenas ultricies mi eget mauris. Mi proin sed libero enim sed. Etiam tempor orci eu lobortis elementum nibh tellus molestie nunc. Orci a scelerisque purus semper eget. Magna fermentum iaculis eu non diam phasellus vestibulum lorem. Eu nisl nunc mi ipsum. Augue eget arcu dictum varius duis at consectetur lorem. Aenean vel elit scelerisque mauris pellentesque. Elit duis tristique sollicitudin nibh.\n" + + "\n" + + "Amet consectetur adipiscing elit ut aliquam. Amet aliquam id diam maecenas ultricies. Tellus in metus vulputate eu scelerisque felis imperdiet proin fermentum. Cursus euismod quis viverra nibh cras pulvinar mattis nunc sed. Bibendum est ultricies integer quis auctor elit sed vulputate mi. Quam elementum pulvinar etiam non quam lacus. At imperdiet dui accumsan sit amet nulla facilisi morbi. Accumsan sit amet nulla facilisi. Enim praesent elementum facilisis leo vel fringilla. Quisque id diam vel quam elementum. Tristique sollicitudin nibh sit amet commodo nulla facilisi nullam vehicula. Volutpat est velit egestas dui id ornare arcu odio ut. Tellus in metus vulputate eu scelerisque felis imperdiet proin fermentum. Velit ut tortor pretium viverra suspendisse.\n" + + "\n" + + "Purus viverra accumsan in nisl nisi scelerisque eu ultrices vitae. Volutpat commodo sed egestas egestas fringilla phasellus faucibus. Lorem sed risus ultricies tristique nulla aliquet enim. Donec ultrices tincidunt arcu non sodales neque sodales ut. Volutpat est velit egestas dui id. Egestas erat imperdiet sed euismod. Egestas pretium aenean pharetra magna. Nunc consequat interdum varius sit amet. Imperdiet dui accumsan sit amet nulla facilisi morbi tempus iaculis. Viverra mauris in aliquam sem fringilla ut morbi tincidunt. Vitae congue eu consequat ac felis donec et odio pellentesque. Volutpat odio facilisis mauris sit amet massa vitae. Tellus mauris a diam maecenas. Eget gravida cum sociis natoque penatibus et magnis dis parturient. Diam quis enim lobortis scelerisque. Ut venenatis tellus in metus vulputate. Et malesuada fames ac turpis. A cras semper auctor neque vitae tempus quam. Sed viverra tellus in hac. Mattis enim ut tellus elementum sagittis vitae et.\n" + + "\n" + + "Nunc lobortis mattis aliquam faucibus purus in massa tempor nec. Gravida dictum fusce ut placerat orci nulla pellentesque. Vel facilisis volutpat est velit egestas dui id ornare arcu. Et ligula ullamcorper malesuada proin libero nunc consequat. A arcu cursus vitae congue. Feugiat scelerisque varius morbi enim nunc faucibus a. Velit dignissim sodales ut eu sem. Vestibulum mattis ullamcorper velit sed. Volutpat commodo sed egestas egestas fringilla phasellus. Libero justo laoreet sit amet cursus sit amet. In est ante in nibh mauris cursus mattis molestie a. Euismod elementum nisi quis eleifend quam adipiscing vitae proin. Cursus in hac habitasse platea dictumst quisque sagittis purus.Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Parturient montes nascetur ridiculus mus mauris vitae. Ornare aenean euismod elementum nisi quis eleifend quam adipiscing vitae. Enim praesent elementum facilisis leo vel fringilla est. Euismod quis viverra nibh cras. Enim ut tellus elementum sagittis. Nisl nisi scelerisque eu ultrices. A erat nam at lectus urna duis convallis. Viverra nam libero justo laoreet sit amet cursus sit. Id aliquet risus feugiat in ante. Amet commodo nulla facilisi nullam. Accumsan lacus vel facilisis volutpat est velit egestas. Nibh nisl condimentum id venenatis. Sagittis eu volutpat odio facilisis mauris. Et magnis dis parturient montes nascetur ridiculus mus mauris vitae. Aliquam nulla facilisi cras fermentum odio eu feugiat. Quis enim lobortis scelerisque fermentum dui faucibus in. At ultrices mi tempus imperdiet.\n" + + "\n" + + "Felis imperdiet proin fermentum leo vel. Luctus accumsan tortor posuere ac ut. Tellus cras adipiscing enim eu. Habitasse platea dictumst quisque sagittis purus sit amet volutpat consequat. Vulputate odio ut enim blandit volutpat maecenas volutpat blandit. Enim nec dui nunc mattis enim. Felis eget nunc lobortis mattis aliquam faucibus. Eget velit aliquet sagittis id consectetur purus ut faucibus. Eget egestas purus viverra accumsan in. Vel elit scelerisque mauris pellentesque pulvinar pellentesque habitant morbi tristique. Sit amet facilisis magna etiam. Consectetur libero id faucibus nisl tincidunt eget nullam non nisi. Aliquet eget sit amet tellus cras adipiscing. Justo eget magna fermentum iaculis. Volutpat maecenas volutpat blandit aliquam. Scelerisque purus semper eget duis at tellus. Morbi tempus iaculis urna id volutpat. Nec ultrices dui sapien eget mi proin sed. Nibh tellus molestie nunc non blandit massa enim nec dui.\n" + + "\n" + + "Dolor sed viverra ipsum nunc aliquet bibendum. Egestas sed tempus urna et pharetra pharetra massa massa ultricies. Ut sem nulla pharetra diam sit amet nisl suscipit. Magna eget est lorem ipsum dolor sit. Consequat interdum varius sit amet mattis. Senectus et netus et malesuada fames ac turpis. Justo eget magna fermentum iaculis eu non diam. Vel elit scelerisque mauris pellentesque pulvinar pellentesque habitant morbi. Venenatis lectus magna fringilla urna porttitor rhoncus dolor purus. Tempus imperdiet nulla malesuada pellentesque. Ornare quam viverra orci sagittis eu. Pellentesque nec nam aliquam sem. Semper viverra nam libero justo laoreet sit amet. A diam sollicitudin tempor id. Sed velit dignissim sodales ut eu sem integer vitae. Fermentum odio eu feugiat pretium nibh ipsum. Morbi tincidunt augue interdum velit euismod in pellentesque massa. Purus ut faucibus pulvinar elementum integer enim. Parturient montes nascetur ridiculus mus mauris vitae ultricies. Eu ultrices vitae auctor eu augue.\n" + + "\n" + + "Netus et malesuada fames ac turpis egestas sed tempus urna. Eget nunc scelerisque viverra mauris in aliquam. Feugiat nibh sed pulvinar proin gravida hendrerit lectus a. Sollicitudin aliquam ultrices sagittis orci. Eleifend mi in nulla posuere sollicitudin aliquam. Non diam phasellus vestibulum lorem sed. Quis auctor elit sed vulputate mi sit amet. Id nibh tortor id aliquet lectus. Et netus et malesuada fames ac turpis egestas. Viverra orci sagittis eu volutpat odio facilisis mauris. Neque viverra justo nec ultrices dui sapien eget. Ut tristique et egestas quis ipsum suspendisse ultrices gravida dictum. Consectetur a erat nam at lectus urna duis. Condimentum mattis pellentesque id nibh tortor id aliquet. Egestas fringilla phasellus faucibus scelerisque eleifend donec pretium vulputate. Nunc sed id semper risus. Vitae auctor eu augue ut lectus. Sociis natoque penatibus et magnis. Odio pellentesque diam volutpat commodo sed egestas egestas. Sit amet nulla facilisi morbi tempus iaculis urna id volutpat.\n" + + "\n" + + "Nunc lobortis mattis aliquam faucibus purus. Quis vel eros donec ac odio tempor orci. Tempus egestas sed sed risus pretium quam vulputate. In hac habitasse platea dictumst vestibulum rhoncus. Aliquam ultrices sagittis orci a scelerisque purus semper eget duis. Diam phasellus vestibulum lorem sed risus ultricies tristique. Tincidunt eget nullam non nisi est sit. Habitant morbi tristique senectus et netus et malesuada. Lorem dolor sed viverra ipsum nunc aliquet bibendum. Magna ac placerat vestibulum lectus mauris. Aliquet eget sit amet tellus cras adipiscing enim. A erat nam at lectus urna duis. Aenean vel elit scelerisque mauris pellentesque pulvinar pellentesque habitant. A diam maecenas sed enim ut sem viverra aliquet. Nunc mi ipsum faucibus vitae aliquet.\n" + + "\n" + + "Leo urna molestie at elementum eu. Arcu cursus vitae congue mauris rhoncus aenean vel. Amet massa vitae tortor condimentum lacinia. Ut tristique et egestas quis. Neque gravida in fermentum et sollicitudin ac. Molestie ac feugiat sed lectus vestibulum mattis ullamcorper. Non curabitur gravida arcu ac tortor dignissim convallis aenean. Aenean et tortor at risus viverra adipiscing. Amet commodo nulla facilisi nullam. Duis convallis convallis tellus id interdum velit laoreet id donec. Fames ac turpis egestas sed tempus urna et pharetra. Ac tincidunt vitae semper quis lectus nulla. Accumsan tortor posuere ac ut consequat semper viverra. Pretium fusce id velit ut tortor pretium viverra suspendisse potenti. Ultricies mi eget mauris pharetra et ultrices neque ornare aenean. Fames ac turpis egestas sed tempus urna.\n" + + "\n" + + "Elit ut aliquam purus sit amet. Placerat duis ultricies lacus sed turpis tincidunt id aliquet. Et malesuada fames ac turpis egestas integer. Ultrices dui sapien eget mi proin sed libero enim sed. Tristique nulla aliquet enim tortor at auctor urna. Scelerisque fermentum dui faucibus in ornare quam viverra orci sagittis. Ornare quam viverra orci sagittis. Diam in arcu cursus euismod quis. Amet mauris commodo quis imperdiet massa. Malesuada fames ac turpis egestas. At ultrices mi tempus imperdiet nulla malesuada pellentesque elit eget. Viverra orci sagittis eu volutpat odio facilisis mauris sit amet. Molestie at elementum eu facilisis sed odio. Turpis cursus in hac habitasse. Sodales ut etiam sit amet nisl purus in.\n" + + "\n" + + "Commodo odio aenean sed adipiscing diam donec adipiscing tristique risus. Nec sagittis aliquam malesuada bibendum arcu vitae elementum curabitur. Cras tincidunt lobortis feugiat vivamus at augue eget. Interdum posuere lorem ipsum dolor sit amet. Sit amet consectetur adipiscing elit pellentesque habitant morbi. Elementum eu facilisis sed odio morbi quis. Vestibulum mattis ullamcorper velit sed ullamcorper morbi tincidunt ornare. Suscipit tellus mauris a diam maecenas. Aliquam ut porttitor leo a diam sollicitudin tempor id eu. Proin fermentum leo vel orci porta non pulvinar neque laoreet.\n" + + "\n" + + "Risus nec feugiat in fermentum posuere urna nec. Quis lectus nulla at volutpat diam ut venenatis. Sed cras ornare arcu dui. Quis commodo odio aenean sed adipiscing diam donec adipiscing. Fermentum dui faucibus in ornare quam viverra orci sagittis. Pellentesque dignissim enim sit amet venenatis urna cursus eget nunc. Massa eget egestas purus viverra. Imperdiet proin fermentum leo vel. Habitant morbi tristique senectus et netus et malesuada fames ac. Amet cursus sit amet dictum sit amet justo. Viverra justo nec ultrices dui sapien eget mi. A arcu cursus vitae congue mauris rhoncus.\n" + + "\n" + + "Ipsum dolor sit amet consectetur adipiscing. Augue neque gravida in fermentum et sollicitudin ac orci. Urna duis convallis convallis tellus. Nunc sed blandit libero volutpat. Massa tincidunt nunc pulvinar sapien et ligula ullamcorper malesuada proin. Nunc id cursus metus aliquam eleifend mi in. Odio pellentesque diam volutpat commodo sed egestas egestas. Vitae congue mauris rhoncus aenean vel elit scelerisque mauris. Enim nulla aliquet porttitor lacus. Nibh nisl condimentum id venenatis. Neque convallis a cras semper auctor neque vitae tempus. Dictum sit amet justo donec. At varius vel pharetra vel. Nisl pretium fusce id velit ut tortor pretium viverra. Tincidunt lobortis feugiat vivamus at augue eget arcu. Cras semper auctor neque vitae. Maecenas accumsan lacus vel facilisis volutpat est. Vulputate odio ut enim blandit. Sed turpis tincidunt id aliquet risus. Egestas purus viverra accumsan in nisl nisi.", + filename: "filename", + restrictions: [{name: "filetype", value: ".pdf, .zip",}, { + name: "docker tests", + value: "filename", + artifact: "filename" + }] }); }, [project]); @@ -43,7 +91,16 @@ export function SubmissionPage() { <>
- + {submission.deadline.format("DD/MM/YYYY")} + sx={{ + width: "99 %", + backgroundColor: "background.default", + padding: 1, + paddingBottom: 3 + }}> {t("assignment")} - - - - + + {submission.assignment} + + + + + {t("filename")} + + + + + {t("restrictions")} + + + { + submission.restrictions.map((restriction, index) => { + return ( + <> + + {restriction.name} + {restriction.artifact && + } + {restriction.value} + + + + ); + }) + } + From 7bd5ff9ed911c27754117a4466a53acb6f69e5ec Mon Sep 17 00:00:00 2001 From: elias Date: Tue, 12 Mar 2024 21:03:01 +0100 Subject: [PATCH 16/19] opdrachten leerkracht pagina statisch klaar --- frontend/frontend/package-lock.json | 134 +++++++++++++---- frontend/frontend/package.json | 6 +- frontend/frontend/src/main.tsx | 5 + .../assignmentPage/assignmentTeacherPage.tsx | 138 ++++++++++++++++++ 4 files changed, 250 insertions(+), 33 deletions(-) create mode 100644 frontend/frontend/src/pages/assignmentPage/assignmentTeacherPage.tsx diff --git a/frontend/frontend/package-lock.json b/frontend/frontend/package-lock.json index 2c201475..51152709 100644 --- a/frontend/frontend/package-lock.json +++ b/frontend/frontend/package-lock.json @@ -8,12 +8,14 @@ "name": "frontend", "version": "0.0.0", "dependencies": { - "@emotion/react": "^11.11.3", + "@emotion/react": "^11.11.4", "@emotion/styled": "^11.11.0", "@fontsource/roboto": "^5.0.8", "@mui/icons-material": "^5.15.11", - "@mui/material": "^5.15.11", + "@mui/material": "^5.15.12", + "@mui/x-date-pickers": "^6.19.6", "axios": "^1.6.7", + "dayjs": "^1.11.10", "i18next": "^23.10.0", "i18next-browser-languagedetector": "^7.2.0", "i18next-http-backend": "^2.5.0", @@ -478,9 +480,9 @@ "integrity": "sha512-W2P2c/VRW1/1tLox0mVUalvnWXxavmv/Oum2aPsRcoDJuob75FC3Y8FbpfLwUegRcxINtGUMPq0tFCvYNTBXNA==" }, "node_modules/@emotion/react": { - "version": "11.11.3", - "resolved": "https://registry.npmjs.org/@emotion/react/-/react-11.11.3.tgz", - "integrity": "sha512-Cnn0kuq4DoONOMcnoVsTOR8E+AdnKFf//6kUWc4LCdnxj31pZWn7rIULd6Y7/Js1PiPHzn7SKCM9vB/jBni8eA==", + "version": "11.11.4", + "resolved": "https://registry.npmjs.org/@emotion/react/-/react-11.11.4.tgz", + "integrity": "sha512-t8AjMlF0gHpvvxk5mAtCqR4vmxiGHCeJBaQO6gncUSdklELOgtwjerNY2yuJNfwnc6vi16U/+uMF+afIawJ9iw==", "dependencies": { "@babel/runtime": "^7.18.3", "@emotion/babel-plugin": "^11.11.0", @@ -1166,14 +1168,14 @@ } }, "node_modules/@mui/base": { - "version": "5.0.0-beta.37", - "resolved": "https://registry.npmjs.org/@mui/base/-/base-5.0.0-beta.37.tgz", - "integrity": "sha512-/o3anbb+DeCng8jNsd3704XtmmLDZju1Fo8R2o7ugrVtPQ/QpcqddwKNzKPZwa0J5T8YNW3ZVuHyQgbTnQLisQ==", + "version": "5.0.0-beta.38", + "resolved": "https://registry.npmjs.org/@mui/base/-/base-5.0.0-beta.38.tgz", + "integrity": "sha512-AsjD6Y1X5A1qndxz8xCcR8LDqv31aiwlgWMPxFAX/kCKiIGKlK65yMeVZ62iQr/6LBz+9hSKLiD1i4TZdAHKcQ==", "dependencies": { "@babel/runtime": "^7.23.9", "@floating-ui/react-dom": "^2.0.8", "@mui/types": "^7.2.13", - "@mui/utils": "^5.15.11", + "@mui/utils": "^5.15.12", "@popperjs/core": "^2.11.8", "clsx": "^2.1.0", "prop-types": "^15.8.1" @@ -1197,9 +1199,9 @@ } }, "node_modules/@mui/core-downloads-tracker": { - "version": "5.15.11", - "resolved": "https://registry.npmjs.org/@mui/core-downloads-tracker/-/core-downloads-tracker-5.15.11.tgz", - "integrity": "sha512-JVrJ9Jo4gyU707ujnRzmE8ABBWpXd6FwL9GYULmwZRtfPg89ggXs/S3MStQkpJ1JRWfdLL6S5syXmgQGq5EDAw==", + "version": "5.15.12", + "resolved": "https://registry.npmjs.org/@mui/core-downloads-tracker/-/core-downloads-tracker-5.15.12.tgz", + "integrity": "sha512-brRO+tMFLpGyjEYHrX97bzqeF6jZmKpqqe1rY0LyIHAwP6xRVzh++zSecOQorDOCaZJg4XkGT9xfD+RWOWxZBA==", "funding": { "type": "opencollective", "url": "https://opencollective.com/mui-org" @@ -1231,16 +1233,16 @@ } }, "node_modules/@mui/material": { - "version": "5.15.11", - "resolved": "https://registry.npmjs.org/@mui/material/-/material-5.15.11.tgz", - "integrity": "sha512-FA3eEuEZaDaxgN3CgfXezMWbCZ4VCeU/sv0F0/PK5n42qIgsPVD6q+j71qS7/62sp6wRFMHtDMpXRlN+tT/7NA==", + "version": "5.15.12", + "resolved": "https://registry.npmjs.org/@mui/material/-/material-5.15.12.tgz", + "integrity": "sha512-vXJGg6KNKucsvbW6l7w9zafnpOp0CWc0Wx4mDykuABTpQ5QQBnZxP7+oB4yAS1hDZQ1WobbeIl0CjxK4EEahkA==", "dependencies": { "@babel/runtime": "^7.23.9", - "@mui/base": "5.0.0-beta.37", - "@mui/core-downloads-tracker": "^5.15.11", - "@mui/system": "^5.15.11", + "@mui/base": "5.0.0-beta.38", + "@mui/core-downloads-tracker": "^5.15.12", + "@mui/system": "^5.15.12", "@mui/types": "^7.2.13", - "@mui/utils": "^5.15.11", + "@mui/utils": "^5.15.12", "@types/react-transition-group": "^4.4.10", "clsx": "^2.1.0", "csstype": "^3.1.3", @@ -1275,12 +1277,12 @@ } }, "node_modules/@mui/private-theming": { - "version": "5.15.11", - "resolved": "https://registry.npmjs.org/@mui/private-theming/-/private-theming-5.15.11.tgz", - "integrity": "sha512-jY/696SnSxSzO1u86Thym7ky5T9CgfidU3NFJjguldqK4f3Z5S97amZ6nffg8gTD0HBjY9scB+4ekqDEUmxZOA==", + "version": "5.15.12", + "resolved": "https://registry.npmjs.org/@mui/private-theming/-/private-theming-5.15.12.tgz", + "integrity": "sha512-cqoSo9sgA5HE+8vZClbLrq9EkyOnYysooepi5eKaKvJ41lReT2c5wOZAeDDM1+xknrMDos+0mT2zr3sZmUiRRA==", "dependencies": { "@babel/runtime": "^7.23.9", - "@mui/utils": "^5.15.11", + "@mui/utils": "^5.15.12", "prop-types": "^15.8.1" }, "engines": { @@ -1332,15 +1334,15 @@ } }, "node_modules/@mui/system": { - "version": "5.15.11", - "resolved": "https://registry.npmjs.org/@mui/system/-/system-5.15.11.tgz", - "integrity": "sha512-9j35suLFq+MgJo5ktVSHPbkjDLRMBCV17NMBdEQurh6oWyGnLM4uhU4QGZZQ75o0vuhjJghOCA1jkO3+79wKsA==", + "version": "5.15.12", + "resolved": "https://registry.npmjs.org/@mui/system/-/system-5.15.12.tgz", + "integrity": "sha512-/pq+GO6yN3X7r3hAwFTrzkAh7K1bTF5r8IzS79B9eyKJg7v6B/t4/zZYMR6OT9qEPtwf6rYN2Utg1e6Z7F1OgQ==", "dependencies": { "@babel/runtime": "^7.23.9", - "@mui/private-theming": "^5.15.11", + "@mui/private-theming": "^5.15.12", "@mui/styled-engine": "^5.15.11", "@mui/types": "^7.2.13", - "@mui/utils": "^5.15.11", + "@mui/utils": "^5.15.12", "clsx": "^2.1.0", "csstype": "^3.1.3", "prop-types": "^15.8.1" @@ -1384,9 +1386,9 @@ } }, "node_modules/@mui/utils": { - "version": "5.15.11", - "resolved": "https://registry.npmjs.org/@mui/utils/-/utils-5.15.11.tgz", - "integrity": "sha512-D6bwqprUa9Stf8ft0dcMqWyWDKEo7D+6pB1k8WajbqlYIRA8J8Kw9Ra7PSZKKePGBGWO+/xxrX1U8HpG/aXQCw==", + "version": "5.15.12", + "resolved": "https://registry.npmjs.org/@mui/utils/-/utils-5.15.12.tgz", + "integrity": "sha512-8SDGCnO2DY9Yy+5bGzu00NZowSDtuyHP4H8gunhHGQoIlhlY2Z3w64wBzAOLpYw/ZhJNzksDTnS/i8qdJvxuow==", "dependencies": { "@babel/runtime": "^7.23.9", "@types/prop-types": "^15.7.11", @@ -1410,6 +1412,71 @@ } } }, + "node_modules/@mui/x-date-pickers": { + "version": "6.19.6", + "resolved": "https://registry.npmjs.org/@mui/x-date-pickers/-/x-date-pickers-6.19.6.tgz", + "integrity": "sha512-QW9AFcPi0vLpkUhmquhhyhLaBvB0AZJuu3NTrE173qNKx3Z3n51aCLY9bc7c6i4ltZMMsVRHlvzQjsve04TC8A==", + "dependencies": { + "@babel/runtime": "^7.23.2", + "@mui/base": "^5.0.0-beta.22", + "@mui/utils": "^5.14.16", + "@types/react-transition-group": "^4.4.8", + "clsx": "^2.0.0", + "prop-types": "^15.8.1", + "react-transition-group": "^4.4.5" + }, + "engines": { + "node": ">=14.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/mui" + }, + "peerDependencies": { + "@emotion/react": "^11.9.0", + "@emotion/styled": "^11.8.1", + "@mui/material": "^5.8.6", + "@mui/system": "^5.8.0", + "date-fns": "^2.25.0 || ^3.2.0", + "date-fns-jalali": "^2.13.0-0", + "dayjs": "^1.10.7", + "luxon": "^3.0.2", + "moment": "^2.29.4", + "moment-hijri": "^2.1.2", + "moment-jalaali": "^0.7.4 || ^0.8.0 || ^0.9.0 || ^0.10.0", + "react": "^17.0.0 || ^18.0.0", + "react-dom": "^17.0.0 || ^18.0.0" + }, + "peerDependenciesMeta": { + "@emotion/react": { + "optional": true + }, + "@emotion/styled": { + "optional": true + }, + "date-fns": { + "optional": true + }, + "date-fns-jalali": { + "optional": true + }, + "dayjs": { + "optional": true + }, + "luxon": { + "optional": true + }, + "moment": { + "optional": true + }, + "moment-hijri": { + "optional": true + }, + "moment-jalaali": { + "optional": true + } + } + }, "node_modules/@nodelib/fs.scandir": { "version": "2.1.5", "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", @@ -2243,6 +2310,11 @@ "resolved": "https://registry.npmjs.org/csstype/-/csstype-3.1.3.tgz", "integrity": "sha512-M1uQkMl8rQK/szD0LNhtqxIPLpimGm8sOBwU7lLnCpSbTyY3yeU1Vc7l4KT5zT4s/yOxHH5O7tIuuLOCnLADRw==" }, + "node_modules/dayjs": { + "version": "1.11.10", + "resolved": "https://registry.npmjs.org/dayjs/-/dayjs-1.11.10.tgz", + "integrity": "sha512-vjAczensTgRcqDERK0SR2XMwsF/tSvnvlv6VcF2GIhg6Sx4yOIt/irsr1RDJsKiIyBzJDpCoXiWWq28MqH2cnQ==" + }, "node_modules/debug": { "version": "4.3.4", "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", diff --git a/frontend/frontend/package.json b/frontend/frontend/package.json index 884b961c..9d646fa8 100644 --- a/frontend/frontend/package.json +++ b/frontend/frontend/package.json @@ -10,12 +10,14 @@ "preview": "vite preview" }, "dependencies": { - "@emotion/react": "^11.11.3", + "@emotion/react": "^11.11.4", "@emotion/styled": "^11.11.0", "@fontsource/roboto": "^5.0.8", "@mui/icons-material": "^5.15.11", - "@mui/material": "^5.15.11", + "@mui/material": "^5.15.12", + "@mui/x-date-pickers": "^6.19.6", "axios": "^1.6.7", + "dayjs": "^1.11.10", "i18next": "^23.10.0", "i18next-browser-languagedetector": "^7.2.0", "i18next-http-backend": "^2.5.0", diff --git a/frontend/frontend/src/main.tsx b/frontend/frontend/src/main.tsx index c6932804..5de8e8c8 100644 --- a/frontend/frontend/src/main.tsx +++ b/frontend/frontend/src/main.tsx @@ -10,6 +10,7 @@ import {MainPage} from "./pages/mainPage/MainPage.tsx"; import {Helmet, HelmetProvider} from "react-helmet-async"; import { SubjectsStudentPage } from "./pages/subjects_page/SubjectsStudentPage.tsx"; import { AssignmentStudentPage } from "./pages/assignmentPage/assignmentStudentPage"; +import { AssignmentTeacherPage } from "./pages/assignmentPage/assignmentTeacherPage.tsx"; const router = createBrowserRouter([ { @@ -25,6 +26,10 @@ const router = createBrowserRouter([ path: "/assignment_student", element: , }, + { + path: "/assignment_teacher", + element: , + }, ]); ReactDOM.createRoot(document.getElementById("root")!).render( diff --git a/frontend/frontend/src/pages/assignmentPage/assignmentTeacherPage.tsx b/frontend/frontend/src/pages/assignmentPage/assignmentTeacherPage.tsx new file mode 100644 index 00000000..0ae9736b --- /dev/null +++ b/frontend/frontend/src/pages/assignmentPage/assignmentTeacherPage.tsx @@ -0,0 +1,138 @@ +import {Header} from "../../components/Header.tsx"; +import {Grid ,TextField,Box,List, Button, Stack, Typography, Card, Divider, ListItem, ListItemText} from "@mui/material"; +import UploadIcon from '@mui/icons-material/Upload'; +import SaveIcon from '@mui/icons-material/Save'; +import AddIcon from '@mui/icons-material/Add'; +import { LocalizationProvider } from '@mui/x-date-pickers'; +import { AdapterDayjs } from '@mui/x-date-pickers/AdapterDayjs' +import { DatePicker } from '@mui/x-date-pickers/DatePicker'; + +const text = "Lorem ipsum dolor sit amet consectetur. Nisi magna dolor et nisi nibh et velit phasellus. Aliquam semper justo posuere suspendisse amet amet nam nec. Tellus magna in proin tempor hac sit. Faucibus laoreet nulla commodo quis. Porttitor sit facilisis sit dignissim quis. Malesuada etiam tempor donec et ante. Aliquam massa donec augue aliquam semper amet blandit sed faucibus. Et elementum duis adipiscing turpis mi. Senectus eu rutrum accumsan convallis metus mattis risus. Quam eget sapien tellus aliquam facilisi sit volutpat. Scelerisque auctor purus nam sit lacus amet ullamcorper amet. Turpis nulla quis in pretium. Maecenas aliquam ac ullamcorper suspendisse morbi cras. Mi nibh aliquet massa sit eget tristique a. Posuere pretium auctor tellus massa et eu egestas. Sit lorem proin aenean tortor morbi condimentum. Leo eu enim cursus tempus sed viverra laoreet. Nisl ornare velit molestie suspendisse. Hendrerit nibh mauris vulputate sit vitae. Tellus quisque non nibh proin nunc lacus scelerisque dui. Aliquam fermentum libero aliquet volutpat at. Vestibulum ultrices nec felis leo nibh viverra. Hendrerit ut nunc porta egestas sit velit dictumst dis porta. Donec quam aliquam commodo mattis purus. Tellus nulla lectus fusce in fames scelerisque at." + +const restrictions = [ + { + type: 'bestandstype', + details: '.pdf .zip', + }, + { + type: 'bestandsgrootte', + details: '< 0.25 gb', + }, + { + type: 'docker test', + details: 'filename', + }, +] + +interface restrictionProps { + type: string, + details: string, +} + +export function Restriction({type,details}:restrictionProps) { + return ( + <> + + {type} + {details} + + + ); +} + + + + +export function AssignmentTeacherPage() { + return ( + <> +
+ + + {/*opdracht and upload button*/ } + + + + + Naam Opdracht: + + + + + + +
+ + + + + + + + Deadline: + + + + + + + + + + {/*Opgave*/ } + + + Opgave + {text} + + + + {/*Restricties*/ } + + + + Type restrictie + Details + + + + {restrictions.map((res) => + + )} + + + + + + + + + +
+ + + + + ); +} \ No newline at end of file From 76ccf9122f7281cfb370f3a820fc49132bbe4c52 Mon Sep 17 00:00:00 2001 From: Ben De Meurichy Date: Tue, 12 Mar 2024 21:03:46 +0100 Subject: [PATCH 17/19] indieningPagina klaar --- .../pages/submissionPage/SubmissionPage.tsx | 21 ++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/frontend/frontend/src/pages/submissionPage/SubmissionPage.tsx b/frontend/frontend/src/pages/submissionPage/SubmissionPage.tsx index f69c7c01..5275735a 100644 --- a/frontend/frontend/src/pages/submissionPage/SubmissionPage.tsx +++ b/frontend/frontend/src/pages/submissionPage/SubmissionPage.tsx @@ -42,6 +42,20 @@ export function SubmissionPage() { }); } + const downloadSubmission = () => { + fetch(`/api/submissions/${project}`) + .then(res => res.blob()) + .then(blob => { + const url = window.URL.createObjectURL(blob); + const a = document.createElement('a'); + a.href = url; + a.download = project + "_submission.zip"; + document.body.appendChild(a); + a.click(); + a.remove(); + }); + } + //TODO: fetch submission data from backend useEffect(() => { // fetch(`/api/submissions/${project}`) @@ -144,7 +158,7 @@ export function SubmissionPage() { {t("filename")} - @@ -166,8 +180,9 @@ export function SubmissionPage() { {restriction.name} {restriction.artifact && - } + } {restriction.value} From 81218a6fa46ab8d6bf4c5874b8695495f90bff4e Mon Sep 17 00:00:00 2001 From: Ben De Meurichy Date: Tue, 12 Mar 2024 21:13:38 +0100 Subject: [PATCH 18/19] restricties deel is nu scrollbaar, alle restricties zijn zichtbaar --- .../frontend/src/pages/submissionPage/SubmissionPage.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/frontend/frontend/src/pages/submissionPage/SubmissionPage.tsx b/frontend/frontend/src/pages/submissionPage/SubmissionPage.tsx index 5275735a..4863a2e0 100644 --- a/frontend/frontend/src/pages/submissionPage/SubmissionPage.tsx +++ b/frontend/frontend/src/pages/submissionPage/SubmissionPage.tsx @@ -96,7 +96,7 @@ export function SubmissionPage() { name: "docker tests", value: "filename", artifact: "filename" - }] + }, {name: "max file size", value: "10MB"}, {name: "min file size", value: "1MB"}] }); }, [project]); @@ -170,8 +170,8 @@ export function SubmissionPage() { height: "20vh", }}> {t("restrictions")} - - + + { submission.restrictions.map((restriction, index) => { return ( From e7a1386a2aec233b48b5032ea36e67bbacb1e12c Mon Sep 17 00:00:00 2001 From: elias Date: Tue, 12 Mar 2024 21:36:09 +0100 Subject: [PATCH 19/19] statische versie van groepen pagina af --- frontend/frontend/src/main.tsx | 6 + .../assignmentPage/assignmentTeacherPage.tsx | 2 - .../src/pages/groupsPage/groupsPage.tsx | 112 ++++++++++++++++++ 3 files changed, 118 insertions(+), 2 deletions(-) create mode 100644 frontend/frontend/src/pages/groupsPage/groupsPage.tsx diff --git a/frontend/frontend/src/main.tsx b/frontend/frontend/src/main.tsx index 5de8e8c8..0ed7e675 100644 --- a/frontend/frontend/src/main.tsx +++ b/frontend/frontend/src/main.tsx @@ -11,6 +11,7 @@ import {Helmet, HelmetProvider} from "react-helmet-async"; import { SubjectsStudentPage } from "./pages/subjects_page/SubjectsStudentPage.tsx"; import { AssignmentStudentPage } from "./pages/assignmentPage/assignmentStudentPage"; import { AssignmentTeacherPage } from "./pages/assignmentPage/assignmentTeacherPage.tsx"; +import { GroupsPage } from "./pages/groupsPage/groupsPage.tsx"; const router = createBrowserRouter([ { @@ -30,6 +31,11 @@ const router = createBrowserRouter([ path: "/assignment_teacher", element: , }, + { + path: "/groups", + element: , + }, + ]); ReactDOM.createRoot(document.getElementById("root")!).render( diff --git a/frontend/frontend/src/pages/assignmentPage/assignmentTeacherPage.tsx b/frontend/frontend/src/pages/assignmentPage/assignmentTeacherPage.tsx index 0ae9736b..fbc7653a 100644 --- a/frontend/frontend/src/pages/assignmentPage/assignmentTeacherPage.tsx +++ b/frontend/frontend/src/pages/assignmentPage/assignmentTeacherPage.tsx @@ -41,8 +41,6 @@ export function Restriction({type,details}:restrictionProps) { } - - export function AssignmentTeacherPage() { return ( <> diff --git a/frontend/frontend/src/pages/groupsPage/groupsPage.tsx b/frontend/frontend/src/pages/groupsPage/groupsPage.tsx new file mode 100644 index 00000000..99cbf84a --- /dev/null +++ b/frontend/frontend/src/pages/groupsPage/groupsPage.tsx @@ -0,0 +1,112 @@ +import {Header} from "../../components/Header.tsx"; +import {Grid ,TextField,Box,List, Button, Stack, Typography, Card, Divider, ListItem, ListItemText} from "@mui/material"; +import Switch from '@mui/material/Switch'; + + +const groups = [ + { + name: 'Jane' + }, + { + name: 'John' + }, + { + name: 'Alice' + }, + { + name: 'Bob' + }, + { + name: 'Emily' + }, + { + name: 'David' + }, + { + name: 'Sophia' + }, + { + name: 'Michael' + }, + { + name: 'Olivia' + }, + { + name: 'William' + }, +]; + + +interface GroupListItemProps { + name: string, +} + +export function GroupListItem({name}:GroupListItemProps) { + return ( + <> + + + {name} + student1, student2.. + + + + ); +} + + +export function GroupsPage() { + return ( + <> +
+ + + Groepen: + + + + + + Leden per groep: + + + + + + + + + + Willekeurige groepen: + + + + Studenten kunnen kiezen: + + + + + + :not(style)': { marginBottom: '8px' ,width: "100vh" } }}> + + Naam Student + Ingeschreven groep + + + + {groups.map((res) => + + )} + + + + + + ); +} \ No newline at end of file