Commit Graph

64 Commits

Author SHA1 Message Date
2eb0cfa459 Feat: agregar botones de debug para limpiar datos y exportar backup
All checks were successful
build-and-deploy / build-and-deploy (push) Successful in 1m6s
- Agregar botón 'LIMPIAR DATOS' que hace TRUNCATE de tablas sin borrar estructura
- Agregar botón 'EXPORTAR BACKUP' que descarga pg_dump completo de la BD
- Crear endpoint POST /api/debug/clear-data para TRUNCATE CASCADE
- Crear endpoint POST /api/debug/export-database para pg_dump con descarga
- Mantener estructura de botones temporales de debug existentes
- Incluir confirmaciones y manejo de errores apropiados
2025-11-22 04:10:50 -06:00
f3a170c882 Feat: agregar 4 flujos complejos al seed y filtrar lotes finales en grafos
All checks were successful
build-and-deploy / build-and-deploy (push) Successful in 1m6s
- Agregar flujo 5: Las Nubes (Geisha) + El Paraíso (Castillo) → SEC-EXOTIC-001
- Agregar flujo 6: Santa Rita (Caturra Rojo) → División → SEC-SRT-PREM-001 + SEC-SRT-STD-001
- Agregar flujo 7: Trinidad + San José + Villa Rosa → Triple Blend → SEC-TRIPLE-001
- Agregar flujo 8: Mezcla de segundas calidades → SEC-COMERCIAL-001
- Implementar filtro soloFinales en queries, API y composable
- Modificar tab Grafos para mostrar solo lotes finales (sin hijos)
- Actualizar descripción de tab Grafos para clarificar el filtro
- Total: 7 lotes finales de secado para visualización de grafos
2025-11-22 04:05:24 -06:00
a5df3159ca Feat: reemplazar emoji con icono en header y crear seed complejo con múltiples productores
All checks were successful
build-and-deploy / build-and-deploy (push) Successful in 17s
2025-11-22 03:43:52 -06:00
599a7999c9 Feat: agregar creación de lotes de input en formulario de operación
All checks were successful
build-and-deploy / build-and-deploy (push) Successful in 1m6s
Ahora el formulario de crear operación permite crear nuevos lotes de
entrada directamente desde el paso 2, sin necesidad de salir del modal.

Cambios:
- Agregar botón "Nuevo lote de entrada" en el paso 2
- Mostrar formulario inline para crear lote con código, tipo y cantidad
- Al crear el lote, se agrega automáticamente a la lista de disponibles
- Se selecciona automáticamente como input de la operación
- Importar createLote del composable useLotes
- Agregar estado showCreateInputForm y creatingInput
- Implementar funciones cancelCreateInput y handleCreateInput

Beneficios:
- Flujo más ágil sin interrupciones
- Consistencia con la creación de lotes de output
- Mejor experiencia de usuario
2025-11-22 03:33:19 -06:00
cb0261dad3 Fix: múltiples correcciones de UI y funcionalidad
All checks were successful
build-and-deploy / build-and-deploy (push) Successful in 1m6s
Cambios realizados:

1. Favicon:
   - Actualizar configuración en app.vue para usar iconos PNG correctos
   - Agregar links con tamaños 32x32 y 16x16
   - Actualizar theme-color a #16a34a (verde del proyecto)

2. Modal de Crear Operación:
   - Reestructurar con slots #header y #body para scroll correcto
   - Extraer header del Form.vue y moverlo al modal
   - Eliminar UCard del componente Form.vue
   - Agregar max-h-[80vh] para limitar altura
   - Ahora muestra scrollbar vertical cuando el contenido excede el espacio

3. USelect de filtro de operaciones:
   - Corregir de :options a :items (API correcta de NuxtUI v4)
   - Agregar label-key y value-key
   - Agregar computed selectOptions (igual que en Lotes)
   - Cambiar filtroTipo de ref('') a ref<string | null>(null)
   - Ahora el filtro funciona correctamente

Archivos modificados:
- app/app.vue: Configuración favicon y modal operaciones
- app/components/operaciones/Form.vue: Eliminar UCard
- app/components/operaciones/Table.vue: Corregir USelect
2025-11-22 03:29:27 -06:00
fd0f5e3518 Fix: agregar slot #body al modal de trazabilidad
All checks were successful
build-and-deploy / build-and-deploy (push) Successful in 1m6s
El componente LotesTrazabilidad no se estaba renderizando porque
no estaba dentro del slot #body. El UModal de NuxtUI requiere que
el contenido esté explícitamente en el slot #body para que se
renderice correctamente.

