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

10
    private
×
11

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

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

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

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

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

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

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

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

51
      def doc_id
×
52
        holding["mms_id"] || adapter.doc_id
×
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.
58
      class HoldingNoteListComponent < ViewComponent::Base
×
59
        renders_one :label
×
60
        renders_one :list_class
×
61
        renders_many :notes
×
62

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