131 Commits

Author SHA1 Message Date
lizerk
78b8615871 feat: refine department calendar behavior and UI 2026-04-16 17:22:06 +03:00
lizerk
5700b53f13 feat: add department calendar bindings and cleanup dept permissions 2026-04-16 15:18:43 +03:00
lizerk
32a20a33ee fix: narrow department chat comment notifications 2026-04-16 12:55:04 +03:00
lizerk
ccad715e36 chore: snapshot current messages and notifications work 2026-04-16 12:07:53 +03:00
lizerk
1296ec9021 Fix employee sorting and department counters 2026-04-15 02:12:32 +03:00
lizerk
9ec4c2349f Add user last activity and refine profile cards 2026-04-15 01:31:18 +03:00
lizerk
35a7250183 refactor(ui): polish chat, requests, and profile actions 2026-04-14 23:11:32 +03:00
lizerk
70d2c55348 refactor(ui): polish department feed and mobile nav placement 2026-04-14 19:11:17 +03:00
lizerk
beb4b8b86b refactor(departments): unify department feed and discussion flows 2026-04-14 16:14:52 +03:00
lizerk
7a3ebbfdff fix(api): preserve role-only department members 2026-04-14 02:24:14 +03:00
lizerk
8d22156b36 feat(admin): add department role ldap sync action 2026-04-14 01:49:30 +03:00
lizerk
21db7f61a2 test(ldap): expand department role sync coverage 2026-04-14 01:33:24 +03:00
lizerk
2574b47923 fix(api): enforce single active department membership 2026-04-14 01:18:32 +03:00
lizerk
2d00699831 fix(ldap): nest department role groups into department group 2026-04-14 01:07:13 +03:00
lizerk
274e5767c9 refactor(departments): label role-only members 2026-04-14 00:35:51 +03:00
lizerk
4ad946da8b fix(api): include approver avatars in procurement approvals 2026-04-13 16:35:34 +03:00
lizerk
5ab638892b chore: checkpoint workspace changes 2026-04-13 16:00:53 +03:00
lizerk
af423d8d0a feat(procurement): tighten approval flow and request actions 2026-04-13 02:55:26 +03:00
lizerk
44da9c46c1 feat(ui): unify action menus and procurement comments 2026-04-12 20:07:34 +03:00
lizerk
e3ba6ea925 refactor(ui): stabilize equipment deep links and qr flow 2026-04-12 16:09:38 +03:00
lizerk
1552bbe84b fix(requests): confirm destructive actions and align surfaces 2026-04-12 07:19:12 +03:00
lizerk
c56fdbb915 feat(frontend): align employee profile flows 2026-04-12 06:27:18 +03:00
lizerk
097a3015e8 fix(profile): stabilize directory login and expand ldap coverage 2026-04-12 04:13:32 +03:00
lizerk
b98a82176c test(ldap): add live integration coverage and fix sync paths 2026-04-12 03:51:52 +03:00
lizerk
f5a908e443 feat(auth): restore password reset flow and polish auth UI 2026-04-12 02:05:13 +03:00
lizerk
7dcf84dcd1 feat(auth): add session management and settings integration 2026-04-11 23:31:14 +03:00
lizerk
6132261d69 Normalize notification email frequency preferences 2026-04-11 00:06:14 +03:00
lizerk
6042b98aa9 Update websocket read-receipt tests to current contract 2026-04-10 20:54:09 +03:00
lizerk
81b8d29b38 Refactor department LDAP sync around canonical service flows 2026-04-10 20:54:09 +03:00
lizerk
4c24b01f06 фикс 2 2026-04-03 22:30:21 +03:00
lizerk
a94b56ecb7 Выявил и исправил два места, которые вместе хорошо объясняют редкую выборочную недогрузку при скролле вверх. 2026-04-03 22:12:09 +03:00
lizerk
219a93215f Improve deleted reply preview context 2026-04-03 21:01:10 +03:00
lizerk
71d0a6092c Refine chat reply preview behavior 2026-04-03 20:53:52 +03:00
lizerk
9b23f480c2 Refine search routing and deep links 2026-04-03 20:30:29 +03:00
lizerk
c4253f6a78 Add readers avatars and emoji picker 2026-04-03 11:43:29 +03:00
lizerk
c5f53cca15 Improve chat delivery states and read details 2026-04-03 11:10:14 +03:00
lizerk
d1aea28be9 Add websocket read receipts and AsyncAPI docs 2026-04-03 09:55:10 +03:00
lizerk
0a71d6a3c9 Read notifications for opened chat 2026-04-02 11:26:09 +03:00
lizerk
f03887aa00 Suppress chat notifications for active websocket session 2026-04-02 10:05:20 +03:00
lizerk
3ca4d108b6 refactor: split monolithic api.ts into domain modules, extract AppShell calendar/mobile concerns
- Split frontend/src/lib/api.ts (2042 lines) into 12 focused domain modules:
  client.ts (base HTTP/auth), calendar.ts, documents.ts, employees.ts,
  equipment.ts, feed.ts, messages.ts, notifications.ts, procurement.ts,
  requests.ts, utils.ts, and index.ts barrel that preserves all existing imports
