Skip to content

Commit

Permalink
fix advanced search facet constraints rendering bug
Browse files Browse the repository at this point in the history
  • Loading branch information
ebenenglish committed Oct 2, 2023
1 parent f6d90b4 commit 536c9f5
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/helpers/commonwealth_vlr_engine/facets_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ def render_facet_item(facet_field, item)
(controller.action_name == 'index' || controller.action_name == 'facet') &&
item.value == 'Collections'

if facet_in_params?(facet_field, item.value)
if facet_in_params?(facet_field, facet_value_for_facet_item(item))
render_selected_facet_value(facet_field, item)
else
render_facet_value(facet_field, item)
Expand Down
16 changes: 16 additions & 0 deletions app/views/blacklight_advanced_search/_facet_limit.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<div class="advanced_facet_limit">
<div class="inclusive_or card card-body bg-light mb-3">
<h5>Any of:</h5>
<ul class="list-unstyled facet-values">
<% advanced_query.filters[facet_field.key].each do |value| %>
<li>
<span class="selected"><%= h(value) %></span>
<%= link_to(remove_advanced_facet_param(facet_field.key, value, params), :class => "remove") do %>
<span class="remove-icon"></span><span class="sr-only">[remove]</span>
<% end %>
</li>
<% end %>
</ul>
</div>
<%# render_facet_limit display_facet, :layout => nil, :partial => advanced_search_facet_partial_name(display_facet) %>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def assets
# similar pattern as Hyrax (https://github.com/samvera/hyrax/commit/0e02c4adf26e74f2d892f575c93789bc166e53ad)
# though we hard-code the assets instead of installing with yarn
def uv_assets
directory 'public/uv' unless File.exist?('public/uv/uv.js')
directory 'public/uv-v4' unless File.exist?('public/uv-v4/umd/UV.js')
end
end
end

0 comments on commit 536c9f5

Please sign in to comment.