Skip to content

Commit 9142012

Browse files
Merge pull request #1493 from projectblacklight/related-2
Display related fields at component level
2 parents b281049 + 530f3b1 commit 9142012

File tree

4 files changed

+42
-2
lines changed

4 files changed

+42
-2
lines changed

lib/generators/arclight/templates/catalog_controller.rb

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -362,7 +362,10 @@ class CatalogController < ApplicationController
362362
config.add_component_field 'altformavail', field: 'altformavail_html_tesim', helper_method: :render_html_tags
363363
config.add_component_field 'otherfindaid', field: 'otherfindaid_html_tesm', helper_method: :render_html_tags
364364
config.add_component_field 'odd', field: 'odd_html_tesim', helper_method: :render_html_tags
365-
365+
config.add_component_field 'relatedmaterial', field: 'relatedmaterial_html_tesm', helper_method: :render_html_tags
366+
config.add_component_field 'separatedmaterial', field: 'separatedmaterial_html_tesm', helper_method: :render_html_tags
367+
config.add_component_field 'originalsloc', field: 'originalsloc_html_tesm', helper_method: :render_html_tags
368+
366369
# Component Show Page - Indexed Terms Section
367370
config.add_component_indexed_terms_field 'access_subjects', field: 'access_subjects_ssim', link_to_facet: true, separator_options: {
368371
words_connector: '<br/>',

spec/features/collection_filtering_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
click_button 'Search'
5353

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

5858
it 'allows the user to choose to search all collections' do

spec/features/component_page_spec.rb

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,25 @@
103103
end
104104
end
105105

106+
describe 'other materials fields' do
107+
let(:doc_id) { 'aoa271_aspace_0d7174f0081ee8fd43f08872cfd7adc3' }
108+
109+
it 'displays relatedmaterial' do
110+
expect(page).to have_css('dt', text: 'Related material')
111+
expect(page).to have_css('dd', text: /^Records relating to the Alpha Omega Commission are held/)
112+
end
113+
114+
it 'displays separatedmaterial' do
115+
expect(page).to have_css('dt', text: 'Separated material')
116+
expect(page).to have_css('dd', text: /^Photographs and sound recordings have been transferred/)
117+
end
118+
119+
it 'displays originalsloc' do
120+
expect(page).to have_css('dt', text: 'Location of originals')
121+
expect(page).to have_css('dd', text: /^File contains photocopies of original still held by the donor/)
122+
end
123+
end
124+
106125
describe 'collection context', js: true do
107126
it 'has ancestor component with badge having children count' do
108127
within '#collection-context' do

spec/fixtures/ead/nlm/alphaomegaalpha.xml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -588,6 +588,24 @@
588588
</did>
589589
</c>
590590
<c id="aspace_0d7174f0081ee8fd43f08872cfd7adc3" level="otherlevel">
591+
<originalsloc>
592+
<p>File contains photocopies of original still held by the donor.</p>
593+
</originalsloc>
594+
<separatedmaterial>
595+
<p>Photographs and sound recordings have been transferred to the appropriate
596+
custodial divisions of the Library where they are identified as part of these papers.
597+
Among the sound recordings are the following broadcasts:</p>
598+
<list>Example broadcast</list>
599+
</separatedmaterial>
600+
<separatedmaterial>
601+
<p>Other papers of Alpha Omega, which relate chiefly to his early years
602+
and public service in California, are held by the California State Archives in
603+
Sacramento.</p>
604+
</separatedmaterial>
605+
<relatedmaterial>
606+
<p>Records relating to the Alpha Omega Commission are held in the National
607+
Archives and Records Administration.</p>
608+
</relatedmaterial>
591609
<did>
592610
<unittitle>Review of constitution and suggestions,</unittitle>
593611
<unitdate>n.d.</unitdate>

0 commit comments

Comments
 (0)