diff --git a/frontend/src/i18n/locales/de.json b/frontend/src/i18n/locales/de.json index a0ea71e3..fd40a049 100644 --- a/frontend/src/i18n/locales/de.json +++ b/frontend/src/i18n/locales/de.json @@ -238,6 +238,7 @@ "defaultPrompt": "Ein Workflow benötigt deine Bestätigung.", "pendingTitle": "Offene Freigaben", "viewAll": "Alle Freigaben ansehen", + "openEntity": "{{type}} #{{id}} öffnen", "acted": "Erledigt" }, "editor": { diff --git a/frontend/src/i18n/locales/en.json b/frontend/src/i18n/locales/en.json index fd5708d0..76f9d374 100644 --- a/frontend/src/i18n/locales/en.json +++ b/frontend/src/i18n/locales/en.json @@ -238,6 +238,7 @@ "defaultPrompt": "A workflow needs your confirmation.", "pendingTitle": "Pending approvals", "viewAll": "View all approvals", + "openEntity": "Open {{type}} #{{id}}", "acted": "Done" }, "editor": { diff --git a/frontend/src/pages/admin/workflows/WorkflowApprovalsPage.tsx b/frontend/src/pages/admin/workflows/WorkflowApprovalsPage.tsx index 6f4f7eed..b036363b 100644 --- a/frontend/src/pages/admin/workflows/WorkflowApprovalsPage.tsx +++ b/frontend/src/pages/admin/workflows/WorkflowApprovalsPage.tsx @@ -36,6 +36,17 @@ export const WorkflowApprovalsPage: React.FC = () => { const promptOf = (a: WorkflowApproval) => (a.payload && (a.payload.prompt as string)) || t('workflows.approvals.defaultPrompt', 'A workflow needs your confirmation.'); + // The admin detail route for the run's entity, so a row click opens the + // document they're being asked to approve. `invoice` lives under /bills. + const entityHref = (a: WorkflowApproval): 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; + }; + return (
@@ -55,24 +66,41 @@ export const WorkflowApprovalsPage: React.FC = () => {
{t('workflows.approvals.empty', 'Nothing waiting for you right now.')}
) : (
    - {approvals.map((a) => ( -
  • -
    + {approvals.map((a) => { + const href = entityHref(a); + const meta = ( + <>
    {promptOf(a)}
    {a.workflow_name} {a.entity_type ? ` · ${a.entity_type} #${a.entity_id}` : ''} {a.created_at ? ` · ${formatDateTime(a.created_at)}` : ''}
    -
    - - -
  • - ))} + + ); + return ( +
  • + {href ? ( + + ) : ( +
    {meta}
    + )} + + +
  • + ); + })}
)}