Skip to content

Commit a10100a

Browse files
committed
Add publishers to geospatial full records
Why these changes are being introduced: Now that the `publishers` field is available in the API via recordId queries, we should add it to the metadata dump in GDT full records. Relevant ticket(s): * [GDT-271](https://mitlibraries.atlassian.net/browse/GDT-271) * [GDT-270](https://mitlibraries.atlassian.net/browse/GDT-270) How this addresses that need: This adds `publishers` to the `more_info_geo` partial and corresponding helper test. Side effects of this change: None.
1 parent 1ce2d54 commit a10100a

File tree

3 files changed

+15
-1
lines changed

3 files changed

+15
-1
lines changed

app/helpers/record_helper.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ def access_type(metadata)
103103
# Note: the publishers field is not yet available in TIMDEX API, but it should be added here once it is.
104104
def more_info_geo?(metadata)
105105
relevant_fields = %w[alternate_titles contributors dates format identifiers languages locations
106-
links notes provider rights]
106+
links notes provider publishers rights]
107107
metadata.keys.any? { |key| relevant_fields.include? key }
108108
end
109109

app/views/record/_more_info_geo.html.erb

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,4 +94,14 @@
9494
</ul>
9595
</li>
9696
<% end %>
97+
98+
<% if metadata['publishers'].present? %>
99+
<li><strong>Publishers</strong>
100+
<ul>
101+
<% parse_nested_field(metadata['publishers']).each do |subfield| %>
102+
<li><%= render_subfield(subfield) %></li>
103+
<% end %>
104+
</ul>
105+
</li>
106+
<% end %>
97107
</ul>

test/helpers/record_helper_test.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -279,6 +279,10 @@ class RecordHelperTest < ActionView::TestCase
279279

280280
provider_record = { 'provider' => 'MIT' }
281281
assert more_info_geo?(provider_record)
282+
283+
publishers_record = { 'publishers' => [{ 'name' => 'Jagjaguwar', 'location' => 'Bloomington, IN',
284+
'date' => '2011' }] }
285+
assert more_info_geo?(provider_record)
282286
end
283287

284288
test 'more_info_geo? false if no more info available' do

0 commit comments

Comments
 (0)