Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Filter URL params don't work if value contains commas #1846

Open
joverlee521 opened this issue Sep 5, 2024 · 1 comment
Open

Filter URL params don't work if value contains commas #1846

joverlee521 opened this issue Sep 5, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@joverlee521
Copy link
Contributor

First noticed when trying to share a URL for rabies tree filtered to specific authors.

  1. Go to https://nextstrain.org/rabies@2024-09-01?f_author=Nsadzetsen,G.A.,Balogun,E.O.,Kabir,J.,Sallau,A.B.,Dacheux,L.,Kia,G.S.N.,Kwaga,J.K.P.,Tekki,I.S.
  2. See URL updates to https://nextstrain.org/rabies@2024-09-01 and the author filter is not applied to the tree.

This fails because we expect multiple values per key to be comma separated. So the author list is separated into individual values, e.g. Nsadzetsen, and which fails the filter value validation

@tsibley
Copy link
Member

tsibley commented Sep 5, 2024

The standard way to pass multiple values for a query param is to give the param multiple times with one value each time, e.g.

?f_author=Foo&f_author=Bar

Maybe Auspice could transition to doing it that way?

joverlee521 added a commit that referenced this issue Sep 9, 2024
Use query param `mf_<field>=<value>` to specify active filters for
the measurements panel. Invalid fields or values are ignored and
removed.

Multiple values for the same field are expected to give the query param
multiple times with different values, e.g.
`mf_reference_strain=A/Stockholm/18/2011&mf_reference_strain=A/Alabama/5/2010`
This is slightly different than the behavior of the tree filter param,
but I'm following this pattern to avoid the issue described in
<#1846>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants