Skip to content

Show organization name for contacts without a personal name#275

Open
jeremyzilar wants to merge 1 commit intostagingfrom
BDMS-786-Company-Contact-Name
Open

Show organization name for contacts without a personal name#275
jeremyzilar wants to merge 1 commit intostagingfrom
BDMS-786-Company-Contact-Name

Conversation

@jeremyzilar
Copy link
Copy Markdown
Contributor

@jeremyzilar jeremyzilar commented May 1, 2026

What is changing

Contacts that represent companies rather than individuals have no personal name value. Previously these contacts showed up blank in the UI across several locations. This PR ensures the organization name is used as the display label whenever name is absent.

See also: DataIntegrationGroup/OcotilloAPI#669

Changes

New utility (src/utils/contactDisplayName.ts):

  • getContactDisplayName(contact) — returns name if present, falls back to organization, then empty string
  • getContactsLabel(contacts[]) — joins display names for a list of contacts

UI locations updated:

  • Wells list pagevalueGetter and renderCell for the Contacts column
  • Well detail contacts card (WellShow/Contacts.tsx) — display name, label ("Contact name" vs "Organization"), and suppresses the redundant org line when the org is already the display name
  • Contacts list pagevalueGetter on the Name column
  • Contact show page — page title

Documentation (feature_files/contact-display-name.md):

  • Documents the full display name resolution logic
  • Includes YAML front-matter with deferred_items for follow-up work (org contact type, confidential org masking)

What is not changing

The API search fix (c.name or c.organization) is handled in a separate PR (#669).

Test plan

  • Find a contact with no name but with an organization (e.g. check well #1236 on staging) and confirm the org name appears in the well detail contacts card, wells list, contacts list, and contact show page
  • Confirm contacts with both a name and org still show the name (not the org) in all locations
  • Confirm the org line is hidden on the contacts card when the contact is org-only (since it would be redundant)
  • Confirm the org line still appears on the contacts card for person contacts

Contacts that represent companies rather than individuals have no name
value, causing blank labels across the UI and in search results. Add a
getContactDisplayName utility that falls back to organization when name
is absent, and apply it to the wells list, contacts list, contact show
page, and the well detail contacts card. Document the logic and deferred
follow-up work in feature_files/contact-display-name.md.
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 1, 2026

Preview Deployment

Preview URL: https://preview-bdms-786-company-contact-name-auejgdbofq-uc.a.run.app

Note: This preview uses the staging API endpoints.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant