feat(digests-ui): publication filter + 'מאמר'/source badges for bulletins
משלים את #154 בצד-לקוח: - פילטר "מקור" בדף /digests (כל המקורות / כל יום / עו"ד על נדל"ן) — backend: list_digests + /api/digests מקבלים publication. - DigestCard: תג "מאמר" ל-digest_kind='article', ו-chip מקור לפרסום שאינו 'כל יום'. build (webpack) עובר, lint נקי. digests = hand-written types (אין api:types). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -44,6 +44,11 @@ export function DigestCard({
|
||||
יומון {digest.yomon_number}
|
||||
</span>
|
||||
)}
|
||||
{digest.publication && digest.publication !== "כל יום" && (
|
||||
<Badge variant="outline" className="bg-rule-soft text-ink-muted text-[0.65rem]">
|
||||
{digest.publication}
|
||||
</Badge>
|
||||
)}
|
||||
{digest.digest_date && <span>· {formatDate(digest.digest_date)}</span>}
|
||||
{digest.practice_area && (
|
||||
<span>· {practiceAreaLabel(digest.practice_area)}</span>
|
||||
@@ -53,6 +58,11 @@ export function DigestCard({
|
||||
עדכון
|
||||
</Badge>
|
||||
)}
|
||||
{digest.digest_kind === "article" && (
|
||||
<Badge variant="outline" className="bg-amber-50 text-amber-700 border-amber-300 text-[0.65rem]">
|
||||
מאמר
|
||||
</Badge>
|
||||
)}
|
||||
{digest.extraction_status !== "completed" && (
|
||||
<Badge variant="outline" className="bg-rule-soft text-ink-muted text-[0.65rem]">
|
||||
{digest.extraction_status === "pending" ? "ממתין לעיבוד" : digest.extraction_status}
|
||||
|
||||
@@ -18,13 +18,21 @@ import { DigestUploadDialog } from "./digest-upload-dialog";
|
||||
|
||||
type LinkedFilter = "all" | "linked" | "unlinked";
|
||||
|
||||
const PUBLICATIONS = [
|
||||
{ value: "_all", label: "כל המקורות" },
|
||||
{ value: "כל יום", label: "כל יום (יומי)" },
|
||||
{ value: 'עו"ד על נדל"ן', label: 'עו"ד על נדל"ן (חודשי)' },
|
||||
];
|
||||
|
||||
export function DigestListPanel() {
|
||||
const [practiceArea, setPracticeArea] = useState<PracticeArea>("");
|
||||
const [linked, setLinked] = useState<LinkedFilter>("all");
|
||||
const [publication, setPublication] = useState<string>("_all");
|
||||
|
||||
const filters: DigestListFilters = {
|
||||
practiceArea: practiceArea || undefined,
|
||||
linked: linked === "all" ? undefined : linked === "linked",
|
||||
publication: publication === "_all" ? undefined : publication,
|
||||
limit: 200,
|
||||
};
|
||||
const { data, isLoading, error } = useDigests(filters);
|
||||
@@ -66,6 +74,17 @@ export function DigestListPanel() {
|
||||
</SelectContent>
|
||||
</Select>
|
||||
</div>
|
||||
<div className="min-w-[180px]">
|
||||
<label className="text-[0.78rem] text-ink-muted">מקור</label>
|
||||
<Select value={publication} onValueChange={setPublication}>
|
||||
<SelectTrigger><SelectValue /></SelectTrigger>
|
||||
<SelectContent>
|
||||
{PUBLICATIONS.map((p) => (
|
||||
<SelectItem key={p.value} value={p.value}>{p.label}</SelectItem>
|
||||
))}
|
||||
</SelectContent>
|
||||
</Select>
|
||||
</div>
|
||||
<div className="min-w-[170px]">
|
||||
<label className="text-[0.78rem] text-ink-muted">קישור לפסק</label>
|
||||
<Select value={linked} onValueChange={(v) => setLinked(v as LinkedFilter)}>
|
||||
|
||||
@@ -66,6 +66,8 @@ export type DigestListFilters = {
|
||||
/** undefined = all; true = linked to a ruling; false = unlinked (open gap) */
|
||||
linked?: boolean;
|
||||
search?: string;
|
||||
/** source publication: 'כל יום' (daily) | 'עו"ד על נדל"ן' (monthly bulletin) */
|
||||
publication?: string;
|
||||
limit?: number;
|
||||
offset?: number;
|
||||
};
|
||||
@@ -94,6 +96,7 @@ export function useDigests(filters: DigestListFilters = {}) {
|
||||
if (filters.conceptTag) p.set("concept_tag", filters.conceptTag);
|
||||
if (filters.linked !== undefined) p.set("linked", String(filters.linked));
|
||||
if (filters.search) p.set("search", filters.search);
|
||||
if (filters.publication) p.set("publication", filters.publication);
|
||||
if (filters.limit) p.set("limit", String(filters.limit));
|
||||
if (filters.offset) p.set("offset", String(filters.offset));
|
||||
const qs = p.toString();
|
||||
|
||||
Reference in New Issue
Block a user