From cea3db4203ceb5daf0f404511627b3467452fcad Mon Sep 17 00:00:00 2001 From: igor_nadein Date: Sat, 28 Feb 2026 13:36:25 +0300 Subject: [PATCH] feat: Enhance document details modal with comprehensive metadata - Added metadata grid with author, creation date, file info, and file size - Added folder location section with FolderOpen icon - Enhanced recipients section with departments and individual recipients - Added visual indicators with colored icon badges - Improved layout with better spacing and visual hierarchy - File open button now full-width for better visibility - Shows up to 10 individual recipients with overflow indicator --- frontend/src/app/documents/page.tsx | 157 +++++++++++++++++++++++++++- frontend/src/types/api.ts | 7 ++ 2 files changed, 160 insertions(+), 4 deletions(-) diff --git a/frontend/src/app/documents/page.tsx b/frontend/src/app/documents/page.tsx index 0dcea422..e57678db 100644 --- a/frontend/src/app/documents/page.tsx +++ b/frontend/src/app/documents/page.tsx @@ -19,6 +19,12 @@ import { SlidersHorizontal, CheckCircle, AlertCircle, + Calendar, + User, + File, + HardDrive, + Users, + Building2, } from "lucide-react"; import { DocumentStatusBadge } from "@/components/documents/DocumentStatusBadge"; import { DocumentWorkflowButtons } from "@/components/documents/DocumentWorkflowButtons"; @@ -656,7 +662,8 @@ export default function DocumentsPage() { showFullscreenToggle > {selectedDocument && ( -
+
+ {/* Status Badge */}
+ {/* Metadata Grid */} +
+ {/* Author */} +
+
+ +
+
+

Автор

+

+ {selectedDocument.uploaded_by + ? `${selectedDocument.uploaded_by.last_name} ${selectedDocument.uploaded_by.first_name}` + : selectedDocument.created_by + ? `${selectedDocument.created_by.last_name} ${selectedDocument.created_by.first_name}` + : "Не указан"} +

+
+
+ + {/* Created Date */} +
+
+ +
+
+

Дата создания

+

+ {formatDate(selectedDocument.uploaded_at || selectedDocument.created_at)} +

+
+
+ + {/* File Info */} + {selectedDocument.file_name && ( +
+
+ +
+
+

Файл

+

+ {selectedDocument.file_name} +

+
+
+ )} + + {/* File Size */} + {selectedDocument.file_size && ( +
+
+ +
+
+

Размер

+

+ {(selectedDocument.file_size / 1024 / 1024).toFixed(2)} МБ +

+
+
+ )} +
+ + {/* Folder Path */} + {selectedDocument.folder_path && ( +
+
+ + Расположение +
+

{selectedDocument.folder_path}

+
+ )} + + {/* Description */}
-

Описание

-

+

+ + Описание +

+

{selectedDocument.description || "Описание отсутствует"}

+ {/* Recipients & Departments */} + {(selectedDocument.sent_to_all || + (selectedDocument.recipients && selectedDocument.recipients.length > 0) || + (selectedDocument.departments && selectedDocument.departments.length > 0)) && ( +
+

+ + Получатели +

+
+ {selectedDocument.sent_to_all && ( +
+ + Отправлено всем сотрудникам +
+ )} + + {selectedDocument.departments && selectedDocument.departments.length > 0 && ( +
+
+ + Отделы +
+
+ {selectedDocument.departments.map((dept) => ( + + {dept.name} + + ))} +
+
+ )} + + {selectedDocument.recipients && selectedDocument.recipients.length > 0 && ( +
+
+ + Конкретные получатели ({selectedDocument.recipients.length}) +
+
+ {selectedDocument.recipients.slice(0, 10).map((recipient) => ( +
+ {recipient.last_name} {recipient.first_name} +
+ ))} + {selectedDocument.recipients.length > 10 && ( +
+ ... и ещё {selectedDocument.recipients.length - 10} +
+ )} +
+
+ )} +
+
+ )} + + {/* Divider */} +
+ + {/* File Action */} {selectedDocument.file_url && (