🐛 stabilize exam links and marks lookup
Browse files at this commitd8b8bf244ed32db01b47a1c0be172c58239aad2aParent: 2725a74- fix
- 🐛 stabilize exam links and marks lookup
7 changed files +12 -12
- src/components/exams/exam-card.tsx +1 -1
- src/components/marks/marks-report-view.tsx +1 -1
- src/pages/course-detail-page.tsx +2 -2
- src/pages/dashboard-page.tsx +1 -1
- src/pages/event-detail-page.tsx +1 -1
- src/pages/exam-detail-page.tsx +1 -1
- src/pages/student-marks-page.tsx +5 -5
src/components/exams/exam-card.tsxmodified+1 -1
| @@ -49,7 +49,7 @@ export function ExamCard(props: { exam: Exam; courseTitle?: string; now?: number | |||
| 49 | }; | 49 | }; |
| 50 | 50 | ||
| 51 | return ( | 51 | return ( |
| 52 | - <Link to="/exams/$id" params={{ id: props.exam.id }} class="group block h-full"> | 52 | + <Link to="/exams/$id" params={() => ({ id: props.exam.id })} class="group block h-full"> |
| 53 | <article class="surface-card relative flex h-full min-h-52 flex-col overflow-hidden transition-all group-hover:-translate-y-0.5 group-hover:border-rose-500/30 group-hover:shadow-sm"> | 53 | <article class="surface-card relative flex h-full min-h-52 flex-col overflow-hidden transition-all group-hover:-translate-y-0.5 group-hover:border-rose-500/30 group-hover:shadow-sm"> |
| 54 | <div class="absolute inset-x-0 top-0 h-1 bg-gradient-to-r from-rose-500/70 via-amber-400/50 to-transparent" /> | 54 | <div class="absolute inset-x-0 top-0 h-1 bg-gradient-to-r from-rose-500/70 via-amber-400/50 to-transparent" /> |
| 55 | <div class="flex flex-1 flex-col p-4"> | 55 | <div class="flex flex-1 flex-col p-4"> |
src/components/marks/marks-report-view.tsxmodified+1 -1
| @@ -67,7 +67,7 @@ export function MarksReportView(props: { report: MarksReport }) { | |||
| 67 | {(entry) => ( | 67 | {(entry) => ( |
| 68 | <TableRow> | 68 | <TableRow> |
| 69 | <TableCell> | 69 | <TableCell> |
| 70 | - <Link to="/exams/$id" params={{ id: entry.exam }} class="font-medium hover:underline"> | 70 | + <Link to="/exams/$id" params={() => ({ id: entry.exam })} class="font-medium hover:underline"> |
| 71 | {entry.title} | 71 | {entry.title} |
| 72 | </Link> | 72 | </Link> |
| 73 | </TableCell> | 73 | </TableCell> |
src/pages/course-detail-page.tsxmodified+2 -2
| @@ -213,7 +213,7 @@ function CourseDetailContent() { | |||
| 213 | 213 | ||
| 214 | <Show when={editing()}> | 214 | <Show when={editing()}> |
| 215 | <form | 215 | <form |
| 216 | - class="surface-card max-w-2xl space-y-4 p-5" | 216 | + class="surface-card w-full space-y-4 p-5" |
| 217 | onSubmit={(e) => { | 217 | onSubmit={(e) => { |
| 218 | e.preventDefault(); | 218 | e.preventDefault(); |
| 219 | void wrap(async () => { | 219 | void wrap(async () => { |
| @@ -337,7 +337,7 @@ function CourseDetailContent() { | |||
| 337 | <li> | 337 | <li> |
| 338 | <Link | 338 | <Link |
| 339 | to="/exams/$id" | 339 | to="/exams/$id" |
| 340 | - params={{ id: exam.id }} | 340 | + params={() => ({ id: exam.id })} |
| 341 | class="group flex items-start justify-between gap-3 rounded-lg border border-border/70 bg-background/60 px-4 py-3 transition-all hover:-translate-y-0.5 hover:border-primary/30 hover:bg-accent/35 hover:shadow-sm" | 341 | class="group flex items-start justify-between gap-3 rounded-lg border border-border/70 bg-background/60 px-4 py-3 transition-all hover:-translate-y-0.5 hover:border-primary/30 hover:bg-accent/35 hover:shadow-sm" |
| 342 | > | 342 | > |
| 343 | <div class="min-w-0 space-y-2"> | 343 | <div class="min-w-0 space-y-2"> |
src/pages/dashboard-page.tsxmodified+1 -1
| @@ -244,7 +244,7 @@ function DashboardContent() { | |||
| 244 | <li> | 244 | <li> |
| 245 | <Link | 245 | <Link |
| 246 | to="/exams/$id" | 246 | to="/exams/$id" |
| 247 | - params={{ id: exam.id }} | 247 | + params={() => ({ id: exam.id })} |
| 248 | class="flex min-h-[3.5rem] items-center justify-between gap-3 rounded-md border border-border/60 bg-muted/30 px-3 py-2.5 transition-colors hover:border-primary/30 hover:bg-primary/[0.04]" | 248 | class="flex min-h-[3.5rem] items-center justify-between gap-3 rounded-md border border-border/60 bg-muted/30 px-3 py-2.5 transition-colors hover:border-primary/30 hover:bg-primary/[0.04]" |
| 249 | > | 249 | > |
| 250 | <div class="min-w-0"> | 250 | <div class="min-w-0"> |
src/pages/event-detail-page.tsxmodified+1 -1
| @@ -147,7 +147,7 @@ function EventDetailContent() { | |||
| 147 | /> | 147 | /> |
| 148 | 148 | ||
| 149 | <Show when={editing()}> | 149 | <Show when={editing()}> |
| 150 | - <section class="surface-card max-w-3xl p-5"> | 150 | + <section class="surface-card w-full p-5"> |
| 151 | <EventForm | 151 | <EventForm |
| 152 | initial={ev()} | 152 | initial={ev()} |
| 153 | submitLabel={t("common.update")} | 153 | submitLabel={t("common.update")} |
src/pages/exam-detail-page.tsxmodified+1 -1
| @@ -281,7 +281,7 @@ function ExamDetailContent() { | |||
| 281 | /> | 281 | /> |
| 282 | 282 | ||
| 283 | <Show when={editing()}> | 283 | <Show when={editing()}> |
| 284 | - <section class="surface-card max-w-3xl p-5"> | 284 | + <section class="surface-card w-full p-5"> |
| 285 | <ExamForm | 285 | <ExamForm |
| 286 | initial={ex()} | 286 | initial={ex()} |
| 287 | submitLabel={t("common.update")} | 287 | submitLabel={t("common.update")} |
src/pages/student-marks-page.tsxmodified+5 -5
| @@ -5,8 +5,9 @@ import { MarksReportView } from "@/components/marks/marks-report-view"; | |||
| 5 | import { RouteGuard } from "@/components/layout/route-guard"; | 5 | import { RouteGuard } from "@/components/layout/route-guard"; |
| 6 | import { PageHeader } from "@/components/layout/page-header"; | 6 | import { PageHeader } from "@/components/layout/page-header"; |
| 7 | import { Button } from "@/components/ui/button"; | 7 | import { Button } from "@/components/ui/button"; |
| 8 | +import { Input } from "@/components/ui/input"; | ||
| 9 | +import { Label } from "@/components/ui/label"; | ||
| 8 | import { PageSpinner } from "@/components/ui/page-spinner"; | 10 | import { PageSpinner } from "@/components/ui/page-spinner"; |
| 9 | -import { UserSearchSelect } from "@/components/users/user-search-select"; | ||
| 10 | import { useT } from "@/stores/preferences-context"; | 11 | import { useT } from "@/stores/preferences-context"; |
| 11 | 12 | ||
| 12 | export default function StudentMarksPage() { | 13 | export default function StudentMarksPage() { |
| @@ -50,13 +51,12 @@ function StudentMarksContent() { | |||
| 50 | }} | 51 | }} |
| 51 | > | 52 | > |
| 52 | <div class="min-w-0 flex-1 space-y-1.5"> | 53 | <div class="min-w-0 flex-1 space-y-1.5"> |
| 53 | - <UserSearchSelect | 54 | + <Label for="student-marks-user">{t("marks.userIdentity")}</Label> |
| 55 | + <Input | ||
| 54 | id="student-marks-user" | 56 | id="student-marks-user" |
| 55 | - label={t("marks.userIdentity")} | ||
| 56 | placeholder={t("marks.userIdentity")} | 57 | placeholder={t("marks.userIdentity")} |
| 57 | value={userId()} | 58 | value={userId()} |
| 58 | - allowManualValue | 59 | + onInput={(e) => setUserId(e.currentTarget.value)} |
| 59 | - onChange={setUserId} | ||
| 60 | /> | 60 | /> |
| 61 | </div> | 61 | </div> |
| 62 | <Button type="submit" class="h-10 w-full sm:w-auto">{t("marks.show")}</Button> | 62 | <Button type="submit" class="h-10 w-full sm:w-auto">{t("marks.show")}</Button> |