Skip to content

Commit

Permalink
Merge pull request #3162 from projectblacklight/depr
Browse files Browse the repository at this point in the history
Silence deprecation warnings under Blacklight 8
  • Loading branch information
jcoyne authored Sep 27, 2024
2 parents 6b3eec9 + d29d20f commit e023cf8
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions app/components/spotlight/icon_component.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
module Spotlight
# Displays the document
class IconComponent < Blacklight::Icons::IconComponent
if Blacklight.version < '8.0'
# Work around https://github.com/projectblacklight/blacklight/issues/3232 (fixed in Blacklight 8.0)
if Blacklight.version < '7.39'
# Work around https://github.com/projectblacklight/blacklight/issues/3232 (fixed in Blacklight 7.39)
def classes
(@classes - ['blacklight-icons-'] + ["blacklight-icons-#{name}"]).uniq
((@classes || (super if defined?(super)) || []) - ['blacklight-icons-'] + ["blacklight-icons-#{name}"]).uniq
end
end
end
Expand Down
2 changes: 1 addition & 1 deletion app/views/spotlight/catalog/edit.html.erb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<div class="container">
<div class="row">
<%- view_config = blacklight_config.view_config(action_name: :edit) %>
<%= render (view_config.document_component || Blacklight::DocumentComponent).new(presenter: document_presenter(@document), classes: ['col-md-8'], component: :div, show: true, actions: false, partials: view_config.partials) do |component| %>
<%= render (view_config.document_component || Blacklight::DocumentComponent).new((Blacklight.version > '8.0' ? :document : :presenter) => document_presenter(@document), classes: ['col-md-8'], component: :div, show: true, actions: false, partials: view_config.partials) do |component| %>
<% component.with_title(as: 'h1', classes: '', link_to_document: false) %>
<% component.with_body do %>
<% view_config.partials.each do |view_partial| %>
Expand Down
2 changes: 1 addition & 1 deletion spec/views/spotlight/pages/show.html.erb_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
end

context 'when rendering with layout' do
let(:blacklight_config) { Blacklight::Configuration.new }
let(:blacklight_config) { Blacklight::Configuration.new header_component: Spotlight::HeaderComponent }
let(:document) { SolrDocument.new id: 'xyz', format: 'a' }
let(:presenter) { Blacklight::ShowPresenter.new(document, view, blacklight_config) }

Expand Down

0 comments on commit e023cf8

Please sign in to comment.