Skip to content

feat(ui): add support for disabling join field row types #12738

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

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

akhrarovsaid
Copy link
Contributor

@akhrarovsaid akhrarovsaid commented Jun 9, 2025

What?

This PR adds a new admin.disableRowTypes config to 'join' fields which hides the "Type" column from the relationship table.

Why?

While the collection type column can be helpful for providing information, it's not always necessary and can sometimes be redundant when the field only has a singular relationTo. Hiding it can be helpful by removing visual noise and providing editors the data directly.

How?

By threading admin.disableRowTypes directly to the getTableState function of the RelationshipTable component.

With row types (via `admin.disableRowTypes: false | undefined OR default for polymorphic):
image

Without row types (default for monomorphic):
image

@akhrarovsaid akhrarovsaid changed the title feat(ui): add support for disabling row types feat(ui): add support for disabling join field row types Jun 9, 2025
@paulpopus
Copy link
Contributor

My first impression is that we shouldn't introduce an additional config option and instead add something like a _collectionType name to this column so that it can be treated like any other column - controlled via defaultColumns or toggleable by the user via UI

@paulpopus
Copy link
Contributor

@akhrarovsaid Actually, we had a discussion and we landed on having the new admin type to disable it
It should also be disabled by default for non-poly joins

@akhrarovsaid
Copy link
Contributor Author

Hey @paulpopus

So I've made it disabled by default for non-poly joins. However, a number of tests actually depend on the type column, and instead of rewriting those tests and/or finding every area of the e2e's where the type column is depended on, I've simply added admin.disableRowTypes: false to them so that otherwise they remain unchanged.

I've also added docs & a few tests to show the behavior between monomorphic and polymorphic fields with disableRowTypes.

Let me know your thoughts & thank you!

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.

2 participants