Closed Vandivier closed 2 years ago
Those are cool suggestions! Some of that is done in the linked PR.
When you mention the dropdown, I'm assuming this is for a form where we're creating a new record that belongs to a user, and we want a dropdown (and potentially a search filter in it) that shows a list of users that should be associated with the record right?
I'm actually not sure how we handle field relationships in the linked PR so gonna look into that actually, but it think it might be better to do that in a separate PR and ship what we have so far first, but up to Brandon and Aleksandra
but it think it might be better to do that in a separate PR and ship what we have so far first
Yep, agree!
@Vandivier I think this issue: https://github.com/blitz-js/blitz/issues/2038 covers some of your points. The additional thing would be the dropdown, right?
I marked it as blocked, so that we merge @Roesh's PR first.
I'm going to close this issue as a duplicate of: https://github.com/blitz-js/blitz/issues/2038. Feel free to open a new one for all the additional features that are not included in https://github.com/blitz-js/blitz/issues/2038.
yall rock, thank you!!
What do you want and why?
As a developer, I would like appropriately detailed forms to be generated based on my model, so that I can save time!
Possible implementation(s)
when making new.tsx, add additional input fields based on the model. this could get complex quickly, but a simple starting point would be to do this only for string fields. So instead of a name input, there would be a LabeledTextField for each string field on the new model.
also the mutation could be updated appropriately, eg:
Additional context
longer-term, it would be cool to automatically make a drop down so that I can pick a user. for example, consider a "Task" model or a "Contact" model like:
blitz generate all contact firstName lastName phone address addressLine2 city state zip email belongsTo:user?
then a dropdown that is prepopulated with users could be provided so that I can pick a user by a readable name instead of having to look up ID in a DB