Skip to content

264: Fix address tool behaviors

Liem Khuu requested to merge 264-fix-address-filter into main

Update the naming of the current filter tags to use the item name instead of the search value as the ID.

This is used by the address_tool.js to find and and update the address text.

This looks to be an issue that was probably there before the search filter refactor for #48 (closed) and was carried over from:

https://gitlab.com/wapdc/website/-/blob/db11b8b267d02a65d9914d6279ea69ef2183cc45/modules/pdc_api_tools/assets/js/datatable_build.js#L79

It also didn't make sense to check for an element with this ID (from the search item value), as it seems that this only worked because it was generally a non-existing element (https://gitlab.com/wapdc/website/-/blob/db11b8b267d02a65d9914d6279ea69ef2183cc45/modules/pdc_api_tools/assets/js/datatable_build.js#L87).

Also ensured that previous behavior matching https://7-26-t-47-pdc-pdc.pantheonsite.io/political-disclosure-reporting-data/browse-search-data/candidates?jurisdiction_type=Statewide where the address filter does not update the URL parameters. This would require additional work to handle translating the display address into filter on page load. This likely will need an update / refactor of the "address_tool.js"

Related to #264 (closed)

Merge request reports