251210:1709 Frontend: reeactor organization and run build
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-10 17:09:11 +07:00
parent aa96cd90e3
commit c8a0f281ef
140 changed files with 3780 additions and 1473 deletions

View File

@@ -52,11 +52,11 @@ export interface TemplateEditorProps {
}
export function TemplateEditor({ template, projectId, projectName, onSave, onCancel }: TemplateEditorProps) {
const [format, setFormat] = useState(template?.template_format || '');
const [docType, setDocType] = useState(template?.document_type_name || '');
const [discipline, setDiscipline] = useState(template?.discipline_code || '');
const [padding, setPadding] = useState(template?.padding_length || 4);
const [reset, setReset] = useState(template?.reset_annually ?? true);
const [format, setFormat] = useState(template?.templateFormat || '');
const [docType, setDocType] = useState(template?.documentTypeName || '');
const [discipline, setDiscipline] = useState(template?.disciplineCode || '');
const [padding, setPadding] = useState(template?.paddingLength || 4);
const [reset, setReset] = useState(template?.resetAnnually ?? true);
const [preview, setPreview] = useState('');
@@ -83,13 +83,13 @@ export function TemplateEditor({ template, projectId, projectName, onSave, onCan
const handleSave = () => {
onSave({
...template,
project_id: projectId, // Ensure project_id is included
template_format: format,
document_type_name: docType,
discipline_code: discipline || undefined,
padding_length: padding,
reset_annually: reset,
example_number: preview
projectId: projectId,
templateFormat: format,
documentTypeName: docType,
disciplineCode: discipline || undefined,
paddingLength: padding,
resetAnnually: reset,
exampleNumber: preview
});
};