Skip to content

Commit 84d9194

Browse files
authored
Merge pull request #152 from MITLibraries/gdt-252-access-type-update
Update access type values
2 parents 1dc615f + c7f05d4 commit 84d9194

File tree

5 files changed

+13
-13
lines changed

5 files changed

+13
-13
lines changed

app/helpers/record_helper.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ def gis_access_link(metadata)
8383

8484
# At this point, we don't show download links for non-MIT records. For MIT records, the download link is stored
8585
# consistently as a download link. We are confirming that the link text is 'Data' for added confirmation.
86-
if access_type(metadata) == 'Not owned by MIT'
86+
if access_type(metadata) == 'unknown: check with owning institution'
8787
links.select { |link| link['kind'] == 'Website' }.first['url']
8888
else
8989
links.select { |link| link['kind'] == 'Download' && link['text'] == 'Data' }.first['url']

app/views/record/_access_button.html.erb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
<% return if @record.blank? %>
22

33
<div class="access-button-container <%= display %>">
4-
<% if access_type(@record) == 'Free/open to all' %>
4+
<% if access_type(@record) == 'no authentication required' %>
55
<a class="btn button-primary access-button" href="<%= gis_access_link(@record) %>">Download geodata files</a>
6-
<% elsif access_type(@record) == 'MIT authentication' %>
6+
<% elsif access_type(@record) == 'MIT authentication required' %>
77
<a class="btn button-primary access-button" href="<%= gis_access_link(@record) %>">
88
Download geodata files <span class="auth-notice">MIT authentication</span>
99
</a>

app/views/record/_record_geo.html.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
<% end %>
4343

4444
<div class="record-access-links">
45-
<% if access_type(@record) != 'Not owned by MIT' && source_metadata_available?(@record['links']) %>
45+
<% if access_type(@record) != 'unknown: check with owning institution' && source_metadata_available?(@record['links']) %>
4646
<a class="btn button-secondary metadata-link"
4747
href="<%= source_metadata_link(@record['links']) %>">Download full metadata</a>
4848
<% end %>

app/views/shared/_geo_data_info.html.erb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@
33
<% if parse_geo_dates(metadata['dates']) %>
44
<li><%= parse_geo_dates(metadata['dates']) %></li>
55
<% end %>
6-
<% if access_type(metadata) == 'Not owned by MIT' %>
6+
<% if access_type(metadata) == 'unknown: check with owning institution' %>
77
<li>
8-
<%= access_type(metadata) %>
8+
Not owned by MIT
99
<span class="other-provider">(<%= link_to "Owned by #{metadata['provider']}", gis_access_link(metadata) %>)</span>
1010
</li>
11-
<% elsif access_type(metadata) == 'MIT authentication' %>
11+
<% elsif access_type(metadata) == 'MIT authentication required' %>
1212
<li><span class="access-restricted"><%= access_type(metadata) %></span></li>
1313
<% end %>
1414
</ul>

test/helpers/record_helper_test.rb

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -122,12 +122,12 @@ class RecordHelperTest < ActionView::TestCase
122122
'kind' => 'bar'
123123
},
124124
{
125-
'description' => 'Free/open to all',
125+
'description' => 'no authentication required',
126126
'kind' => 'Access to files'
127127
}
128128
]
129129
}
130-
assert_equal 'Free/open to all', access_type(rights)
130+
assert_equal 'no authentication required', access_type(rights)
131131
end
132132

133133
test 'gis_access_link returns nil if access type is blank' do
@@ -157,7 +157,7 @@ class RecordHelperTest < ActionView::TestCase
157157
'kind' => 'bar'
158158
},
159159
{
160-
'description' => 'Free/open to all',
160+
'description' => 'no authentication required',
161161
'kind' => 'Access to files'
162162
}
163163
]
@@ -173,7 +173,7 @@ class RecordHelperTest < ActionView::TestCase
173173
'kind' => 'bar'
174174
},
175175
{
176-
'description' => 'Not owned by MIT',
176+
'description' => 'unknown: check with owning institution',
177177
'kind' => 'Access to files'
178178
}
179179
],
@@ -202,7 +202,7 @@ class RecordHelperTest < ActionView::TestCase
202202
'kind' => 'bar'
203203
},
204204
{
205-
'description' => 'Free/open to all',
205+
'description' => 'no authentication required',
206206
'kind' => 'Access to files'
207207
}
208208
],
@@ -226,7 +226,7 @@ class RecordHelperTest < ActionView::TestCase
226226
'kind' => 'bar'
227227
},
228228
{
229-
'description' => 'MIT authenticated',
229+
'description' => 'MIT authentication required',
230230
'kind' => 'Access to files'
231231
}
232232
],

0 commit comments

Comments
 (0)