home: split cases table by appeal type + add appeal-type chart
All checks were successful
Build & Deploy / build-and-deploy (push) Successful in 32s
All checks were successful
Build & Deploy / build-and-deploy (push) Successful in 32s
Backend (cases listing) - /api/cases: also return updated_at, created_at, practice_area, appeal_subtype, subject. The detail-mode response was previously dropping these even though db.list_cases reads them, leaving the UI's "תחום" and "עודכן" columns blank. Frontend - Split the home table into two: רישוי (1xxx) and היטל השבחה ופיצויים (8xxx + 9xxx), bucketing on appeal_subtype with a case-number-prefix fallback. The "תחום" column is now redundant and removed. - New AppealTypeBars chart in the right rail next to the existing status donut. - Donut: switch to a vertical layout (donut on top, legend below in a 3-col grid) so labels like "חדש / בעיבוד" no longer wrap inside the 320px sidebar; counts now align in a tabular column. - CasesTable accepts emptyText/searchPlaceholder so each split table has its own copy. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -17,7 +17,6 @@ import {
|
||||
import { Input } from "@/components/ui/input";
|
||||
import { Skeleton } from "@/components/ui/skeleton";
|
||||
import { StatusBadge } from "@/components/cases/status-badge";
|
||||
import { APPEAL_SUBTYPE_LABELS } from "@/lib/practice-area";
|
||||
import type { Case } from "@/lib/api/cases";
|
||||
|
||||
function formatDate(iso?: string) {
|
||||
@@ -60,15 +59,6 @@ const columns: ColumnDef<Case>[] = [
|
||||
header: "סטטוס",
|
||||
cell: ({ row }) => <StatusBadge status={row.original.status} />,
|
||||
},
|
||||
{
|
||||
accessorKey: "appeal_subtype",
|
||||
header: "תחום",
|
||||
cell: ({ row }) => {
|
||||
const s = row.original.appeal_subtype;
|
||||
if (!s || s === "unknown") return <span className="text-ink-muted">—</span>;
|
||||
return <span className="text-ink-soft text-sm">{APPEAL_SUBTYPE_LABELS[s]}</span>;
|
||||
},
|
||||
},
|
||||
{
|
||||
accessorKey: "document_count",
|
||||
header: "מסמכים",
|
||||
@@ -91,10 +81,14 @@ export function CasesTable({
|
||||
cases,
|
||||
loading,
|
||||
error,
|
||||
emptyText = "עדיין אין תיקי ערר",
|
||||
searchPlaceholder = "חיפוש לפי מס׳ ערר או כותרת…",
|
||||
}: {
|
||||
cases?: Case[];
|
||||
loading?: boolean;
|
||||
error?: Error | null;
|
||||
emptyText?: string;
|
||||
searchPlaceholder?: string;
|
||||
}) {
|
||||
const [sorting, setSorting] = useState<SortingState>([
|
||||
{ id: "updated_at", desc: true },
|
||||
@@ -128,7 +122,7 @@ export function CasesTable({
|
||||
<Input
|
||||
value={globalFilter}
|
||||
onChange={(e) => setGlobalFilter(e.target.value)}
|
||||
placeholder="חיפוש לפי מס׳ ערר או כותרת…"
|
||||
placeholder={searchPlaceholder}
|
||||
className="max-w-sm bg-surface"
|
||||
dir="rtl"
|
||||
/>
|
||||
@@ -176,7 +170,7 @@ export function CasesTable({
|
||||
<TableRow>
|
||||
<TableCell colSpan={columns.length} className="text-center text-ink-muted py-12">
|
||||
<div className="text-gold text-2xl mb-2" aria-hidden>❦</div>
|
||||
{globalFilter ? "אין תיקים תואמים לחיפוש" : "עדיין אין תיקי ערר"}
|
||||
{globalFilter ? "אין תיקים תואמים לחיפוש" : emptyText}
|
||||
</TableCell>
|
||||
</TableRow>
|
||||
) : (
|
||||
|
||||
Reference in New Issue
Block a user