diff --git a/src/backend/routers/iep.ts b/src/backend/routers/iep.ts index 293f3943..fb942b8d 100644 --- a/src/backend/routers/iep.ts +++ b/src/backend/routers/iep.ts @@ -215,6 +215,23 @@ export const iep = router({ return result; }), + getSubgoal: authenticatedProcedure + .input( + z.object({ + subgoal_id: z.string(), + }) + ) + .query(async (req) => { + const { subgoal_id } = req.input; + + const result = await req.ctx.db + .selectFrom("subgoal") + .where("subgoal.subgoal_id", "=", subgoal_id) + .selectAll() + .execute(); + return result; + }), + getSubgoalsByAssignee: authenticatedProcedure .input( z.object({ diff --git a/src/components/subgoal/Subgoal-Assignment-Modal.module.css b/src/components/subgoal/Subgoal-Assignment-Modal.module.css new file mode 100644 index 00000000..c1373b78 --- /dev/null +++ b/src/components/subgoal/Subgoal-Assignment-Modal.module.css @@ -0,0 +1,34 @@ +/* Styles for Assign Subgoal Modal Component */ +.assignSubgoalModal { + max-width: 360px; + width: 360px; + max-height: 580px; + height: 800px; + margin: auto; + font-size: 16px; + text-align: left; +} + +.assignSubgoalModalTitle { + font-size: 24px; +} + +.subgoalDescriptionBox { + border-radius: 8px; + background-color: #f6f5ff; + padding: 8px 16px; +} + +.subgoalTitle { + font-size: 20px; +} + +.subgoalDescription, +.staffListItemText { + font-size: 16px; +} + +/* We may have to set up a theme to override the MUI styles so we can achieve our design systems setups since this does not work, or build our own global buttons and use those */ +.button { + background-color: #20159e; +} diff --git a/src/components/subgoal/Subgoal-Assignment-Modal.tsx b/src/components/subgoal/Subgoal-Assignment-Modal.tsx index b285caa8..4627b871 100644 --- a/src/components/subgoal/Subgoal-Assignment-Modal.tsx +++ b/src/components/subgoal/Subgoal-Assignment-Modal.tsx @@ -3,8 +3,6 @@ import { Box, Dialog, DialogTitle, - Alert, - AlertTitle, Button, List, ListItem, @@ -14,15 +12,21 @@ import { ListItemText, } from "@mui/material"; import { useState } from "react"; +import $subgoal from "./Subgoal-Assignment-Modal.module.css"; interface SubgoalAssignmentModalProps { isOpen: boolean; onClose: () => void; + subgoal_id: string; } export const SubgoalAssignmentModal = (props: SubgoalAssignmentModalProps) => { const [selectedParaIds, setSelectedParaIds] = useState([]); + const [currentModalSelection, setCurrentModalSelection] = useState(1); const myParasQuery = trpc.case_manager.getMyParas.useQuery(); + const { data: subgoal } = trpc.iep.getSubgoal.useQuery({ + subgoal_id: props.subgoal_id, + }); const handleParaToggle = (paraId: string) => () => { setSelectedParaIds((prev) => { @@ -37,51 +41,78 @@ export const SubgoalAssignmentModal = (props: SubgoalAssignmentModalProps) => { const handleClose = () => { props.onClose(); setSelectedParaIds([]); + setCurrentModalSelection(1); }; return ( - - Assign to benchmark + + + Assign to benchmark + - - Benchmark - By October, when given a list of 20 unfamiliar words that contain - short-vowel sounds, the student will correctly pronounce 18 of the 20 - words with 90% accuracy in 3 out of 4 trials. - - Select one or more paras: - - - {myParasQuery.data?.map((para) => ( - - - - - - - {para.first_name} {para.last_name} - - - - ))} - + +

Benchmark

+ {subgoal?.map((thisSubgoal) => ( +

+ {thisSubgoal.description} +

+ ))}
+ {/* we could make this and the 2nd selection process with a reusable component, e.g. labels in the

below could be from rendering {selectionLabel} but this is one solution to start */} + {currentModalSelection === 1 && ( + +

Select one or more paras:

+ + + {myParasQuery.data?.map((para) => ( + // CSS ask is to reorder the mapped staff so that the selected staff are moved to the top of the list + + + + + + + {para.first_name} {para.last_name} + + + + ))} + + +
+ )} + {/* Enter 2nd selection process here, utilizing selected staff at the end of the process */} + {currentModalSelection === 2 && } - diff --git a/src/components/subgoal/Subgoal.tsx b/src/components/subgoal/Subgoal.tsx index a08222d6..0aa5b11e 100644 --- a/src/components/subgoal/Subgoal.tsx +++ b/src/components/subgoal/Subgoal.tsx @@ -74,6 +74,7 @@ const Subgoals = ({ subgoal }: SubgoalProps) => { setIsAssignmentModalOpen(false)} + subgoal_id={subgoal.subgoal_id} /> );