From 1a86e6134118a72088eb8f549bd3efb1290485e1 Mon Sep 17 00:00:00 2001 From: igor_nadein Date: Sat, 28 Feb 2026 08:45:47 +0300 Subject: [PATCH] =?UTF-8?q?fix(documents):=20=D0=A3=D0=BF=D1=80=D0=BE?= =?UTF-8?q?=D1=89=D0=B5=D0=BD=D0=B8=D0=B5=20=D1=84=D0=BE=D1=80=D0=BC=D1=8B?= =?UTF-8?q?=20=D0=B7=D0=B0=D0=B3=D1=80=D1=83=D0=B7=D0=BA=D0=B8=20-=20?= =?UTF-8?q?=D1=83=D0=B4=D0=B0=D0=BB=D0=B5=D0=BD=D1=8B=20document=5Ftype=20?= =?UTF-8?q?=D0=B8=20tags?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Убраны поля document_type и tags из DocumentUploadForm - Обновлен API клиент: createDocument и updateDocument без этих полей - Обновлены TypeScript типы в api.ts - Убраны document_type и tags из отображения в documents/page.tsx - Форма теперь принимает только: title, description, file --- frontend/src/app/documents/page.tsx | 24 +-------- .../documents/DocumentUploadForm.tsx | 54 +------------------ frontend/src/lib/api.ts | 10 ---- frontend/src/types/api.ts | 2 - 4 files changed, 4 insertions(+), 86 deletions(-) diff --git a/frontend/src/app/documents/page.tsx b/frontend/src/app/documents/page.tsx index 32af646c..5e3ded5f 100644 --- a/frontend/src/app/documents/page.tsx +++ b/frontend/src/app/documents/page.tsx @@ -67,11 +67,10 @@ export default function DocumentsPage() { return sorted.filter((doc) => { const title = doc.title.toLowerCase(); const description = (doc.description || "").toLowerCase(); - const type = (doc.document_type || "").toLowerCase(); const author = doc.created_by ? `${doc.created_by.last_name} ${doc.created_by.first_name}`.toLowerCase() : ""; - return title.includes(q) || description.includes(q) || type.includes(q) || author.includes(q); + return title.includes(q) || description.includes(q) || author.includes(q); }); }, [documents, search]); @@ -155,7 +154,6 @@ export default function DocumentsPage() { statusCode={doc.status_code} /> -

Тип: {doc.document_type || "—"}

@@ -187,20 +185,7 @@ export default function DocumentsPage() {

{doc.tags && doc.tags.length > 0 && ( -
- {doc.tags.map((tag) => ( - - #{tag} - - ))} -
- )} - - {/* Workflow Buttons */} -
+ div className="mt-3"> - - Открыть файл
)} diff --git a/frontend/src/components/documents/DocumentUploadForm.tsx b/frontend/src/components/documents/DocumentUploadForm.tsx index d06d8c84..301b7689 100644 --- a/frontend/src/components/documents/DocumentUploadForm.tsx +++ b/frontend/src/components/documents/DocumentUploadForm.tsx @@ -14,9 +14,7 @@ interface DocumentUploadFormProps { export function DocumentUploadForm({ onSuccess, onCancel }: DocumentUploadFormProps) { const [title, setTitle] = useState(""); const [description, setDescription] = useState(""); - const [documentType, setDocumentType] = useState(""); const [file, setFile] = useState(null); - const [tags, setTags] = useState(""); const [isSubmitting, setIsSubmitting] = useState(false); const [error, setError] = useState(null); @@ -48,7 +46,7 @@ export function DocumentUploadForm({ onSuccess, onCancel }: DocumentUploadFormPr e.preventDefault(); setError(null); - if (!title || !documentType || !file) { + if (!title || !file) { setError("Заполните все обязательные поля"); return; } @@ -56,17 +54,10 @@ export function DocumentUploadForm({ onSuccess, onCancel }: DocumentUploadFormPr setIsSubmitting(true); try { - const tagsList = tags - .split(',') - .map(t => t.trim()) - .filter(t => t.length > 0); - await apiClient.createDocument({ title, description, - document_type: documentType, file, - tags: tagsList.length > 0 ? tagsList : undefined, }); toast.success("Документ успешно загружен"); @@ -74,9 +65,7 @@ export function DocumentUploadForm({ onSuccess, onCancel }: DocumentUploadFormPr // Сброс формы setTitle(""); setDescription(""); - setDocumentType(""); setFile(null); - setTags(""); if (onSuccess) { onSuccess(); @@ -159,29 +148,6 @@ export function DocumentUploadForm({ onSuccess, onCancel }: DocumentUploadFormPr />
- {/* Document Type */} -
- - -
- {/* Description */}
- {/* Tags */} -
- - setTags(e.target.value)} - placeholder="Введите теги через запятую" - className="w-full rounded-lg border border-gray-300 px-3 py-2 text-sm focus:border-sky-500 focus:outline-none focus:ring-2 focus:ring-sky-100" - /> -

Например: hr, политика, обязательно

-
- {/* Buttons */}