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

Humanize labels on scaffold forms #493

Merged
merged 2 commits into from
May 2, 2020

Conversation

lachlanjc
Copy link
Contributor

This is my first code contribution to Redwood, so hoping I did this right!

Right now, when you generate scaffolding, the input labels are exactly the names of the database columns. If I were making a Pitchfork clone, it might have this:
Screen Shot 2020-05-02 at 4 28 10 PM

I really like how Rails converts those names to more readable labels. Now, using humanize-string:
Screen Shot 2020-05-02 at 4 39 44 PM

This adds a dependency to the CLI package, but we already have a number of string-converting libraries in use for scaffolding, & it doesn't add any weight to the app dependencies or the forms themselves.

@mojombo
Copy link
Contributor

mojombo commented May 2, 2020

This is great! Definitely an improvement, and no runtime weight added. Thanks!

@cannikin cannikin merged commit c7bc9f4 into redwoodjs:master May 2, 2020
@cannikin
Copy link
Member

cannikin commented May 2, 2020

Love it, thanks!

@lachlanjc lachlanjc deleted the scaffolds-humanize-form-labels branch May 2, 2020 23:25
lachlanjc added a commit to lachlanjc/redwood that referenced this pull request May 3, 2020
@thedavidprice thedavidprice added this to the next release milestone May 7, 2020
jmreidy pushed a commit to jmreidy/redwood that referenced this pull request May 30, 2020
* Humanize labels on scaffold forms

* Update snapshot
Tobbe pushed a commit to Tobbe/redwood that referenced this pull request Jun 19, 2020
Tobbe pushed a commit to Tobbe/redwood that referenced this pull request Jun 19, 2020
Tobbe pushed a commit to Tobbe/redwood that referenced this pull request Jun 19, 2020
cannikin pushed a commit that referenced this pull request Jun 19, 2020
* Use CheckBox component for Boolean fields on scaffolded forms

* Fix bug for Boolean-less forms

* Update post-#493

* scaffold.js remove unnecessary computed property key

* Fix component name

* Fix component name in template

* Update template

* Prevent required on checkboxes

* Update scaffold form

* Switch to JS syntax

* Less CheckBox-specific template

* scaffold: Left-align checkbox

Co-authored-by: Lachlan Campbell <lachlan@hackclub.com>
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