Skip to content

Commit 104c809

Browse files
authored
Merge pull request #320 from MITLibraries/use-253
Add feature flag for full record fulfillment links
2 parents 5ab6b4b + b26824c commit 104c809

File tree

4 files changed

+10
-5
lines changed

4 files changed

+10
-5
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ See `Optional Environment Variables` for more information.
9797
- `FEATURE_GEODATA`: Enables features related to geospatial data discovery. Setting this variable to `true` will trigger geodata
9898
mode. Note that this is currently intended _only_ for the geodata app and
9999
may have unexpected consequences if applied to other TIMDEX UI apps.
100+
- `FEATURE_RECORD_LINK`: Display the 'View full record' link below each record.
100101
- `FEATURE_SIMULATE_SEARCH_LATENCY`: DO NOT SET IN PRODUCTION. Set to ensure a minimum of a one second delay in returning search results. Useful to see spinners/loaders. Only introduces delay for results that take less than one second to complete.
101102
- `FEATURE_TAB_PRIMO_ALL`: Display a tab for displaying the combined Primo data (CDI + Alma)
102103
- `FEATURE_TAB_TIMDEX_ALL`: Display a tab for displaying the combined TIMDEX data. `TIMDEX_INDEX` affects which data appears in this tab.

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)