From 18ea301411042cfb816570f8db6990164b5a24f7 Mon Sep 17 00:00:00 2001 From: Vincent Shuali Date: Thu, 19 Dec 2024 14:07:44 -0800 Subject: [PATCH] Rename BenchmarkAssignmentModal to BenchmarkAssignment --- src/backend/routers/iep.ts | 2 +- ...nchmarkAssignmentModal.tsx => BenchmarkAssignment.tsx} | 8 +++----- src/components/benchmarks/BenchmarkListElement.tsx | 4 ++-- 3 files changed, 6 insertions(+), 8 deletions(-) rename src/components/benchmarks/{BenchmarkAssignmentModal.tsx => BenchmarkAssignment.tsx} (96%) diff --git a/src/backend/routers/iep.ts b/src/backend/routers/iep.ts index 5db3a2d3..0a66ae5f 100644 --- a/src/backend/routers/iep.ts +++ b/src/backend/routers/iep.ts @@ -366,7 +366,7 @@ export const iep = router({ const result = await req.ctx.db .selectFrom("benchmark") .where("benchmark.benchmark_id", "=", benchmark_id) - .selectAll() + .selectAll() // add second query to get the tasks associated with benchmark .execute(); return result; }), diff --git a/src/components/benchmarks/BenchmarkAssignmentModal.tsx b/src/components/benchmarks/BenchmarkAssignment.tsx similarity index 96% rename from src/components/benchmarks/BenchmarkAssignmentModal.tsx rename to src/components/benchmarks/BenchmarkAssignment.tsx index 0da8e56f..ef64768b 100644 --- a/src/components/benchmarks/BenchmarkAssignmentModal.tsx +++ b/src/components/benchmarks/BenchmarkAssignment.tsx @@ -17,7 +17,7 @@ import $button from "@/components/design_system/button/Button.module.css"; import $benchmark from "./BenchmarkAssignmentModal.module.css"; import { ParaSelectionStep } from "@/components/benchmarks/ParaSelectionStep"; -interface BenchmarkAssignmentModalProps { +interface BenchmarkAssignmentProps { isOpen: boolean; onClose: () => void; benchmark_id: string; @@ -26,9 +26,7 @@ interface BenchmarkAssignmentModalProps { const STEPS = ["PARA_SELECTION", "DURATION_SELECTION"]; type Step = (typeof STEPS)[number]; -export const BenchmarkAssignmentModal = ( - props: BenchmarkAssignmentModalProps -) => { +export const BenchmarkAssignment = (props: BenchmarkAssignmentProps) => { const [selectedParaIds, setSelectedParaIds] = useState([]); const nextButtonRef = useRef(null); const [assignmentDuration, setAssignmentDuration] = @@ -38,7 +36,7 @@ export const BenchmarkAssignmentModal = ( const { data: myParas } = trpc.case_manager.getMyParas.useQuery(); const { data: benchmark } = trpc.iep.getBenchmark.useQuery({ benchmark_id: props.benchmark_id, - }); + }); // maybe it should include assignments, or have a flag to include assignments const [errorMessage, setErrorMessage] = useState(""); diff --git a/src/components/benchmarks/BenchmarkListElement.tsx b/src/components/benchmarks/BenchmarkListElement.tsx index 24d22297..649e2f59 100644 --- a/src/components/benchmarks/BenchmarkListElement.tsx +++ b/src/components/benchmarks/BenchmarkListElement.tsx @@ -4,7 +4,7 @@ import Button from "@mui/material/Button"; import Divider from "@mui/material/Divider"; import ContentPasteIcon from "@mui/icons-material/ContentPaste"; import { useState, type ReactNode } from "react"; -import { BenchmarkAssignmentModal } from "./BenchmarkAssignmentModal"; +import { BenchmarkAssignment } from "./BenchmarkAssignment"; import $button from "@/components/design_system/button/Button.module.css"; import { format } from "date-fns"; import Typography from "@mui/material/Typography"; @@ -173,7 +173,7 @@ const BenchmarkListElement = ({ benchmark, index }: BenchmarkProps) => { - setIsAssignmentModalOpen(false)} benchmark_id={benchmark.benchmark_id}