Prioritize filters with predicates in active filter labels (#7702)#7717
Open
ray-curran wants to merge 1 commit intoactiveadmin:masterfrom
Open
Prioritize filters with predicates in active filter labels (#7702)#7717ray-curran wants to merge 1 commit intoactiveadmin:masterfrom
ray-curran wants to merge 1 commit intoactiveadmin:masterfrom
Conversation
ee720aa to
d46e559
Compare
corlissc
approved these changes
Feb 10, 2023
corlissc
left a comment
There was a problem hiding this comment.
@ray-curran looks good. This will resolve the issue that I submitted.
d46e559 to
420bc74
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #7717 +/- ##
=======================================
Coverage 99.05% 99.05%
=======================================
Files 184 184
Lines 4740 4740
=======================================
Hits 4695 4695
Misses 45 45
☔ View full report in Codecov by Sentry. |
…in#7702) When there are filters for a single field and a multi-field ransack search with predicate, the multi-field label on the active filter should use the custom label from the filter input box. Reproduction steps: ./app/admin/posts.rb ``` ActiveAdmin.register Post do filter :title_or_body_contains, as: :string, label: 'Title or Body' filter :title, as: :string ... end ``` Navigate to the posts path for a user like `localhost:3000/admin/users/4/posts` Complete search in both fields, note that both active filters use the label "Title contains". The `title_or_body_contains` should use the label from the filter "Title or Body contains".
420bc74 to
7e29df2
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When there are filters for a single field and a multi-field ransack search with predicate, the multi-field label on the active filter should use the custom label from the filter input box.
Reproduction steps:
./app/admin/posts.rb
Navigate to the posts path for a user like
localhost:3000/admin/users/4/postsComplete search in all fields, note that all three active filters use the label "Title contains".
The
title_or_body_containsshould use the label from the filter "Title or Body contains".The
title_or_bodyshould use the label from the filter: "Title/Body equals".Fixes #7702