Files
analiticaNucleo/nuxt4-app/app/app.vue
josedario87 b6dc08e599
All checks were successful
build-and-deploy / build-and-deploy (push) Successful in 48s
Feat: Implementar sistema de notificaciones con historial por usuario
- Crear composable useNotifications con gestión por localStorage
  - Almacenamiento separado por usuario usando UID de Authentik
  - Auto-limpieza de notificaciones mayores a 30 días
  - Sincronización automática entre pestañas
  - Filtrado por tipo, búsqueda y gestión completa

- Crear wrapper useToast para guardar toasts automáticamente
  - Intercepta todos los toasts de la aplicación
  - Guarda historial sin afectar funcionalidad existente

- Implementar endpoints de API para notificaciones del backend
  - POST /api/notifications/send para enviar notificaciones
  - GET /api/notifications/list para obtener pendientes

- Actualizar página de notificaciones con funcionalidad real
  - Búsqueda y filtros por tipo (info, warning, success, error)
  - Eliminar individual o todas las notificaciones
  - Marcar como leídas individual o todas
  - Badges de origen (toast, backend, manual)
  - Estados vacíos con mensajes informativos

- Actualizar badge del sidebar con contador dinámico
  - Muestra número real de notificaciones no leídas
  - Se oculta cuando no hay notificaciones

- Inicializar sistema en app.vue
  - Auto-inicialización al montar la app
  - Limpieza automática de notificaciones antiguas
2025-10-30 18:03:37 -06:00

47 lines
1.1 KiB
Vue

<template>
<UApp>
<div class="brand-shell text-[var(--brand-text)]">
<NuxtRouteAnnouncer />
<NuxtLayout>
<NuxtPage />
</NuxtLayout>
</div>
</UApp>
</template>
<script setup lang="ts">
// Inicializar sistema de temas
const { loadTheme, initStorageListener, cleanupStorageListener } = useTheme()
// Inicializar sistema de notificaciones
const { initialize: initNotifications, cleanupOldNotifications } = useNotifications()
// Signal that the app is ready
onMounted(() => {
// Cargar tema guardado (o aplicar el por defecto)
loadTheme()
// Inicializar sincronización de tema entre pestañas
initStorageListener()
// Inicializar sistema de notificaciones
initNotifications()
// Limpiar notificaciones antiguas (> 30 días)
cleanupOldNotifications()
// Add class to HTML element to hide loading screen
if (process.client) {
// Small delay to ensure everything is painted
setTimeout(() => {
document.documentElement.classList.add('nuxt-ready')
}, 100)
}
})
// Limpiar listeners al desmontar
onBeforeUnmount(() => {
cleanupStorageListener()
})
</script>