Fix draft label to reflect revision number instead of always showing "first draft"
All checks were successful
Build & Deploy / build-and-deploy (push) Successful in 1m36s
All checks were successful
Build & Deploy / build-and-deploy (push) Successful in 1m36s
The drafts panel now checks for עריכה-v* files and shows the correct draft number (e.g. "טיוטה 2 (מתוקנת) מוכנה לעיון") instead of always displaying "טיוטה ראשונה מוכנה לעיון". Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -90,6 +90,21 @@ export function DraftsPanel({
|
||||
const isDraftReady = status && DRAFT_READY.includes(status);
|
||||
const openFeedbacks = feedbacks?.filter((f) => !f.resolved) ?? [];
|
||||
|
||||
// Determine draft label based on exports — revised if there are עריכה files or multiple טיוטה versions
|
||||
const draftLabel = (() => {
|
||||
if (!exports?.length) return "טיוטה מוכנה לעיון";
|
||||
const revisions = exports.filter((f) => f.filename.startsWith("עריכה-"));
|
||||
const drafts = exports.filter((f) => f.filename.startsWith("טיוטה-"));
|
||||
if (revisions.length > 0) {
|
||||
const ver = revisions.length + 1;
|
||||
return `טיוטה ${ver} (מתוקנת) מוכנה לעיון`;
|
||||
}
|
||||
if (drafts.length > 1) {
|
||||
return `טיוטה ${drafts.length} מוכנה לעיון`;
|
||||
}
|
||||
return "טיוטה ראשונה מוכנה לעיון";
|
||||
})();
|
||||
|
||||
function handleUpload(file: File) {
|
||||
uploadDraft.mutate(file, {
|
||||
onSuccess: (data) =>
|
||||
@@ -130,7 +145,7 @@ export function DraftsPanel({
|
||||
<div className="flex items-center gap-3 rounded-lg border border-gold/40 bg-gold-wash px-4 py-3">
|
||||
<FileText className="w-5 h-5 text-gold-deep shrink-0" />
|
||||
<span className="text-sm font-medium text-gold-deep">
|
||||
טיוטה ראשונה מוכנה לעיון
|
||||
{draftLabel}
|
||||
</span>
|
||||
<div className="me-auto" />
|
||||
<Button
|
||||
|
||||
@@ -62,7 +62,7 @@ const STATUS_DESCRIPTIONS: Record<CaseStatus, string> = {
|
||||
ready_for_writing: "הכל מוכן — ממתין לכותב ההחלטה",
|
||||
drafting: "טיוטת ההחלטה בתהליך כתיבה",
|
||||
qa_review: "הטיוטה בבדיקת איכות אוטומטית",
|
||||
drafted: "טיוטה ראשונה מוכנה לעיון",
|
||||
drafted: "טיוטה מוכנה לעיון",
|
||||
exported: "ההחלטה יוצאה לקובץ DOCX",
|
||||
reviewed: "ההחלטה נבדקה ע\"י היו\"ר",
|
||||
final: "החלטה סופית — מוכנה להגשה",
|
||||
|
||||
Reference in New Issue
Block a user