The generateRules script was still pulling dropdown value lists from the hidden row within each tab that had inconsistent/incorrect values in many cases.
We had identified and corrected some of those mistakes manually in validation-rules.json, but hadn't addresses the issue systematically so we were regularly getting more errors reported.
This PR changes the system to ignore those often-incorrect lists, and instead uses the lists recorded in the Dropdowns tab of the worksheet to populate the extracted rules. The change resulted in around 370 lines of corrected validations.
It requires manually recording which field-ids map to which dropdown names, so I've added that mapping to the script, and included an error check so that when the Dropdowns tab is updated in the future it will remind us to update the mappings at the same time.
NOTE: This structure assumes that every instance of a certain field-id will adhere to the same list of values. If that assumption ever changes, then we'll have to update this system to include EC codes in the mappings.
The
generateRules
script was still pulling dropdown value lists from the hidden row within each tab that had inconsistent/incorrect values in many cases.We had identified and corrected some of those mistakes manually in
validation-rules.json
, but hadn't addresses the issue systematically so we were regularly getting more errors reported.This PR changes the system to ignore those often-incorrect lists, and instead uses the lists recorded in the Dropdowns tab of the worksheet to populate the extracted rules. The change resulted in around 370 lines of corrected validations.
It requires manually recording which field-ids map to which dropdown names, so I've added that mapping to the script, and included an error check so that when the Dropdowns tab is updated in the future it will remind us to update the mappings at the same time.
NOTE: This structure assumes that every instance of a certain field-id will adhere to the same list of values. If that assumption ever changes, then we'll have to update this system to include EC codes in the mappings.