Skip to content

Commit

Permalink
Merge pull request #2856 from AlchemyCMS/deprecate-js_filter_field
Browse files Browse the repository at this point in the history
Deprecate `js_filter_field`
  • Loading branch information
tvdeyen authored May 2, 2024
2 parents 03538cc + 4d2228c commit 350da56
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 5 deletions.
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 @@ -104,10 +104,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

0 comments on commit 350da56

Please sign in to comment.