Commit Graph

136 Commits

Author SHA1 Message Date
root d313a3b6b9 fix: driver badge shows only assigned deliveries, add agreed+paid_storage to visible statuses
- DashboardPage: driver badge now counts only groups visible to driver AND assigned to current user
- DRIVER_VISIBLE_DELIVERY_STATUSES: added 'agreed' and 'paid_storage' so driver sees all relevant statuses
- DriverDeliveryPlanner: added agreed/paid_storage to status sort order
- Previously badge showed allOrderGroups.length (5) but list was empty because filter was too strict
2026-06-12 19:22:36 +00:00
root 3e5be5edf1 fix: remove on_route and pickup from manual status buttons and filters 2026-06-12 18:25:52 +00:00
root 6617abc27f feat: add picked_up (Вывезено) status — terminal status for self-pickup orders 2026-06-12 18:17:44 +00:00
root d22302838b fix: driver assignment only on delivery tab, hidden on pickup tab 2026-06-12 17:20:29 +00:00
root 62475c7e48 fix: remove duplicate renderValue declaration 2026-06-12 15:48:50 +00:00
root 2f2dae686c refactor: Phase 3 resilience — ErrorBoundary, split saving states, extract useStopWords
- ErrorBoundary: Russian UI, compact mode for card-level errors, reload button
- ErrorBoundary wraps OrderDetailPanel in GroupDetailPage + DeliverySetDetailPanel
- Split isSavingDeliveryChoice into 3 independent states:
  isSavingDeliveryChoice (delivery tab save)
  isSavingDriverAssignment (driver assign)
  isSavingStatusChange (status change)
- Extract useStopWords hook + matchesStopWord to shared hooks/useStopWords.js
- Remove 3x duplicated matchesStopWord from OrderDetailPanel, DriverShipmentPanel, OrderCompositionPanel
- Remove useStopWords + supabase import from OrderDetailPanel
2026-06-12 15:47:55 +00:00
root 129175fed7 refactor: Phase 2 decomposition — extract CalendarWidget, StatusActionPanel, DriverAssignmentPanel
- CalendarWidget: eliminates duplicated calendar JSX (delivery + pickup variants)
- StatusActionPanel: status action buttons with onConfirmStatus callback
- DriverAssignmentPanel: driver selection with onDriverSelect/onConfirmDriver callbacks
- OrderDetailPanel reduced from 1510 to 1261 lines
- No UI changes — all props passed through, all class names preserved
2026-06-12 15:30:30 +00:00
root 4dde64ff5a refactor: Phase 1 stabilization — hooks ordering, deduplicate utils, extract shared constants
- P0-1: Move all hooks (useState, useCallback, useMemo) before early return to fix Rules of Hooks violation
- P0-3: Replace 7 inline isPickupOrder checks with single computed variable
- P1: Extract getErrorMessage, normalizeNom to shared utils/deliveryUtils.js
- P1: Replace duplicate STATUS_LABELS with DELIVERY_GROUP_STATUS_LABELS import
- P1: Add requires_address to DELIVERY_GROUP_STATUS_LABELS
- Remove duplicate getErrorMessage from useOrderGroups.js and OrderDetailPanel.jsx
- Remove duplicate normalizeNom from OrderDetailPanel.jsx and orderGroupRepository.js
2026-06-12 14:50:56 +00:00
root 1a665b5165 fix: TDZ crash — move agreedTypeMatchesTab after isEditingDate declaration 2026-06-12 13:34:05 +00:00
root 1cab6c886e fix: tab-aware agreed banner — show delivery form when switching tabs, not stale pickup banner 2026-06-12 13:25:29 +00:00
root fb5728ba43 fix: order numbers clickable+copy, expandable sub-accounts, preserve delivery address on pickup switch, opaque calendar, tab-aware date label 2026-06-12 13:19:57 +00:00
root 005d4467bc Apply 7 UI fixes: center badges, hide not-ready, customer address for pickup, compact calendars, confirm modals, hide driver panel for pickup, format dates 2026-06-12 12:49:48 +00:00
root fe2d8c4e9b fix: restore deleted data preparation vars in AdminDashboard (TDZ crash) 2026-06-12 12:21:23 +00:00
root 498faca24d feat: delivery/pickup switching in admin card + address field
- Added delivery address input field in manual agreement form (visible when delivery type)
- Pickup switching clears delivery_address in DB, delivery switching preserves/updates it
- useOrderGroups passes deliveryType, deliveryAddress, pickupDate, pickupTimeSlot to API
- orderGroupRepository: updateOrderGroupDeliveryChoice now handles delivery_type and address
- Pickup orders: address cleared, pickup_date/pickup_time_slot saved
- Delivery orders: address saved, pickup fields cleared
- Updated tests to match new payload structure
2026-06-12 08:23:41 +00:00
root 9aef4d49c0 fix: pickup display — detect from source_orders.ship, show correct labels, hide placeholder address
- orderGroupRepository: detect pickup from source_orders.ship='САМОВЫВОЗ' and address='САМОВЫВОЗ'
- orderGroupRepository: set effectiveDeliveryType='pickup' when source data indicates pickup even if DB says 'delivery'
- orderGroupRepository: clear deliveryAddress when it's just 'САМОВЫВОЗ' placeholder
- OrderDetailPanel: dynamic header 'Карточка группы самовывоза' vs 'Карточка группы доставки'
- OrderDetailPanel: subtitle now includes orderNumbers for visibility
- OrderDetailPanel: label changed from 'Номер счёта' to 'Заказ' with '+N сч.' for sub-bills
- GroupDetailPage: neutral 'Группа не найдена' instead of 'Группа доставки не найдена'
- Added pickup-specific test case
2026-06-12 08:14:20 +00:00
root ec9b28fa6f fix: resolve merge conflict - remove duplicate order declaration in GroupDetailPage 2026-06-12 07:48:20 +00:00
root 55422ec65a feat: add skeleton loading states across all pages
- New Loading.jsx component library (Skeleton, SkeletonPanel, SkeletonPage, SkeletonTable, Spinner, LoadingBlock)
- Dashboard: SkeletonTable/SkeletonPage during isLoading
- OrdersTable, LogisticsReadinessBoard, DriverDeliveryPlanner: show skeleton instead of empty state
- ChatTimeline, DeliverySlotsPicker, GroupDetailPage: skeleton while loading
- AdminDashboard, StopWordsPanel, UserManagementPanel, ErrorLogPanel, ActionLogPanel: skeleton during initial load
- NotificationSettings: skeleton for push toggle and notification preferences
- ClientDeliveryPage: skeleton bars instead of text-only loading
2026-06-12 07:46:58 +00:00
root 69a2023ec1 feat: suggestions panel for employees + admin review 2026-06-10 18:24:58 +00:00
root 7e43f9e990 feat: requires_address status + address input for pickup-to-delivery switch
- New status: requires_address (Требуется адрес) in deliveryWorkflow
- ClientDeliveryPage: address input shown when delivery chosen without address on file
- OrderDetailPanel: requires_address status badge + address input for manager
- confirm_delivery_choice_by_token RPC: p_delivery_address param, sets requires_address status
- Edge function: delivery_address passed to RPC
- deliveryInvitationApi: deliveryAddress param
- CHECK constraint: requires_address, address_required added
- PickupSlotsPicker: styled storage conditions info block
2026-06-10 14:52:17 +00:00
root c774c6a362 feat: add pickup analytics — RPC, hook, PickupStatsPanel, dashboard integration 2026-06-10 12:32:51 +00:00
root 14fe89f899 docs: update documentation for pickup (самовывоз) feature and autodeploy 2026-06-10 12:22:56 +00:00
root 3651dbb484 chore: cleanup 2026-06-10 12:12:10 +00:00
root 813852ff45 fix: JSX structure errors + orderGroupRepository syntax 2026-06-10 12:12:04 +00:00
root e05613ac1d feat: add pickup (самовывоз) delivery type
- New status pickup in delivery workflow
- DB: delivery_type, pickup_date, pickup_time_slot columns
- Client page: tabs Доставка/Самовывоз with PickupSlotsPicker
- PickupSlotsPicker: today/tomorrow/day-after with half-day slots
- Storage notice: free 2 workdays, then 300₽/day
- OrderDetailPanel: delivery type tabs, pickup date/time, status button
- Edge function: delivery_type/pickup fields in confirm-delivery-choice
- RPC: confirm_delivery_choice_by_token updated for pickup
- orderGroupRepository: full pickup field mapping
2026-06-10 12:02:46 +00:00
root 3c22eb71ab fix: case-insensitive stop word matching 2026-05-28 19:55:57 +00:00
root dda8f8fe1f feat: add stopWords to delivery invitation RPC response 2026-05-28 19:24:40 +00:00
root 50f504c2ff fix: city regex requires mandatory dot+space — no more Гор→ор, Годная→одная 2026-05-28 11:05:38 +00:00
root 9e992d8280 fix: extractCity uses known cities list instead of first-chunk heuristic 2026-05-28 10:57:03 +00:00
root 2d1bca9cb4 fix: default city=Севастополь when not specified 2026-05-28 10:33:38 +00:00
root 6f29948f8a fix: remove Группы tab from logistician, remove Справка, Телефон→Город, Заказы→Водитель, add city filter 2026-05-28 10:29:13 +00:00
root bb439a4d93 fix: clean action log — no UUID/ID duplicates, smart expanded row 2026-05-28 10:22:31 +00:00
root a5b9dc1153 fix: ternary syntax in assignDriver logPayload 2026-05-28 10:18:29 +00:00
root 1e0344ee34 fix: action log — resolve UUID to names, show old→new, add oldValue for driver reassignment 2026-05-28 10:17:29 +00:00
root 581a275bc0 fix: action log — readable driver names, no duplicate columns, meaningful descriptions 2026-05-28 10:11:57 +00:00
root 805ceca152 fix: 8 bugfixes — current undefined, auth email, sequential statuses, problem dialog, action log details, KPI layout, date sort, driver lock 2026-05-28 10:03:19 +00:00
root 2ee437e83e fix: add Ошибки tab to admin nav + already fixed client→supabase in ErrorLogPanel 2026-05-27 15:33:06 +00:00
root 7dfdd91798 fix: comprehensive error logging — all errors now captured in client_error_logs
- safeSupabaseCall: logs caught errors via logError
- AuthContext: logs sendOtp, verifyOtp errors
- ErrorLogPanel: fixed client→supabase reference in delete functions
- AuthContext: sets window.__supersam_user_id__ on auth state change
2026-05-27 15:30:33 +00:00
root dac8450586 feat: action_logs — журнал действий сотрудников с фильтрами 2026-05-27 15:12:46 +00:00
root 8f50a68687 feat: delivery_date_source tracking + manual date in analytics funnel 2026-05-27 14:59:57 +00:00
root f90b476bfd fix: hide delivery choice flow after save, remove confusing hero block 2026-05-27 14:40:20 +00:00
root 136e5c826a fix: parseOrderList collects ALL source orders, edge fn returns orderItems 2026-05-27 14:36:00 +00:00
root d0f2a72dda feat: stop words CRUD + client-side filtering 2026-05-27 14:28:52 +00:00
root a764213a77 feat: logistics board as grouped tables with column headers 2026-05-27 14:16:00 +00:00
root f8c6c538b7 compact: logistics readiness cards — single-line on desktop, stacked on mobile 2026-05-27 14:12:39 +00:00
root 0930ea9c26 fix: back button uses browser history instead of hardcoded /dashboard 2026-05-27 14:06:54 +00:00
root db555bbf55 remove: drop readiness column from orders table 2026-05-27 14:03:57 +00:00
root d43dd04e9b feat: add orders table tab for logistician role 2026-05-27 13:59:21 +00:00
root 8dcab4da77 fix: show delivery date card for agreed+ statuses, not just agreed 2026-05-27 12:57:31 +00:00
root 470270118b fix: driver_assigned status on assign + driver column in table 2026-05-27 12:48:48 +00:00
root 58dc110007 feat: allow admin/logistician to re-edit delivery date after agreement 2026-05-27 12:44:43 +00:00