• 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/holdings/holding_notes_component.rb
1
# frozen_string_literal: true
2
# This component is responsible for rendering holdings-level notes
UNCOV
3
class Holdings::HoldingNotesComponent < ViewComponent::Base
×
UNCOV
4
  def initialize(holding, holding_id, adapter)
×
UNCOV
5
    @holding = holding
×
UNCOV
6
    @holding_id = holding_id
×
UNCOV
7
    @adapter = adapter
×
UNCOV
8
  end
×
9

UNCOV
10
    private
×
11

UNCOV
12
      attr_reader :holding, :holding_id, :adapter
×
13

UNCOV
14
      def render_shelving_titles?
×
UNCOV
15
        adapter.shelving_title?(holding)
×
UNCOV
16
      end
×
17

UNCOV
18
      def render_location_notes?
×
UNCOV
19
        adapter.location_note?(holding)
×
UNCOV
20
      end
×
21

UNCOV
22
      def render_location_has?
×
UNCOV
23
        adapter.location_has?(holding)
×
UNCOV
24
      end
×
25

UNCOV
26
      def render_supplements?
×
UNCOV
27
        adapter.supplements?(holding)
×
UNCOV
28
      end
×
29

UNCOV
30
      def render_indexes?
×
UNCOV
31
        adapter.indexes?(holding)
×
UNCOV
32
      end
×
33

UNCOV
34
      def render_issues?
×
UNCOV
35
        adapter.journal?
×
UNCOV
36
      end
×
37

38
      # :reek:TooManyStatements
39
      # :reek:NestedIterators
40
      # :reek:FeatureEnvy
UNCOV
41
      def render_list(label:, list_class:, notes:)
×
UNCOV
42
        render HoldingNoteListComponent.new do |component|
×
UNCOV
43
          component.with_label { label }
×
UNCOV
44
          component.with_list_class { list_class }
×
UNCOV
45
          notes&.each do |note|
×
UNCOV
46
            component.with_note { note }
×
UNCOV
47
          end
×
UNCOV
48
        end
×
UNCOV
49
      end
×
50

UNCOV
51
      def doc_id
×
UNCOV
52
        holding["mms_id"] || adapter.doc_id
×
UNCOV
53
      end
×
54

55
      # This private class is responsible for displaying a list of
56
      # notes.  It is used for many types of notes that all have the
57
      # same DOM structure and style.
UNCOV
58
      class HoldingNoteListComponent < ViewComponent::Base
×
UNCOV
59
        renders_one :label
×
UNCOV
60
        renders_one :list_class
×
UNCOV
61
        renders_many :notes
×
62

UNCOV
63
        erb_template <<~END_TEMPLATE
×
UNCOV
64
          <ul class="<%= list_class %>">
×
UNCOV
65
            <li class="holding-label"><%= label %></li>
×
UNCOV
66
            <% notes.each do |note| %>
×
UNCOV
67
              <li><lux-show-more v-bind:character-limit="150" show-label="See more" hide-label="See less"><%= note %></lux-show-more></li>
×
UNCOV
68
            <% end %>
×
UNCOV
69
          </ul>
×
UNCOV
70
        END_TEMPLATE
×
UNCOV
71
      end
×
UNCOV
72
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