From 8c5516f353f2caf22f6ebe2a15b560fa7b8c2444 Mon Sep 17 00:00:00 2001 From: lorentz Date: Fri, 10 Apr 2026 14:00:54 +0000 Subject: [PATCH] Tasks always show Policy #, Type, Renewal Date, and clickable notes icon on all surfaces --- .../src/app/(dashboard)/clients/[id]/page.tsx | 14 +++++++ .../(dashboard)/tasks/assign/page-client.tsx | 10 ++++- .../src/app/(dashboard)/tasks/page-client.tsx | 39 ++++++++++++------- .../src/components/clients/client-detail.tsx | 29 +++++++++++++- 4 files changed, 75 insertions(+), 17 deletions(-) diff --git a/ondeck/src/app/(dashboard)/clients/[id]/page.tsx b/ondeck/src/app/(dashboard)/clients/[id]/page.tsx index 90d69af..f895d1f 100644 --- a/ondeck/src/app/(dashboard)/clients/[id]/page.tsx +++ b/ondeck/src/app/(dashboard)/clients/[id]/page.tsx @@ -78,6 +78,14 @@ export default async function ClientDetailPage({ } })(), include: { + policy: { + select: { + id: true, + policyNumber: true, + policyType: true, + expirationDate: true, + }, + }, assignments: { include: { user: { @@ -88,6 +96,12 @@ export default async function ClientDetailPage({ }, }, }, + taskNotes: { + include: { + user: { select: { id: true, displayName: true, email: true } }, + }, + orderBy: { createdAt: 'asc' }, + }, }, orderBy: { dueDate: 'asc' }, }, diff --git a/ondeck/src/app/(dashboard)/tasks/assign/page-client.tsx b/ondeck/src/app/(dashboard)/tasks/assign/page-client.tsx index 0fb6777..c26c478 100644 --- a/ondeck/src/app/(dashboard)/tasks/assign/page-client.tsx +++ b/ondeck/src/app/(dashboard)/tasks/assign/page-client.tsx @@ -23,7 +23,7 @@ import { TableRow, } from '@/components/ui/table' import { Users, Filter, CheckSquare, Wand2, MessageSquare } from 'lucide-react' -import { formatDate } from '@/lib/utils' +import { formatDate, formatRenewalDate } from '@/lib/utils' interface SimpleUser { id: string; displayName: string | null; email: string; department: string | null } interface SimpleClient { id: string; name: string } @@ -327,6 +327,9 @@ export function BulkAssignClient({ users, clients, designations }: BulkAssignCli Task Client Department + Policy # + Type + Renewal Due Date Status Assigned To @@ -360,6 +363,11 @@ export function BulkAssignClient({ users, clients, designations }: BulkAssignCli {task.client?.name || '—'} {task.department?.replace('_', ' ') || '—'} + {task.policy?.policyNumber || '—'} + {task.policy?.policyType || '—'} + + {task.policy?.expirationDate ? formatRenewalDate(task.policy.expirationDate) : '—'} + {formatDate(task.dueDate)} diff --git a/ondeck/src/app/(dashboard)/tasks/page-client.tsx b/ondeck/src/app/(dashboard)/tasks/page-client.tsx index 4463025..1b50266 100644 --- a/ondeck/src/app/(dashboard)/tasks/page-client.tsx +++ b/ondeck/src/app/(dashboard)/tasks/page-client.tsx @@ -23,7 +23,7 @@ import { import { UserSelectContent } from '@/components/ui/user-select-content' import { CheckSquare, Clock, AlertCircle, MessageSquare, CheckCircle2, RotateCcw, Eye, CalendarRange, ArrowRightLeft, Search, X, Building2, Plus, Ban, ArrowUpDown, ArrowUp, ArrowDown, Filter } from 'lucide-react' import { Input } from '@/components/ui/input' -import { formatDate } from '@/lib/utils' +import { formatDate, formatRenewalDate } from '@/lib/utils' import { AdditionalServiceModal } from '@/components/tasks/additional-service-modal' interface TaskUser { displayName: string | null; email: string } @@ -222,18 +222,23 @@ function TaskCard({ task: initial }: { task: Task }) { ) : ( Client )} - {notes.length > 0 && ( - - {notes.length} - - )} + {task.description && (

{task.description}

)} - {/* Meta row */} + {/* Meta row — always show policy number, type, renewal date */}
{task.client && ( @@ -249,14 +254,20 @@ function TaskCard({ task: initial }: { task: Task }) { )} - {task.policy && ( - - Policy:{' '} - - {[task.policy.policyNumber, task.policy.policyType].filter(Boolean).join(' · ')} - + + Policy #:{' '} + {task.policy?.policyNumber || '—'} + + + Type:{' '} + {task.policy?.policyType || '—'} + + + Renewal:{' '} + + {task.policy?.expirationDate ? formatRenewalDate(task.policy.expirationDate) : '—'} - )} + Due:{' '} diff --git a/ondeck/src/components/clients/client-detail.tsx b/ondeck/src/components/clients/client-detail.tsx index 584b8d0..d293ebd 100644 --- a/ondeck/src/components/clients/client-detail.tsx +++ b/ondeck/src/components/clients/client-detail.tsx @@ -20,7 +20,7 @@ import { SelectValue, } from '@/components/ui/select' import { Textarea } from '@/components/ui/textarea' -import { Building2, MapPin, Phone, Mail, FileText, CheckSquare, CalendarRange, Users, X, Plus, UserCheck, StickyNote, Pencil, Trash2, ChevronDown, ChevronUp, ArrowUp, ArrowDown, ArrowUpDown, GitBranch, ChevronRight, Settings2 } from 'lucide-react' +import { Building2, MapPin, Phone, Mail, FileText, CheckSquare, CalendarRange, Users, X, Plus, UserCheck, StickyNote, Pencil, Trash2, ChevronDown, ChevronUp, ArrowUp, ArrowDown, ArrowUpDown, GitBranch, ChevronRight, Settings2, MessageSquare } from 'lucide-react' import { Combobox, type ComboboxGroup } from '@/components/ui/combobox' import { formatDate, formatRenewalDate } from '@/lib/utils' import { PolicyGroupManager } from '@/components/clients/policy-group-manager' @@ -676,9 +676,34 @@ export function ClientDetail({ client, designations, policyGroups = [], allPolic }`}> {task.priority} + +
+ {/* Always show Policy #, Type, Renewal Date */} +
+ + Policy #:{' '} + {task.policy?.policyNumber || '—'} + + + Type:{' '} + {task.policy?.policyType || '—'} + + + Renewal:{' '} + + {task.policy?.expirationDate ? formatRenewalDate(task.policy.expirationDate) : '—'} + +
{task.description && ( -

{task.description}

+

{task.description}

)} {task.assignments?.length > 0 && (