From 5168fbbd77a05639b7b928c79de1e803242d4525 Mon Sep 17 00:00:00 2001 From: Emma N Date: Sun, 21 May 2023 18:42:35 +0200 Subject: [PATCH 1/8] responsiveness communication --- .../autocompleteComponent.tsx | 2 +- frontend/pages/admin/communication.tsx | 109 ++++++++++-------- 2 files changed, 61 insertions(+), 50 deletions(-) diff --git a/frontend/components/autocompleteComponents/autocompleteComponent.tsx b/frontend/components/autocompleteComponents/autocompleteComponent.tsx index 39000eb1..8905703e 100644 --- a/frontend/components/autocompleteComponents/autocompleteComponent.tsx +++ b/frontend/components/autocompleteComponents/autocompleteComponent.tsx @@ -86,7 +86,7 @@ const AutocompleteComponent: React.FC = ({ }, [fetchOptions, initialId]); return ( -
+
{label}
- +

Communicatie extern

- - - + + +
- - - - - -
- -
-
+
- + +
+ +
+ + + +
+ +
+ +
+ + -
- -
+ +
+ +
+
- +
+
From 2989eac68f145e49a11b5b4147450559c59f419e Mon Sep 17 00:00:00 2001 From: Emma N Date: Sun, 21 May 2023 18:56:26 +0200 Subject: [PATCH 2/8] minWidth autocomplete change --- .../components/autocompleteComponents/autocompleteComponent.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/components/autocompleteComponents/autocompleteComponent.tsx b/frontend/components/autocompleteComponents/autocompleteComponent.tsx index 8905703e..8ad754ab 100644 --- a/frontend/components/autocompleteComponents/autocompleteComponent.tsx +++ b/frontend/components/autocompleteComponents/autocompleteComponent.tsx @@ -111,7 +111,7 @@ const AutocompleteComponent: React.FC = ({ getOptionLabel={(option: any) => option.label || ""} disabled={disabled} renderInput={(params: AutocompleteRenderInputParams) => ( - + )} ListboxProps={{ style: { maxHeight: 200, overflowY: "auto" } }} /> From 0805f8aefd705910172a80da1531133217b96634 Mon Sep 17 00:00:00 2001 From: Emma N Date: Sun, 21 May 2023 19:33:50 +0200 Subject: [PATCH 3/8] fix analysis tour --- .../autocompleteComponent.tsx | 2 +- frontend/pages/admin/analysis/tour.tsx | 14 ++-- .../pages/admin/analysis/worked-hours.tsx | 77 ++++++++++--------- 3 files changed, 48 insertions(+), 45 deletions(-) diff --git a/frontend/components/autocompleteComponents/autocompleteComponent.tsx b/frontend/components/autocompleteComponents/autocompleteComponent.tsx index 8ad754ab..147a5a28 100644 --- a/frontend/components/autocompleteComponents/autocompleteComponent.tsx +++ b/frontend/components/autocompleteComponents/autocompleteComponent.tsx @@ -86,7 +86,7 @@ const AutocompleteComponent: React.FC = ({ }, [fetchOptions, initialId]); return ( -
+
{label}
-
-
+ -
-
+ + @@ -438,8 +437,8 @@ function AdminTour() { studentId={selectedStudentId} disabled={!validTourUser} /> -
-
+ + @@ -453,8 +452,7 @@ function AdminTour() { } disabled={!validTourUser} /> -
-
+
diff --git a/frontend/pages/admin/analysis/worked-hours.tsx b/frontend/pages/admin/analysis/worked-hours.tsx index e27221a6..cb7f31eb 100644 --- a/frontend/pages/admin/analysis/worked-hours.tsx +++ b/frontend/pages/admin/analysis/worked-hours.tsx @@ -1,17 +1,17 @@ import AdminHeader from "@/components/header/adminHeader"; -import React, { useEffect, useState } from "react"; -import { addDays, differenceInMinutes, startOfWeek, subDays, subMonths } from "date-fns"; -import { Card, Col, Container, Form, ListGroup, Row } from "react-bootstrap"; -import { datesEqual, formatDate } from "@/lib/date"; -import { getWorkedHours } from "@/lib/analysis"; -import { getAllTours, Tour } from "@/lib/tour"; -import { getAllRegions, RegionInterface } from "@/lib/region"; -import { getFullName, getTourUsers, User } from "@/lib/user"; +import React, {useEffect, useState} from "react"; +import {differenceInMinutes, startOfWeek, subMonths} from "date-fns"; +import {Card, Col, Container, Form, ListGroup, Row} from "react-bootstrap"; +import {datesEqual} from "@/lib/date"; +import {getWorkedHours} from "@/lib/analysis"; +import {getAllTours, Tour} from "@/lib/tour"; +import {getAllRegions, RegionInterface} from "@/lib/region"; +import {getFullName, getTourUsers, User} from "@/lib/user"; import ErrorMessageAlert from "@/components/errorMessageAlert"; -import { getAllStudentOnTourFromDate, StudentOnTour, StudentOnTourStringDate } from "@/lib/student-on-tour"; -import { WorkedHours } from "@/types"; -import { handleError } from "@/lib/error"; -import { withAuthorisation } from "@/components/withAuthorisation"; +import {getAllStudentOnTourFromDate, StudentOnTour, StudentOnTourStringDate} from "@/lib/student-on-tour"; +import {WorkedHours} from "@/types"; +import {handleError} from "@/lib/error"; +import {withAuthorisation} from "@/components/withAuthorisation"; import Select from "react-select"; import Masonry from "@mui/lab/Masonry"; import Link from "next/link"; @@ -58,7 +58,8 @@ function AdminAnalysisWorkingHours() { const tours: Tour[] = res.data; setAllTours(tours); }, - () => {} + () => { + } ); getAllRegions().then( @@ -66,7 +67,8 @@ function AdminAnalysisWorkingHours() { const regions: RegionInterface[] = res.data; setAllRegions(regions); }, - () => {} + () => { + } ); getTourUsers(true).then( @@ -74,7 +76,8 @@ function AdminAnalysisWorkingHours() { const users: User[] = res.data; setAllUsers(users); }, - () => {} + () => { + } ); }, []); @@ -89,7 +92,7 @@ function AdminAnalysisWorkingHours() { }, (err) => setErrorMessages(handleError(err)) ); - getAllStudentOnTourFromDate({ startDate, endDate }).then( + getAllStudentOnTourFromDate({startDate, endDate}).then( (res) => { const sots: StudentOnTourStringDate[] = res.data; setStudentOnTours( @@ -172,27 +175,18 @@ function AdminAnalysisWorkingHours() { return (
- +
- +
- - Periode: - - Sorteer op: { return { value: r.id, @@ -239,11 +233,22 @@ function AdminAnalysisWorkingHours() { menuPortalTarget={document.querySelector("body")} /> + + Periode: +
+ +
+
-
- +
+ {workedHours.map((worked) => { const name: string = getStudentName(worked.student_id); const time: string = toHoursAndMinutes(worked.worked_minutes); @@ -252,17 +257,17 @@ function AdminAnalysisWorkingHours() { - + {time} - + {worked.student_on_tour_ids.map((s, index) => { const sot: StudentOnTour | undefined = studentOnTours.find( (st) => st.id === s ); if (!sot) { - return
; + return
; } return ( From dc3ce9ab2a68e09e00ab1f4ad498e9780b23e331 Mon Sep 17 00:00:00 2001 From: emneirin Date: Sun, 21 May 2023 17:34:37 +0000 Subject: [PATCH 4/8] Auto formatted code --- frontend/pages/admin/analysis/tour.tsx | 66 +++++++++---------- .../pages/admin/analysis/worked-hours.tsx | 59 ++++++++--------- 2 files changed, 61 insertions(+), 64 deletions(-) diff --git a/frontend/pages/admin/analysis/tour.tsx b/frontend/pages/admin/analysis/tour.tsx index 3fd983bf..15169ba3 100644 --- a/frontend/pages/admin/analysis/tour.tsx +++ b/frontend/pages/admin/analysis/tour.tsx @@ -420,39 +420,39 @@ function AdminTour() { - - - - - - - - - - - setSelectedDate(date)} - highlightDates={validDates} // highlight valid dates - filterDate={(date: Date) => - validDates.map((d) => d.toLocaleDateString()).includes(date.toLocaleDateString()) - } - disabled={!validTourUser} - /> - + + + + + + + + + + + setSelectedDate(date)} + highlightDates={validDates} // highlight valid dates + filterDate={(date: Date) => + validDates.map((d) => d.toLocaleDateString()).includes(date.toLocaleDateString()) + } + disabled={!validTourUser} + /> + diff --git a/frontend/pages/admin/analysis/worked-hours.tsx b/frontend/pages/admin/analysis/worked-hours.tsx index cb7f31eb..4dc965be 100644 --- a/frontend/pages/admin/analysis/worked-hours.tsx +++ b/frontend/pages/admin/analysis/worked-hours.tsx @@ -1,17 +1,17 @@ import AdminHeader from "@/components/header/adminHeader"; -import React, {useEffect, useState} from "react"; -import {differenceInMinutes, startOfWeek, subMonths} from "date-fns"; -import {Card, Col, Container, Form, ListGroup, Row} from "react-bootstrap"; -import {datesEqual} from "@/lib/date"; -import {getWorkedHours} from "@/lib/analysis"; -import {getAllTours, Tour} from "@/lib/tour"; -import {getAllRegions, RegionInterface} from "@/lib/region"; -import {getFullName, getTourUsers, User} from "@/lib/user"; +import React, { useEffect, useState } from "react"; +import { differenceInMinutes, startOfWeek, subMonths } from "date-fns"; +import { Card, Col, Container, Form, ListGroup, Row } from "react-bootstrap"; +import { datesEqual } from "@/lib/date"; +import { getWorkedHours } from "@/lib/analysis"; +import { getAllTours, Tour } from "@/lib/tour"; +import { getAllRegions, RegionInterface } from "@/lib/region"; +import { getFullName, getTourUsers, User } from "@/lib/user"; import ErrorMessageAlert from "@/components/errorMessageAlert"; -import {getAllStudentOnTourFromDate, StudentOnTour, StudentOnTourStringDate} from "@/lib/student-on-tour"; -import {WorkedHours} from "@/types"; -import {handleError} from "@/lib/error"; -import {withAuthorisation} from "@/components/withAuthorisation"; +import { getAllStudentOnTourFromDate, StudentOnTour, StudentOnTourStringDate } from "@/lib/student-on-tour"; +import { WorkedHours } from "@/types"; +import { handleError } from "@/lib/error"; +import { withAuthorisation } from "@/components/withAuthorisation"; import Select from "react-select"; import Masonry from "@mui/lab/Masonry"; import Link from "next/link"; @@ -58,8 +58,7 @@ function AdminAnalysisWorkingHours() { const tours: Tour[] = res.data; setAllTours(tours); }, - () => { - } + () => {} ); getAllRegions().then( @@ -67,8 +66,7 @@ function AdminAnalysisWorkingHours() { const regions: RegionInterface[] = res.data; setAllRegions(regions); }, - () => { - } + () => {} ); getTourUsers(true).then( @@ -76,8 +74,7 @@ function AdminAnalysisWorkingHours() { const users: User[] = res.data; setAllUsers(users); }, - () => { - } + () => {} ); }, []); @@ -92,7 +89,7 @@ function AdminAnalysisWorkingHours() { }, (err) => setErrorMessages(handleError(err)) ); - getAllStudentOnTourFromDate({startDate, endDate}).then( + getAllStudentOnTourFromDate({ startDate, endDate }).then( (res) => { const sots: StudentOnTourStringDate[] = res.data; setStudentOnTours( @@ -175,18 +172,18 @@ function AdminAnalysisWorkingHours() { return (
- +
- +
Sorteer op: { return { value: r.id, @@ -235,7 +232,7 @@ function AdminAnalysisWorkingHours() { Periode: -
+
-
- +
+ {workedHours.map((worked) => { const name: string = getStudentName(worked.student_id); const time: string = toHoursAndMinutes(worked.worked_minutes); @@ -257,17 +254,17 @@ function AdminAnalysisWorkingHours() { - + {time} - + {worked.student_on_tour_ids.map((s, index) => { const sot: StudentOnTour | undefined = studentOnTours.find( (st) => st.id === s ); if (!sot) { - return
; + return
; } return ( From f11df0123a6116452faf794a4a8dc192ba9606a5 Mon Sep 17 00:00:00 2001 From: Emma N Date: Sun, 21 May 2023 19:41:42 +0200 Subject: [PATCH 5/8] table responsive --- frontend/pages/admin/analysis/tour.tsx | 2 +- frontend/pages/admin/dashboard.tsx | 7 +++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/frontend/pages/admin/analysis/tour.tsx b/frontend/pages/admin/analysis/tour.tsx index 3fd983bf..13ace237 100644 --- a/frontend/pages/admin/analysis/tour.tsx +++ b/frontend/pages/admin/analysis/tour.tsx @@ -494,7 +494,7 @@ function AdminTour() {

- +
diff --git a/frontend/pages/admin/dashboard.tsx b/frontend/pages/admin/dashboard.tsx index d7f2f980..ab51c79c 100644 --- a/frontend/pages/admin/dashboard.tsx +++ b/frontend/pages/admin/dashboard.tsx @@ -19,7 +19,6 @@ import { getAllRemarksOfStudentOnTour } from "@/lib/remark-at-building"; import Box from "@mui/material/Box"; import CheckIcon from "@mui/icons-material/Check"; import { handleError } from "@/lib/error"; -import CheckCircleOutlineIcon from "@mui/icons-material/CheckCircleOutline"; import ErrorMessageAlert from "@/components/errorMessageAlert"; import { Divider, Tooltip } from "@mui/material"; import { Card, Container, Table } from "react-bootstrap"; @@ -296,7 +295,7 @@ function AdminDashboard() { {completedStudentOnTours.length > 0 ? ( <> -
Gebouw
+
@@ -359,7 +358,7 @@ function AdminDashboard() { {startedStudentOnTours.length > 0 ? ( <> -
Ronde
+
@@ -417,7 +416,7 @@ function AdminDashboard() { {notYetStartedStudentOnTours.length > 0 ? ( <> -
Ronde
+
From 0d23864055d7f96f9d3e8a6c6b6d3eceea699c2e Mon Sep 17 00:00:00 2001 From: Emma N Date: Sun, 21 May 2023 19:47:10 +0200 Subject: [PATCH 6/8] garbage autocomplete styling fix --- frontend/pages/admin/data/garbage-collection/index.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/frontend/pages/admin/data/garbage-collection/index.tsx b/frontend/pages/admin/data/garbage-collection/index.tsx index c988cf9d..b627f422 100644 --- a/frontend/pages/admin/data/garbage-collection/index.tsx +++ b/frontend/pages/admin/data/garbage-collection/index.tsx @@ -461,8 +461,8 @@ function GarbageCollectionSchedule() { - -
+
+
- +
From 20a7e3b7769675ea5467d27fa1d9cfd8493599c9 Mon Sep 17 00:00:00 2001 From: Emma N Date: Sun, 21 May 2023 20:09:10 +0200 Subject: [PATCH 7/8] responsive communication --- frontend/pages/admin/communication.tsx | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/frontend/pages/admin/communication.tsx b/frontend/pages/admin/communication.tsx index 676307bb..5002fb56 100644 --- a/frontend/pages/admin/communication.tsx +++ b/frontend/pages/admin/communication.tsx @@ -135,7 +135,7 @@ function AdminCommunication() {

Communicatie extern

-
+
- +
-
- +
- +
-
Ronde