• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

pulibrary / orangelight / 4c391e0e-519a-40cb-8ad3-354445f4ce03

12 Aug 2025 08:47PM UTC coverage: 85.348% (-10.0%) from 95.335%
4c391e0e-519a-40cb-8ad3-354445f4ce03

push

circleci

web-flow
[#5143] Use access restriction note as Aeon ItemInfo1 if available (#5173)

With this commit, if a user visits a record with an access
restrictions note and presses the Reading Room Request
button, they will get to an Aeon form with the 'Restrictions'
field pre-filled with the restriction note.

If the record does not have an access restrictions note,
the field will be pre-filled with 'Reading Room Access Only',
as it has been previously.

Closes #5143

5493 of 6436 relevant lines covered (85.35%)

251.82 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

55.26
/app/helpers/requests/request_helper.rb
1
# frozen_string_literal: true
2
module Requests
1✔
3
  module RequestHelper
1✔
4
    def parse_json(data)
1✔
5
      JSON.parse(data).with_indifferent_access
×
6
    end
7

8
    def current_user_status(current_user)
1✔
9
      ## Expect that the host app can provide you a devise current_user object
10
      if current_user.cas_provider?
×
11
        content_tag(:div, class: "flash_messages-user") do
×
12
          content_tag(:div, I18n.t('requests.account.pul_auth', current_user_name: current_user.uid), class: "flash-alert")
×
13
        end
14
      elsif current_user.guest?
×
15
        content_tag(:div) do
×
16
          concat link_to I18n.t('blacklight.login.netid_login_msg'), '/users/auth/cas', role: 'menuitem', class: 'btn btn-primary', id: 'cas-login' # , current_user_name: current_user.uid)
×
17
        end
18
      else
19
        I18n.t('requests.account.unauthenticated')
×
20
      end
21
    end
22

23
    def pul_patron_name(patron)
1✔
24
      return "" if patron.last_name.blank? && patron.first_name.blank?
67✔
25
      "#{patron.first_name} #{patron.last_name}"
67✔
26
    end
27

28
    def request_title
1✔
29
      I18n.t('requests.default.form_title')
72✔
30
    end
31

32
    ### FIXME. This should come directly as a sub-property from the request object holding property.
33
    # def render_mfhd_message requestable_list
34
    #   mfhd_services = []
35
    #   requestable_list.each do |requestable|
36
    #     requestable.services.each do |service|
37
    #       mfhd_services << service
38
    #     end
39
    #   end
40
    #   mfhd_services.uniq!
41
    #   if mfhd_services.include? 'paging'
42
    #     content_tag(:div, class: 'flash_mesages-mfhd flash-notice') do
43
    #       concat content_tag(:div, I18n.t('requests.paging.status').html_safe)
44
    #       concat content_tag(:div, I18n.t('requests.paging.message').html_safe)
45
    #     end
46
    #   end
47
    # end
48

49
    def return_message(submission)
1✔
50
      link_to "Return to Record", return_url(submission.id), class: 'btn btn-secondary icon-moveback', title: 'Return to Record'
62✔
51
    end
52

53
    def login_url(request)
1✔
54
      url = "/requests/#{request.bib_id}?"
×
55
      params = []
×
56
      params.push("mfhd=#{request.mfhd}") unless request.mfhd.nil?
×
57
      url += params.join("&")
×
58

59
      url
×
60
    end
61

62
    def return_url(id)
1✔
63
      "/catalog/#{id}"
62✔
64
    end
65

66
    def zero_results_link(query_params, search_field)
1✔
67
      if query_params
2✔
68
        "https://princeton-borrowdirect.reshare.indexdata.com/Search/Results?lookfor=#{query_params}&type=#{reshare_type(search_field)}"
1✔
69
      else
70
        "https://princeton-borrowdirect.reshare.indexdata.com/Search/Results"
1✔
71
      end
72
    end
73

74
    def reshare_type(search_field)
1✔
75
      case search_field
1✔
76
      when 'all_fields'
77
        'AllFields'
×
78
      when 'author'
79
        'Author'
×
80
      when 'subject'
81
        'Subject'
×
82
      when 'title'
83
        'Title'
×
84
      else
85
        'AllFields'
1✔
86
      end
87
    end
88
  end
89
end
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc