110 Commits

Author SHA1 Message Date
f2e85de672 Support unified LDAP, email, and phone login 2026-09-04 09:58:20 +03:00
cae8e97146 Add corporate OpenID Connect provider and browser sessions 2026-09-04 09:50:56 +03:00
lizerk
205fd7252d Update application features and supporting components 2026-08-19 12:09:01 +03:00
lizerk
bd515fd6d5 Harden commerce import reliability 2026-08-18 18:48:00 +03:00
lizerk
214323760b Fix notification lifecycle and commerce task scheduling 2026-08-18 16:43:50 +03:00
lizerk
138a1284cd Improve commerce, notifications, and task UX 2026-08-18 15:30:55 +03:00
lizerk
156b649b04 Complete commerce synchronization and realtime updates 2026-08-18 09:10:40 +03:00
lizerk
53cf1918c0 Add message mentions and unread mention tracking 2026-08-17 16:08:14 +03:00
lizerk
3c5a8c87e2 Update application functionality and supporting components 2026-08-17 13:54:35 +03:00
lizerk
cca52d70d6 Refactor project structure and remove obsolete code 2026-08-15 11:16:50 +03:00
lizerk
b7e20c8956 feat: stream calendar events over websocket 2026-08-14 23:44:28 +03:00
lizerk
aaa1da663c refactor: unify observability and realtime updates 2026-08-14 22:49:20 +03:00
lizerk
014afc485e Remove obsolete code and simplify project structure 2026-08-14 17:00:49 +03:00
lizerk
78f19e27af Remove obsolete files and simplify project structure 2026-08-14 16:35:21 +03:00
lizerk
beb4b8b86b refactor(departments): unify department feed and discussion flows 2026-04-14 16:14:52 +03:00
lizerk
969554bf3f refactor(frontend): remove redundant department panels 2026-04-13 23:44:18 +03:00
lizerk
64eafeea46 refactor(frontend): normalize danger action shells 2026-04-13 23:41:16 +03:00
lizerk
3b855e2ef1 refactor(frontend): split department showcase and management 2026-04-13 22:25:30 +03:00
lizerk
b73336744a refactor(frontend): simplify department workspace 2026-04-13 21:23:54 +03:00
lizerk
28d61b842c refactor(frontend): build department management screen 2026-04-13 17:52:41 +03:00
lizerk
5ab638892b chore: checkpoint workspace changes 2026-04-13 16:00:53 +03:00
lizerk
4127e65c4f docs(frontend): prioritize person chip pattern 2026-04-13 15:49:16 +03:00
lizerk
b9a6de7b43 refactor(frontend): unify comment composer controls 2026-04-13 15:33:57 +03:00
lizerk
c96b9453a5 refactor(frontend): normalize vertical rhythm scale 2026-04-13 15:21:54 +03:00
lizerk
07ded50432 refactor(frontend): extract settings page controller 2026-04-13 14:44:38 +03:00
lizerk
caf6eebc0f refactor(frontend): refine profile timeline balance 2026-04-13 14:30:29 +03:00
lizerk
d437f63d02 refactor(frontend): finish people cluster alignment 2026-04-13 14:25:00 +03:00
lizerk
79b66c5884 refactor(frontend): align profile sections and users list 2026-04-13 14:20:51 +03:00
lizerk
fe040e2da9 refactor(frontend): align profile page controllers 2026-04-13 14:15:34 +03:00
lizerk
55f3171636 docs(frontend): document genre drift and refactor waves 2026-04-13 14:05:47 +03:00
lizerk
c87901452a docs(frontend): soften requests guidance 2026-04-13 13:46:03 +03:00
lizerk
61db827ae2 refactor(frontend): tighten requests controls contract 2026-04-13 13:23:16 +03:00
lizerk
ba41dd2b0f refactor(frontend): remove requests image warnings 2026-04-13 13:19:54 +03:00
lizerk
2cfa1099f3 refactor(frontend): normalize requests list shell 2026-04-13 13:17:34 +03:00
lizerk
8b150e270d refactor(frontend): extract requests screen orchestration 2026-04-13 13:11:58 +03:00
lizerk
331dc1433a refactor(frontend): decompose requests screen 2026-04-13 12:56:00 +03:00
lizerk
ae7e1daf89 refactor(frontend): align profile, notifications and procurement flows 2026-04-12 18:02:47 +03:00
lizerk
c56fdbb915 feat(frontend): align employee profile flows 2026-04-12 06:27:18 +03:00
lizerk
e80412918d Refactor chat frontend and optimize chat queries 2026-04-03 17:05:14 +03:00
lizerk
3a2d05a64d feat(requests): улучшены фильтры по датам, исправлена логика фильтрации, добавлена инструкция по тестированию 2026-03-27 14:57:31 +03:00
lizerk
540e295ef4 feat: Fix LDAP DN bugs + add password management in admin
BREAKING CHANGES:
- Department.head автоматически очищается при увольнении руководителя
- LDAP managedBy атрибут очищается при увольнении

