From c7f05d4bda1485d30930c1add3120ce95c31307e Mon Sep 17 00:00:00 2001 From: jazairi <16103405+jazairi@users.noreply.github.com> Date: Fri, 29 Mar 2024 11:53:36 -0400 Subject: [PATCH] Update access type values Why these changes are being introduced: The "access to files" values have been changed in the data mapping layer. We need to make a corresponding change in a few partials where the value of that field is a rendering condition. Relevant ticket(s): * [GDT-252](https://mitlibraries.atlassian.net/browse/GDT-252) How this addresses that need: This updates the values as needed in the access_button, record_geo, and geo_data_info partials, as well as the access_type helper method. Side effects of this change: It was a bit tricky to wrangle and update all of these hardcoded values. Though they are unlikely to change again, this is something that we may want to consider refactoring. --- app/helpers/record_helper.rb | 2 +- app/views/record/_access_button.html.erb | 4 ++-- app/views/record/_record_geo.html.erb | 2 +- app/views/shared/_geo_data_info.html.erb | 6 +++--- test/helpers/record_helper_test.rb | 12 ++++++------ 5 files changed, 13 insertions(+), 13 deletions(-) diff --git a/app/helpers/record_helper.rb b/app/helpers/record_helper.rb index bfa632fe..36c45d99 100644 --- a/app/helpers/record_helper.rb +++ b/app/helpers/record_helper.rb @@ -83,7 +83,7 @@ def gis_access_link(metadata) # At this point, we don't show download links for non-MIT records. For MIT records, the download link is stored # consistently as a download link. We are confirming that the link text is 'Data' for added confirmation. - if access_type(metadata) == 'Not owned by MIT' + if access_type(metadata) == 'unknown: check with owning institution' links.select { |link| link['kind'] == 'Website' }.first['url'] else links.select { |link| link['kind'] == 'Download' && link['text'] == 'Data' }.first['url'] diff --git a/app/views/record/_access_button.html.erb b/app/views/record/_access_button.html.erb index d4bf91c6..cb09dfd8 100644 --- a/app/views/record/_access_button.html.erb +++ b/app/views/record/_access_button.html.erb @@ -1,9 +1,9 @@ <% return if @record.blank? %>
- <% if access_type(@record) == 'Free/open to all' %> + <% if access_type(@record) == 'no authentication required' %> Download geodata files - <% elsif access_type(@record) == 'MIT authentication' %> + <% elsif access_type(@record) == 'MIT authentication required' %> Download geodata files MIT authentication diff --git a/app/views/record/_record_geo.html.erb b/app/views/record/_record_geo.html.erb index 31f311cb..ea4a1bd1 100644 --- a/app/views/record/_record_geo.html.erb +++ b/app/views/record/_record_geo.html.erb @@ -42,7 +42,7 @@ <% end %>