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

pulibrary / orangelight / 62bad3f1-d46d-40af-822c-403d653da2a8

17 Jun 2025 05:30PM UTC coverage: 0.447% (-94.9%) from 95.337%
62bad3f1-d46d-40af-822c-403d653da2a8

push

circleci

maxkadel
Install chrome & chromedriver for smoke specs

43 of 9610 relevant lines covered (0.45%)

0.01 hits per line

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

0.0
/app/components/request_button_component.rb
1
# frozen_string_literal: true
2

3
# ViewComponent that displays a request button on the show page
4
class RequestButtonComponent < ViewComponent::Base
×
5
  def initialize(location:, doc_id:, holding: nil, holding_id: nil)
×
6
    @location = location
×
7
    @doc_id = doc_id
×
8
    @holding = holding
×
9
    @holding_id = holding_id
×
10
  end
×
11

12
  def label
×
13
    return 'Reading Room Request' if aeon?
×
14
    'Request'
×
15
  end
×
16

17
  def url
×
18
    query = { mfhd: @holding_id, aeon: aeon?.to_s }.compact.to_query
×
19
    URI::HTTP.build(path: "/requests/#{@doc_id}", query:).request_uri
×
20
  end
×
21

22
  private
×
23

24
    def aeon?
×
25
      @aeon ||= (@location&.dig(:aeon_location) || scsb_supervised_items?)
×
26
    end
×
27

28
    def scsb_supervised_items?
×
29
      return false unless @holding
×
30
      return false unless @holding['items']
×
31
      @holding['items'].all? { |item| item['use_statement']&.casecmp('supervised use')&.zero? }
×
32
    end
×
33
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