Show organization name for contacts without a personal name#275
Open
jeremyzilar wants to merge 1 commit intostagingfrom
Open
Show organization name for contacts without a personal name#275jeremyzilar wants to merge 1 commit intostagingfrom
jeremyzilar wants to merge 1 commit intostagingfrom
Conversation
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.
Preview DeploymentPreview URL: https://preview-bdms-786-company-contact-name-auejgdbofq-uc.a.run.app Note: This preview uses the staging API endpoints. |
Merged
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What is changing
Contacts that represent companies rather than individuals have no personal
namevalue. Previously these contacts showed up blank in the UI across several locations. This PR ensures the organization name is used as the display label whenevernameis absent.See also: DataIntegrationGroup/OcotilloAPI#669
Changes
New utility (
src/utils/contactDisplayName.ts):getContactDisplayName(contact)— returnsnameif present, falls back toorganization, then empty stringgetContactsLabel(contacts[])— joins display names for a list of contactsUI locations updated:
valueGetterandrenderCellfor the Contacts columnWellShow/Contacts.tsx) — display name, label ("Contact name" vs "Organization"), and suppresses the redundant org line when the org is already the display namevalueGetteron the Name columnDocumentation (
feature_files/contact-display-name.md):deferred_itemsfor 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
namebut with anorganization(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