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

Deprecate js_filter_field #2856

Merged
merged 1 commit into from
May 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion app/helpers/alchemy/admin/base_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -106,10 +106,11 @@ def sites_for_select
# The css class of the <input> tag
# @option options [String or Hash] :data ({'alchemy-list-filter' => items})
# A HTML data attribute that holds the jQuery selector that represents the list to be filtered
#
# @deprecated render Alchemy::Admin::ListFilter.new(items) instead
def js_filter_field(items, _options = {})
render Alchemy::Admin::ListFilter.new(items)
end
deprecate js_filter_field: "render Alchemy::Admin::ListFilter.new(items) instead", deprecator: Alchemy::Deprecation

# Returns a link that opens a modal confirmation to delete window.
#
Expand Down
2 changes: 1 addition & 1 deletion app/views/alchemy/admin/attachments/_tag_list.html.erb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<% if Alchemy::Attachment.tag_counts.any? %>
<h3><%= Alchemy.t("Filter by tag") %></h3>
<%= js_filter_field '.tag-list li' %>
<%= render Alchemy::Admin::ListFilter.new(".tag-list li") %>
<ul>
<%= render_tag_list('Alchemy::Attachment') %>
</ul>
Expand Down
2 changes: 1 addition & 1 deletion app/views/alchemy/admin/pictures/_tag_list.html.erb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<% if Alchemy::Picture.tag_counts.any? %>
<h3><%= Alchemy.t("Filter by tag") %></h3>
<%= js_filter_field '.tag-list li' %>
<%= render Alchemy::Admin::ListFilter.new(".tag-list li") %>
<ul>
<%= render_tag_list('Alchemy::Picture') %>
</ul>
Expand Down
2 changes: 1 addition & 1 deletion app/views/alchemy/admin/resources/_tag_list.html.erb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<div class="tag-list<%= ' with_filter_bar' if resource_has_filters %><%= ' filtered' if search_filter_params[:tagged_with].present? %>">
<h3><%= Alchemy.t("Filter by tag") %></h3>
<%= js_filter_field '.tag-list li' %>
<%= render Alchemy::Admin::ListFilter.new(".tag-list li") %>
<ul>
<%= render_tag_list(resource_model.name) %>
</ul>
Expand Down
2 changes: 1 addition & 1 deletion app/views/alchemy/admin/tags/edit.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<div class="input tags">
<label class="control-label"><%= Alchemy.t('Tags') %></label>
<div class="control_group" id="tags_tag_list">
<%= js_filter_field '.tag-list li' %>
<%= render Alchemy::Admin::ListFilter.new(".tag-list li") %>
<ul class="tags tag-list">
<%= render partial: "radio_tag", collection: @tags, locals: {name: "tag"} %>
</ul>
Expand Down