Skip to content

feat: add admin tiles to dashboard - #1825

Merged
Japrolol merged 4 commits into
pz_feat_1714_add_dashboardfrom
pz_feat_1717_add_dashboard_admin_tiles
Aug 7, 2026
Merged

feat: add admin tiles to dashboard#1825
Japrolol merged 4 commits into
pz_feat_1714_add_dashboardfrom
pz_feat_1717_add_dashboard_admin_tiles

Conversation

@Pieselak

Copy link
Copy Markdown
Collaborator

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

image image image

@Pieselak Pieselak self-assigned this Jul 29, 2026
@Pieselak Pieselak added the review me 👀 PR is ready to be reviewed label Jul 29, 2026
@Japrolol
Japrolol changed the base branch from staging to pz_feat_1714_add_dashboard August 4, 2026 12:14
.where(
and(
eq(studentCourses.status, COURSE_ENROLLMENT.ENROLLED),
sql`${studentCourses.progress} != 'completed'`,

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use not(eq())

eq(studentCourses.status, COURSE_ENROLLMENT.ENROLLED),
sql`${studentCourses.progress} != 'completed'`,
eq(groupCourses.isMandatory, true),
sql`${groupCourses.dueDate} IS NOT NULL`,

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use not(isNull())

perPage: number,
) {
const riskCondition =
riskType === "overdue"

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use enum

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'

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

don't we have an enum for these statuses?

});

export const DashboardDeadlineRiskTypeSchema = Type.Union([
Type.Literal("overdue"),

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

might as well use enum for this

import type { GetDashboardDeadlineRisksResponse } from "../generated-api";
import type { SupportedLanguages } from "@repo/shared";

export type DashboardDeadlineRiskType = "overdue" | "dueSoon";

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

previously stated enum

} from "../components/WidgetCard";
import { DASHBOARD_WIDGET_REGISTRY } from "../widgetRegistry";

const RISK_TYPE = {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

put this in shared, why define enum and then use literal strings everywhere

@Japrolol
Japrolol force-pushed the pz_feat_1714_add_dashboard branch 2 times, most recently from 095ed57 to dd67618 Compare August 7, 2026 09:35
@Japrolol
Japrolol force-pushed the pz_feat_1717_add_dashboard_admin_tiles branch from bc66d1f to 41dc8cf Compare August 7, 2026 09:41
@Japrolol
Japrolol merged commit ab5b071 into pz_feat_1714_add_dashboard Aug 7, 2026
7 checks passed
@Japrolol
Japrolol deleted the pz_feat_1717_add_dashboard_admin_tiles branch August 7, 2026 12:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

review me 👀 PR is ready to be reviewed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants