From a3a5d8870c1525d20a2a2541ea26a98fefd57a34 Mon Sep 17 00:00:00 2001 From: Yama <103905928+symysak@users.noreply.github.com> Date: Sat, 20 Apr 2024 14:00:18 +0900 Subject: [PATCH 1/3] Fix typo in JPNIC.tsx --- src/components/Dashboard/JPNIC/JPNIC.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/Dashboard/JPNIC/JPNIC.tsx b/src/components/Dashboard/JPNIC/JPNIC.tsx index be53b28..2645d6e 100644 --- a/src/components/Dashboard/JPNIC/JPNIC.tsx +++ b/src/components/Dashboard/JPNIC/JPNIC.tsx @@ -116,7 +116,7 @@ export function JPNICDetail(props: { labelPlacement="end" checked={jpnicCopy.is_group} onChange={() => { - setJPNICCopy({ ...jpnicCopy, hidden: !jpnicCopy.is_group }) + setJPNICCopy({ ...jpnicCopy, is_group: !jpnicCopy.is_group }) }} /> Date: Sat, 8 Jun 2024 00:22:53 +0900 Subject: [PATCH 2/3] Add filters to group table on the dashboard page --- src/pages/Dashboard/Dashboard.tsx | 56 +++++++++++++++++++++++++++++-- 1 file changed, 54 insertions(+), 2 deletions(-) diff --git a/src/pages/Dashboard/Dashboard.tsx b/src/pages/Dashboard/Dashboard.tsx index a6d3448..f03a492 100644 --- a/src/pages/Dashboard/Dashboard.tsx +++ b/src/pages/Dashboard/Dashboard.tsx @@ -11,7 +11,7 @@ import { ServiceDetailData, TicketDetailData, } from '../../interface' -import { Card, CardContent, Chip, Grid, Stack } from '@mui/material' +import { Button, Card, CardContent, Chip, Checkbox, FormControlLabel, Grid, Stack } from '@mui/material' import Ticket from '../../components/Dashboard/Ticket/Ticket' import Request from '../../components/Dashboard/Request/Request' import Service from '../../components/Dashboard/Service/Service' @@ -30,6 +30,11 @@ export default function Dashboard() { const [group, setGroup] = useState() const [connection, setConnection] = useState() const template = useRecoilValue(TemplateState) + const [expired_status0IsChecked, setExpired_status0IsChecked] = useState(true); + const [expired_status1IsChecked, setExpired_status1IsChecked] = useState(false); + const [expired_status2IsChecked, setExpired_status2IsChecked] = useState(false); + const [expired_status3IsChecked, setExpired_status3IsChecked] = useState(false); + const [groupDialogIsOpen, setGroupDialogIsOpen] = useState(false); useEffect(() => { if (reload) { @@ -176,7 +181,54 @@ export default function Dashboard() { /> - + { + if (!expired_status0IsChecked && item.expired_status === 0) {return false} + if (!expired_status1IsChecked && item.expired_status === 1) {return false} + if (!expired_status2IsChecked && item.expired_status === 2) {return false} + if (!expired_status3IsChecked && item.expired_status === 3) {return false} + return true + })} + setReload={setReload} + /> + setExpired_status0IsChecked(!expired_status0IsChecked)}/>} + label="通常" + /> + setExpired_status1IsChecked(!expired_status1IsChecked)}/>} + label="審査落ち" + /> + setExpired_status2IsChecked(!expired_status2IsChecked)}/>} + label="ユーザにより廃止" + /> + setExpired_status3IsChecked(!expired_status3IsChecked)}/>} + label="運営委員により廃止" + /> + + { + groupDialogIsOpen + ? (

+ {template?.group?.filter((item) => { + if (!expired_status0IsChecked && item.expired_status === 0) { return false } + if (!expired_status1IsChecked && item.expired_status === 1) { return false } + if (!expired_status2IsChecked && item.expired_status === 2) { return false } + if (!expired_status3IsChecked && item.expired_status === 3) { return false } + return true + }).map(((group) => + group.users?.filter((user) => + user.level < 3 + ).map((user) => + user.email + "," + ) + )) + } +

+ ) : (<>) + }
Date: Sat, 8 Jun 2024 00:37:01 +0900 Subject: [PATCH 3/3] Fix select items in connection component --- src/pages/Connection/ConnectionDetail/ConnectionDetail.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pages/Connection/ConnectionDetail/ConnectionDetail.tsx b/src/pages/Connection/ConnectionDetail/ConnectionDetail.tsx index d6e713f..8e67c97 100644 --- a/src/pages/Connection/ConnectionDetail/ConnectionDetail.tsx +++ b/src/pages/Connection/ConnectionDetail/ConnectionDetail.tsx @@ -211,7 +211,7 @@ export function ConnectionOpen(props: { type="number" > なし(初期値) - {template.bgp_router?.map((row: BGPRouterDetailData) => ( + {template.bgp_router?.filter((router) => router.enable === true).map((row: BGPRouterDetailData) => ( {row.hostname} @@ -240,7 +240,7 @@ export function ConnectionOpen(props: { type="number" > なし(初期値) - {template.tunnel_endpoint_router_ip?.map( + {template.tunnel_endpoint_router_ip?.filter((ip) => ip.enable === true).map( (row: TunnelEndPointRouterIPTemplateData) => ( {row.tunnel_endpoint_router.hostname}