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

Append keywords in questions tag filter as GET URL parameters #897

Closed
4 tasks
jywarren opened this issue Oct 17, 2016 · 9 comments · Fixed by #1335
Closed
4 tasks

Append keywords in questions tag filter as GET URL parameters #897

jywarren opened this issue Oct 17, 2016 · 9 comments · Fixed by #1335
Labels
enhancement explains that the issue is to improve upon one of our existing features help wanted requires help by anyone willing to contribute Ruby summer-of-code

Comments

@jywarren
Copy link
Member

jywarren commented Oct 17, 2016

At https://publiclab.org/questions, when you add a "filter" of a given tag, the URL is not changed -- the added tag filters are stored in the session.

It's important that the keywords should be be appended to the url instead of being stored in the session. The routing should be more like:

https://publiclab.org/questions/spectrometry

and for multiple tags, perhaps:

https://publiclab.org/questions/spectrometry,second-tag,another

These would be fetched in the questions_controller via params[:id].split(',') -- here: https://github.com/publiclab/plots2/blob/master/app/controllers/questions_controller.rb. The index, answered, popular, liked action use this functionality presently.

The sorting is done using the sort_questions_by_tag method in the application controller, where it sources from the session: https://github.com/publiclab/plots2/blob/master/app/controllers/application_controller.rb#L190-L200. This method is called in all the places mentioned above.

The addition and deletion of tags from the session is done using the methods in tag_controller listed here: https://github.com/publiclab/plots2/blob/master/app/controllers/tag_controller.rb#L239-L267. So you need to modify these methods too.

The tag sorting interface (that generates the sessions, and would generate the URLs in our new plan) shown on the sidebar, is here: https://github.com/publiclab/plots2/blob/master/app/views/tag/_sorting.html.erb

That itself might be moved into this directory for easier management: https://github.com/publiclab/plots2/blob/master/app/views/questions/

Steps to solve

Summarizing the steps below

  • Modify the tag methods mentioned here to append the keywords in url instead of session and fetch them accordingly
  • Modify the sort_questions_by_tag method according to changes made and deprecate the use of session and use GET url parameters
  • Modify the index, answered, popular, likedactions in questions controller accordingly
  • Move the tag sorting template from views/tag --> views/questions
@jywarren jywarren added enhancement explains that the issue is to improve upon one of our existing features help wanted requires help by anyone willing to contribute Ruby labels Oct 17, 2016
@jywarren
Copy link
Member Author

@ananyo2012 -- any chance you could take this one on? I understand if you're busy!!!

@ananyo2012
Copy link
Member

ananyo2012 commented Oct 17, 2016

Sure Jeff I can work on this. In fact I was just onto other issues as well.

Uh sorry to say it here I recently sent you a mail. Do have a look at it.

@jywarren
Copy link
Member Author

jywarren commented Oct 17, 2016

Thanks and i got your email -- chatting w/ other staff about it today and
we appreciate your interest!

@jywarren
Copy link
Member Author

jywarren commented Nov 4, 2016

@jywarren
Copy link
Member Author

jywarren commented Nov 4, 2016

@ryzokuken - if you're looking for new projects, this is also a key one I've been having trouble with. It seems to be related to a recurrence (for me) of bug #638, where no questions are shown:

screenshot

@ryzokuken
Copy link
Member

@jywarren Sure, I'll look into it.

@jywarren
Copy link
Member Author

@ananyo2012, perhaps this'd be a good GCI candidate, esp. if you're familiar with this code?

@ananyo2012
Copy link
Member

Yes this is a good one. Holds importance for improving the sort feature. I can improve documentation for this issue and then we can add this as a task.

@ananyo2012 ananyo2012 changed the title Switch questions search tagging to GET URL parameters Append keywords in questions tag filter as GET URL parameters Nov 27, 2016
@jywarren
Copy link
Member Author

Closed, hooray!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement explains that the issue is to improve upon one of our existing features help wanted requires help by anyone willing to contribute Ruby summer-of-code
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants