Forward ooni_run_link_id from MAT View measurements link#1129
Open
toomore wants to merge 1 commit into
Open
Conversation
The MAT chart tooltip's "View measurements >" link forwards the active filters to the /search page, but the ooni_run_link_id filter was missing from the allow-list in generateSearchQuery. As a result, filtering an aggregation by an OONI Run link was lost when navigating to the measurements list. Add ooni_run_link_id to the forwarded keys. The /search page already accepts it as a supported filter, so no other change is needed.
|
@toomore is attempting to deploy a commit to the OONI Team on Vercel. A member of the Team first needs to authorize it. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
On the MAT (Measurement Aggregation Toolkit) chart, each tooltip has a "View measurements >" link that carries the active filters over to the
/searchmeasurements list page. When the aggregation is filtered byooni_run_link_id, that filter was not included in the generated link, so the destination/searchpage showed unfiltered results instead of the OONI Run link's measurements.Cause
The link query is built by
generateSearchQueryincomponents/aggregation/mat/CustomTooltip.js, which only forwards a fixed allow-list of keys (probe_cc,test_name,category_code,probe_asn,input,domain).ooni_run_link_idwas missing from that list, even though:query(the MATFormhas anooni_run_link_idfield), and/searchpage already accepts it as a supported filter (pages/search.js).Change
Add
ooni_run_link_idto the forwarded keys. The existing reduce logic handles it correctly: it's a filter (not a chart axis), so it's pulled from the MATqueryand only included when set and non-empty. Links without an OONI Run filter are unchanged. No other change is needed since/searchalready parses the param.Testing
ooni_run_link_idset, hovered a data point, and confirmed the link'shrefnow containsooni_run_link_id=<id>./searchloads with the OONI Run link filter applied.ooni_run_link_idset, the link is unchanged.🤖 Generated with Claude Code