Cambios:
- Envolver LotesTrazabilidad en <template #body>
- El modal ahora muestra correctamente el contenido con scroll vertical
2025-11-22 03:14:41 -06:00
8816900edd Mejoras en el grafo de trazabilidad
All checks were successful
build-and-deploy / build-and-deploy (push) Successful in 1m6s
- Corregir referencia a colorMode (agregar .value)
- Optimizar renderizado de aristas usando paths SVG
- Mejorar posicionamiento de nodos con agrupación por padre
- Evitar solapamiento de nodos hermanos
- Ajustar cálculo dinámico del ancho del SVG
2025-11-22 02:57:12 -06:00
22fe3547b5 Fix: corregir visualización del modal de detalle de operación
All checks were successful
build-and-deploy / build-and-deploy (push) Successful in 1m6s
- Mover v-if al UCard completo para renderizado consistente
- Agregar configuración de UI con ancho max-w-2xl
- Remover v-if redundantes internos
- Seguir el patrón de otros modales que funcionan correctamente
2025-11-22 02:53:40 -06:00
883896a864 fix 3
All checks were successful
build-and-deploy / build-and-deploy (push) Successful in 1m6s
2025-11-22 02:34:29 -06:00
ef7554dafd fix 2
All checks were successful
build-and-deploy / build-and-deploy (push) Successful in 1m5s
2025-11-22 02:29:24 -06:00
8a7a409de6 fix
All checks were successful
build-and-deploy / build-and-deploy (push) Successful in 1m5s
2025-11-22 02:25:04 -06:00
c4be9649b8 mejoras UI 5
All checks were successful
build-and-deploy / build-and-deploy (push) Successful in 1m5s
2025-11-22 02:19:32 -06:00
e698cc795a fix
All checks were successful
build-and-deploy / build-and-deploy (push) Successful in 1m6s
2025-11-22 02:12:42 -06:00
028d7e54c8 mejoras UI 4
Some checks failed
build-and-deploy / build-and-deploy (push) Failing after 11s
2025-11-22 02:07:57 -06:00
99a2137daa mejoras UI 3
All checks were successful
build-and-deploy / build-and-deploy (push) Successful in 1m5s
2025-11-22 01:57:19 -06:00
1478ad9e09 mejoras de UI 2
All checks were successful
build-and-deploy / build-and-deploy (push) Successful in 1m6s
2025-11-22 01:50:46 -06:00
990b87fca0 mejorar de UI
All checks were successful
build-and-deploy / build-and-deploy (push) Successful in 1m4s
2025-11-22 01:44:17 -06:00
f551fa67ed mejorando la trazabilidad
All checks were successful
build-and-deploy / build-and-deploy (push) Successful in 1m5s
2025-11-22 01:18:37 -06:00
0bdb5013f7 veamo
All checks were successful
build-and-deploy / build-and-deploy (push) Successful in 1m6s
2025-11-22 01:10:37 -06:00
47c42cbcf3 seguimos confiando en codex
All checks were successful
build-and-deploy / build-and-deploy (push) Successful in 1m4s
2025-11-22 00:57:13 -06:00
9b1628485f codex es otro pedo, lo soluciono
All checks were successful
build-and-deploy / build-and-deploy (push) Successful in 1m7s
2025-11-22 00:48:21 -06:00
12da05bfe7 Fix: Envolver componentes en ClientOnly para evitar error SSR
All checks were successful
build-and-deploy / build-and-deploy (push) Successful in 1m7s
Los componentes LotesTable y OperacionesTable usan UTable de Nuxt UI,
que internamente usa @tanstack/table-core. Esta librería no puede
renderizarse en el servidor (SSR), causando error 500.

Solución: Envolver los componentes en <ClientOnly> para que solo se
rendericen en el navegador.
2025-11-21 23:46:36 -06:00
bd31838139 Debug: Agregar plugin de error handler y más logging
All checks were successful
build-and-deploy / build-and-deploy (push) Successful in 1m5s
- Crear plugin error-handler.ts para capturar todos los errores
- Captura errores de app:error, vue:error y errorHandler
- Agregar logs en script setup de componentes
- Logs antes y después de llamar a useLotes()
- Esto nos mostrará exactamente dónde crashea la app
2025-11-21 23:42:08 -06:00
b0b179d945 Debug: Agregar logging extensivo en servidor y cliente
All checks were successful
build-and-deploy / build-and-deploy (push) Successful in 1m6s
- Logs en useLotes() para ver cuándo se llama
- Logs en fetchLotes() para rastrear el flujo
- Logs en API /api/lotes para ver requests del servidor
- Todos los logs con emojis para fácil identificación:
  🔵 = Cliente/Composable
  🟦 = Servidor/API
   = Errores
