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

Short link with filters #6642

Closed
kirya-dev opened this issue Dec 1, 2020 · 10 comments · Fixed by #6700
Closed

Short link with filters #6642

kirya-dev opened this issue Dec 1, 2020 · 10 comments · Fixed by #6700
Labels

Comments

@kirya-dev
Copy link
Contributor

When im using filter im get too long link with all filters. We can add to link only changed(not default) parameters?

@VincentLanglet
Copy link
Member

When im using filter im get too long link with all filters. We can add to link only changed(not default) parameters?

Can you develop ? Maybe with screenshot ?

@haivala
Copy link

haivala commented Dec 1, 2020

one solution is described here #689

@kirya-dev
Copy link
Contributor Author

kirya-dev commented Dec 1, 2020

When no filters:
image

When one filter applied
image

and link is https://gfdaog.demo.sonata-project.org/admin/app/news-comment/list?filter%5Bname%5D%5Btype%5D=&filter%5Bname%5D%5Bvalue%5D=Gunnar&filter%5Bemail%5D%5Btype%5D=&filter%5Bemail%5D%5Bvalue%5D=&filter%5Bmessage%5D%5Btype%5D=&filter%5Bmessage%5D%5Bvalue%5D=&filter%5B_page%5D=1&filter%5B_sort_by%5D=id&filter%5B_sort_order%5D=ASC&filter%5B_per_page%5D=32

Im expected: https://gfdaog.demo.sonata-project.org/admin/app/news-comment/list?filter[name][value]=Gunnar

@kirya-dev
Copy link
Contributor Author

one solution is described here #689

Just replacing value on v we dont escape providing other filters. And we also get url encoded [ as %5B

Some systems using json representation or own developed representation of query structure.

@kirya-dev
Copy link
Contributor Author

What kind use joined filter names instead of array substructure?

For ex:
https://gfdaog.demo.sonata-project.org/admin/app/news-comment/list?filter_name_value=Gunnar

@haivala
Copy link

haivala commented Dec 1, 2020

I meant the jquery version

@kirya-dev
Copy link
Contributor Author

I meant the jquery version

You didnt says that you meant =(

And now we have two problems:

  1. Extra params - resolves by jQuery
  2. Url encoded symbols - use prefixes sturcture.

@VincentLanglet
Copy link
Member

I meant the jquery version

Removing the empty filters since a great start.

Do you want to try a PR with this @kirya-dev ?

@kirya-dev
Copy link
Contributor Author

Of course. Im can. Im invent that:
For determine valid state of filters we need:

  1. Use JS for submiting form. Variants:
    1.a) Use window.location = '...';
    1.b) Disable unmodified inputs and before submit.
    1.c) Create fake form and submit it.
  2. Store default filter values at form attribute for determine changed filters - first variable in AbstractAmin:getFilterParamaterts
  3. Comparing algorithm with form values and submitted

Im think prefer 1.a point in 1 step

@kirya-dev
Copy link
Contributor Author

Using window.location = '.. allows no encode url charapters such as [ & ]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants