## ST-3.3 Documentation (3 SP) - Add 11 page specification files documenting 25 pages - Create docs/05-frontend/pages/ directory - Specs: Goals, MLM, Portfolio, RBAC, Notifications, Analytics, Audit, Storage, Webhooks, Settings - Add _INDEX.md with complete listing ## ST-3.4 Dead Code Analysis (1 SP) - Analyze usePortfolio hook usage (18/21 functions used) - Document components ready for future use - Decision: Keep all code as preparation for features - Create DEAD-CODE-REPORT.md ## Frontend Submodule - WCAG improvements (11 files) - 160 unit tests (8 new test files) Sprint 3 (P2) completed: 14 SP Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
4.8 KiB
4.8 KiB
Notifications Admin Pages Specification
Modulo: notifications Ultima actualizacion: 2026-02-03 Total Paginas: 2
1. NotificationsPage
Ruta: /dashboard/notifications
Archivo: src/pages/dashboard/notifications/NotificationsPage.tsx
Descripcion
Centro de notificaciones del usuario. Muestra notificaciones recibidas con tabs para filtrar y configurar preferencias.
Componentes Utilizados
- Tab Navigation - Tabs All/Unread/Settings
- Notification Item - Card de notificacion con acciones
- Preferences Section - Toggles de preferencias
- Pagination - Navegacion de paginas
- Icons: Bell, CheckCheck, ExternalLink, Settings, Mail, Smartphone, MessageSquare, FileText (lucide-react)
Hooks Utilizados
useNotifications({page, limit, unreadOnly})- Lista notificacionesuseUnreadCount()- Contador de no leidasuseMarkAsRead()- Marca como leidauseMarkAllAsRead()- Marca todas como leidasuseNotificationPreferences()- Obtiene preferenciasuseUpdatePreferences()- Actualiza preferenciasgetNotificationTypeColor()- Color segun tipoformatNotificationTime()- Formato de tiempo
Funcionalidades
- Ver notificaciones con titulo, cuerpo, tiempo
- Filtrar por todas o solo no leidas
- Marcar individual como leida
- Marcar todas como leidas
- Ver action link si existe
- Configurar preferencias por canal (email, push, in-app, SMS)
- Navegar a gestion de templates
Estados
- Loading: Spinner centrado
- Success: Lista de notificaciones
- Empty All: "No notifications yet"
- Empty Unread: "No unread notifications"
Acciones del Usuario
| Accion | Resultado |
|---|---|
| Click tab "All" | Muestra todas |
| Click tab "Unread" | Filtra no leidas |
| Click tab "Settings" | Muestra preferencias |
| Click "Mark as read" | Marca como leida |
| Click "Mark all as read" | Confirm + marca todas |
| Click action link | Navega a URL |
| Toggle preferencia | Actualiza setting |
| Click "Manage Templates" | Navega a templates |
| Click Previous/Next | Cambia pagina |
Permisos Requeridos
- Usuario autenticado
2. TemplatesPage
Ruta: /dashboard/notifications/templates
Archivo: src/pages/dashboard/notifications/TemplatesPage.tsx
Descripcion
Gestion de templates de notificacion. Permite crear, editar, previsualizar y gestionar templates para diferentes canales.
Componentes Utilizados
- Search Input - Busqueda de templates
- Channel Filter - Filtro por canal (email, push, in_app, sms)
- Category Filter - Filtro por categoria
- Templates Grid - Grid de cards de template
- TemplateCard - Card con preview y acciones
- TemplateForm - Formulario de creacion/edicion
- TemplatePreview - Modal de preview
- Delete Confirmation Modal - Modal de confirmacion
- Icons: Plus, ArrowLeft, FileText, AlertTriangle, Search, Filter (lucide-react)
Hooks Utilizados
useNotificationTemplates()- Lista templatesuseCreateTemplate()- Crea templateuseUpdateTemplate()- Actualiza templateuseDeleteTemplate()- Elimina templateuseToggleTemplateActive()- Activa/desactiva template
Funcionalidades
- Buscar templates por nombre, codigo o descripcion
- Filtrar por canal (email, push, in_app, sms)
- Filtrar por categoria
- Ver grid de templates con preview rapido
- Toggle active/inactive desde card
- Crear nuevo template con formulario completo
- Editar template existente
- Previsualizar template
- Eliminar template con confirmacion
Estados
- View Modes: list, create, edit
- Loading: Spinner en grid
- Success: Grid de templates
- Empty: "No templates yet" + CTA
- Filtered Empty: "No matching templates"
Acciones del Usuario
| Accion | Resultado |
|---|---|
| Click "Create Template" | Cambia a vista create |
| Buscar | Filtra templates |
| Seleccionar canal | Filtra por canal |
| Seleccionar categoria | Filtra por categoria |
| Click edit en card | Cambia a vista edit |
| Click preview en card | Abre modal preview |
| Click delete en card | Abre modal confirm |
| Toggle active | Activa/desactiva |
| Submit form | Crea o actualiza |
| Click "Cancel" | Vuelve a lista |
| Confirm delete | Elimina template |
Permisos Requeridos
notifications:read- Ver templatesnotifications:write- Crear/editar/togglenotifications:delete- Eliminar templates
Notas
- Los templates usan variables con formato
{{variable}} - Cada canal tiene campos especificos (email tiene subject, html_body)
- La preview muestra como se veria la notificacion
Canales de Notificacion
| Canal | Campos | Descripcion |
|---|---|---|
| subject, html_body, text_body | Correo electronico | |
| push | title, body | Notificacion push del navegador |
| in_app | title, body, action_url | Notificacion dentro de la app |
| sms | body | Mensaje SMS |
Documentacion generada - Template SaaS - 2026-02-03