Closed pkalita-lbl closed 2 years ago
@ddooley @turbomam I think this is ready for review now
As mentioned in commit, "Field function hooks are now possible by assigning a dictionary of field names as keys in dh.field_settings{} to an object containing functions such as onChange() which are merged with the template's "field" data structure. Validation rules trigger onChange() etc. functions when value of field changes. onChange() can then trigger effects on other field picklist content etc."
These changes to
script/data-harmonizer/index.js
andscript/data-harmonizer/field_rules.js
provide hooks that allow a client application to customize certain column aspects. The client passes the configuration to aDataHarmonizer
instance via a new property calledfield_settings
.This will be useful to NMDC because it will enable our code which sets up a
DataHarmonizer
instance to customizer the behavior columns that represent GOLD Ecosystem Classification Levels and let them interact with each other. But I think these hooks are generic enough to be useful to other clients ofDataHarmonizer
as well.Fixes #302