acteng / atip

Active Travel Infrastructure Platform
https://acteng.github.io/atip/
Apache License 2.0
22 stars 4 forks source link

Display user-friendly field names for auto-generated forms #275

Closed dabreegster closed 1 year ago

dabreegster commented 1 year ago

Closes #273 https://acteng.github.io/atip/capitalize_auto_form/scheme.html?authority=Adur&schema=v2

Screenshot from 2023-07-14 14-52-43

An incremental improvement. It'd also be nice to apply these to radio buttons, so we don't see SchoolCrossing. But we need to be careful with https://github.com/sindresorhus/humanize-string, because it mangles the dash in "20 - 30 mph"

Pete-Y-CS commented 1 year ago

Looks good, only question is if it mangles one of our strings, maybe we want to manually write something since it's probably not much effort and it can be good to avoid adding too many package

Pete-Y-CS commented 1 year ago

Looks good, only question is if it mangles one of our strings, maybe we want to manually write something since it's probably not much effort and it can be good to avoid adding too many package

As with other things, it's easier to fix after Monday if we want this for when you're in the office, though

dabreegster commented 1 year ago

Manually writing might be better long-term. It'd make it harder to initially write schemas, if the human-visible label is required. Imagine adding something to everything in schemas/*.json... maybe it can be optional, and by default the actual value we stick in JSON can match the label. Thoughts?

dabreegster commented 1 year ago

Yeah, agreed, thanks -- let's treat this as a tiny step forward and revisit next week

Pete-Y-CS commented 1 year ago

Manually writing might be better long-term. It'd make it harder to initially write schemas, if the human-visible label is required. Imagine adding something to everything in schemas/*.json... maybe it can be optional, and by default the actual value we stick in JSON can match the label. Thoughts?

I was actually thinking writing our own string tidier, but adding an optional human-friendly-label to the schema might not be a bad idea