- Extract calendar modal state from AppShell into useCalendarModals hook
- Extract CalendarModals and MobileDrawers into components/layout/
- AppShell: 745 → 460 lines, focused on layout concerns only
- Fix setState-in-effect lint error with startTransition pattern
- Stabilize notifications memo to prevent unnecessary re-renders
- Fix flaky WS test: handle CancelledError in channels-testing cleanup
- All 609 backend tests pass, TypeScript typecheck clean, ESLint clean
2026-04-01 15:56:10 +03:00
lizerk
613248905e Refactor realtime sync and message UI 2026-04-01 15:20:27 +03:00
lizerk
3f59f8ebb9 Add backend OpenAPI docs and clean test suite 2026-03-31 17:05:31 +03:00
lizerk
f88d90230b refactor: clean architecture, align tests to current API contracts, all tests green [deploy-ready] 2026-03-30 04:27:18 +03:00
lizerk
260f684c75 удалил тест 2026-03-30 02:17:46 +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
2031872461 refactor(procurement): approval logic now fully driven by ApprovalRoute table (priority+min_amount), removed hardcoded steps, all workflow is DB-driven; tests and migrations updated 2026-03-30 02:16:29 +03:00
lizerk
f15e8aca3f feat(ldap): add LDAP sync retry queue with Celery
- Add LdapSyncQueue model for deferred LDAP operations
- Add Celery tasks: process_ldap_queue_item, process_ldap_queue
- Refactor all LDAP signals (employee, department, group, position)
  to enqueue operations on DirectoryLdapError/DirectoryServiceError
- Add _queue.py helper for enqueuing with automatic Celery dispatch
- Add Celery Beat periodic task (every 60s) for queue processing
- Add management command: ldap_queue (status/retry/cleanup)
- Add migration 0043_ldap_sync_queue
- Add 18 tests covering model, tasks, signals, and enqueue logic
- Include LDAP services refactoring (base_service, constants,
  user_login_service, user_mapper_service, user_password_service,
  phone_utils)
2026-03-19 15:07:34 +03:00
lizerk
0539f50233 refactor: переход на строгий AD-only LDAP, регистрация + верификация email
- Удалён LDAP_SERVER_TYPE и все OpenLDAP ветки кода
- user_service.py: только AD (sAMAccountName, UAC, microsoft.modify_password)
- auth_backends.py: AD фильтры и атрибуты (objectCategory, objectGUID)
- Удалён server_configs.py (больше не нужен)
- Удалён OpenLDAP Docker окружение (docker-compose.ldap.yml, ldap/, QUICKSTART_LDAP.md)
- Фронтенд: мульти-шаговая регистрация, AvatarCropper 3:4, verify-email страница
- Убран CSRF для JWT API, IP-ограничения работают независимо
- Полевые ошибки регистрации с красной подсветкой на фронте
2026-03-19 00:48:13 +03:00
lizerk
50169ec09d refactor(api): удалить монолитный views.py (4500 строк)
- Удалён дублирующий монолит api/v1/employees/views.py (4622 строки)
- Все ViewSet'ы уже реэкспортированы в views/__init__.py
- Обновлены импорты в extended_views.py, analyze_queries.py, тестах
- -4622 строки дублированного кода

Импорты 'from api.v1.employees.views import X' работают через views/__init__.py
2026-03-18 15:46:23 +03:00
lizerk
91342d199d feat: миграция на ChatMembership.is_active, удаление дублирования participants
АРХИТЕКТУРНЫЙ РЕФАКТОРИНГ:
✅ Убрано дублирование логики Chat.participants vs ChatMembership.is_active
✅ Теперь единственный источник истины - ChatMembership.is_active
✅ Исправлен баг с изменением ролей (роли не отображались после изменения)

ИЗМЕНЕНИЯ:

Backend (viewsets.py):
- get_queryset: мигрировано на memberships__is_active=True
- create: убрано participants.add, только memberships
- leave/remove_member: только is_active=False + left_at
- add_member: восстанавливает is_active=True если был False
- change_role: явно устанавливает is_active=True + left_at=None

Backend (serializers.py):
- Убрано поле participants из ChatDetailSerializer
- get_participant_details: через memberships.filter(is_active=True)
- get_participant_names: через memberships

Backend (models.py):
- get_participants(): только через ChatMembership.is_active=True
- __str__(): получаем участников через memberships
- participants помечен как устаревший (в комментариях)

Backend (rules.py):
- is_member_of_chat: только ChatMembership.is_active=True
- has_send_messages_permission: убран fallback на participants

Миграции:
- Создана 0038: убирает 'owner' из choices, очищает help_text
- Исправлены зависимости в requests_app/documents/feed 0010/0014/0006
  (заменили __latest__ на конкретную версию 0037)
- Создан management command migrate_participants_to_memberships
  (перенос данных participants → memberships)

Frontend:
- Добавлено оптимистичное обновление UI при изменении ролей
- Детальное логирование для диагностики

Тесты:
- test_change_role_improved.py: проверка изменения ролей с задержкой
- Обновлен test_chat_roles.py

Удаление устаревшей документации:
- Удалены старые отчеты из docs/ (73 файла)
- Сохранены актуальные руководства

ИСПРАВЛЕННЫЙ БАГ:
До: При изменении роли is_active оставался False → membership не попадал в filter(is_active=True) → исчезал с фронтенда
После: Явно устанавливаем is_active=True при любом действии с членством
2026-03-12 15:58:49 +03:00