Skip to content

Commit 023c1b0

Browse files
authored
Merge pull request #3230 from projectblacklight/view_component3
Drop support for view_component 2
2 parents d25f695 + 4bf6ea2 commit 023c1b0

File tree

3 files changed

+2
-9
lines changed

3 files changed

+2
-9
lines changed

.github/workflows/ruby.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,6 @@ jobs:
5151
additional_name: "Solr 8.11.2"
5252
- ruby: "3.1"
5353
rails_version: "7.1.3.4"
54-
- ruby: "3.1"
55-
rails_version: "7.1.3.4"
56-
view_component_version: "~> 2.66"
57-
additional_name: "/ ViewComponent 2"
5854
- ruby: "3.1"
5955
rails_version: "7.0.8.4"
6056
additional_name: "/ Propshaft"

app/components/blacklight/document_component.rb

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,6 @@ module Blacklight
2222
class DocumentComponent < Blacklight::Component
2323
with_collection_parameter :document
2424

25-
# ViewComponent 3 changes iteration counters to begin at 0 rather than 1
26-
COLLECTION_INDEX_OFFSET = ViewComponent::VERSION::MAJOR < 3 ? 0 : 1
27-
2825
# Content appearing before the document
2926
renders_one :header
3027

@@ -108,7 +105,7 @@ def initialize(document: nil, presenter: nil, partials: nil,
108105

109106
@counter = counter
110107
@document_counter = document_counter || args.fetch(self.class.collection_counter_parameter, nil)
111-
@counter ||= @document_counter + COLLECTION_INDEX_OFFSET + counter_offset if @document_counter.present?
108+
@counter ||= 1 + @document_counter + counter_offset if @document_counter.present?
112109

113110
@show = show
114111
end

blacklight.gemspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ Gem::Specification.new do |s|
3131
s.add_dependency "kaminari", ">= 0.15" # the pagination (page 1,2,3, etc..) of our search results
3232
s.add_dependency "i18n", '>= 1.7.0' # added named parameters
3333
s.add_dependency "ostruct", '>= 0.3.2'
34-
s.add_dependency "view_component", '>= 2.66', '< 4'
34+
s.add_dependency "view_component", '~> 3.9'
3535
s.add_dependency "zeitwerk"
3636

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

0 commit comments

Comments
 (0)