feat(dashboard): add commissions pagination, career filter, unassigned KPI card, and occupancy pie charts v3.8.19
This commit is contained in:
@@ -7,7 +7,7 @@ from typing import Any
|
||||
from database import db, get_db, engine, SessionLocal, session
|
||||
from config.config import Config
|
||||
|
||||
__version__ = "3.8.18"
|
||||
__version__ = "3.8.19"
|
||||
|
||||
class DummyContext:
|
||||
def __enter__(self):
|
||||
|
||||
@@ -10,6 +10,7 @@ from sqlalchemy import func
|
||||
from app import db
|
||||
from app.models.classroom import Classroom
|
||||
from app.models.subject import Subject, Commission
|
||||
from app.models.career import Career
|
||||
from app.models.user import User
|
||||
from app.models.reservation import Reservation
|
||||
from app.models.audit_log import AuditLog
|
||||
@@ -366,12 +367,20 @@ class DashboardService:
|
||||
if r_first:
|
||||
assigned_room = r_first.classroom.code if r_first.classroom else 'Aula Virtual'
|
||||
assigned_time = f"{r_first.start_time.strftime('%H:%M')} - {r_first.end_time.strftime('%H:%M')} hs"
|
||||
|
||||
career_name = comm.career_name if hasattr(comm, 'career_name') else (comm.subject.career.name if (comm.subject and comm.subject.career) else 'UniCABA')
|
||||
career_names = comm.career_names if hasattr(comm, 'career_names') else career_name
|
||||
career_id = comm.career_id if hasattr(comm, 'career_id') else None
|
||||
|
||||
return {
|
||||
'id': comm.id,
|
||||
'code': comm.code,
|
||||
'full_code': comm.get_full_code(),
|
||||
'subject_name': comm.subject.name if comm.subject else 'Sin materia',
|
||||
'subject_code': comm.subject.code if comm.subject else '',
|
||||
'career_name': career_name,
|
||||
'career_names': career_names,
|
||||
'career_id': career_id,
|
||||
'teacher_name': comm.teacher_name or 'Sin docente',
|
||||
'schedule': comm.schedule or 'Sin horario',
|
||||
'shift': comm.shift or 'Sin turno',
|
||||
@@ -639,6 +648,7 @@ class DashboardService:
|
||||
'milestones': milestones,
|
||||
'filter_stats': filter_stats,
|
||||
'date_labels': date_labels,
|
||||
'careers': [c.to_dict() for c in Career.query.order_by(Career.name.asc()).all()],
|
||||
'ui': {
|
||||
'show_role_banner': SystemSetting.get_value('dashboard_role_banner_enabled', 'true') in ['true', 'True', '1', True]
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user