18F / epa-notice

Web interface for viewing and commenting on proposed changes to federal regulations
Other
7 stars 17 forks source link

[WIP] Prototype custom form fields. #237

Closed jmcarp closed 8 years ago

jmcarp commented 8 years ago

Tasks remaining:

Goes with https://github.com/eregs/regulations-site/pull/300

cmc333333 commented 8 years ago

Would it make sense to pass the lookup information from the backend, since it's readily available? The template would need to know where to look but we wouldn't need a code change should the list be modified.

jmcarp commented 8 years ago

Ideally, yes. We could do this in -site: fetch all fields, identity the ones with dependencies, and then fetch all per-dependency values for each option (it's potentially a lot of api calls, but at least they'll be cached). Alternatively, it might make sense to fetch options in this repo instead, so that agencies only fetch the form metadata that they actually need. What do you think @cmc333333 @vrajmohan?

cmc333333 commented 8 years ago

I think fetching the fields and their available values is an everyone need -- we need for validation, for example. I'd imagine -site pulls down the fields and passes them to the template. In this case, the template would largely ignore this information.

Re lots of api calls: I still hold hope that those are all performed only once (in the parser), when generating the other proposal data.

jmcarp commented 8 years ago

Agreed that we should be fetching field metadata in -parser eventually. What I'm wondering is when that should happen, since we're currently doing this work in -site. Before/after we merge this PR? Before/after the end of the sprint? My (slight) preference would be to get this pair of PRs reviewed and merged soon-ish, so design-minded people can start making this look good, and track fetching field metadata in a separate issue.

cmc333333 commented 8 years ago

I think it'd be pretty straight forward to pass the data from -site into the template (moving it one step closer to the parser). We could probably do that this sprint, but I agree we can merge this earlier. Let's not worry about completeness of fake data, though.

jmcarp commented 8 years ago

Updated. Will pass options to the template and generate all combo-select options in a separate PR.

cmc333333 commented 8 years ago

:+1: