Skip to content

Commit eb33224

Browse files
authored
Merge pull request #3732 from projectblacklight/doc-id
Push the default id for the show page back to the partial.
2 parents cb99523 + e197725 commit eb33224

File tree

3 files changed

+2
-9
lines changed

3 files changed

+2
-9
lines changed

app/components/blacklight/document_component.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ def initialize(document: nil, partials: nil,
9393

9494
@component = component
9595
@title_component = title_component
96-
@id = id || ('document' if show)
96+
@id = id
9797
@classes = classes
9898

9999
@counter = counter

app/views/catalog/_show_main_content.html.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<% content_for(:head) { render_link_rel_alternates } %>
44

55
<% document_component = blacklight_config.view_config(:show).document_component -%>
6-
<%= render document_component.new(document: document_presenter(@document), component: :div, show: true, partials: blacklight_config.view_config(:show).partials) do |component| %>
6+
<%= render document_component.new(id: 'document', document: document_presenter(@document), component: :div, show: true, partials: blacklight_config.view_config(:show).partials) do |component| %>
77
<% component.with_title(as: 'h1', classes: '', link_to_document: false, actions: false) %>
88
<% component.with_footer do %>
99
<% if @document.respond_to?(:export_as_openurl_ctx_kev) %>

spec/components/blacklight/document_component_spec.rb

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -136,13 +136,6 @@
136136
vc_test_controller.action_name = "show"
137137
end
138138

139-
it 'renders with an id' do
140-
component.with_body { '-' }
141-
render_inline component
142-
143-
expect(page).to have_css 'article#document'
144-
end
145-
146139
it 'renders a title' do
147140
render_inline component
148141

0 commit comments

Comments
 (0)