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

pulibrary / orangelight / 00dbc10b-d747-4ad7-b211-7b26d753abbb

14 Aug 2025 01:25PM UTC coverage: 0.483% (-94.9%) from 95.343%
00dbc10b-d747-4ad7-b211-7b26d753abbb

push

circleci

web-flow
Merge pull request #5181 from pulibrary/dependabot/bundler/activestorage-7.2.2.2

Bump activestorage from 7.2.2.1 to 7.2.2.2

47 of 9721 relevant lines covered (0.48%)

0.01 hits per line

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

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

8
    def current_user_status(current_user)
×
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)
×
24
      return "" if patron.last_name.blank? && patron.first_name.blank?
×
25
      "#{patron.first_name} #{patron.last_name}"
×
26
    end
×
27

28
    def request_title
×
29
      I18n.t('requests.default.form_title')
×
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)
×
50
      link_to "Return to Record", return_url(submission.id), class: 'btn btn-secondary icon-moveback', title: 'Return to Record'
×
51
    end
×
52

53
    def login_url(request)
×
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)
×
63
      "/catalog/#{id}"
×
64
    end
×
65

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

74
    def reshare_type(search_field)
×
75
      case search_field
×
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'
×
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