feat: add necessary wiring and formatting to make department admin dashboard page mirror figma#1089
Merged
carddev81 merged 3 commits intoCK-7vn/total-refactorfrom Mar 3, 2026
Conversation
…shboard page mirror figma
CK-7vn
reviewed
Feb 27, 2026
Member
CK-7vn
left a comment
There was a problem hiding this comment.
Few small things nothing serious serious.
backend/src/services/classes.go
Outdated
| return nil, err | ||
| } | ||
|
|
||
| missingByFacility := make(map[uint]int64, len(summaries)) |
Member
There was a problem hiding this comment.
We should probably refactor this section since each iteration is making multiple DB calls. I would suggest maybe calling GetMissingAttendanceForFacility once and building a map, but, i'm sure you can figure out whatever would be best.
allItems, err := svc.GetMissingAttendanceForFacility(args, facilityID, days)
if err != nil {
return nil, err
}
classes, err := svc.db.GetClasses(args, facilityID)
if err != nil {
return nil, err
}
classToFacility := make(map[uint]uint, len(classes))
for _, c := range classes {
classToFacility[c.ID] = c.FacilityID
}
missingByFacility := make(map[uint]map[uint]struct{})
for _, item := range allItems {
fid := classToFacility[item.ClassID]
if missingByFacility[fid] == nil {
missingByFacility[fid] = make(map[uint]struct{})
}
missingByFacility[fid][item.ClassID] = struct{}{}
}
for i := range summaries {
fid := summaries[i].FacilityID
summaries[i].AttendanceConcerns = attendanceConcerns[fid]
summaries[i].MissingAttendance = int64(len(missingByFacility[fid]))
}
CK-7vn
approved these changes
Mar 3, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pre-Submission PR Checklist
Description of the change
Made change to dashboard for ONLY department administrators (dashboard). Mirrors figma exactly. Made several backend changes to account for frontend data w/look and feel.
Please test thoroughly. You will need to create facilities, programs, classes, enrollments, and mark attendance and make to create your records across facilities. You will need to mark attendance for multiple classes with attendance status of 'unexecused'
Here is a query you can use to back date the enrollments:
update program_class_enrollments set enrolled_at = '2025-01-01 08:00:00' where enrollment_status = 'Enrolled';Screenshot(s)