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

[RelationshipList] A field for a relation-many that display a table #2646

Closed
wants to merge 10 commits into from

Conversation

Nikodermus
Copy link
Contributor

@Nikodermus Nikodermus commented Apr 2, 2020

Why

The idea behind this, is for some fields with large relations to many, text chips are insufficient and hard to consume. That field display can grow out of control and doesn't provide detail if needed.

How

This would display a customizable table, with special support for links and booleans. For a more in depth explanation of the customization see packages/fields/src/types/RelationshipList/README.md

What it looks like

Kapture 2020-04-02 at 18 36 43

Before merge

  • Pray you guys will think this is a good idea
  • Revert auth changes in demo/blog
  • Run changeset

@changeset-bot
Copy link

changeset-bot bot commented Apr 2, 2020

💥 No Changeset

Latest commit: ce3db18

Merging this PR will not cause any packages to be released. If these changes should not cause updates to packages in this repo, this is fine 🙂

If these changes should be published to npm, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@MadeByMike
Copy link
Contributor

This idea is great, but I think rather than making a new field it would be better to have options on the relationship field type to choose different presentations.

What do you think about that?

@Nikodermus
Copy link
Contributor Author

Sure sounds great, if the option inner field is present it should automatically take the table presentation

I'll be working on this 😁

@JedWatson
Copy link
Member

I like this.

I'd recommend specifying an explicit option for our relationship fields, i.e

{ type: Relationship, ref: 'User', displayMode: 'table', columns: ['name', 'email'] }

That new option would default to select for the current behaviour; setting table would use the new component & graphql query logic; and it leaves us with room to implement other display modes in the future as well.

I'd also like to call the option that specifies the data to display columns because that is consistent with the list view.

We'll also need to pull the column views for the fields specified by columns from the list that's on the other side of the relationship as per how the List view works, rather than hard-coding assumptions on how to render different field types in the table (e.g how there is currently a special case for "boolean")

@Nikodermus tbh this isn't going to be a small amount of work or particularly simple (I'm sure there will be more things to do as you get closer) but I'm really happy you're taking it on & will keep advising as you go if you're up for it!

@gautamsi
Copy link
Member

gautamsi commented Apr 3, 2020

It may also be helpful to have it expand to table (configurable isExpanded) and minimize to regular select. Thoughts?

@Nikodermus
Copy link
Contributor Author

I think changing from the regular select to the table would be too agressive for the user, I think we should keep one look so we can handle in the list only

@Nikodermus
Copy link
Contributor Author

Moved to #2885

@Nikodermus Nikodermus closed this May 4, 2020
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.

4 participants