feat(registratura): add Conex (reply) + Inchide buttons, reorder completari last

- Conex button on table rows (Reply icon, blue) — opens new entry with threadParentId pre-set + flipped direction
- Conex button on detail panel — same behavior
- Inchide button on table rows (CheckCircle2 icon, green) — only for open entries
- replyTo prop on RegistryEntryForm: pre-sets threadParentId + direction flip (intrat→iesit, iesit→intrat)
- Card header shows "Conex la BTG-0042/2026" with blue badge when replying
- Completari moved to last position in deadline category order

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
AI Assistant
2026-03-10 20:40:12 +02:00
parent f01fe47af4
commit f5e19ce3d1
5 changed files with 91 additions and 9 deletions
@@ -87,6 +87,8 @@ import { getDeadlineType } from "../services/deadline-catalog";
interface RegistryEntryFormProps {
initial?: RegistryEntry;
/** Pre-fill as reply (conex) to this entry — sets threadParentId, flips direction */
replyTo?: RegistryEntry;
allEntries?: RegistryEntry[];
onSubmit: (
data: Omit<RegistryEntry, "id" | "number" | "createdAt" | "updatedAt">,
@@ -106,6 +108,7 @@ interface RegistryEntryFormProps {
export function RegistryEntryForm({
initial,
replyTo,
allEntries,
onSubmit,
onCancel,
@@ -150,8 +153,12 @@ export function RegistryEntryForm({
return sorted;
}, [docTypeTags, localCustomTypes]);
// When replyTo is provided, flip direction (intrat→iesit, iesit→intrat)
const replyDirection: RegistryDirection | undefined = replyTo
? replyTo.direction === "intrat" ? "iesit" : "intrat"
: undefined;
const [direction, setDirection] = useState<RegistryDirection>(
initial?.direction ?? "intrat",
initial?.direction ?? replyDirection ?? "intrat",
);
const defaultDocType = initial?.documentType ?? (direction === "intrat" ? "aviz" : "cerere");
const [documentType, setDocumentType] = useState<DocumentType>(defaultDocType);
@@ -182,7 +189,7 @@ export function RegistryEntryForm({
initial?.assigneeContactId ?? "",
);
const [threadParentId, setThreadParentId] = useState(
initial?.threadParentId ?? "",
initial?.threadParentId ?? replyTo?.id ?? "",
);
const [notes, setNotes] = useState(initial?.notes ?? "");
const [linkedEntryIds, setLinkedEntryIds] = useState<string[]>(