diff --git a/CHANGELOG.md b/CHANGELOG.md index 6b0345f..41706ef 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,16 @@ El formato está basado en [Keep a Changelog](https://keepachangelog.com/es-ES/1 - **Sincronización Continua Moodle (Fase 6):** Automatización de workers persistentes en background para el procesamiento continuo de la cola de Web Services Moodle 4.1. - **Pruebas de Carga y Hardening (Fase 6):** Pruebas de estrés de concurrencia y validación final de producción. +## [3.4.4] - 2026-10-07 +### Añadido & Mejorado (Dashboard Operativo de Bedelía y Admin) +- **Filtro Temporal "Mañana" en Switchers de Período y Cartelera:** + - Incorporación del botón de filtro temporal "Mañana" (`tomorrow`) de forma homogénea en los switchers de período del dashboard: + - **Panel de Percentiles de Ocupación de Aulas Físicas:** switcher con `Día (Hoy)`, `Mañana`, `Semana` y `Mes`, calculando métricas de ocupación y aulas libres para el día siguiente. + - **Panel de Comisiones Asignadas vs Sin Asignar:** visualización inmediata de comisiones con y sin aula asignada programadas para mañana. + - **Panel de Aulas Físicas Asignadas vs Libres:** tarjetas detalladas con aulas libres con botón de asignación directa y aulas en uso para el día de mañana. + - **Cartelera Operativa & Agenda de Clases:** pestaña "Clases de Mañana" con listado completo de cursadas presenciales y virtuales activas del día siguiente. + - Soporte completo en backend (`backend/app/routes/api/dashboard.py`): cálculo de `tomorrow_dt`, estadísticas en `filter_stats['tomorrow']`, `tomorrow_schedule_list` y soporte de sincronización de datos con frontend BFF. + ## [3.4.3] - 2026-10-07 ### Añadido & Refactorizado (Sincronización Google Sheets) - **Selección Granular de Entidades a Importar:** diff --git a/MEMORY.md b/MEMORY.md index b85e280..b1e74e2 100644 --- a/MEMORY.md +++ b/MEMORY.md @@ -119,6 +119,19 @@ Memoria del proyecto entre sesiones para la rama `dev`. - Versión incrementada a `v3.4.3` en Frontend y Backend. - Despliegue y verificación en caliente en el servidor institucional `10.0.0.217` (`https://eduspace.oemspot.com.ar`). +- **Sprint Dashboard Bedelía: Filtro Temporal "Mañana" en Switchers y Cartelera (v3.4.4)**: + - **Requerimiento**: Agregar "Mañana" en el filtro actual del dashboard que decía "Día (Hoy) / Semana / Mes". + - **Implementación**: + - **Backend API (`backend/app/routes/api/dashboard.py`)**: Cálculo de `tomorrow_dt` (00:00:00 a 23:59:59), agregando estadísticas en `filter_stats['tomorrow']` para percentiles de aulas físicas y comisiones asignadas/sin asignar, y `tomorrow_schedule_list` para la agenda de clases. + - **Frontend BFF & Vistas (`frontend/views/dashboard/dashbede.html`, `dashbede.html`, `dashadm.html`, `dashboard.html`)**: + - Switcher de percentiles: botón "Mañana" con actualización dinámica de percentiles de ocupación de aulas físicas. + - Switcher de comisiones: botón "Mañana" y bloques `#commBlock-tomorrow-unassigned` y `#commBlock-tomorrow-assigned`. + - Switcher de aulas físicas: botón "Mañana" y bloques `#classBlock-tomorrow-unassigned` (aulas libres con botón "Asignar") y `#classBlock-tomorrow-assigned` (aulas en uso). + - Cartelera Operativa & Agenda de Clases: botón "Clases de Mañana" y tabla `#bedeliaScheduleTomorrow` mostrando asignaturas, comisiones, docentes y enlaces para mañana. + - **Bump Semántico y Despliegue Obligatorio (Principio 9)**: + - Versión incrementada a `v3.4.4` en Frontend y Backend. + - Despliegue al servidor institucional `10.0.0.217` (`https://eduspace.oemspot.com.ar`) y verificación en caliente. + ## Próximos pasos 1. Continuar con los objetivos de la Fase 6 del Roadmap institucional (Docker-compose productivo, Nginx con SSL y automatización de workers continuos Moodle). 2. Monitoreo continuo de la experiencia de usuario en Bedelía, Cartelera del Día y Sincronización Académica. \ No newline at end of file diff --git a/ROADMAP.md b/ROADMAP.md index ba5164e..769fb22 100644 --- a/ROADMAP.md +++ b/ROADMAP.md @@ -2,7 +2,7 @@ ## Gestión de Espacios Áulicos, Asignación de Comisiones y Operatoria de Bedelía **Institución:** Universidad de la Ciudad de Buenos Aires (UniCABA) -**Versión:** 3.4.3 (Refactorización del Importador Google Sheets: Selección Granular y Grilla Interactiva) +**Versión:** 3.4.4 (Dashboard Bedelía: Filtro Temporal "Mañana" en Switchers y Cartelera Operativa) **Fecha de Actualización:** 07 de Octubre de 2026 **Rama Base:** `dev` diff --git a/backend/app/__init__.py b/backend/app/__init__.py index e0dfa44..e7b784c 100644 --- a/backend/app/__init__.py +++ b/backend/app/__init__.py @@ -6,7 +6,7 @@ from flask_babel import Babel, gettext as _ from config.config import Config # Initialize extensions -__version__ = "3.4.3" +__version__ = "3.4.4" db = SQLAlchemy() migrate = Migrate() cors = CORS() diff --git a/backend/app/routes/api/dashboard.py b/backend/app/routes/api/dashboard.py index ffb13fb..6559961 100644 --- a/backend/app/routes/api/dashboard.py +++ b/backend/app/routes/api/dashboard.py @@ -150,9 +150,13 @@ def get_stats(): upcoming_reservations = [serialize_reservation(r) for r in upcoming_reservations_q] milestones = [serialize_milestone(m) for m in milestones_q] - # ---- Bedelía: Filtros completos de Aulas y Comisiones por Día, Semana y Mes ---- + # ---- Bedelía: Filtros completos de Aulas y Comisiones por Día (Hoy), Mañana, Semana y Mes ---- import calendar today_dt = datetime.utcnow() + tomorrow_dt = today_dt + timedelta(days=1) + tomorrow_start = tomorrow_dt.replace(hour=0, minute=0, second=0, microsecond=0) + tomorrow_end = tomorrow_dt.replace(hour=23, minute=59, second=59, microsecond=0) + week_start = today_dt - timedelta(days=today_dt.weekday()) # Lunes week_start = week_start.replace(hour=0, minute=0, second=0, microsecond=0) week_end = week_start + timedelta(days=6, hours=23, minutes=59, seconds=59) @@ -166,11 +170,16 @@ def get_stats(): meses_esp = ['', 'Enero', 'Febrero', 'Marzo', 'Abril', 'Mayo', 'Junio', 'Julio', 'Agosto', 'Septiembre', 'Octubre', 'Noviembre', 'Diciembre'] weekday_name = dias_esp[today_dt.weekday()] month_name = meses_esp[today_dt.month] + tomorrow_weekday_name = dias_esp[tomorrow_dt.weekday()] + tomorrow_month_name = meses_esp[tomorrow_dt.month] date_labels = { 'today': f"Hoy · {weekday_name} {today_dt.strftime('%d/%m/%Y')}", 'today_short': f"{weekday_name} {today_dt.strftime('%d/%m')}", 'today_full': f"{weekday_name}, {today_dt.day} de {month_name} de {today_dt.year}", + 'tomorrow': f"Mañana · {tomorrow_weekday_name} {tomorrow_dt.strftime('%d/%m/%Y')}", + 'tomorrow_short': f"{tomorrow_weekday_name} {tomorrow_dt.strftime('%d/%m')}", + 'tomorrow_full': f"{tomorrow_weekday_name}, {tomorrow_dt.day} de {tomorrow_month_name} de {tomorrow_dt.year}", 'week': f"Semana del {week_start.strftime('%d/%m')} al {week_end.strftime('%d/%m/%Y')}", 'week_full': f"Semana del {week_start.strftime('%d/%m/%Y')} al {week_end.strftime('%d/%m/%Y')}", 'month': f"Mes de {month_name} {today_dt.year} ({month_start.strftime('%d/%m')} al {month_end.strftime('%d/%m/%Y')})", @@ -178,6 +187,12 @@ def get_stats(): } # Reservas por período + tomorrow_reservations_q = Reservation.query.filter( + Reservation.start_time >= tomorrow_start, + Reservation.start_time <= tomorrow_end + ).order_by(Reservation.start_time.asc()).all() + tomorrow_schedule_list = [serialize_reservation(r) for r in tomorrow_reservations_q] + week_reservations_q = Reservation.query.filter( Reservation.start_time >= week_start, Reservation.start_time <= week_end @@ -195,6 +210,11 @@ def get_stats(): if r.classroom_id: res_map_classroom_today.setdefault(r.classroom_id, []).append(r) + res_map_classroom_tomorrow = {} + for r in tomorrow_reservations_q: + if r.classroom_id: + res_map_classroom_tomorrow.setdefault(r.classroom_id, []).append(r) + res_map_classroom_week = {} for r in week_reservations_q: if r.classroom_id: @@ -211,6 +231,11 @@ def get_stats(): if r.commission_id: res_map_comm_today.setdefault(r.commission_id, []).append(r) + res_map_comm_tomorrow = {} + for r in tomorrow_reservations_q: + if r.commission_id: + res_map_comm_tomorrow.setdefault(r.commission_id, []).append(r) + res_map_comm_week = {} for r in week_reservations_q: if r.commission_id: @@ -273,10 +298,13 @@ def get_stats(): # 1. Hoy classrooms_assigned_today = [build_classroom_item(c, res_map_classroom_today[c.id]) for c in physical_classrooms_list if c.id in res_map_classroom_today] classrooms_unassigned_today = [build_classroom_item(c, []) for c in physical_classrooms_list if c.id not in res_map_classroom_today] - # 2. Semana + # 2. Mañana + classrooms_assigned_tomorrow = [build_classroom_item(c, res_map_classroom_tomorrow[c.id]) for c in physical_classrooms_list if c.id in res_map_classroom_tomorrow] + classrooms_unassigned_tomorrow = [build_classroom_item(c, []) for c in physical_classrooms_list if c.id not in res_map_classroom_tomorrow] + # 3. Semana classrooms_assigned_week = [build_classroom_item(c, res_map_classroom_week[c.id]) for c in physical_classrooms_list if c.id in res_map_classroom_week] classrooms_unassigned_week = [build_classroom_item(c, []) for c in physical_classrooms_list if c.id not in res_map_classroom_week] - # 3. Mes + # 4. Mes classrooms_assigned_month = [build_classroom_item(c, res_map_classroom_month[c.id]) for c in physical_classrooms_list if c.id in res_map_classroom_month] classrooms_unassigned_month = [build_classroom_item(c, []) for c in physical_classrooms_list if c.id not in res_map_classroom_month] @@ -284,10 +312,13 @@ def get_stats(): # 1. Hoy commissions_assigned_today = [build_comm_item(comm, res_map_comm_today[comm.id]) for comm in all_active_commissions if comm.id in res_map_comm_today] commissions_unassigned_today = [build_comm_item(comm, []) for comm in all_active_commissions if comm.id not in res_map_comm_today] - # 2. Semana + # 2. Mañana + commissions_assigned_tomorrow = [build_comm_item(comm, res_map_comm_tomorrow[comm.id]) for comm in all_active_commissions if comm.id in res_map_comm_tomorrow] + commissions_unassigned_tomorrow = [build_comm_item(comm, []) for comm in all_active_commissions if comm.id not in res_map_comm_tomorrow] + # 3. Semana commissions_assigned_week = [build_comm_item(comm, res_map_comm_week[comm.id]) for comm in all_active_commissions if comm.id in res_map_comm_week] commissions_unassigned_week = [build_comm_item(comm, []) for comm in all_active_commissions if comm.id not in res_map_comm_week] - # 3. Mes + # 4. Mes commissions_assigned_month = [build_comm_item(comm, res_map_comm_month[comm.id]) for comm in all_active_commissions if comm.id in res_map_comm_month] commissions_unassigned_month = [build_comm_item(comm, []) for comm in all_active_commissions if comm.id not in res_map_comm_month] @@ -310,6 +341,7 @@ def get_stats(): for comm in all_active_commissions: if comm.id in comm_ids_virtual: res_today = res_map_comm_today.get(comm.id, []) + res_tomorrow = res_map_comm_tomorrow.get(comm.id, []) res_week = res_map_comm_week.get(comm.id, []) res_month = res_map_comm_month.get(comm.id, []) v_link = comm.virtual_link or (res_today[0].virtual_link if res_today and res_today[0].virtual_link else '') @@ -331,10 +363,12 @@ def get_stats(): 'building': 'Campus Virtual', 'floor': 'Remoto ∞', 'today_classes': len(res_today), + 'tomorrow_classes': len(res_tomorrow), 'week_classes': len(res_week), 'month_classes': len(res_month), 'res_count': len(res_month), 'is_active_today': len(res_today) > 0, + 'is_active_tomorrow': len(res_tomorrow) > 0, 'assigned_summary': f"{comm.subject.name if comm.subject else 'Clase Virtual'} ({comm.schedule or 'Remoto'})" }) @@ -355,8 +389,10 @@ def get_stats(): # Compatibilidad hacia atrás para vistas existentes available_classrooms_today = classrooms_unassigned_today + available_classrooms_tomorrow = classrooms_unassigned_tomorrow available_classrooms_week = classrooms_unassigned_week available_classrooms_month = classrooms_unassigned_month + unassigned_commissions_tomorrow = commissions_unassigned_tomorrow unassigned_commissions_week = commissions_unassigned_week unassigned_commissions_month = commissions_unassigned_month @@ -386,6 +422,29 @@ def get_stats(): 'total': total_active_commissions } }, + 'tomorrow': { + 'label': date_labels['tomorrow'], + 'date_short': date_labels['tomorrow_short'], + 'date_full': date_labels['tomorrow_full'], + 'classrooms': { + 'assigned': classrooms_assigned_tomorrow, + 'unassigned': classrooms_unassigned_tomorrow, + 'assigned_count': len(classrooms_assigned_tomorrow), + 'unassigned_count': len(classrooms_unassigned_tomorrow), + 'assigned_pct': round((len(classrooms_assigned_tomorrow) / max(1, total_physical_count)) * 100, 1), + 'unassigned_pct': round((len(classrooms_unassigned_tomorrow) / max(1, total_physical_count)) * 100, 1), + 'total': total_physical_count + }, + 'commissions': { + 'assigned': commissions_assigned_tomorrow, + 'unassigned': commissions_unassigned_tomorrow, + 'assigned_count': len(commissions_assigned_tomorrow), + 'unassigned_count': len(commissions_unassigned_tomorrow), + 'assigned_pct': round((len(commissions_assigned_tomorrow) / max(1, total_active_commissions)) * 100, 1), + 'unassigned_pct': round((len(commissions_unassigned_tomorrow) / max(1, total_active_commissions)) * 100, 1), + 'total': total_active_commissions + } + }, 'week': { 'label': date_labels['week'], 'date_short': date_labels['week'], @@ -503,12 +562,14 @@ def get_stats(): 'assigned_today_pct': assigned_today_pct, 'unassigned_today_classrooms': unassigned_today_count, 'unassigned_today_pct': unassigned_today_pct, - 'total_active_commissions': total_active_commissions + 'total_active_commissions': total_active_commissions, + 'tomorrow_reservations': len(tomorrow_reservations_q) if 'tomorrow_reservations_q' in locals() else 0 }, 'audit_logs': audit_data, 'monthly_data': monthly_data, 'pending_reservations': pending_reservations, 'today_schedule_list': today_schedule_list, + 'tomorrow_schedule_list': tomorrow_schedule_list if 'tomorrow_schedule_list' in locals() else [], 'week_schedule_list': week_schedule_list, 'upcoming_reservations': upcoming_reservations, 'milestones': milestones, @@ -516,10 +577,12 @@ def get_stats(): 'show_role_banner': SystemSetting.get_value('dashboard_role_banner_enabled', 'true') in ['true', 'True', '1', True] }, 'bedelia': { + 'unassigned_commissions_tomorrow': unassigned_commissions_tomorrow if 'unassigned_commissions_tomorrow' in locals() else [], 'unassigned_commissions_week': unassigned_commissions_week, 'unassigned_commissions_month': unassigned_commissions_month, 'unassigned_commissions_general': unassigned_commissions_general, 'available_classrooms_today': available_classrooms_today, + 'available_classrooms_tomorrow': available_classrooms_tomorrow if 'available_classrooms_tomorrow' in locals() else [], 'available_classrooms_week': available_classrooms_week, 'available_classrooms_month': available_classrooms_month, 'virtual_rooms': virtual_rooms_data, diff --git a/backend/app/routes/api/openapi.py b/backend/app/routes/api/openapi.py index cfad23d..7880a55 100644 --- a/backend/app/routes/api/openapi.py +++ b/backend/app/routes/api/openapi.py @@ -7,7 +7,7 @@ OPENAPI_SPEC = { "info": { "title": "Edu-Space REST API", "description": "Enterprise Academic & Physical Space Management REST API with JWT Authentication and Role-Based Access Control.", - "version": "3.4.3" + "version": "3.4.4" }, "servers": [ { diff --git a/backend/setup.py b/backend/setup.py index 3d46df7..a31be7c 100644 --- a/backend/setup.py +++ b/backend/setup.py @@ -2,7 +2,7 @@ from setuptools import setup, find_packages setup( name="edu-space-admin", - version="3.4.3", + version="3.4.4", description="Administrative interface for Edu-Space Classroom Management System", author="Edu-Space Development Team", author_email="admin@edu-space.com", diff --git a/frontend/package.json b/frontend/package.json index cbd1669..8d6570c 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -1,6 +1,6 @@ { "name": "frontend", - "version": "3.4.3", + "version": "3.4.4", "description": "", "main": "index.js", "scripts": { diff --git a/frontend/src/app.js b/frontend/src/app.js index 9fab616..22878ff 100644 --- a/frontend/src/app.js +++ b/frontend/src/app.js @@ -85,9 +85,9 @@ const env = nunjucks.configure(path.join(__dirname, '../views'), { }); // Versiones institucionales del sistema -const APP_VERSION = '3.4.3'; -const FRONTEND_VERSION = '3.4.3'; -const BACKEND_VERSION = '3.4.3'; +const APP_VERSION = '3.4.4'; +const FRONTEND_VERSION = '3.4.4'; +const BACKEND_VERSION = '3.4.4'; env.addGlobal('app_version', APP_VERSION); env.addGlobal('frontend_version', FRONTEND_VERSION); diff --git a/frontend/src/routes/dashboard.js b/frontend/src/routes/dashboard.js index 8ea5376..736d496 100644 --- a/frontend/src/routes/dashboard.js +++ b/frontend/src/routes/dashboard.js @@ -123,17 +123,21 @@ router.get('/', async (req, res) => { ] }; } else if (role === 'bedelia') { + const apiTomorrowSchedule = Array.isArray(apiData.tomorrow_schedule_list) ? apiData.tomorrow_schedule_list : []; const apiWeekSchedule = Array.isArray(apiData.week_schedule_list) ? apiData.week_schedule_list : []; role_data = { filter_stats, date_labels, pending_reservations: apiPending || [], today_schedule_list: apiTodaySchedule || [], + tomorrow_schedule_list: apiTomorrowSchedule, week_schedule_list: apiWeekSchedule, + unassigned_commissions_tomorrow: bedeliaData.unassigned_commissions_tomorrow || [], unassigned_commissions_week: bedeliaData.unassigned_commissions_week || [], unassigned_commissions_month: bedeliaData.unassigned_commissions_month || [], unassigned_commissions_general: bedeliaData.unassigned_commissions_general || [], available_classrooms_today: bedeliaData.available_classrooms_today || [], + available_classrooms_tomorrow: bedeliaData.available_classrooms_tomorrow || [], available_classrooms_week: bedeliaData.available_classrooms_week || [], available_classrooms_month: bedeliaData.available_classrooms_month || [], virtual_rooms: virtual_rooms_list, diff --git a/frontend/views/dashadm.html b/frontend/views/dashadm.html index d498b52..b2a5dec 100644 --- a/frontend/views/dashadm.html +++ b/frontend/views/dashadm.html @@ -107,6 +107,9 @@ + diff --git a/frontend/views/dashbede.html b/frontend/views/dashbede.html index ff3a362..075be38 100644 --- a/frontend/views/dashbede.html +++ b/frontend/views/dashbede.html @@ -109,6 +109,9 @@ + @@ -223,6 +226,10 @@ Clases de Hoy {{ role_data.today_schedule_list | length }} + + @@ -527,7 +606,109 @@ {% endif %} - + + + + + + +
- +
+ @@ -852,7 +1036,73 @@ {% endif %}
- + + + + + + +
- +
+ @@ -527,7 +606,109 @@ {% endif %}
- + + + + + + +
- +
+ @@ -852,7 +1036,73 @@ {% endif %}
- + + + + + + +