From 2c25697ac70197ecdf0495a4d9f6607dc96c0d23 Mon Sep 17 00:00:00 2001 From: "gpt-engineer-app[bot]" <159125892+gpt-engineer-app[bot]@users.noreply.github.com> Date: Sun, 19 Apr 2026 23:49:29 +0000 Subject: [PATCH] Changes Co-authored-by: renee-png <262607627+renee-png@users.noreply.github.com> --- src/components/cases/collections-tab.tsx | 33 ++++++++++-------------- 1 file changed, 14 insertions(+), 19 deletions(-) diff --git a/src/components/cases/collections-tab.tsx b/src/components/cases/collections-tab.tsx index 6c83181..8e673da 100644 --- a/src/components/cases/collections-tab.tsx +++ b/src/components/cases/collections-tab.tsx @@ -1221,19 +1221,16 @@ function AddCollectionDialog({ onCreated(); }; - const hoOptions = available.map((h) => ({ - value: `ho:${h.id}`, - label: `${h.last_name}, ${h.first_name}${h.unit_number ? ` — Unit ${h.unit_number}` : ""}`, - keywords: `${h.first_name} ${h.last_name} ${h.unit_number ?? ""}`, - group: "HOA homeowners", - })); - const ctOptions = contactOptions.map(({ contact, first, last }) => ({ - value: `ct:${contact.id}`, - label: `${last || contact.name}${first ? `, ${first}` : ""} — Case contact`, - keywords: `${first} ${last} ${contact.name} ${contact.email ?? ""}`, - group: "Case contacts (homeowner)", - })); - const allOptions = [...hoOptions, ...ctOptions]; + const ctOptions = contactOptions.map(({ contact, first, last }) => { + const roleLabel = (contact._link_role || contact.contact_type || "homeowner").toLowerCase(); + const niceRole = roleLabel.charAt(0).toUpperCase() + roleLabel.slice(1); + return { + value: `ct:${contact.id}`, + label: `${last || contact.name}${first ? `, ${first}` : ""} — ${niceRole}`, + keywords: `${first} ${last} ${contact.name} ${contact.email ?? ""}`, + }; + }); + const allOptions = ctOptions; return ( @@ -1241,9 +1238,8 @@ function AddCollectionDialog({ Add homeowner collection - Attach a homeowner to this matter. You can pick from this HOA's - homeowners or any case contact tagged as a homeowner. Each - homeowner can only have one collection per case. + Pick a case contact tagged as a homeowner or tenant. Link contacts + on the Contacts tab of this case to make them available here.
@@ -1251,9 +1247,8 @@ function AddCollectionDialog({ {allOptions.length === 0 ? (

- {homeowners.length === 0 && contactHomeowners.length === 0 - ? "No homeowners yet. Use 'New homeowner' or link a homeowner contact to this case." - : "All available homeowners already have a collection on this matter."} + No case contacts tagged as homeowner or tenant. Add one on the + Contacts tab of this case.

) : (