2025-11-21 23:39:11 -06:00
2ca062b9e0 Fix: Deshabilitar useToast en SSR para evitar crash
All checks were successful
build-and-deploy / build-and-deploy (push) Successful in 1m6s
El problema era que useToast() no funciona en Server-Side Rendering.
Cuando los componentes se renderizaban en el servidor, crasheaba con error 500.

Cambios:
- Hacer que toast sea opcional: process.client ? useToast() : null
- Cambiar todos toast.add() a toast?.add()
- Ahora el composable funciona tanto en servidor como en cliente
2025-11-21 23:36:01 -06:00
da5032ad54 Debug: Agregar manejo robusto de errores en componentes
All checks were successful
build-and-deploy / build-and-deploy (push) Successful in 1m6s
- Agregar try-catch en loadLotes/loadOperaciones
- Agregar try-catch en onMounted y watch
- Agregar estado de error y mostrar mensaje en UI
- Agregar console.log detallados para debug
- Mostrar errores en tarjeta roja sin crashear la app
2025-11-21 23:30:12 -06:00
01e99609c9 Fix: Restaurar componentes completos de Lotes y Operaciones
All checks were successful
build-and-deploy / build-and-deploy (push) Successful in 1m5s
- Restaurar LotesTable completo con onMounted y watch
- Habilitar carga automática de datos
- Base de datos recreada con credenciales correctas
- Conexión PostgreSQL funcionando correctamente
2025-11-21 23:25:16 -06:00
120e1871e5 Test: Simplificar LotesTable para debug de hidratación
All checks were successful
build-and-deploy / build-and-deploy (push) Successful in 2m30s
Componente ultra simple sin composables complejos ni Nuxt UI
para aislar el problema de hidratación SSR.
2025-11-21 23:07:08 -06:00
039bf47d21 masiso
All checks were successful
build-and-deploy / build-and-deploy (push) Successful in 1m4s
2025-11-21 23:03:31 -06:00
acafcd1390 Fix: Usar nombres correctos de componentes LotesLotesTable y OperacionesOperacionesTable
All checks were successful
build-and-deploy / build-and-deploy (push) Successful in 16s
2025-11-21 23:00:19 -06:00
a385f58500 otra vez cambiesito facil de codex 2025-11-21 22:58:45 -06:00
85bcd5737c Debug: Deshabilitar onMounted y watch en componentes de tablas
All checks were successful
build-and-deploy / build-and-deploy (push) Successful in 1m3s
2025-11-21 22:55:17 -06:00
c5d11433e3 Debug: Importar componentes explícitamente en app.vue
All checks were successful
build-and-deploy / build-and-deploy (push) Successful in 1m4s
2025-11-21 22:49:51 -06:00
0857573334 Debug: Agregar console.logs a componentes de tablas
All checks were successful
build-and-deploy / build-and-deploy (push) Successful in 1m4s
2025-11-21 22:46:40 -06:00
c37dbc03f6 UI: Mejorar estilo del header principal
All checks were successful
build-and-deploy / build-and-deploy (push) Successful in 1m4s
2025-11-21 22:41:32 -06:00
00b508ffaf Debug: Agregar headers a tabs para verificar renderizado
All checks were successful
build-and-deploy / build-and-deploy (push) Successful in 15s
2025-11-21 20:48:09 -06:00
6f713a5ed1 Fix: Actualizar implementación de UTabs a Nuxt UI v4
All checks were successful
build-and-deploy / build-and-deploy (push) Successful in 1m4s
- Cambiar selectedTab de ref(0) a ref('lotes') para usar string
- Agregar propiedad value explícita a cada tab item
- Crear documento nuxt-ui-tips.md con documentación de cambios
- Los valores deben ser strings según API de v4
2025-11-21 20:44:04 -06:00
d9ea2fb18d Fix: Actualizar implementación de UModal a Nuxt UI v4
All checks were successful
build-and-deploy / build-and-deploy (push) Successful in 1m4s
- Cambiar v-model a v-model:open según API de v4
- Agregar slot #content requerido en todos los modales
- Corregir prop :ui para anchos personalizados (content en lugar de width)
- Aplicar clases correctas del tema para max-w-3xl y max-w-4xl
2025-11-21 20:35:58 -06:00
3a1c3fb7a2 Agregar botones de debug temporales para gestión de BD
All checks were successful
build-and-deploy / build-and-deploy (push) Successful in 16s
⚠️ CÓDIGO TEMPORAL - NO ELIMINAR SIN CONSULTAR ⚠️

Backend:
- POST /api/debug/reset-database - Borra todos los datos
- POST /api/debug/seed-database - Carga datos de ejemplo

Frontend:
- Card rojo con advertencias notorias
- Botones: 🗑️ BORRAR TODA LA BD y 🌱 CARGAR DATOS DE EJEMPLO
- Confirmación antes de resetear
- Estados de loading
- Alertas de éxito/error

