251216:1644 Docunment Number: Update frontend/
Some checks failed
Spec Validation / validate-markdown (push) Has been cancelled
Spec Validation / validate-diagrams (push) Has been cancelled
Spec Validation / check-todos (push) Has been cancelled

This commit is contained in:
admin
2025-12-16 16:44:23 +07:00
parent 9c1e175b76
commit 95ee94997f
12 changed files with 1097 additions and 198 deletions

View File

@@ -96,7 +96,7 @@ export function TemplateEditor({
onSave({
...template,
projectId: projectId,
correspondenceTypeId: Number(typeId),
correspondenceTypeId: typeId && typeId !== '__default__' ? Number(typeId) : null,
disciplineId: Number(disciplineId),
formatTemplate: format,
templateFormat: format, // Legacy support
@@ -107,7 +107,7 @@ export function TemplateEditor({
});
};
const isValid = format.length > 0 && typeId;
const isValid = format.length > 0; // typeId is optional (null = default for all types)
return (
<Card className="p-6 space-y-6">
@@ -136,12 +136,13 @@ export function TemplateEditor({
{/* Configuration Column */}
<div className="space-y-4">
<div>
<Label>Document Type *</Label>
<Label>Document Type (Optional)</Label>
<Select value={typeId} onValueChange={setTypeId}>
<SelectTrigger>
<SelectValue placeholder="Select type..." />
<SelectValue placeholder="Default (All Types)" />
</SelectTrigger>
<SelectContent>
<SelectItem value="__default__">Default (All Types)</SelectItem>
{correspondenceTypes.map((type) => (
<SelectItem key={type.id} value={type.id.toString()}>
{type.typeCode} - {type.typeName}
@@ -149,6 +150,9 @@ export function TemplateEditor({
))}
</SelectContent>
</Select>
<p className="text-xs text-muted-foreground mt-1">
Leave empty to create a default template for this project.
</p>
</div>
<div>