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

Allow form generator to take a fields option which will prepopulate the form with those fields #5

Closed
SpencerCDixon opened this issue Feb 14, 2016 · 7 comments
Labels

Comments

@SpencerCDixon
Copy link
Owner

No description provided.

@jflayhart
Copy link

jflayhart commented Aug 24, 2016

Interesting... so how would this work, like: redux g form SignUp --fields=firstName lastName email password? Would this only be for the field names or how would it know that the input types should be of attribute "email" or "password" or "text"?

@SpencerCDixon
Copy link
Owner Author

Yeah something along those lines would be nice. Maybe you would separte field names with their types like in a rails migration.

firstName:text email:email lastName:text age:number etc.

@jflayhart
Copy link

jflayhart commented Aug 24, 2016

Ok, seems pretty straight forward then; so a complete command for this would include an optional --fields flag with any number of <field name>:<input type> arguments. In theory, this could look like:

redux g form <form name> --fields=<field name>:<input type> where multiple fields are separated by spaces. Unless there's a cleaner way...

This might be a separate issue, but I think redux-cli needs to have some sort of validation for this in that if a form or component already exists, complain about it in the CLI instead of overwriting it (as well as making sure the syntax is correct for the including the field arguments). The overwriting of existing components has been a cumbersome issue I've experienced using this library. Nothing a revert of the local repo couldn't fix, but still...

@SpencerCDixon
Copy link
Owner Author

Yeah I totally agree with the overwrite issues. If you want to try and tackle that I'd be open to a PR. I just started a new job though and need to learn Go and Angular at the moment so not sure how much free time I'll have to work on that for at least a few weeks.

@jflayhart
Copy link

jflayhart commented Aug 25, 2016

Cool. I just wanted to create some ideas here for reference whenever I might have time to work on this...

Another idea, however, is to allow another flag for --validation=true or something, which would create some simple validation logic around the user-defined fields during the generation process. That would be pretty cool... I would love to work on this when I have time, which isn't now unfortunately. But will leave these notes behind for future reference.

This was referenced Sep 22, 2017
@anithri
Copy link
Collaborator

anithri commented Sep 25, 2017

#110 will address this. And this issue will be closed when it is accepted

data will be able to be passed to blueprints that can use to do things like generate form fields for each attribute.

@anithri
Copy link
Collaborator

anithri commented Sep 30, 2017

Merged #110 into the 2.0 master.

@anithri anithri closed this as completed Sep 30, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants