Skip to content

Commit 2eef622

Browse files
committed
Add feature flag for full record fulfillment links
Why these changes are being introduced: Initial usability testing suggested that the 'View full record' fulfillment links are not frequently used. UXWS would like to hide this feature for testing, and possibly bring it back if users struggle to reach the records in external systems. Relevant ticket(s): * [USE-253](https://mitlibraries.atlassian.net/browse/USE-253) How this addresses that need: This adds a `record_link` feature flag and hides the full record fulfillment links behind it. Side effects of this change: If we decide to permanently remove these links, we should remove the feature flag as well.
1 parent 5ab6b4b commit 2eef622

3 files changed

Lines changed: 9 additions & 5 deletions

File tree

app/models/feature.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
class Feature
3535
# List of all valid features in the application
3636
VALID_FEATURES = %i[geodata boolean_picker simulate_search_latency tab_primo_all tab_timdex_all
37-
tab_timdex_alma].freeze
37+
tab_timdex_alma record_link].freeze
3838

3939
# Check if a feature is enabled by name
4040
#

app/views/search/_result.html.erb

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,10 @@
5656
<%= render partial: 'search/highlights', locals: { result: result } %>
5757
</div>
5858

59-
<div class="result-get">
60-
<%= view_record(result) %>
61-
</div>
59+
<% if Feature.enabled?(:record_link) %>
60+
<div class="result-get">
61+
<%= view_record(result) %>
62+
</div>
63+
<% end %>
6264
</div>
6365
</li>

app/views/search/_result_primo.html.erb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,9 @@
6363
<% if result[:links].present? %>
6464
<% result[:links].each do |link| %>
6565
<% if link['kind'].downcase == 'full record' %>
66-
<%= view_record(link) %>
66+
<% if Feature.enabled?(:record_link) %>
67+
<%= link_to 'View full record', link['url'], class: 'button' %>
68+
<% end %>
6769
<% else %>
6870
<%= link_to link['kind'].titleize, link['url'], class: 'button' %>
6971
<% end %>

0 commit comments

Comments
 (0)