-
Notifications
You must be signed in to change notification settings - Fork 927
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
Add filtering functionality to user notes page #5255
Add filtering functionality to user notes page #5255
Conversation
2e18a7c
to
63ca327
Compare
e382dfa
to
721f8d5
Compare
About the date pickers: I wanted to add them to our standard pagination because we already have date indexes. Then we wouldn't need them here, specifically in this notes filer. But this plan haven't worked so far because:
|
d87609f
to
d88ec30
Compare
Thank you for the detailed background and context, Anton. I agree that using date pickers makes sense if we’re filtering notes by dates, especially since the current setup isn’t relying on standard pagination. Having date pickers included in standard pagination for entries with created_at and updated_at attributes makes sense in a way but I'm not sure how long would it take for something like this to be implemented and merged. As for the next steps, I’m not sure whether it’s better to get this PR merged as is and refactor later when the notes move to standard pagination, or if we should address the pagination issue on user note pages first and then refactor this PR accordingly. On a side note, I’ve managed to implement sortable columns on a table UI end for |
84a01a3
to
8725d95
Compare
You can make a pull request that just adds the status filter. That doesn't depend on pagination and shouldn't tank the performance because:
|
<%= select_tag :status, | ||
options_for_select([[t(".all"), "all"], [t(".open"), "open"], [t(".closed"), "closed"]], params[:status] || "all"), | ||
:class => "form-select", | ||
:onchange => "this.form.requestSubmit()" %> |
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.
onchange
is not going to work with the csp_enforce: true
setting.
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.
Locally, this works as expected for me. Could you provide more details on how to reproduce this issue locally, or is this something that only occurs on production servers? Thanks.
I looked again at why similar things were rejected in the past like #1656 and there doesn't seem to be any clear reason. |
Besides the double-join db query, there's couple more issues with the interaction type: "blue on blue" colors and whether the submitted/commented classification makes sense at all (what if I closed a note without a comment?). I wanted to try opened/closed/commented instead. |
Thank you for review @AntonKhorev Few updates since last commit:
|
cc6c281
to
900b915
Compare
900b915
to
ec76688
Compare
As for splitting this into multiple smaller PRs, I would prefer we merge this as a complete feature/functionality. Adding filters one by one would significantly increase the time required and might leave the feature feeling incomplete. This PR covers filtering part for intended functionality cohesively, and it seems better to refine and adjust post-merge if needed. |
Obviously you didn't introduce it. That comment was made in July.
Check it when the note is colored as "submitted". |
Time for what? For PR review?
Are you sure? Is it complete with exactly the filters you added and not some other filters? |
Exactly, since each PR would need to be reviewed sequentially, it would prolong the overall process.
Yes, the goal was to implement the filters that were most commonly requested and improve the feature based on that feedback. However, if you have any suggestions for additional filters that could enhance the usability for mappers, I’m definitely open to discussing and considering those ideas too. |
Where are these requests? For example #832 wants status filter but doesn't say anything about date ranges. Why would a status filter be incomplete without a date range filter? Also #1534 (comment). |
I opened new PR #5297 according to suggestion here. Closing this as not planed for now.
|
This PR addresses #832 by adding sorting and filtering functionality to user note pages. This PR is also an alternative, or better put expanding #5239 so that filtering and sorting functionality can be expanded further on if needed.
Key Changes:
from
andto
date range.created_at
orupdated_at
in ascending or descending order.Tests for added methods and scopes have been added to ensure that these features work as expected across different scenarios, including handling of date ranges and note types.
Screenshots: