29 Commits

Author SHA1 Message Date
lizerk
b9829a613e feat(documents): refine regulations workflow and notifications 2026-07-22 22:34:26 +03:00
lizerk
df2377431d feat: expand documents tasks and procurement workflows 2026-07-17 14:09:06 +03:00
lizerk
042952b7a9 feat: link tasks with workplace entities 2026-07-06 15:24:37 +03:00
lizerk
0b45888f5c feat: improve documents and procurement workflows 2026-07-06 10:13:27 +03:00
lizerk
91c9820109 fix 2026-06-08 17:10:22 +03:00
lizerk
9319eb8171 Add document preview support 2026-06-03 10:05:31 +03:00
lizerk
14d9d4a4dc feat: improve documents management 2026-06-01 16:47:22 +03:00
lizerk
b9a6de7b43 refactor(frontend): unify comment composer controls 2026-04-13 15:33:57 +03:00
lizerk
e3ba6ea925 refactor(ui): stabilize equipment deep links and qr flow 2026-04-12 16:09:38 +03:00
lizerk
601f0d58d8 chore(frontend): checkpoint current theme polish state 2026-04-11 19:30:22 +03:00
lizerk
111ddb2bfd Refactor modals and add chat message search 2026-04-03 19:53:31 +03:00
lizerk
825726e0f0 chore: commit remaining backend and frontend changes, remove legacy test, add missing migrations 2026-03-30 02:17:28 +03:00
lizerk
e689ee7e5a feat(frontend): добавление новых компонентов управления документами
- Добавлен DocumentMetadataEditor для редактирования метаданных
- Добавлен TagColorPicker для выбора цветов тегов
- Добавлен TagForm для создания/редактирования тегов
- Добавлен TagManagementModal для управления тегами
2026-03-06 12:31:33 +03:00
lizerk
bf493ba9d2 refactor(frontend): обновление компонентов документов
- Удалены ссылки на document_type из DocumentUploadForm
- Удалены фильтры по статусам из DocumentRelated
- Удалены статистика статусов из DocumentsDashboard
- Обновлены экспорты компонентов (удалены устаревшие)
- Добавлены экспорты для новых компонентов тегов
2026-03-06 12:26:43 +03:00
lizerk
8c6753c188 refactor(frontend): удаление устаревших компонентов документов
- Удален DocumentStatusBadge (больше нет статусов)
- Удален DocumentWorkflowButtons (нет FSM workflow)
- Удален DocumentVersionHistory (дубль, есть другая реализация)
- Удален AdvancedSearch (заменен на фильтры)
- Удалена папка versions/ с компонентами истории версий
2026-03-06 12:23:11 +03:00
lizerk
f2bff36f3c feat(documents): рефакторинг модального окна с предпросмотром
Доработан DocumentDetailModal:
- Добавлен встроенный предпросмотр PDF и изображений
- Добавлен полноэкранный режим для предпросмотра (desktop)
- Добавлены вкладки: Предпросмотр, Информация, Активность, Ознакомления, Комментарии, Связанные
- Добавлены пропсы: onEditMetadata, onViewReport, onNavigateToRelated
- Интегрированы DocumentComments и DocumentRelated
- Улучшена шапка с полной информацией о документе на мобильных

Desktop layout:
- Split-view: предпросмотр слева (60%), вкладки справа
- Кнопка полноэкранного режима

Mobile layout:
- Вкладочная навигация
- Все метаданные видны в шапке (имя файла, размер, дата, автор)

Оптимизация page.tsx:
- Заменен встроенный модал (270 строк) на компонент DocumentDetailModal
- Удалены ненужные импорты DocumentAcknowledgement, DocumentComments, DocumentRelated
- Уменьшен размер с 1199 до 952 строк (-247 строк, -21%)
2026-03-06 12:09:23 +03:00
lizerk
6d9e6655b5 refactor(documents): удаление функционала комментариев при ознакомлении
- Удалено текстовое поле для комментариев в DocumentAcknowledgement
- Удален параметр notes из acknowledgeDocument API метода
- Удалено поле notes из интерфейса DocumentAcknowledgement
- Упрощена форма подтверждения прочтения до простой кнопки
2026-03-06 12:08:44 +03:00
41e4238a84 feat: add document related, comments, tags, versions components and notifications integration 2026-03-02 12:37:55 +03:00
11acea9ad0 feat: Extend DocumentUploadForm with full enterprise features
PROBLEM:
- Upload form was minimal, not using full backend capabilities
- Missing: recipients, departments, acknowledgement requirement
- No folder indication when uploading to specific folder

SOLUTION - BACKEND:
- Added 'acknowledgement_required' field to DocumentWriteSerializer
- Now accepts: sent_to_all, department_ids, recipient_ids, acknowledgement_required

SOLUTION - FRONTEND:
Extended DocumentUploadForm with enterprise-grade features:

NEW FIELDS:
1. Sent to All Toggle
   - Checkbox to send document to all employees
   - When checked, hides recipients/departments selection

2. Recipients Section (when sent_to_all = false)
   - Multi-select for departments (with Building2 icon)
   - Multi-select for specific employees (with Users icon)
   - Live loading from API
   - Validation: requires at least one department OR recipient
   - Helper text for Ctrl/Cmd multi-select

3. Acknowledgement Required
   - Checkbox to require recipients to acknowledge reading
   - Clear explanation of what it means

UX IMPROVEMENTS:
- Folder indicator: shows when uploading to specific folder
- Visual sections with dividers and headers
- Icons for each field type
- Warning when no recipients selected (amber alert)
- Better validation messages
- Reset all new fields on successful upload

API CLIENT:
- Updated createDocument signature to include acknowledgement_required
- Properly serializes checkbox values as strings

DATA LOADING:
- useEffect loads departments and employees on mount
- Loading states during fetch
- Handles empty lists gracefully

VALIDATION:
- Requires file and title (unchanged)
- NEW: When sent_to_all=false, requires departments OR recipients
- Shows user-friendly error messages

BENEFITS:
- Full feature parity with backend capabilities
- Professional document management workflow
- Granular control over document distribution
- Acknowledgement tracking from upload stage
- Better UX with progressive disclosure
2026-02-28 14:04:27 +03:00
4025eb2b19 feat: Create modern DocumentDetailModal with tabs based on market analysis
Analyzed leading DMS solutions (Google Drive, Notion, Confluence, SharePoint, ClickUp)
and implemented enterprise-grade document modal with progressive disclosure.

NEW COMPONENT:
- DocumentDetailModal.tsx - modern tabbed interface for document details

STRUCTURE:
- Fixed header with title, metadata, quick actions, status badge
- Tab navigation: Overview | Activity | Acknowledgements | Versions
- Full-screen modal with optimized layout

TAB: OVERVIEW
- 2-column layout (66% main content, 33% sidebar)
- Document preview (images, PDF iframe, file icon fallback)
- Description section
- Workflow actions
- Sidebar with:
  • Author & dates (created, modified)
  • Folder location (breadcrumbs)
  • Tags (color badges)
  • Recipients (departments + individuals)

TAB: ACTIVITY
- Timeline placeholder for workflow events
- Ready for integration with django-reversion API
- Shows created/published events

TAB: ACKNOWLEDGEMENTS
- Reuses existing DocumentAcknowledgement component
- Progress visualization
- User list with status

TAB: VERSIONS
- Placeholder for version history
- Ready for integration with django-reversion API

IMPROVEMENTS:
- Progressive disclosure - info organized in tabs, not overwhelming
- Visual hierarchy - preview is focal point, actions always visible
- Quick actions - Open, Download, Share in header
- Rich metadata - type, size, dates, location, tags, recipients
- Scalable structure - easy to add new tabs (comments, related docs)

TYPES:
- Added document_type field (id, name, description) to Document interface
- Added tags field (id, name, color) to Document interface

DOCUMENTATION:
- docs/guides/MODERN_DOCUMENT_UI.md - comprehensive guide
- Market analysis of 5+ leading DMS solutions
- Architecture decisions and UX improvements
- Integration roadmap with django-reversion
- Future features: comments, related documents, @mentions

