diff --git a/frontend/src/pages/admin/AdminDashboard.tsx b/frontend/src/pages/admin/AdminDashboard.tsx index 142dc4f3..d03aca71 100644 --- a/frontend/src/pages/admin/AdminDashboard.tsx +++ b/frontend/src/pages/admin/AdminDashboard.tsx @@ -96,6 +96,17 @@ export const AdminDashboard: React.FC = () => { onError: (err: any) => toast.error(err?.response?.data?.error || (t('common.error', 'Something went wrong') as string)), }); + // Admin detail route for an approval's run entity, so clicking opens the + // document under review. Mirrors WorkflowApprovalsPage (`invoice` → /bills). + const approvalEntityHref = (a: { entity_type?: string | null; entity_id?: number | null }): string | null => { + if (!a.entity_type || a.entity_id == null) return null; + const base: Record = { + quote: 'quotes', invoice: 'bills', event: 'events', contract: 'contracts', customer: 'customers', + }; + const seg = base[a.entity_type]; + return seg ? `/admin/${seg}/${a.entity_id}` : null; + }; + const isLoading = statsLoading || eventsLoading; if (isLoading) { @@ -277,14 +288,29 @@ export const AdminDashboard: React.FC = () => {
{pendingApprovals.slice(0, 5).map((a) => { const prompt = (a.payload as any)?.prompt as string | undefined; + const href = approvalEntityHref(a); + const info = ( + <> +

{a.workflow_name}

+

+ {prompt || a.type}{a.entity_type ? ` · ${a.entity_type} #${a.entity_id}` : ''} +

+ + ); return (
-
-

{a.workflow_name}

-

- {prompt || a.type}{a.entity_type ? ` · ${a.entity_type} #${a.entity_id}` : ''} -

-
+ {href ? ( + + ) : ( +
{info}
+ )}