CodeForPhilly / stately

Form-driven workflow engine
http://tinyurl.com/statelydeck
21 stars 5 forks source link

Case data view should render fields in form template order #25

Open timwis opened 8 years ago

timwis commented 8 years ago

The "data" view should render the case's data in the same field order as the form template. It should also use the same names, instead of the underscore-separated ones. This should be a matter of combining all the actions' templates in order and passing them to the CaseData view.

Alternatively, we could just have a template property on the case object in the workflow definition. That would probably be ideal, but maybe it's optional, and it should fall back to the same order of the form templates.

Either way, this is definitely not for MVP.

mjumbewu commented 8 years ago

In the long run, I'm definitely in favor of more template customization. For now, we could use OrderedDict objects to parse and dump the JSON. This should result in an ordering consistent with however the data is sent up to the server.

timwis commented 8 years ago

Interesting ... once it's dumped to json, I would have assumed we'd lose the order (or at least the guarantee of order)? If not, that's a clever solution for now. Doesn't get us the human-friendly field names, but this is more of a "eventually" issue anyway.