feat: add admin tiles to dashboard - #1825
Merged
Japrolol merged 4 commits intoAug 7, 2026
Merged
Conversation
Japrolol
reviewed
Aug 4, 2026
| .where( | ||
| and( | ||
| eq(studentCourses.status, COURSE_ENROLLMENT.ENROLLED), | ||
| sql`${studentCourses.progress} != 'completed'`, |
| eq(studentCourses.status, COURSE_ENROLLMENT.ENROLLED), | ||
| sql`${studentCourses.progress} != 'completed'`, | ||
| eq(groupCourses.isMandatory, true), | ||
| sql`${groupCourses.dueDate} IS NOT NULL`, |
| perPage: number, | ||
| ) { | ||
| const riskCondition = | ||
| riskType === "overdue" |
| notStarted: sql<number>`COUNT(*) FILTER (WHERE ${studentCourses.progress} = 'not_started')::INTEGER`, | ||
| total: sql<number>`COUNT(*)::INTEGER`, | ||
| overdue: sql<number>`COUNT(*) FILTER ( | ||
| WHERE ${studentCourses.progress} != 'completed' |
Collaborator
There was a problem hiding this comment.
don't we have an enum for these statuses?
| }); | ||
|
|
||
| export const DashboardDeadlineRiskTypeSchema = Type.Union([ | ||
| Type.Literal("overdue"), |
Collaborator
There was a problem hiding this comment.
might as well use enum for this
| import type { GetDashboardDeadlineRisksResponse } from "../generated-api"; | ||
| import type { SupportedLanguages } from "@repo/shared"; | ||
|
|
||
| export type DashboardDeadlineRiskType = "overdue" | "dueSoon"; |
| } from "../components/WidgetCard"; | ||
| import { DASHBOARD_WIDGET_REGISTRY } from "../widgetRegistry"; | ||
|
|
||
| const RISK_TYPE = { |
Collaborator
There was a problem hiding this comment.
put this in shared, why define enum and then use literal strings everywhere
Japrolol
force-pushed
the
pz_feat_1714_add_dashboard
branch
2 times, most recently
from
August 7, 2026 09:35
095ed57 to
dd67618
Compare
Japrolol
force-pushed
the
pz_feat_1717_add_dashboard_admin_tiles
branch
from
August 7, 2026 09:41
bc66d1f to
41dc8cf
Compare
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.
Issue(s)
Overview
This PR introduces four functional admin dashboard widgets:
Event and deadline calendar
Training completion
Courses with incomplete enrollments
Deadline risks
The widgets provide up-to-date organization-level insights, direct access to course details, and respect permissions, tenant configuration, and dashboard customization.
Business Value
Admins and L&D teams gain a single operational view of training performance. This helps them identify overdue assignments and upcoming risks earlier, take action before compliance issues arise, and reduce time spent navigating between reports, courses, and the calendar.
Screenshots / Video