From 90f6c2a5f992a34c0e67a3641595de092228666a Mon Sep 17 00:00:00 2001 From: Yinyin Liu Date: Wed, 29 Apr 2026 15:01:02 +0200 Subject: [PATCH] allow multiple choices on status to filter --- .../content/dashboards/Tickets/TicketList.tsx | 45 ++++++++++++------- 1 file changed, 28 insertions(+), 17 deletions(-) diff --git a/typescript/frontend-marios2/src/content/dashboards/Tickets/TicketList.tsx b/typescript/frontend-marios2/src/content/dashboards/Tickets/TicketList.tsx index 50a91e3dc..fb2e4d715 100644 --- a/typescript/frontend-marios2/src/content/dashboards/Tickets/TicketList.tsx +++ b/typescript/frontend-marios2/src/content/dashboards/Tickets/TicketList.tsx @@ -4,9 +4,11 @@ import { Alert, Box, Button, + Checkbox, Container, FormControl, InputLabel, + ListItemText, MenuItem, Select, Table, @@ -52,7 +54,7 @@ function TicketList() { const intl = useIntl(); const [tickets, setTickets] = useState([]); const [search, setSearch] = useState(''); - const [statusFilter, setStatusFilter] = useState(''); + const [statusFilter, setStatusFilter] = useState([]); const [createOpen, setCreateOpen] = useState(false); const [error, setError] = useState(''); @@ -73,7 +75,7 @@ function TicketList() { search === '' || t.subject.toLowerCase().includes(search.toLowerCase()) || t.installationName.toLowerCase().includes(search.toLowerCase()); - const matchesStatus = statusFilter === '' || t.status === statusFilter; + const matchesStatus = statusFilter.length === 0 || statusFilter.includes(t.status); return matchesSearch && matchesStatus; }) .sort((a, b) => new Date(b.createdAt).getTime() - new Date(a.createdAt).getTime()); @@ -110,28 +112,37 @@ function TicketList() { onChange={(e) => setSearch(e.target.value)} sx={{ minWidth: 250 }} /> - +