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
Search hackery #1187
Search hackery #1187
Conversation
…ithub.io into search_hackery
…ithub.io into search_hackery
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, it works fine very good but there is a minor issue. For the first visit or after refreshing the page whilst having an invalid query string it works fine but after the page is loaded and we press back on the browser it will include and accept the query as a valid query in the chips holder, please check both URL and also chips holder situation:
I'm not sure that this is something that can be prevented; this whole PR is a bit of a hack in any case. fairsharing.github.io/src/router/index.js Lines 96 to 98 in 9ae13c5
|
I tried some code today to see how I can fix it. still no luck |
My Final review I think no user can add those edge-cases filters into the URL by using our UI, and the only way they might be redirected would be an old link given to them or shared with them(which prevent them your code properly in these cases), then the code you already had written I believe is enough and its very rare that someone enters a new filter(query) in the URL or press back. Besides we are not responsible for all sort of data user enters in the query if no data is returned then there will be no problem in this regard as well. Due to the above reasons I approve your branch. |
Thanks, sounds reasonable. |
This code causes search parameters to be modified if they match certain (known) patterns from the old system.
This ticket lists some particular URLs which have been used in a paper recently and so must be intercepted, as readers of the paper will encounter the new site and try to use old URLs with it.
#1186
Look in
src/router/hackSearch.js
for details of the re-writing. It's called any time anyone visits a search url (seesrc/router/index.js
). Themodified
parameter should ensure that the hack is only called once.Of course, queries formatted for the new system should pass through
hackSearch.js
untouched.