mountetna / magma

Data server with friendly data loaders
GNU General Public License v2.0
5 stars 2 forks source link

Clean up Magma::Attribute#json_template #128

Open graft opened 4 years ago

graft commented 4 years ago

Ye olde #json_template method on Magma::Attribute is an ancient piece of Magma code, and probably getting crusty now that we are attempting to clean up the structure of the attributes themselves. The main reformation we wish to make is to bring it in line with the model specified in #99. The changes: 1) Consolidate 'match' and 'options' following #126 - this will mostly make Timur upset since it uses some of these values to control its AttributeViewer component. 2) Remove the odd 'model_name', which appears to only be necessary for link attribute types. However, this should be reported somehow once we resolve how to store this value in the attribute table, see #127.

alimi commented 4 years ago

1) Consolidate 'match' and 'options' following #126 - this will mostly make Timur upset since it uses some of these values to control its AttributeViewer component.

How are you thinking to consolidate match and options? Would we combine them into a single validation item?

graft commented 4 years ago

I think I wrote this before we discussed better strategy for not breaking Timur - a non-breaking way to do this would be to maintain match and options for now but add in the validation item, which would just include the validation JSON. We can patch Timur to use this json, then retire the 'match' and 'options'.