-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
[WIP] Temporarily fixes double pagination on /questions/tag/ #8479
Conversation
Codecov Report
@@ Coverage Diff @@
## main #8479 +/- ##
=======================================
Coverage 82.01% 82.01%
=======================================
Files 101 101
Lines 5899 5894 -5
=======================================
- Hits 4838 4834 -4
+ Misses 1061 1060 -1
|
Hi, this is looking good so far... did you need any help with it? Thanks! |
@jywarren There were some comments I made in the issue, and I realized the suggested fix doesn't 100% fix it... 馃様 It's mainly because |
Hi @tyler-wel - i'm so sorry it took me a while to circle back to this. Let me look at your code and maybe call in some help... i really appreciate your work here! Noting that this is still an issue at https://publiclab.org/questions/tag/water-quality and even the latest code at https://stable.publiclab.org/questions/tag/water-quality so this will be great to figure out. 馃帀 |
<%== pagy_bootstrap_nav @pagy %> | ||
<% else %> | ||
<%= will_paginate @questions, :renderer => WillPaginate::ActionView::BootstrapLinkRenderer unless @unpaginated || @questions.empty? %> | ||
<% if @answered_questions.present? %> |
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.
So, is the issue here that one of the pagination elements is for answered questions and the other is for unanswered? Looking at the two includes at
plots2/app/views/tag/show/_tab_content.html.erb
Lines 28 to 37 in 0633521
<div class="tab-content"> | |
<div class="tab-pane active" id="asked-tab"> | |
<%= render partial: "questions/new_question" %> | |
</div> | |
<div class="tab-pane" id="answered-tab"> | |
<% if @answered_questions %> | |
<%= render partial: "users/answered" %> | |
<% end %> | |
</div> |
To test this theory, we could try commenting out one and seeing if the double pagination helper disappears.
Just to note, I believe we are OK eliminating the distinction between answered and unanswered in this display. Pinging @ebarry to confirm though.
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.
yes it does sound ok to eliminate the "answered | unanswered" toggle and the associated pagination.
One idea towards helping people choose which question card to potentially click on is to pull out the # of comments that is contained in the ...
on each question card, and perhaps show these #s directly on the card to give people a sense of where there's a lot of dialogue/engagement.
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.
OK, great, so confirmed we can just remove the toggle, and hopefully that resolves the double pagination too!
I'm breaking out the design discussion portion into its own issue at: #8731
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.
Also we will move over to #8689 -- thanks!
Fixes #7530
Checks
Make sure these boxes are checked before your pull request (PR) is ready to be reviewed and merged. Thanks!
rake test
@publiclab/reviewers
for help, in a comment belowDescription
Changes the
_answered
html fragment to check the existence of@answered_questions
before rendering the pagy pagination.Note, that this was not actually tested with answered questions because it seems that the Asked/Answered tabs are broken under the
questions/tag
screen. Clicking either tab does not change anything. @jywarrenBefore
After
If tests do fail, click on the red
X
to learn why by reading the logs.Please be sure you've reviewed our contribution guidelines at https://publiclab.org/contributing-to-public-lab-software
Thanks!