URL shortener for queries
Why?
Queries generated can be quite overwhelming.
Even a simple query like:
(filter_machine_tag_name = 'ICL' AND filter_deleted_on = NONE) OR filter_description ICONTAINS 'all machines'
leads to a looooooooong loooooooooong url:
cibuglog.exmaple.com/bug/open_bugs?query=%28filter_machine_tag_name+%3D+%27ICL%27+AND+filter_deleted_on+%3D+NONE%29+OR+filter_description+ICONTAINS+%27all+machines%27
And this gets out of hand pretty quickly filling multiple screens in bug reports and not fitting in the IRC character limit.
Sharing them is hard.
What?
Instead of putting the full query we should store it in the database and use a short, automatically generated tag, à la URL shortener.
Behaviour I would like to see:
- I enter a long query and press enter/click "filter" button
- POST query to the server, generate the short name for the query and store it in the db
- display the results, in the response we also get the "short name" of the stored query
- update the page URL using
window.history.pushState()
so we can copy and share the link e.g./open_bugs?short_query=aAaaAaA
/relate #76