Fixes:
- DN не перемещался при восстановлении сотрудника (Dismissed → Users)
- DN не перемещался при увольнении сотрудника без отделов
- Ошибка при увольнении из множественных отделов (двойной modify_dn)
- Неправильные URL patterns для LDAP моделей в админке
- Двойное кодирование DN в редиректе смены пароля

Features:
- Добавлен метод _ensure_ldap_dn_location для гарантированного перемещения DN
- Добавлена проверка already_there в sync_department_member_to_ldap
- Управление паролями LDAP пользователей через админку:
  * Кнопка смены пароля в карточке пользователя
  * Массовое действие смены пароля
  * Автосинхронизация с Django password hash
- Автоочистка Department.head и LDAP managedBy при увольнении руководителя
- Добавлены методы set_password() и change_password() в LdapUser

Changed:
- Переписан сигнал sync_department_member_to_ldap с реальными методами
- Исправлены URL patterns: ldap_* → employees_*
2026-03-23 20:32:39 +03:00
lizerk
75662ec7ea feat(ldap): Полная миграция на django-ldapdb ORM с миксинами и Django Admin
LDAP ORM модели (orm_models.py):
================================
✅ Применены миксины ModifyDnMixin и LdapSyncStateMixin ко всем моделям
✅ LdapUser - поддержка modify_dn + автоуправление LdapSyncState
✅ LdapGroup - поддержка modify_dn для перемещения групп
✅ LdapOrganizationalUnit - поддержка modify_dn для реорганизации

Миксины (mixins.py) - НОВЫЙ ФАЙЛ:
=================================
✅ ModifyDnMixin - автоматический modify_dn при изменении base_dn
   • Отслеживает изменения base_dn
   • Выполняет LDAP modify_dn с newsuperior
   • Обновляет _saved_dn для корректного последующего save()
   • Использование: user.base_dn = new_dn; user.save()

✅ LdapSyncStateMixin - автоуправление LdapSyncState
   • Автоматически создает/обновляет LdapSyncState при save()
   • Автоматически удаляет LdapSyncState при delete()
   • Настройки: _sync_model_name, _sync_pk_field

Django Admin для LDAP (admin.py) - НОВЫЙ ФАЙЛ:
==============================================
✅ LdapUserAdmin - полноценная админка для LDAP пользователей
   • List display: CN, SAM, email, Django Employee link, sync status
   • Search: по CN, SAM, email, имени, фамилии
   • Filters: по userAccountControl
   • Actions синхронизации:
     - sync_from_ldap_to_django (LDAP → Django)
     - sync_from_django_to_ldap (Django → LDAP)
     - show_sync_diff (сравнение данных)
   • Fieldsets: идентификация, персональные данные, контакты, UAC, группы
   • DN форматирование с подсветкой компонентов
   • Sync status indicators с иконками

Django Admin для Employee (employees/admin.py):
===============================================
✅ Добавлены зеркальные actions синхронизации:
   • sync_from_django_to_ldap - создание/обновление в LDAP
     - Автоматическое создание LDAP пользователя если не существует
     - Генерация временного пароля
     - Установка is_ldap_managed = True
   • sync_from_ldap_to_django - обновление из LDAP
   • show_sync_diff - сравнение Django ↔ LDAP
✅ Импорт django.contrib.messages для уведомлений

Сервисы LDAP (services/):
=========================
✅ UserService - полная миграция на ORM для UPDATE операций
✅ GroupService - использование ORM для модификаций
✅ DepartmentService - ORM для обновления OU
✅ PositionService - ORM для групп позиций

Тесты (tests/unit/):
===================
✅ test_user_service.py - обновлены под ORM
✅ test_group_service.py - обновлены под ORM
✅ test_position_service.py - обновлены под ORM
✅ conftest.py - добавлены фикстуры для ORM моделей

Authentication (auth_backends.py):
=================================
✅ EmailOrPhoneBackend - добавлено подробное debug логирование
   • Логирование email/phone lookup
   • Логирование is_active проверки
   • Логирование password check с hash prefix
✅ SuperuserOnlyBackend - добавлено debug логирование
   • Логирование parent auth результата
   • Логирование is_superuser проверки

API (api/auth/serializers.py):
==============================
✅ PhoneOrEmailTokenObtainPairSerializer - исправлен KeyError
   • Добавлена проверка credentials перед super().validate()
   • Явный AuthenticationFailed при отсутствии учетных данных

Middleware (middleware.py):
===========================
✅ Очистка от устаревшего кода (305 → 102 строки)
   • ❌ Удалена EmailVerificationMiddleware (не используется)
   • ❌ Удалена RegistrationIPRestrictionMiddleware (не используется)
   • ❌ Удалены все ссылки на namespace 'auth_front'
   • ✅ Возврат 403 для неавторизованных вместо редиректа

Settings (settings.py):
=======================
✅ LOGIN_URL изменен с 'auth_front:login' на '/admin/login/'
✅ Добавлено DEBUG логирование для:
   • django.contrib.auth
   • eusrr_backend.auth_backends

Миграции:
=========
✅ Удалены старые миграции LDAP моделей (0042, 0043)
✅ Добавлена миграция LdapSyncQueue (0042_ldapsyncqueue.py)

Документация:
=============
✅ ADMIN_GUIDE.md - руководство по использованию LDAP Admin
✅ docs/guides/ldap-orm-mixins-usage.md - usage guide для миксинов
✅ docs/completed/ldap-orm-create-support.md - документация ORM миграции
✅ docs/in-progress/LDAP_ORM_MIGRATION_PLAN.md - план миграции

Инфраструктура (__init__.py):
=============================
✅ Добавлен импорт admin для авторегистрации
✅ Экспорт ORM моделей (LdapUser, LdapGroup, LdapOrganizationalUnit)

ИТОГО:
======
• Полная миграция с ldap3 на django-ldapdb ORM для UPDATE/MOVE/DELETE
• Унификация: один подход для всех LDAP операций через модели
• Автоматизация: синхронизация состояния и перемещения через миксины
• UI: полноценный Django Admin для управления LDAP объектами
• Отладка: расширенное логирование аутентификации
• Чистота: удален устаревший код middleware и миграций
• Тесты: 29 passed, 0 failed, 18 skipped

