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

[Feat] add category filter on review page #1145

Merged
merged 2 commits into from
Jan 24, 2024
Merged

[Feat] add category filter on review page #1145

merged 2 commits into from
Jan 24, 2024

Conversation

iknowright
Copy link
Contributor

Types of changes

Thanks for sending a pull request! Please fill in the following content to let us know better about this change.
Please put an x in the box that applies

  • Bugfix
  • New feature
  • Refactoring
  • Breaking change (any change that would cause existing functionality to not work as expected)
  • Documentation Update
  • Other (please describe)

Description

Describe what the change is
Add category filed to proposal table. When you click on a category, the list of proposals will be filtered by the category you selected.

Steps to Test This Pull Request

Steps to reproduce the behavior:

  1. Go to review page
  2. Click on category filed

Expected behavior

Show the proposal list which was be filtered.

Related Issue

If applicable, refernce to the issue related to this pull request.

More Information

Screenshots
If applicable, add screenshots to help explain your problem.

Additional context
Add any other context about the problem here. You may also want to refer
to how to wirte the perfect pull request

2022-04-09.4.10.36.mov

@iknowright iknowright linked an issue Jul 4, 2023 that may be closed by this pull request
@codecov-commenter
Copy link

codecov-commenter commented Jul 4, 2023

Codecov Report

Attention: 11 lines in your changes are missing coverage. Please review.

Comparison is base (3be480d) 69.74% compared to head (daa9f1b) 70.59%.
Report is 35 commits behind head on master.

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1145      +/-   ##
==========================================
+ Coverage   69.74%   70.59%   +0.84%     
==========================================
  Files          85       85              
  Lines        3378     3394      +16     
==========================================
+ Hits         2356     2396      +40     
+ Misses       1022      998      -24     
Files Coverage Δ
src/reviews/views.py 29.86% <15.38%> (-1.44%) ⬇️

... and 3 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@iknowright
Copy link
Contributor Author

outcome

Dashboard._.PyCon.Taiwan.-.Google.Chrome.2023-07-04.21-57-26.mp4

@iknowright iknowright self-assigned this Jul 4, 2023
@iknowright iknowright requested a review from josix July 4, 2023 14:11
@iknowright
Copy link
Contributor Author

@josix
https://github.com/pycontw/pycon.tw/assets/25934612/9e519b89-c331-4d91-a33f-e2fd6e3b3384

updated outcome

  • showing X of X in the proposals tab
  • always query all but filter afterward (via template)

})
print(context)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess this is used for debugging? could you help remove it, thanks!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Resolved in daa9f1b

Comment on lines 39 to 46
<option value="?order=count">ALL</option>
{% else %}
<option value="?order=count&category={{ category }}">{{ category }}</option>
<option value="?order=count">ALL</option>
{% endif %}
{% for category_option in category_options %}
{% if category != category_option %}
<option value="?order=count&category={{ category_option }}">{{ category_option }}</option>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

issue: the value order=count here will cause the proposals ordered only by the count after selecting the category even the user has chosen to ordered by other field like lang, count, etc. I guess we need to pass the query parameter from URL.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Resolved in daa9f1b
use a trick to retain both order={}&category={} query params.

Copy link
Collaborator

@josix josix left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, Sorry that I didn't notice that there is an update for the last review.

@josix josix merged commit c520012 into master Jan 24, 2024
1 check passed
@iknowright iknowright deleted the ben/category_filter branch May 1, 2024 13:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[feature request] add filters "level" and "category" on reviewer page
3 participants