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
ui.itemProps on collections #3411
base: main
Are you sure you want to change the base?
Conversation
🦋 Changeset detectedLatest commit: 08c26ac The changes in this PR will be included in the next version bump. This PR includes changesets to release 13 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Modified PackagesThe following packages were modified by this pull request:
|
@@ -97,6 +97,7 @@ export class TinaAdminApi { | |||
filename | |||
extension | |||
} | |||
_values |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While the PR is nicely small, you might agree that it's not very bandwidth-efficient.
What I could change here, is to introduce a _sys.fields
attribute
in packages/@tinacms/graphql/src/resolver/index.ts
instead:
an object that would have only the subset of fields.
The question is: what that subset should contain?
- everything but the one with
isBody: true
? - everything but those with
type: "rich-text"
? - only those with simple types? (not
rich-text
and notobject
)
That is a design decision, and you probably in a better position than me to answer that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah this is a good point, it has the potential to de-optimize that query, it might be best to provide a property on field definitions that would populate it to the _sys.fields
property, as you noted.
It's not so much a matter of the size of payload, but also if we can avoid providing the _values
then we can skip retrieving the document entirely (basically the same thing we do with _sys.title
, except it'd be a JSON
type probably.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just thinking ahead a bit, If the user can specify which fields they want available to that list-view, maybe we should allow them to create new columns for a given field?
In that case, instead of using itemProps to control the label field, they'd be able to control the UI for any given column, as opposed to just the title-label.
(Another common example might be including a custom "author" field in this list).
Thanks for the PR @newash - we'll discuss the ramifications of including the |
Do you have any updates on this @jeffsee55 ? |
We'll be discussing this next week and we'll get back to you, thanks @newash ! |
Any update lads? |
Hey @newash - sorry for the delay, this PR is definitely something we'd like to have but it introduces more complexity than we'd thought. We don't have the bandwidth right now to approach it properly, but do plan to address it. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
I still need this |
not stale |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
still need this |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
will this ever be addressed? |
Hey @newash, I've been thinking a lot about the suggestion here and would like to go that route: What do you think? Our roadmap is fully booked for the next few weeks, but I'll try to slot this in shortly after that. |
Of course, I'm not going to argue against your obviously neater solution. 🙂 |
Hello!
I created this PR for #3389
I tried it with
experimental-examples/tina-cloud-starter
adding thedraft
field and theui.itemProps
to the collection schema:and could produce this:
I'm not sure though if both
packages/@tinacms/schema-tools/src/types.ts
andpackages/@tinacms/schema-tools/src/types/SchemaTypes.ts
file needed to be updated, or one would have been enough.I also haven't looked into your tests, so I'm not sure about the necessary tests either.