From 2278b89035fd2eb06b83381c3994653ae8111a7b Mon Sep 17 00:00:00 2001 From: "gpt-engineer-app[bot]" <159125892+gpt-engineer-app[bot]@users.noreply.github.com> Date: Sat, 18 Apr 2026 16:22:48 +0000 Subject: [PATCH 1/3] Changes Co-authored-by: renee-png <262607627+renee-png@users.noreply.github.com> --- src/components/cases/litigation-tab.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/cases/litigation-tab.tsx b/src/components/cases/litigation-tab.tsx index 1b016c5..97feb81 100644 --- a/src/components/cases/litigation-tab.tsx +++ b/src/components/cases/litigation-tab.tsx @@ -1,4 +1,4 @@ -import { useState } from "react"; +import { useEffect, useState } from "react"; import { supabase } from "@/integrations/supabase/client"; import { Button } from "@/components/ui/button"; import { Card, CardContent } from "@/components/ui/card"; @@ -6,7 +6,7 @@ import { Input } from "@/components/ui/input"; import { Label } from "@/components/ui/label"; import { Textarea } from "@/components/ui/textarea"; import { Separator } from "@/components/ui/separator"; -import { Pencil, Save, X, Calendar, Gavel, Scale, FileSearch, Users, AlertCircle } from "lucide-react"; +import { Pencil, Save, X, Calendar, Gavel, Scale, FileSearch, Users, AlertCircle, ListChecks } from "lucide-react"; import { toast } from "sonner"; import { formatCurrency, formatDate } from "@/lib/format"; From ed887669b406df1b8a7915888c3f095c0260f142 Mon Sep 17 00:00:00 2001 From: "gpt-engineer-app[bot]" <159125892+gpt-engineer-app[bot]@users.noreply.github.com> Date: Sat, 18 Apr 2026 16:23:02 +0000 Subject: [PATCH 2/3] Changes Co-authored-by: renee-png <262607627+renee-png@users.noreply.github.com> --- src/components/cases/litigation-tab.tsx | 29 +++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/src/components/cases/litigation-tab.tsx b/src/components/cases/litigation-tab.tsx index 97feb81..aa827a7 100644 --- a/src/components/cases/litigation-tab.tsx +++ b/src/components/cases/litigation-tab.tsx @@ -45,6 +45,35 @@ export function CaseLitigationTab({ caseRecord, canManage, onSaved }: Props) { const [keyDates, setKeyDates] = useState>( Array.isArray(caseRecord.key_dates) ? caseRecord.key_dates : [], ); + const [customFilled, setCustomFilled] = useState< + Array<{ id: string; label: string; field_type: string; value: string }> + >([]); + + useEffect(() => { + let cancelled = false; + (async () => { + const { data } = await supabase + .from("case_field_values") + .select("id, value, field:custom_case_fields(id, label, field_type, sort_order, active)") + .eq("case_id", caseRecord.id); + if (cancelled) return; + const rows = (data ?? []) + .map((r: any) => ({ + id: r.id, + label: r.field?.label ?? "", + field_type: r.field?.field_type ?? "text", + sort_order: r.field?.sort_order ?? 0, + active: r.field?.active ?? true, + value: (r.value ?? "").toString().trim(), + })) + .filter((r) => r.active && r.value.length > 0) + .sort((a, b) => a.sort_order - b.sort_order || a.label.localeCompare(b.label)); + setCustomFilled(rows); + })(); + return () => { + cancelled = true; + }; + }, [caseRecord.id]); const startEdit = () => { setForm({ ...caseRecord }); From 7611143132f28ee6d24f8d115a46c7a48891d680 Mon Sep 17 00:00:00 2001 From: "gpt-engineer-app[bot]" <159125892+gpt-engineer-app[bot]@users.noreply.github.com> Date: Sat, 18 Apr 2026 16:23:28 +0000 Subject: [PATCH 3/3] Changes Co-authored-by: renee-png <262607627+renee-png@users.noreply.github.com> --- src/components/cases/litigation-tab.tsx | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/components/cases/litigation-tab.tsx b/src/components/cases/litigation-tab.tsx index aa827a7..400808c 100644 --- a/src/components/cases/litigation-tab.tsx +++ b/src/components/cases/litigation-tab.tsx @@ -148,6 +148,24 @@ export function CaseLitigationTab({ caseRecord, canManage, onSaved }: Props) { + {customFilled.length > 0 && ( + <> +
} title="Custom fields"> +
+ {customFilled.map((c) => ( +
+ +
+ {c.field_type === "date" ? formatDate(c.value) : c.value} +
+
+ ))} +
+
+ + + )} +
} title="Case summary"> {editing ? (