From ff3cbef014fb13714b78f8a2dc07022e6b2a0d99 Mon Sep 17 00:00:00 2001 From: Ben De Meurichy Date: Wed, 13 Mar 2024 14:13:49 +0100 Subject: [PATCH] imports geoptimaliseerd en dubbele declaraties verwijderd. paginas moete nu werkende zijn. --- frontend/frontend/src/components/ItemList.tsx | 74 +++++---- .../src/components/StudentScoreListItem.tsx | 26 +-- frontend/frontend/src/main.tsx | 76 +++++---- .../assignmentPage/assignmentStudentPage.tsx | 121 +++++++------- .../assignmentPage/assignmentTeacherPage.tsx | 149 +++++++++--------- .../src/pages/groupsPage/groupsPage.tsx | 77 ++++----- 6 files changed, 269 insertions(+), 254 deletions(-) diff --git a/frontend/frontend/src/components/ItemList.tsx b/frontend/frontend/src/components/ItemList.tsx index 8c9c749d..cf90a656 100644 --- a/frontend/frontend/src/components/ItemList.tsx +++ b/frontend/frontend/src/components/ItemList.tsx @@ -1,40 +1,52 @@ -import { Paper, TableContainer, Table, TableHead, TableRow, TableCell, TableBody,useTheme, ThemeProvider } from '@mui/material'; +import {Paper, Table, TableBody, TableCell, TableContainer, TableHead, TableRow} from '@mui/material'; import theme from '../Theme'; interface Item { - opdracht: string; - deadline: string; - status: string; - score: string; + opdracht: string; + deadline: string; + status: string; + score: string; } interface ItemListProps { - itemList: Item[]; + itemList: Item[]; } -export const ItemList: React.FC = ({ itemList }) => { - return ( - - - - - Opdracht - Deadline - Status - Score - - - - {itemList.map((item, index) => ( - - {item.opdracht} - {item.deadline} - {item.status} - {item.score} - - ))} - -
-
- ); +export const ItemList: React.FC = ({itemList}) => { + return ( + + + + + Opdracht + Deadline + Status + Score + + + + {itemList.map((item, index) => ( + + {item.opdracht} + {item.deadline} + {item.status} + {item.score} + + ))} + +
+
+ ); }; diff --git a/frontend/frontend/src/components/StudentScoreListItem.tsx b/frontend/frontend/src/components/StudentScoreListItem.tsx index 74d6bccd..fd586d32 100644 --- a/frontend/frontend/src/components/StudentScoreListItem.tsx +++ b/frontend/frontend/src/components/StudentScoreListItem.tsx @@ -1,6 +1,7 @@ -import {ListItem, ListItemText, Divider, TextField, IconButton} from "@mui/material"; +import {Divider, IconButton, ListItem, ListItemText, TextField} from "@mui/material"; import DownloadIcon from '@mui/icons-material/Download'; -import {t} from "i18next"; + +//TODO: take care of internationalization interface StudentScoreListItemProps { key: string; @@ -15,10 +16,10 @@ interface StudentScoreListItemProps { * @param submissionFiles: string[] - a list of all files submitted by this student */ -export function StudentScoreListItem({key, studentName, submissionFiles}:StudentScoreListItemProps) { +export function StudentScoreListItem({key, studentName, submissionFiles}: StudentScoreListItemProps) { return ( <> - + <> - - - - - + + + + + - + - + diff --git a/frontend/frontend/src/main.tsx b/frontend/frontend/src/main.tsx index 9141dcd8..201c4b5b 100644 --- a/frontend/frontend/src/main.tsx +++ b/frontend/frontend/src/main.tsx @@ -9,14 +9,12 @@ 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"; -import { ProjectScoresPage } from "./pages/scoresPage/ProjectScoresPage.tsx"; -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"; -import {SubjectsStudentPage} from "./pages/subjects_page/SubjectsStudentPage.tsx"; +import {SubjectsStudentPage} from "./pages/SubjectsPage/SubjectsStudentPage.tsx"; +import {SubjectsTeacherPage} from "./pages/SubjectsPage/SubjectsTeacherPage.tsx"; +import {ProjectScoresPage} from "./pages/scoresPage/ProjectScoresPage.tsx"; +import {AssignmentStudentPage} from "./pages/assignmentPage/assignmentStudentPage"; +import {AssignmentTeacherPage} from "./pages/assignmentPage/assignmentTeacherPage.tsx"; +import {GroupsPage} from "./pages/groupsPage/groupsPage.tsx"; import {LocalizationProvider} from "@mui/x-date-pickers"; import {AdapterDayjs} from '@mui/x-date-pickers/AdapterDayjs/AdapterDayjs'; @@ -25,37 +23,37 @@ import {SimpleRequestsPage} from "./pages/simpleRequestsPage/SimpleRequestsPage. const router = createBrowserRouter([ - { - path: "/", - element: , - errorElement: , - }, - { - path: "/subjects_student/:courseId", - element: , - }, - { - - path: "/subjects_teacher/:courseId", - element: , - }, - { - path: "/scores", - element: , - }, + { + path: "/", + element: , + errorElement: , + }, + { + path: "/subjects_student/:courseId", + element: , + }, + { - path: "/assignment_student", - element: , - }, - { - path: "/assignment_teacher", - element: , - }, - { - path: "/groups", - element: , - }, - { + path: "/subjects_teacher/:courseId", + element: , + }, + { + path: "/scores", + element: , + }, + { + path: "/assignment_student", + element: , + }, + { + path: "/assignment_teacher", + element: , + }, + { + path: "/groups", + element: , + }, + { path: "/subjects_student", element: , }, @@ -65,7 +63,7 @@ const router = createBrowserRouter([ path: "/submission/:project", element: , }, - { + { path: "/test_requests", element: , } diff --git a/frontend/frontend/src/pages/assignmentPage/assignmentStudentPage.tsx b/frontend/frontend/src/pages/assignmentPage/assignmentStudentPage.tsx index d4ee8111..83b137f2 100644 --- a/frontend/frontend/src/pages/assignmentPage/assignmentStudentPage.tsx +++ b/frontend/frontend/src/pages/assignmentPage/assignmentStudentPage.tsx @@ -1,6 +1,6 @@ import {Header} from "../../components/Header.tsx"; -import { AssignmentListItem } from "../../components/AssignmentListItem.tsx"; -import {Box,List, Button, Stack, Typography, Card, Divider} from "@mui/material"; +import {AssignmentListItem} from "../../components/AssignmentListItem.tsx"; +import {Box, Button, Card, Divider, List, Stack, Typography} 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." @@ -53,74 +53,75 @@ const assignments = [ ]; - export function AssignmentStudentPage() { return ( <> -
- - - {/*deadline and groep button */ } - - Deadline: 02/04/2024 -
- - +
+ - {/*Opgave*/ } - - - Opgave - {text} + {/*deadline and groep button */} + + Deadline: 02/04/2024 +
+ - - {/*Indieningen*/ } - - - Indiening - Datum - - - {assignments.map((assignment) => ( - <> - - - - - ))} - - + > + + Opgave + {text} + + - {/*Upload knop*/ } - - -
- - + {/*Indieningen*/} + + + Indiening + Datum + + + {assignments.map((assignment) => ( + <> + + + + + ))} + + - + {/*Upload knop*/} + + +
+ + + + ); } diff --git a/frontend/frontend/src/pages/assignmentPage/assignmentTeacherPage.tsx b/frontend/frontend/src/pages/assignmentPage/assignmentTeacherPage.tsx index fbc7653a..660605ae 100644 --- a/frontend/frontend/src/pages/assignmentPage/assignmentTeacherPage.tsx +++ b/frontend/frontend/src/pages/assignmentPage/assignmentTeacherPage.tsx @@ -1,11 +1,11 @@ import {Header} from "../../components/Header.tsx"; -import {Grid ,TextField,Box,List, Button, Stack, Typography, Card, Divider, ListItem, ListItemText} from "@mui/material"; +import {Button, Card, Divider, Grid, List, ListItem, ListItemText, Stack, TextField, Typography} 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'; +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." @@ -29,7 +29,7 @@ interface restrictionProps { details: string, } -export function Restriction({type,details}:restrictionProps) { +export function Restriction({type, details}: restrictionProps) { return ( <> @@ -44,93 +44,94 @@ export function Restriction({type,details}:restrictionProps) { export function AssignmentTeacherPage() { return ( <> -
- - - {/*opdracht and upload button*/ } - +
+ + + {/*opdracht and upload button*/} + - + Naam Opdracht: - + -
- - - + - - - - Deadline: - - - - - - + + + + + Deadline: + + + + + + + - - - {/*Opgave*/ } - - - Opgave - {text} - - + > + + Opgave + {text} + + - {/*Restricties*/ } - - - - Type restrictie - Details - - - - {restrictions.map((res) => - - )} - - - - - - - - - -
- + > + + + Type restrictie + Details + + + + {restrictions.map((res) => + + )} + + + + + + + + + +
+ + - ); } \ No newline at end of file diff --git a/frontend/frontend/src/pages/groupsPage/groupsPage.tsx b/frontend/frontend/src/pages/groupsPage/groupsPage.tsx index 99cbf84a..e20645cc 100644 --- a/frontend/frontend/src/pages/groupsPage/groupsPage.tsx +++ b/frontend/frontend/src/pages/groupsPage/groupsPage.tsx @@ -1,5 +1,5 @@ import {Header} from "../../components/Header.tsx"; -import {Grid ,TextField,Box,List, Button, Stack, Typography, Card, Divider, ListItem, ListItemText} from "@mui/material"; +import {Card, Divider, Grid, List, ListItem, ListItemText, Stack, TextField, Typography} from "@mui/material"; import Switch from '@mui/material/Switch'; @@ -41,15 +41,15 @@ interface GroupListItemProps { name: string, } -export function GroupListItem({name}:GroupListItemProps) { +export function GroupListItem({name}: GroupListItemProps) { return ( <> - {name} @@ -64,47 +64,48 @@ export function GroupListItem({name}:GroupListItemProps) { export function GroupsPage() { return ( <> -
- - - Groepen: - - +
+ + + Groepen: + + - + Leden per groep: - + - - - - Willekeurige groepen: - - - - Studenten kunnen kiezen: - - - + + + + Willekeurige groepen: + + + + Studenten kunnen kiezen: + + + - - :not(style)': { marginBottom: '8px' ,width: "100vh" } }}> - - Naam Student - Ingeschreven groep - - - - {groups.map((res) => - - )} - - + + :not(style)': {marginBottom: '8px', width: "100vh"}}}> + + Naam Student + Ingeschreven groep + + + + {groups.map((res) => + + )} + +