Skip to content

Commit

Permalink
use view_component with_SLOT api, instead of deprecated 2.x slot API
Browse files Browse the repository at this point in the history
Deprecated 2.x Slot API was taken away in view_component [3.0.0](https://viewcomponent.org/CHANGELOG.html#v300).  By switching to with_SLOT_NAME API, we can support view_component 3.x.

The with_SLOTNAME API was introduced in view_component [2.54.0](https://viewcomponent.org/CHANGELOG.html#2540) (May 2022).  So we now express a dependency requiring view_component at least 2.54.0. As we do use view_components directly in source code here, it is appropriate to express it as a dependency, instead of just leaving it an indirect dependency.
  • Loading branch information
jrochkind committed Oct 4, 2023
1 parent 9e81b9e commit 3162ce6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<%= render(@layout.new(facet_field: @facet_field)) do |component| %>
<% component.label do %>
<% component.with_label do %>
<%= @facet_field.label %>
<% end %>
<% component.body do %>
<% component.with_body do %>
<div class="limit_content range_limit <%= @facet_field.key %>-config blrl-plot-config">
<% if @facet_field.selected_range_facet_item %>
<%= render BlacklightRangeLimit::RangeSegmentsComponent.new(facet_field: @facet_field, facet_items: [@facet_field.selected_range_facet_item], classes: ['current']) %>
Expand Down Expand Up @@ -37,7 +37,7 @@

<%= render BlacklightRangeLimit::RangeFormComponent.new(facet_field: @facet_field, classes: @classes) %>
<%= more_link(key: @facet_field.key, label: @facet_field.label) unless @facet_field.in_modal? %>
<%= with_more_link(key: @facet_field.key, label: @facet_field.label) unless @facet_field.in_modal? %>
<% if @facet_field.missing_facet_item && !request.xhr? %>
<%= render BlacklightRangeLimit::RangeSegmentsComponent.new(facet_field: @facet_field, facet_items: [@facet_field.missing_facet_item], classes: ['missing', 'subsection']) %>
Expand Down
2 changes: 2 additions & 0 deletions blacklight_range_limit.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ Gem::Specification.new do |s|
s.license = 'Apache 2.0'

s.add_dependency 'blacklight', '>= 7.25.2', '< 9'
# We now use new `with_` slot API, so need view_copmonent >= 2.54.0, through 3.x
s.add_dependency 'view_component', ">= 2.54.0", "< 4"
s.add_dependency 'deprecation'

s.add_development_dependency 'rspec', '~> 3.0'
Expand Down

0 comments on commit 3162ce6

Please sign in to comment.