feat(notifications): add per-user notification system with inbox, email, and webhook targets
- Add UserNotificationTarget, UserNotificationPreference, InAppNotification models - Add migration 025_add_user_notifications (tables + indexes) - Add app/utils/user_notification.py dispatch service - Add app/api/notifications.py REST endpoints (inbox, targets, preferences) - Add app/views/notifications.py view route - Add frontend/templates/notifications_dashboard.html Alpine.js dashboard - Add bell icon with unread badge in base.html nav (desktop + mobile) - Register routers in app/api/__init__.py and app/views/__init__.py - Add 32 unit tests in tests/test_notifications_api.py Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
@@ -18,6 +18,7 @@ from app.views.help import router as help_router # Built-in help / How-To docs
|
||||
from app.views.imap_accounts import router as imap_accounts_router
|
||||
from app.views.integrations import router as integrations_router # Unified integrations dashboard
|
||||
from app.views.license_routes import router as license_router # Add the license router
|
||||
from app.views.notifications import router as notifications_router
|
||||
from app.views.onboarding import router as onboarding_router
|
||||
from app.views.onedrive import router as onedrive_router
|
||||
from app.views.pipelines import router as pipelines_router # Processing pipelines
|
||||
@@ -52,4 +53,5 @@ router.include_router(onboarding_router) # User onboarding wizard
|
||||
router.include_router(pipelines_router) # Processing pipelines
|
||||
router.include_router(imap_accounts_router) # Per-user IMAP ingestion accounts
|
||||
router.include_router(integrations_router) # Unified integrations dashboard
|
||||
router.include_router(notifications_router) # User notification dashboard
|
||||
router.include_router(help_router) # Built-in help / How-To docs
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
"""View route for the notifications dashboard."""
|
||||
|
||||
import logging
|
||||
|
||||
from fastapi import Request
|
||||
|
||||
from app.views.base import APIRouter, require_login, templates
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
router = APIRouter()
|
||||
|
||||
|
||||
@router.get("/notifications")
|
||||
@require_login
|
||||
async def notifications_dashboard(request: Request):
|
||||
"""Render the notifications dashboard."""
|
||||
return templates.TemplateResponse(
|
||||
"notifications_dashboard.html",
|
||||
{"request": request, "page_title": "Notifications"},
|
||||
)
|
||||
Reference in New Issue
Block a user