Skip to content

Commit

Permalink
Merge pull request #3230 from projectblacklight/view_component3
Browse files Browse the repository at this point in the history
Drop support for view_component 2
  • Loading branch information
jcoyne authored Sep 25, 2024
2 parents d25f695 + 4bf6ea2 commit 023c1b0
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 9 deletions.
4 changes: 0 additions & 4 deletions .github/workflows/ruby.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,6 @@ jobs:
additional_name: "Solr 8.11.2"
- ruby: "3.1"
rails_version: "7.1.3.4"
- ruby: "3.1"
rails_version: "7.1.3.4"
view_component_version: "~> 2.66"
additional_name: "/ ViewComponent 2"
- ruby: "3.1"
rails_version: "7.0.8.4"
additional_name: "/ Propshaft"
Expand Down
5 changes: 1 addition & 4 deletions app/components/blacklight/document_component.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,6 @@ module Blacklight
class DocumentComponent < Blacklight::Component
with_collection_parameter :document

# ViewComponent 3 changes iteration counters to begin at 0 rather than 1
COLLECTION_INDEX_OFFSET = ViewComponent::VERSION::MAJOR < 3 ? 0 : 1

# Content appearing before the document
renders_one :header

Expand Down Expand Up @@ -108,7 +105,7 @@ def initialize(document: nil, presenter: nil, partials: nil,

@counter = counter
@document_counter = document_counter || args.fetch(self.class.collection_counter_parameter, nil)
@counter ||= @document_counter + COLLECTION_INDEX_OFFSET + counter_offset if @document_counter.present?
@counter ||= 1 + @document_counter + counter_offset if @document_counter.present?

@show = show
end
Expand Down
2 changes: 1 addition & 1 deletion blacklight.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ Gem::Specification.new do |s|
s.add_dependency "kaminari", ">= 0.15" # the pagination (page 1,2,3, etc..) of our search results
s.add_dependency "i18n", '>= 1.7.0' # added named parameters
s.add_dependency "ostruct", '>= 0.3.2'
s.add_dependency "view_component", '>= 2.66', '< 4'
s.add_dependency "view_component", '~> 3.9'
s.add_dependency "zeitwerk"

s.add_development_dependency "rsolr", ">= 1.0.6", "< 3" # Library for interacting with rSolr.
Expand Down

0 comments on commit 023c1b0

Please sign in to comment.