Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add "labelField" metadata to entities #19504

Merged
merged 1 commit into from
Feb 2, 2021

Conversation

colemanw
Copy link
Member

@colemanw colemanw commented Feb 2, 2021

Overview

This PR adds some metadata to the schema for which field will be shown when displaying an entity (e.g. when viewing a Contact, show the display_name).

Before

How to show an entity was determined by either hard-coding or guesswork (e.g. Search Kit attempts to guess by looking for a field named display_name, title, label or name).

After

How to show an entity can be known by looking at metadata

Comments

This PR only adds the metadata. A followup PR will make use of it once this is merged.

This determines which field will be shown when displaying a single record
e.g. when viewing a Contact, show the display_name.
@civibot
Copy link

civibot bot commented Feb 2, 2021

(Standard links)

@civibot civibot bot added the master label Feb 2, 2021
@seamuslee001
Copy link
Contributor

This makes sense to me MOP

@eileenmcnaughton eileenmcnaughton merged commit f7dc440 into civicrm:master Feb 2, 2021
@eileenmcnaughton eileenmcnaughton deleted the labelField branch February 2, 2021 20:47
@demeritcowboy
Copy link
Contributor

Misc thought/wishlist: Depending on where it's going to be used I'm not sure "subject" is the best label for something like a Case or Activity. You often wouldn't be able to tell multiple records apart. A results page like search kit is probably ok since you could add more columns, but in a dropdown they'd all look the same. A compound label, like the Case entityRef displays, is better in a dropdown.

@colemanw
Copy link
Member Author

colemanw commented Feb 3, 2021

@demeritcowboy the current use is Search Kit where columns are all shown separately, but I agree it's not enough metadata for a dropdown select widget for some entities.
It's a start though.

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

Successfully merging this pull request may close these issues.

4 participants