3.5 KiB
3.5 KiB
Release v1.2.3 (2026-02-10)
Summary
Unified synchronization functionality with event-driven UI updates. Resolved user confusion about duplicate sync buttons by implementing a single sync source with automatic page refreshes.
Changes
Main Feature: Sync Event System
- Added
sync-completedevent in base.html'ssyncAction()function- Dispatched after successful
/api/sync/allor/api/sync/push - Includes endpoint and response data in event detail
- Enables pages to react automatically to sync completion
- Dispatched after successful
Configs Page (configs.html)
- Removed "Импорт с сервера" button - duplicate functionality no longer needed
- Updated layout - changed from 2-column grid to single button layout
- Removed
importConfigsFromServer()function - functionality now handled by navbar sync - Added sync-completed event listener:
- Automatically reloads configurations list after sync
- Resets pagination to first page
- New configurations appear immediately without manual refresh
Projects Page (projects.html)
- Wrapped initialization in DOMContentLoaded:
- Moved
loadProjects()and all event listeners inside handler - Ensures DOM is fully loaded before accessing elements
- Moved
- Added sync-completed event listener:
- Automatically reloads projects list after sync
- New projects appear immediately without manual refresh
Pricelists Page (pricelists.html)
- Added sync-completed event listener to existing DOMContentLoaded:
- Automatically reloads pricelists when sync completes
- Maintains existing permissions and modal functionality
Benefits
User Experience
- ✅ Single "Синхронизация" button in navbar - no confusion about sync sources
- ✅ Automatic list updates after sync - no need for manual F5 refresh
- ✅ Consistent behavior across all pages (configs, projects, pricelists)
- ✅ Better feedback: toast notification + automatic UI refresh
Architecture
- ✅ Event-driven loose coupling between navbar and pages
- ✅ Easy to extend to other pages (just add event listener)
- ✅ No backend changes needed
- ✅ Production-ready
Breaking Changes
/api/configs/importendpoint still works but UI button removed- Users should use navbar "Синхронизация" button instead
- Backend API remains unchanged for backward compatibility
Files Modified
web/templates/base.html- Added sync-completed event dispatchweb/templates/configs.html- Event listener + removed duplicate UIweb/templates/projects.html- DOMContentLoaded wrapper + event listenerweb/templates/pricelists.html- Event listener for auto-refresh
Stats: 4 files changed, 59 insertions(+), 65 deletions(-)
Commits
99fd80b- feat: unify sync functionality with event-driven UI updates
Testing Checklist
- Configs page: New configurations appear after navbar sync
- Projects page: New projects appear after navbar sync
- Pricelists page: Pricelists refresh after navbar sync
- Both
/api/sync/alland/api/sync/pushtrigger updates - Toast notifications still show correctly
- Sync status indicator updates
- Error handling (423, network errors) still works
- Mode switching (Active/Archive) works correctly
- Backward compatibility maintained
Known Issues
None - implementation is production-ready
Migration Notes
No migration needed. Changes are frontend-only and backward compatible:
- Old
/api/configs/importendpoint still functional - No database schema changes
- No configuration changes needed