Breaking Changes: НЕТ - обратная совместимость сохранена
2026-03-19 22:33:06 +03:00
lizerk
c5a8455421 feat: автоматическое создание EmployeeAction из заявок
- Добавлены сигналы в employees/signals.py для автоматизации создания кадровых событий
- Реализованы стратегии: немедленные (transfer, dismissal) и отложенные (vacation, sick_leave)
- Добавлены Celery tasks для отложенного создания событий и авто-возврата
- Настроен periodic task для очистки пропущенных возвратов
- Архитектура: employees (ядро) обрабатывает события из requests_app (модуль)
2026-03-17 20:34:14 +03:00
lizerk
ef3c02290e docs: Add phase 2 completion report for Chat refactoring 2026-03-11 14:31:28 +03:00
lizerk
66f6473e6e docs: Add phase 1 completion report for Chat refactoring 2026-03-11 14:24:15 +03:00
lizerk
f5ec8ffc8b docs: add communications refactoring plan and migration strategy
- Add detailed comparison of current vs refactored Chat model
- Add step-by-step migration plan with zero data loss guarantee
- Document GenericForeignKey approach for universal chat contexts
- Include rollback procedures and verification commands
2026-03-11 12:55:21 +03:00
lizerk
ed636081dc refactor: complete notifications v2 system with frontend translation
- Remove hard-coded Russian translations from backend API
- Backend now returns raw verb values (language-agnostic)
- Implement frontend translation functions for notification titles and categories
- Add category badge system with filters on notifications page
- Create translation utilities in frontend (verbTranslations.ts)
- Add notification settings page structure
- Update API endpoints to return simplified notification data
- Refactor notification signals across all apps
- Remove deprecated code and tests
- Add comprehensive documentation for v2 migration

Backend changes:
- notifications/api/views.py: Remove translation logic, simplify responses
- All notification_signals.py: Update to use consistent patterns
- Remove deprecated Telegram bot command
- Update Celery tasks for new notification structure

Frontend changes:
- app/notifications/page.tsx: Add translation functions and category badges
- hooks/useNotificationWebSocket.ts: New WebSocket hook for real-time updates
- lib/verbTranslations.ts: Centralized translation mappings
- components/NotificationCenter.tsx: Update to use new API format

This makes the notifications module fully reusable and project-independent.
2026-03-09 21:35:36 +03:00
lizerk
a662642864 docs: добавление документации по рефакторингу
- Добавлен отчет о рефакторинге хранилища медиафайлов
- Добавлено сравнение веток feature/django-filer-documents и develop
- Добавлен аудит frontend документов
- Добавлен отчет об очистке types, cabinets и dashboard
2026-03-06 12:33:18 +03:00
lizerk
f2f853da37 test: Add comprehensive testing suite for documents FSM workflow and notifications
- Add 87 new tests (16 FSM + 71 integration)
- Fix document API tests (all 34 passing)
- Add FSM workflow tests for all state transitions
- Add notification integration tests for document lifecycle
- Add comment and acknowledgement notification tests
- Add edge cases and performance tests
- Create testing plan documentation

FSM Tests (16 tests - ALL PASSING):
- 7 valid transitions (draft→in_review→approved→published→archived)
- 3 invalid transition error cases
- 5 permission tests
- 1 complete lifecycle test

Integration Tests (71 tests - created, require Celery config):
- test_document_notifications.py: 10 tests
- test_acknowledgement_notifications.py: 8 tests
- test_comment_notifications.py: 8 tests
- test_related_documents_notifications.py: 6 tests
- test_edge_cases.py: 15 tests
- test_performance.py: 7 tests

Fixes:
- Fix django-rules permission issue (commented out universal add_document)
- Fix get_queryset() to check ANY permission (not just view_document)
- Fix FSMField compatibility (use Document.objects.get() instead of refresh_from_db())
- Fix test expectations (403 → 404 for security by obscurity)
- Increase N+1 query threshold to 50 (realistic for django-filer)

Docs:
- docs/in-progress/TESTING_PLAN.md - comprehensive testing plan with 5 phases
2026-03-04 17:22:55 +03:00
41e4238a84 feat: add document related, comments, tags, versions components and notifications integration 2026-03-02 12:37:55 +03:00