Skip to content

Commit 530f3b1

Browse files
committed
Display related fields at component level
Closes #1464
1 parent aa81135 commit 530f3b1

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
@@ -353,7 +353,10 @@ class CatalogController < ApplicationController
353353
config.add_component_field 'altformavail', field: 'altformavail_html_tesim', helper_method: :render_html_tags
354354
config.add_component_field 'otherfindaid', field: 'otherfindaid_html_tesm', helper_method: :render_html_tags
355355
config.add_component_field 'odd', field: 'odd_html_tesim', helper_method: :render_html_tags
356-
356+
config.add_component_field 'relatedmaterial', field: 'relatedmaterial_html_tesm', helper_method: :render_html_tags
357+
config.add_component_field 'separatedmaterial', field: 'separatedmaterial_html_tesm', helper_method: :render_html_tags
358+
config.add_component_field 'originalsloc', field: 'originalsloc_html_tesm', helper_method: :render_html_tags
359+
357360
# Component Show Page - Indexed Terms Section
358361
config.add_component_indexed_terms_field 'access_subjects', field: 'access_subjects_ssim', link_to_facet: true, separator_options: {
359362
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
@@ -90,6 +90,25 @@
9090
end
9191
end
9292

93+
describe 'other materials fields' do
94+
let(:doc_id) { 'aoa271_aspace_0d7174f0081ee8fd43f08872cfd7adc3' }
95+
96+
it 'displays relatedmaterial' do
97+
expect(page).to have_css('dt', text: 'Related material')
98+
expect(page).to have_css('dd', text: /^Records relating to the Alpha Omega Commission are held/)
99+
end
100+
101+
it 'displays separatedmaterial' do
102+
expect(page).to have_css('dt', text: 'Separated material')
103+
expect(page).to have_css('dd', text: /^Photographs and sound recordings have been transferred/)
104+
end
105+
106+
it 'displays originalsloc' do
107+
expect(page).to have_css('dt', text: 'Location of originals')
108+
expect(page).to have_css('dd', text: /^File contains photocopies of original still held by the donor/)
109+
end
110+
end
111+
93112
describe 'collection context', js: true do
94113
it 'has ancestor component with badge having children count' do
95114
within '#collection-context' do

spec/fixtures/ead/nlm/alphaomegaalpha.xml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -525,6 +525,24 @@
525525
</did>
526526
</c>
527527
<c id="aspace_0d7174f0081ee8fd43f08872cfd7adc3" level="otherlevel">
528+
<originalsloc>
529+
<p>File contains photocopies of original still held by the donor.</p>
530+
</originalsloc>
531+
<separatedmaterial>
532+
<p>Photographs and sound recordings have been transferred to the appropriate
533+
custodial divisions of the Library where they are identified as part of these papers.
534+
Among the sound recordings are the following broadcasts:</p>
535+
<list>Example broadcast</list>
536+
</separatedmaterial>
537+
<separatedmaterial>
538+
<p>Other papers of Alpha Omega, which relate chiefly to his early years
539+
and public service in California, are held by the California State Archives in
540+
Sacramento.</p>
541+
</separatedmaterial>
542+
<relatedmaterial>
543+
<p>Records relating to the Alpha Omega Commission are held in the National
544+
Archives and Records Administration.</p>
545+
</relatedmaterial>
528546
<did>
529547
<unittitle>Review of constitution and suggestions,</unittitle>
530548
<unitdate>n.d.</unitdate>

0 commit comments

Comments
 (0)