Todos los archivos marcados con comentarios muy visibles:
⚠️⚠️⚠️ NO ELIMINAR SIN CONSULTAR A DARIO/DRAGANEL/NUCLEO000 ⚠️⚠️⚠️

Útil para desarrollo y debugging del sistema de trazabilidad.
2025-11-21 19:43:04 -06:00
f24f2373f9 Agregar botones de prueba de API en frontend
All checks were successful
build-and-deploy / build-and-deploy (push) Successful in 1m4s
- Botones simples para probar GET /api/lotes, /api/operaciones y trazabilidad
- Resultados se muestran en console.log del navegador
- Facilita debugging de la API desde el frontend
2025-11-21 19:28:59 -06:00
ee3dffa38e Implementar sistema completo de trazabilidad de lotes
Some checks failed
build-and-deploy / build-and-deploy (push) Failing after 1m47s
- Agregar PostgreSQL 16 con esquema completo
- Crear API endpoints para lotes y operaciones
- Implementar UI con Nuxt UI (tablas, formularios, trazabilidad)
- Agregar datos de ejemplo del flujo completo
- Documentar sistema en PLAN_TRAZABILIDAD.md
2025-11-21 18:39:04 -06:00
43bcf4a647 Add modular group verification system with frontend and backend checks
This commit implements a comprehensive, reusable group verification system:

Components:
- GroupCheckButton: Base component for group verification
- 7 specialized buttons: 3 real groups (authentik Admins, grupo-prueba, lvl0), 1 public access test, 2 system verification buttons
- All buttons support both frontend and backend verification modes

Backend:
- New API endpoint /api/auth/check-group for server-side group validation
- Reads Authentik headers and validates group membership

Frontend:
- Enhanced useAuthentik composable with hasGroup() and checkGroupBackend() methods
- Toast notifications for all verification results
- Smooth animations and color-coded visual feedback

UI Improvements:
- Organized layout with cards for different verification types
- Grid layout for group buttons
- Professional styling with hover effects and shadows
- Clear visual distinction between frontend/backend checks
2025-10-13 04:09:42 -06:00
f52f9f393f Add temporary debug endpoint to inspect all headers 2025-10-13 03:40:36 -06:00
1c901fa877 Remove debug endpoint 2025-10-13 03:21:59 -06:00
96fac68c6d Enhance user metadata display with app and outpost information
- Update AuthentikUser interface to include appSlug and outpostName
- Capture x-authentik-meta-app and x-authentik-meta-outpost headers
- Improve UserMetadata component to display connection information
- Filter empty groups from groups array
- Add documentation about available Authentik headers
2025-10-13 03:20:05 -06:00
1cba2f427e Add debug endpoint to inspect Authentik headers 2025-10-13 03:16:36 -06:00
3f5c4bc820 Fix TypeScript errors in useAuthentik composable
- Add AuthentikUser and AuthStatusResponse interfaces
- Fix toast color from 'gray' to 'neutral' (valid color)
- Remove invalid 'timeout' property from toast.add()
- Fix toast action from 'click' to 'onClick'
- Add proper type annotations for error handling
- Replace process.server with import.meta.server
- Make email, name, uid optional in AuthentikUser interface
2025-10-13 03:05:04 -06:00
d8f70f2aa5 Refactor auth components into individual button components
- Remove StatusBadges component (badges for authenticated, connected, groups)
- Remove ActionButtons component
- Create individual button components:
  - SessionStatusButton: handles session status check
  - ProfileButton: navigates to user profile
  - LogoutButton: handles user logout
  - LoginButton: reloads page to trigger login
- Update app.vue to use new individual button components
- Improve code quality with better component separation and reusability
2025-10-13 03:00:02 -06:00
87ae5b95e6 Improve PWA offline functionality and fix session caching
- Enable navigateFallback for offline navigation support
- Add JSON files to glob patterns for heroicons support
- Change Authentik API caching from NetworkFirst to NetworkOnly to prevent stale session data
- Add offline detection in checkSessionStatus with proper user feedback
- Add no-cache headers to /api/auth/status endpoint to prevent browser caching
- Show "Modo Offline" toast when user tries to check session while offline
2025-10-13 02:21:50 -06:00
226fcc7c64 Make 'Iniciar Sesión' button always visible alongside other buttons
Change button layout to show all 4 buttons at the same time:
- Estado de Sesión (info/blue)
- Ver Perfil (primary/blue)
- Cerrar Sesión (error/red)
- Iniciar Sesión (success/green) - NEW: always visible

This allows users to force a re-authentication by clicking 'Iniciar
Sesión' even when already authenticated, triggering Authentik login flow.
2025-10-13 02:02:45 -06:00