Merge pull request 'feat(home): הסרת כרטיס "תיקים לפי סטטוס" — דונאט-הסטטוס לבדו (#1)' (#274) from worktree-home-remove-status-bars into main
This commit was merged in pull request #274.
This commit is contained in:
@@ -9,7 +9,7 @@ import { AppealTypeBars, subtypeOf } from "@/components/cases/appeal-type-bars";
|
|||||||
import { CasesTable } from "@/components/cases/cases-table";
|
import { CasesTable } from "@/components/cases/cases-table";
|
||||||
import { Card, CardContent } from "@/components/ui/card";
|
import { Card, CardContent } from "@/components/ui/card";
|
||||||
import { Button } from "@/components/ui/button";
|
import { Button } from "@/components/ui/button";
|
||||||
import { useCases, type Case, type CaseStatus } from "@/lib/api/cases";
|
import { useCases, type Case } from "@/lib/api/cases";
|
||||||
import {
|
import {
|
||||||
usePendingApprovals,
|
usePendingApprovals,
|
||||||
type ApprovalSeverity,
|
type ApprovalSeverity,
|
||||||
@@ -23,17 +23,6 @@ const SEVERITY_DOT: Record<ApprovalSeverity, string> = {
|
|||||||
ok: "bg-success",
|
ok: "bg-success",
|
||||||
};
|
};
|
||||||
|
|
||||||
// "תיקים לפי סטטוס" horizontal status bars (mockup 04: .bar / .track / .fill).
|
|
||||||
// Driven by the same live cases the KPI row uses — five status groups onto the
|
|
||||||
// gold/info/success/danger/muted palette.
|
|
||||||
type StatusBarRow = { label: string; fill: string; match: CaseStatus[] };
|
|
||||||
const STATUS_BARS: StatusBarRow[] = [
|
|
||||||
{ label: "בהכנה", fill: "bg-info", match: ["new", "uploading", "processing", "documents_ready", "analyst_verified", "research_complete", "outcome_set"] },
|
|
||||||
{ label: "ניתוח וכיוון", fill: "bg-gold", match: ["brainstorming", "direction_approved", "analysis_enriched", "ready_for_writing"] },
|
|
||||||
{ label: "בכתיבה", fill: "bg-warn", match: ["drafting", "qa_review", "drafted"] },
|
|
||||||
{ label: "הושלם", fill: "bg-success", match: ["exported", "reviewed", "final"] },
|
|
||||||
];
|
|
||||||
|
|
||||||
export default function HomePage() {
|
export default function HomePage() {
|
||||||
const { data, isPending, error } = useCases(true);
|
const { data, isPending, error } = useCases(true);
|
||||||
// INV-IA1 pointer: surface the single approvals aggregate on the dashboard,
|
// INV-IA1 pointer: surface the single approvals aggregate on the dashboard,
|
||||||
@@ -52,16 +41,6 @@ export default function HomePage() {
|
|||||||
return { permits, levies };
|
return { permits, levies };
|
||||||
}, [data]);
|
}, [data]);
|
||||||
|
|
||||||
const statusBars = useMemo(() => {
|
|
||||||
const cases = data ?? [];
|
|
||||||
const counts = STATUS_BARS.map((b) => ({
|
|
||||||
...b,
|
|
||||||
n: cases.filter((c) => b.match.includes(c.status)).length,
|
|
||||||
}));
|
|
||||||
const max = Math.max(1, ...counts.map((c) => c.n));
|
|
||||||
return { counts, max };
|
|
||||||
}, [data]);
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<AppShell>
|
<AppShell>
|
||||||
<section className="space-y-7">
|
<section className="space-y-7">
|
||||||
@@ -93,31 +72,8 @@ export default function HomePage() {
|
|||||||
{/* two-column body — main flow + narrow gold gate rail (mockup 04 .cols) */}
|
{/* two-column body — main flow + narrow gold gate rail (mockup 04 .cols) */}
|
||||||
<div className="grid gap-6 lg:grid-cols-[1fr_360px]">
|
<div className="grid gap-6 lg:grid-cols-[1fr_360px]">
|
||||||
<div className="space-y-6 min-w-0">
|
<div className="space-y-6 min-w-0">
|
||||||
{/* תיקים לפי סטטוס — horizontal bars (mockup 04) */}
|
{/* "תיקים לפי סטטוס" (פסים אופקיים) הוסר — פיזור-הסטטוסים מוצג
|
||||||
<Card className="bg-surface border-rule shadow-sm">
|
בדונאט "פיזור סטטוסים" בטור-הצד (#1). */}
|
||||||
<CardContent className="px-6 py-5">
|
|
||||||
<h2 className="text-navy text-lg mb-4">תיקים לפי סטטוס</h2>
|
|
||||||
<ul className="space-y-3">
|
|
||||||
{statusBars.counts.map((b) => (
|
|
||||||
<li key={b.label} className="flex items-center gap-3">
|
|
||||||
<span className="w-20 shrink-0 text-[0.82rem] text-ink-soft">
|
|
||||||
{b.label}
|
|
||||||
</span>
|
|
||||||
<span className="flex-1 h-3.5 rounded-full bg-rule-soft overflow-hidden">
|
|
||||||
<span
|
|
||||||
className={`block h-full rounded-full ${b.fill} transition-[width] duration-500`}
|
|
||||||
style={{ width: `${(b.n / statusBars.max) * 100}%` }}
|
|
||||||
/>
|
|
||||||
</span>
|
|
||||||
<span className="w-9 shrink-0 text-end text-[0.82rem] font-semibold text-navy tabular-nums">
|
|
||||||
{isPending ? "—" : b.n}
|
|
||||||
</span>
|
|
||||||
</li>
|
|
||||||
))}
|
|
||||||
</ul>
|
|
||||||
</CardContent>
|
|
||||||
</Card>
|
|
||||||
|
|
||||||
{/* live case tables kept in full (richer than the mockup's single feed) */}
|
{/* live case tables kept in full (richer than the mockup's single feed) */}
|
||||||
<Card className="bg-surface border-rule shadow-sm">
|
<Card className="bg-surface border-rule shadow-sm">
|
||||||
<CardContent className="px-6 py-5">
|
<CardContent className="px-6 py-5">
|
||||||
|
|||||||
Reference in New Issue
Block a user