BENEFITS:
- Enterprise-level UX matching Confluence/SharePoint standards
- All document info accessible without context switching
- Transparent workflow and history (after backend integration)
- Modular and extensible architecture
2026-02-28 13:46:58 +03:00
a92a7dcdcd feat: Improve modal functionality with advanced UX features
New features:
- Create reusable Modal component with animations
- Add useModal hook for common modal behaviors
- Add useClickOutside hook for backdrop clicks
- Implement ESC key handling for all modals
- Add focus trap to prevent focus escaping modals
- Add body scroll locking when modals are open
- Add fullscreen toggle option for modals
- Add fade-in/scale animations for smooth transitions

Modal improvements:
- Upload modal: converted to use new Modal component
- Document details modal: converted to use new Modal component
- Create folder modal: converted to use new Modal component
- Acknowledgements report: enhanced with modal hooks

Technical details:
- Modal sizes: sm, md, lg, xl, full
- Configurable close behavior (ESC, click outside, close button)
- Automatic scrollbar width compensation
- Focus restoration after modal close
- Accessible with ARIA attributes and keyboard navigation
2026-02-28 13:22:42 +03:00
6def6d2d43 feat: Improve folders UI with breadcrumbs and document counts
Backend improvements:
- Add document_count annotation to FolderViewSet queryset
- Add document_count field to FolderSerializer

Frontend improvements:
- Add folder_path display in document cards with folder icon
- Add document count badges in folder tree
- Add breadcrumbs navigation showing current folder path
- Improve folder selector button to show selected folder name
- Add clear filter button (X) to folder selector
- Add highlighted style for selected folder in selector
- Update Document interface to include folder and folder_path fields

UI enhancements:
- Folder path shown in sky-blue color with FolderOpen icon in cards
- Document count displayed in gray badge next to folder names
- Breadcrumbs allow quick navigation back to root
- Selected folder highlighted with sky-blue background
- Visual feedback for folder selection state
2026-02-28 13:15:06 +03:00
f4b5b75c01 feat: Implement folder-document integration and acknowledgements UI
Backend changes:
- Add acknowledgement_required field to Document model (migration 0009)
- Add FolderViewSet with CRUD endpoints for folder management
- Add folder_id filtering support in DocumentViewSet.get_queryset()
- Register folders endpoint in API router

Frontend changes:
- Add DocumentAcknowledgementsReport component for viewing acknowledgement status
- Add folder_id parameter to getDocuments API method
- Add currentFolderId prop to DocumentUploadForm
- Update document creation to save to selected folder
- Add folder filtering in documents list view
- Fix PDF worker loading (use local worker instead of CDN)
- Lock pdfjs-dist version to 5.4.296 to prevent conflicts
- Add postinstall script to copy PDF worker to public/

Features:
- Hierarchical folder structure with parent-child relationships
- Filter documents by selected folder
- Upload documents to specific folders
- View acknowledgement statistics with search and export
- Local PDF worker for reliable document preview
2026-02-28 13:06:41 +03:00
8e872b3593 feat(documents): Full integration - Folder Tree + All Phase 4 components
MAJOR UPDATE: Complete documents page overhaul with all advanced features!

Frontend Integration:
- Created FolderTree component (hierarchical folder navigation)
- Added sidebar with folders and quick navigation
- Integrated Dashboard view (toggle between Documents/Dashboard)
- Added Advanced Search toggle (simple/advanced modes)
- Integrated BulkActionsToolbar with multi-select checkboxes
- Added EnhancedPDFViewer for PDF files
- Select All checkbox for bulk operations
- Folder filtering support

New Components:
- FolderTree: Expandable tree with CRUD actions
- Sidebar: Folders + Quick navigation menu
- View Modes: Documents | Dashboard tabs

Updated documents/page.tsx:
- 2-column layout: Sidebar + Main content
- Bulk selection with useDocumentSelection hook
- Enhanced PDF preview for .pdf files
- Regular preview for other files
- Folder-based filtering
- Toggle sidebar visibility
- All Phase 4 components integrated

Features Now Available:
✅ Hierarchical folder navigation
✅ Bulk operations (select all, multi-select)
✅ Enhanced PDF viewer with zoom/rotate/search
✅ Advanced search with filters
✅ Dashboard with analytics
✅ Document acknowledgements (already present)
✅ Workflow buttons
✅ Status filtering

