• 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/components/request_button_component.rb
1
# frozen_string_literal: true
2

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

14
  def label
×
15
    return 'Reading Room Request' if aeon?
×
16
    'Request'
×
17
  end
×
18

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

24
  private
×
25

26
    attr_reader :open_holdings
×
27

28
    def aeon?
×
29
      @aeon ||= (@location&.dig(:aeon_location) || scsb_supervised_items?)
×
30
    end
×
31

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