Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Prioritize filters with predicates in active filter labels (#7702)#7717

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
ray-curran wants to merge1 commit intoactiveadmin:master
base:master
Choose a base branch
Loading
fromray-curran:7702-prioritize-predicate-labels

Conversation

@ray-curran
Copy link
Contributor

@ray-curranray-curran commentedNov 9, 2022
edited
Loading

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_or_body, as: :string, filters: [:equals], label: 'Title/Body'  filter :title, as: :string  ...end

Navigate to the posts path for a user like
localhost:3000/admin/users/4/posts

Complete search in all fields, note that all three active filters use the label "Title contains".
Thetitle_or_body_contains should use the label from the filter "Title or Body contains".
Thetitle_or_body should use the label from the filter: "Title/Body equals".

Fixes#7702

Copy link

@corlissccorlissc left a comment

Choose a reason for hiding this comment

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

@ray-curran looks good. This will resolve the issue that I submitted.

@javierjuliojavierjulioforce-pushed the7702-prioritize-predicate-labels branch fromd46e559 to420bc74CompareMarch 13, 2023 00:16
@codecov
Copy link

codecovbot commentedMar 13, 2023
edited
Loading

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base(12c39a7) 99.05% compared to head(7e29df2) 99.05%.

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
FilesCoverage Δ
lib/active_admin/filters/active_filter.rb100.00% <100.00%> (ø)

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

…in#7702)When there are filters for a single field and a multi-field ransacksearch with predicate, the multi-field label on the active filtershould 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 thelabel "Title contains". The `title_or_body_contains` should use thelabel from the filter "Title or Body contains".
@ray-curranray-curranforce-pushed the7702-prioritize-predicate-labels branch from420bc74 to7e29df2CompareNovember 3, 2023 18:39
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

1 more reviewer

@corlissccorlissccorlissc approved these changes

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Using multi-attribute Ransack filter not properly creating/pulling label for active filters sidebar content display

2 participants

@ray-curran@corlissc

[8]ページ先頭

©2009-2025 Movatter.jp