Merge pull request 'fix(precedents): deferred (snooze) לא נספר כ"ממתין" ולא צובע שורה אדום' (#218) from worktree-defer-not-pending into main
This commit was merged in pull request #218.
This commit is contained in:
@@ -3707,9 +3707,11 @@ async def list_external_case_law(
|
|||||||
(SELECT COUNT(*) FROM halachot h WHERE h.case_law_id = case_law.id
|
(SELECT COUNT(*) FROM halachot h WHERE h.case_law_id = case_law.id
|
||||||
AND h.review_status IN ('approved', 'published')) AS approved_count,
|
AND h.review_status IN ('approved', 'published')) AS approved_count,
|
||||||
(SELECT COUNT(*) FROM halachot h WHERE h.case_law_id = case_law.id
|
(SELECT COUNT(*) FROM halachot h WHERE h.case_law_id = case_law.id
|
||||||
AND h.review_status IN ('pending_review', 'deferred')) AS pending_count,
|
AND h.review_status = 'pending_review') AS pending_count,
|
||||||
(SELECT COUNT(*) FROM halachot h WHERE h.case_law_id = case_law.id
|
(SELECT COUNT(*) FROM halachot h WHERE h.case_law_id = case_law.id
|
||||||
AND h.review_status = 'rejected') AS rejected_count
|
AND h.review_status = 'rejected') AS rejected_count,
|
||||||
|
(SELECT COUNT(*) FROM halachot h WHERE h.case_law_id = case_law.id
|
||||||
|
AND h.review_status = 'deferred') AS deferred_count
|
||||||
FROM case_law
|
FROM case_law
|
||||||
WHERE {where_sql}
|
WHERE {where_sql}
|
||||||
ORDER BY created_at DESC
|
ORDER BY created_at DESC
|
||||||
|
|||||||
@@ -140,14 +140,20 @@ function StatusPill({ p }: { p: Precedent }) {
|
|||||||
}
|
}
|
||||||
// Split the count into approved / pending / rejected so a high total no
|
// Split the count into approved / pending / rejected so a high total no
|
||||||
// longer reads as "lots waiting" when the remainder is actually rejected.
|
// longer reads as "lots waiting" when the remainder is actually rejected.
|
||||||
// Pending is the only state that needs the chair — highlight it in red.
|
// Only pending_review needs the chair — it (and only it) is highlighted red
|
||||||
|
// and tints the row. deferred ("snoozed", #84) was deliberately set aside and
|
||||||
|
// is excluded from the active review queue, so it never alarms — it shows as
|
||||||
|
// a separate muted segment, surfaced only when present.
|
||||||
const hasPending = p.pending_count > 0;
|
const hasPending = p.pending_count > 0;
|
||||||
|
const title =
|
||||||
|
`${p.approved_count} מאושרות · ${p.pending_count} ממתינות · ${p.rejected_count} נדחו` +
|
||||||
|
(p.deferred_count > 0 ? ` · ${p.deferred_count} נדחו למועד` : "");
|
||||||
return (
|
return (
|
||||||
<Badge
|
<Badge
|
||||||
variant="outline"
|
variant="outline"
|
||||||
dir="ltr"
|
dir="ltr"
|
||||||
className="bg-gold-wash text-gold-deep border-gold/40 tabular-nums"
|
className="bg-gold-wash text-gold-deep border-gold/40 tabular-nums"
|
||||||
title={`${p.approved_count} מאושרות · ${p.pending_count} ממתינות · ${p.rejected_count} נדחו`}
|
title={title}
|
||||||
>
|
>
|
||||||
<span className="text-success font-semibold">{p.approved_count}</span>
|
<span className="text-success font-semibold">{p.approved_count}</span>
|
||||||
<span className="text-ink-light">/</span>
|
<span className="text-ink-light">/</span>
|
||||||
@@ -156,6 +162,11 @@ function StatusPill({ p }: { p: Precedent }) {
|
|||||||
</span>
|
</span>
|
||||||
<span className="text-ink-light">/</span>
|
<span className="text-ink-light">/</span>
|
||||||
<span className="text-ink-muted">{p.rejected_count}</span>
|
<span className="text-ink-muted">{p.rejected_count}</span>
|
||||||
|
{p.deferred_count > 0 ? (
|
||||||
|
<span className="ms-1 text-[0.7rem] text-ink-light">
|
||||||
|
(⏸ {p.deferred_count})
|
||||||
|
</span>
|
||||||
|
) : null}
|
||||||
<span className="ms-1 text-[0.7rem] text-ink-muted">הלכות</span>
|
<span className="ms-1 text-[0.7rem] text-ink-muted">הלכות</span>
|
||||||
</Badge>
|
</Badge>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -59,6 +59,7 @@ export type Precedent = {
|
|||||||
approved_count: number;
|
approved_count: number;
|
||||||
pending_count: number;
|
pending_count: number;
|
||||||
rejected_count: number;
|
rejected_count: number;
|
||||||
|
deferred_count: number;
|
||||||
};
|
};
|
||||||
|
|
||||||
export type Halacha = {
|
export type Halacha = {
|
||||||
|
|||||||
Reference in New Issue
Block a user