Skip to content

Commit c2e2923

Browse files
authored
Merge pull request #160 from MITLibraries/gdt-271-publishers-in-more-info
Add publishers to geospatial full records
2 parents 9cb4da5 + a10100a commit c2e2923

14 files changed

+196
-102
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/models/timdex_record.rb

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,11 @@ class TimdexRecord < TimdexBase
7272
physicalDescription
7373
provider
7474
publicationFrequency
75-
publicationInformation
75+
publishers {
76+
date
77+
location
78+
name
79+
}
7680
relatedItems {
7781
description
7882
itemType

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>

config/schema/schema.json

Lines changed: 79 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1213,6 +1213,61 @@
12131213
"enumValues": null,
12141214
"possibleTypes": null
12151215
},
1216+
{
1217+
"kind": "OBJECT",
1218+
"name": "Publishers",
1219+
"description": null,
1220+
"fields": [
1221+
{
1222+
"name": "date",
1223+
"description": "The date of the publication",
1224+
"args": [
1225+
1226+
],
1227+
"type": {
1228+
"kind": "SCALAR",
1229+
"name": "String",
1230+
"ofType": null
1231+
},
1232+
"isDeprecated": false,
1233+
"deprecationReason": null
1234+
},
1235+
{
1236+
"name": "location",
1237+
"description": "Where the publisher is located",
1238+
"args": [
1239+
1240+
],
1241+
"type": {
1242+
"kind": "SCALAR",
1243+
"name": "String",
1244+
"ofType": null
1245+
},
1246+
"isDeprecated": false,
1247+
"deprecationReason": null
1248+
},
1249+
{
1250+
"name": "name",
1251+
"description": "The name of the publisher",
1252+
"args": [
1253+
1254+
],
1255+
"type": {
1256+
"kind": "SCALAR",
1257+
"name": "String",
1258+
"ofType": null
1259+
},
1260+
"isDeprecated": false,
1261+
"deprecationReason": null
1262+
}
1263+
],
1264+
"inputFields": null,
1265+
"interfaces": [
1266+
1267+
],
1268+
"enumValues": null,
1269+
"possibleTypes": null
1270+
},
12161271
{
12171272
"kind": "OBJECT",
12181273
"name": "Query",
@@ -1943,7 +1998,7 @@
19431998
}
19441999
},
19452000
"isDeprecated": true,
1946-
"deprecationReason": "Use `publicationInformation`"
2001+
"deprecationReason": "Use `publishers`"
19472002
},
19482003
{
19492004
"name": "inBibliography",
@@ -2243,7 +2298,7 @@
22432298
},
22442299
{
22452300
"name": "publicationInformation",
2246-
"description": "Imprint information for item",
2301+
"description": null,
22472302
"args": [
22482303

22492304
],
@@ -2260,6 +2315,28 @@
22602315
}
22612316
}
22622317
},
2318+
"isDeprecated": true,
2319+
"deprecationReason": "Use `publishers`"
2320+
},
2321+
{
2322+
"name": "publishers",
2323+
"description": "Publishers that are associated with the item",
2324+
"args": [
2325+
2326+
],
2327+
"type": {
2328+
"kind": "LIST",
2329+
"name": null,
2330+
"ofType": {
2331+
"kind": "NON_NULL",
2332+
"name": null,
2333+
"ofType": {
2334+
"kind": "OBJECT",
2335+
"name": "Publishers",
2336+
"ofType": null
2337+
}
2338+
}
2339+
},
22632340
"isDeprecated": false,
22642341
"deprecationReason": null
22652342
},

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

test/vcr_cassettes/alma_record_with_no_publication_date.yml

Lines changed: 11 additions & 11 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)