From 12baaa511ce151829c265bec21369149780b47e7 Mon Sep 17 00:00:00 2001 From: Levi Gomes Date: Fri, 10 Jul 2026 00:13:20 -0300 Subject: [PATCH 1/2] feat(dashboard): count pending change requests in Platform Overview The Platform Overview "Pending Requests" stat counted only pending access requests. Add pending change requests (project/language create & edit) so the card reflects everything awaiting admin review, matching its "aggregate counts" framing. Both request fetches degrade gracefully so a failure in one still renders the dashboard with what loaded. --- .../pages/dashboard/AdminDashboard.tsx | 32 +++++++++++++++---- 1 file changed, 25 insertions(+), 7 deletions(-) diff --git a/src/components/pages/dashboard/AdminDashboard.tsx b/src/components/pages/dashboard/AdminDashboard.tsx index 2de5f30..137212e 100644 --- a/src/components/pages/dashboard/AdminDashboard.tsx +++ b/src/components/pages/dashboard/AdminDashboard.tsx @@ -8,8 +8,18 @@ import { ArrowRight, Bell, } from "lucide-react" -import { usersAPI, projectsAPI, orgsAPI, accessRequestsAPI } from "@/services/api" -import type { UserListResponse, AccessRequestResponse } from "@/types" +import { + usersAPI, + projectsAPI, + orgsAPI, + accessRequestsAPI, + changeRequestsAPI, +} from "@/services/api" +import type { + UserListResponse, + AccessRequestResponse, + ChangeRequestResponse, +} from "@/types" import { Badge } from "@/components/ui/badge" import { StatCard } from "@/components/common/StatCard" import { InfoTooltip } from "@/components/common/InfoTooltip" @@ -22,6 +32,7 @@ interface AdminData { projectsWithLocation: number orgCount: number pendingRequests: AccessRequestResponse[] + pendingChangeRequests: ChangeRequestResponse[] } export function AdminDashboard() { @@ -31,11 +42,16 @@ export function AdminDashboard() { useEffect(() => { async function fetchData() { try { - const [usersRes, projectsRes, orgsRes, requestsRes] = await Promise.all([ + const [usersRes, projectsRes, orgsRes, accessRes, changeRes] = await Promise.all([ usersAPI.list(), projectsAPI.list(), orgsAPI.list(), - accessRequestsAPI.list({ status: "pending" }), + accessRequestsAPI + .list({ status: "pending" }) + .catch(() => ({ data: [] as AccessRequestResponse[] })), + changeRequestsAPI + .list({ status: "pending" }) + .catch(() => ({ data: [] as ChangeRequestResponse[] })), ]) setData({ users: usersRes.data, @@ -44,7 +60,8 @@ export function AdminDashboard() { (p) => p.latitude != null && p.longitude != null, ).length, orgCount: orgsRes.data.length, - pendingRequests: requestsRes.data, + pendingRequests: accessRes.data, + pendingChangeRequests: changeRes.data, }) } catch { // Stats are non-critical @@ -59,6 +76,7 @@ export function AdminDashboard() { const activeUsers = data.users.filter((u) => u.is_active).length const userMap = new Map(data.users.map((u) => [u.id, u])) + const totalPending = data.pendingRequests.length + data.pendingChangeRequests.length return (
@@ -108,11 +126,11 @@ export function AdminDashboard() { 0} + highlight={totalPending > 0} />
From 2c227956fc4917132fda27d62a47869b23288046 Mon Sep 17 00:00:00 2001 From: Levi Gomes Date: Wed, 15 Jul 2026 17:00:54 -0300 Subject: [PATCH 2/2] chore(ci): empty commit to re-trigger CI checks Co-Authored-By: Claude Opus 4.8 (1M context)