• 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

86.96
/app/services/holding_requests_builder.rb
1
# frozen_string_literal: true
2

3
class HoldingRequestsBuilder
1✔
4
  extend ActionView::Helpers::TagHelper
1✔
5
  extend ActionView::Helpers::UrlHelper
1✔
6

7
  # Generate <div> container for a holding block
8
  # @param children [String] the children for the holding block
9
  # @return [String] the markup
10
  def self.holding_block(children)
1✔
11
    content_tag(:tr, children.html_safe, class: 'holding-block') unless children.empty?
×
12
  end
13

14
  # Generate <div> container for holding details
15
  # @param children [String] the children for the holding details
16
  # @return [String] the markup
17
  def self.holding_details(children)
1✔
18
    content_tag(:td, children.html_safe, class: 'holding-details') unless children.empty?
×
19
  end
20

21
  # Generate <div> container for missing item holdings
22
  # @return [String] the markup
23
  def self.missing_holdings
1✔
24
    holding_block(I18n.t('blacklight.holdings.missing'))
×
25
  end
26

27
  # Constructor
28
  # @param adapter [HoldingRequestsAdapter] adapter for the SolrDocument and Bibdata API
29
  # @param online_markup_builder [Class] the builder class for online holdings blocks
30
  # @param physical_markup_builder [Class] the builder class for physical holdings blocks
31
  # @param params [ActionController::Parameters]
32
  def initialize(adapter:, online_markup_builder:, physical_markup_builder:, params:)
1✔
33
    @adapter = adapter
29✔
34
    @online_markup_builder = online_markup_builder
29✔
35
    @physical_markup_builder = physical_markup_builder
29✔
36
    @params = params
29✔
37
  end
38

39
  # Builds the markup for online and physical holdings for a given record
40
  # @return [Array<String>] the markup for the online and physical holdings
41
  def build
1✔
42
    online_builder = @online_markup_builder.new(@adapter)
29✔
43
    online_markup = online_builder.build
29✔
44

45
    physical_builder = @physical_markup_builder.new(@adapter, params)
29✔
46
    physical_markup = physical_builder.build
29✔
47

48
    physical_markup = self.class.missing_holdings if physical_markup.blank? && online_markup.blank?
29✔
49

50
    [online_markup, physical_markup]
29✔
51
  end
52

53
  private
1✔
54

55
    attr_reader :params
1✔
56
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