Skip to content

Commit

Permalink
Merge pull request #3420 from projectblacklight/release-8.x-backport
Browse files Browse the repository at this point in the history
Backport: Remove default partial slot value.
  • Loading branch information
jcoyne authored Oct 25, 2024
2 parents e1927c7 + ba29af7 commit 89bcb60
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
11 changes: 4 additions & 7 deletions app/components/blacklight/document_component.rb
Original file line number Diff line number Diff line change
Expand Up @@ -129,14 +129,11 @@ def before_render
set_slot(:thumbnail, nil) unless thumbnail || show?
set_slot(:metadata, nil, fields: presenter.field_presenters, show: @show) unless metadata
set_slot(:embed, nil) unless embed
if view_partials.present?
view_partials.each do |view_partial|
with_partial(view_partial) do
helpers.render_document_partial @document, view_partial, component: self, document_counter: @counter
end

view_partials.each do |view_partial|
with_partial(view_partial) do
helpers.render_document_partial @document, view_partial, component: self, document_counter: @counter
end
else
set_slot(:partials, nil)
end
end

Expand Down
6 changes: 6 additions & 0 deletions spec/components/blacklight/document_component_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,12 @@ def call
expect(rendered).to have_content 'Partials'
end

it 'has no partials by default' do
component.render_in(view_context)

expect(component.partials?).to be false
end

context 'with before_titles' do
let(:render) do
component.render_in(view_context) do
Expand Down

0 comments on commit 89bcb60

Please sign in to comment.