Skip to content

Commit

Permalink
Merge pull request #1493 from projectblacklight/related-2
Browse files Browse the repository at this point in the history
Display related fields at component level
  • Loading branch information
randalldfloyd authored Dec 15, 2023
2 parents b281049 + 530f3b1 commit 9142012
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 2 deletions.
5 changes: 4 additions & 1 deletion lib/generators/arclight/templates/catalog_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,10 @@ class CatalogController < ApplicationController
config.add_component_field 'altformavail', field: 'altformavail_html_tesim', helper_method: :render_html_tags
config.add_component_field 'otherfindaid', field: 'otherfindaid_html_tesm', helper_method: :render_html_tags
config.add_component_field 'odd', field: 'odd_html_tesim', helper_method: :render_html_tags

config.add_component_field 'relatedmaterial', field: 'relatedmaterial_html_tesm', helper_method: :render_html_tags
config.add_component_field 'separatedmaterial', field: 'separatedmaterial_html_tesm', helper_method: :render_html_tags
config.add_component_field 'originalsloc', field: 'originalsloc_html_tesm', helper_method: :render_html_tags

# Component Show Page - Indexed Terms Section
config.add_component_indexed_terms_field 'access_subjects', field: 'access_subjects_ssim', link_to_facet: true, separator_options: {
words_connector: '<br/>',
Expand Down
2 changes: 1 addition & 1 deletion spec/features/collection_filtering_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
click_button 'Search'

expect(page).to have_css('.constraint-value .filter-value', text: 'Alpha Omega Alpha Archives, 1894-1992')
expect(page).to have_css('.al-document-listings .document', count: 1) # has results
expect(page).to have_css('.al-document-listings .document', count: 2) # has results
end

it 'allows the user to choose to search all collections' do
Expand Down
19 changes: 19 additions & 0 deletions spec/features/component_page_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,25 @@
end
end

describe 'other materials fields' do
let(:doc_id) { 'aoa271_aspace_0d7174f0081ee8fd43f08872cfd7adc3' }

it 'displays relatedmaterial' do
expect(page).to have_css('dt', text: 'Related material')
expect(page).to have_css('dd', text: /^Records relating to the Alpha Omega Commission are held/)
end

it 'displays separatedmaterial' do
expect(page).to have_css('dt', text: 'Separated material')
expect(page).to have_css('dd', text: /^Photographs and sound recordings have been transferred/)
end

it 'displays originalsloc' do
expect(page).to have_css('dt', text: 'Location of originals')
expect(page).to have_css('dd', text: /^File contains photocopies of original still held by the donor/)
end
end

describe 'collection context', js: true do
it 'has ancestor component with badge having children count' do
within '#collection-context' do
Expand Down
18 changes: 18 additions & 0 deletions spec/fixtures/ead/nlm/alphaomegaalpha.xml
Original file line number Diff line number Diff line change
Expand Up @@ -588,6 +588,24 @@
</did>
</c>
<c id="aspace_0d7174f0081ee8fd43f08872cfd7adc3" level="otherlevel">
<originalsloc>
<p>File contains photocopies of original still held by the donor.</p>
</originalsloc>
<separatedmaterial>
<p>Photographs and sound recordings have been transferred to the appropriate
custodial divisions of the Library where they are identified as part of these papers.
Among the sound recordings are the following broadcasts:</p>
<list>Example broadcast</list>
</separatedmaterial>
<separatedmaterial>
<p>Other papers of Alpha Omega, which relate chiefly to his early years
and public service in California, are held by the California State Archives in
Sacramento.</p>
</separatedmaterial>
<relatedmaterial>
<p>Records relating to the Alpha Omega Commission are held in the National
Archives and Records Administration.</p>
</relatedmaterial>
<did>
<unittitle>Review of constitution and suggestions,</unittitle>
<unitdate>n.d.</unitdate>
Expand Down

0 comments on commit 9142012

Please sign in to comment.