What Users Can Now See:
1. Folder tree in sidebar
2. Documents with checkboxes
3. Bulk actions toolbar when items selected
4. Advanced search option
5. Dashboard tab
6. Enhanced PDF viewer for PDFs
7. Select all functionality

Branch: feature/django-filer-documents
2026-02-28 09:51:37 +03:00
d3abf1ad67 feat(documents): Add Batch Operations and Dashboard
Phase 4 Advanced Features complete!

- Created BulkActionsToolbar component with features:
  * Multi-select documents with checkboxes
  * Batch actions: move to folder, add tags, change status, delete
  * Real-time progress tracking for batch operations
  * Undo notification with 5-second timeout
  * useDocumentSelection hook for state management

- Created DocumentsDashboard component with features:
  * Statistics cards: total docs, my docs, approved, activity
  * Line chart: uploads over last 30 days (recharts)
  * Pie chart: document type distribution
  * Bar chart: document status distribution
  * Activity feed: recent uploads, edits, status changes
  * Quick access sections: Recent, Favorites, My Documents
  * Responsive grid layout

Total Phase 4 Deliverables:
  1. ✅ Client-side processing integration into upload form
  2. ✅ Enhanced PDF Viewer with zoom, rotate, page navigation
  3. ✅ Advanced Search with filters and saved searches
  4. ✅ Batch Operations with progress tracking
  5. ✅ Dashboard & Analytics with charts
2026-02-28 09:42:08 +03:00
9e1a1d4138 feat(documents): Add Enhanced PDF Viewer and Advanced Search
- Created EnhancedPDFViewer component with features:
  * Page navigation with keyboard shortcuts
  * Zoom in/out (0.5x - 3.0x)
  * Rotate pages clockwise
  * Fit to width / Fit to page modes
  * Thumbnail sidebar for quick navigation
  * Search functionality (Ctrl+F)
  * Print support (Ctrl+P)
  * Fullscreen modal overlay

- Created AdvancedSearch component with features:
  * Full-text search with fuzzy matching (fuse.js)
  * Multiple filters: document type, status, tags, date range, author
  * Sort options: relevance, date, title, author
  * Saved searches (localStorage)
  * Results with highlighted matches
  * Active filter badges
  * Mobile-responsive grid layout
2026-02-28 09:38:57 +03:00
a315ce4f33 feat(documents): Integrate client-side processing into upload form
- Updated DocumentUploadForm to use processDocument utility
- Added real-time progress tracking with visual feedback
- Display extracted text in editable textarea
- Support compressed file upload
- Added extracted_text field to API client and backend serializer
- Auto-process PDFs, DOCX, and images on file selection
2026-02-28 09:36:17 +03:00
1a86e61341 fix(documents): Упрощение формы загрузки - удалены document_type и tags
- Убраны поля document_type и tags из DocumentUploadForm
- Обновлен API клиент: createDocument и updateDocument без этих полей
- Обновлены TypeScript типы в api.ts
- Убраны document_type и tags из отображения в documents/page.tsx
- Форма теперь принимает только: title, description, file
2026-02-28 08:45:47 +03:00
12f3b7b81b feat(frontend): Полная интеграция документов с django-filer и django-fsm
- Установлены библиотеки: react-dropzone, react-pdf, pdfjs-dist, react-file-icon, @tanstack/react-table
- Обновлены TypeScript типы для Document + FSM статусы
- Обновлен API клиент: CRUD операции, FSM переходы, подтверждение прочтения
- Создан DocumentUploadForm: drag&drop загрузка файлов
- Создан DocumentStatusBadge: цветные статусы (draft/in_review/approved/published/archived/rejected)
- Создан DocumentWorkflowButtons: динамические кнопки FSM переходов
- Создан DocumentPreview: встроенный просмотр PDF с навигацией
- Создан DocumentAcknowledgement: подтверждение прочтения с комментариями
- Обновлена страница documents: фильтры, модальные окна, workflow UI
- Добавлена документация в DOCUMENTS_IMPLEMENTATION.md
2026-02-28 08:30:11 +03:00