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

pulibrary / orangelight / 0e37073d-109c-440c-949f-49d2aa86311b

18 Aug 2025 09:05PM UTC coverage: 0.482% (-94.9%) from 95.343%
0e37073d-109c-440c-949f-49d2aa86311b

push

circleci

web-flow
Replace per_page_options_for_select with custom component to avoid deprecation issue (#5186)

* Start creating new component to address deprecaton warning

* Replace per_page_options_for_select with custom component to avoid deprecation issue

Co-authored-by: Jane Sandberg <sandbergja@users.noreply.github.com>

---------

Co-authored-by: Ryan Jensen <rj1044@princeton.edu>
Co-authored-by: Jane Sandberg <sandbergja@users.noreply.github.com>

0 of 33 new or added lines in 1 file covered. (0.0%)

9374 existing lines in 213 files now uncovered.

47 of 9753 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
UNCOV
5
class RequestButtonComponent < ViewComponent::Base
×
UNCOV
6
  def initialize(location:, doc_id:, holding: nil, holding_id: nil, open_holdings: nil)
×
UNCOV
7
    @location = location
×
UNCOV
8
    @doc_id = doc_id
×
UNCOV
9
    @holding = holding
×
UNCOV
10
    @holding_id = holding_id
×
UNCOV
11
    @open_holdings = open_holdings
×
UNCOV
12
  end
×
13

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

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

UNCOV
24
  private
×
25

UNCOV
26
    attr_reader :open_holdings
×
27

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

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