• 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/processors/orangelight/browse_link_processor.rb
1
# frozen_string_literal: true
2

UNCOV
3
module Orangelight
×
UNCOV
4
  class BrowseLinkProcessor < Blacklight::Rendering::AbstractStep
×
UNCOV
5
    include ActionView::Helpers::UrlHelper
×
UNCOV
6
    include ActionView::Helpers::SanitizeHelper
×
7

UNCOV
8
    def render
×
UNCOV
9
      return next_step(values) unless config.browse_link
×
10

UNCOV
11
      next_step(values.map { |value| add_links_to value })
×
UNCOV
12
    end
×
13

UNCOV
14
    private
×
15

UNCOV
16
      def facet_field
×
UNCOV
17
        case config.browse_link
×
UNCOV
18
        when :name
×
UNCOV
19
          'author_s'
×
UNCOV
20
        when :name_title
×
UNCOV
21
          'name_title_browse_s'
×
UNCOV
22
        end
×
UNCOV
23
      end
×
24

UNCOV
25
      def browse_path
×
UNCOV
26
        "#{config.browse_link}s"
×
UNCOV
27
      end
×
28

UNCOV
29
      def search_class
×
UNCOV
30
        "search-#{config.browse_link.to_s.tr('_', '-')}"
×
UNCOV
31
      end
×
32

UNCOV
33
      def browse_class
×
UNCOV
34
        "browse-#{config.browse_link.to_s.tr('_', '-')}"
×
UNCOV
35
      end
×
36

UNCOV
37
      def add_links_to(value)
×
UNCOV
38
        return value unless should_render_links?(value)
×
39

UNCOV
40
        if context.action_name == "show"
×
UNCOV
41
          link_to(value, "/?f[#{facet_field}][]=#{strip_tags(CGI.escape(strip_tags(value)))}", class: search_class, 'data-original-title' => "Search: #{strip_tags(value)}") + ' ' +
×
UNCOV
42
            link_to('[Browse]', "/browse/#{browse_path}?q=#{CGI.escape(strip_tags(value))}", class: browse_class, 'data-original-title' => "Browse: #{strip_tags(value)}", dir: value.dir.to_s)
×
UNCOV
43
        else
×
UNCOV
44
          link_to(value, "/?f[#{facet_field}][]=#{strip_tags(CGI.escape(strip_tags(value)))}", class: search_class, 'data-original-title' => "Search: #{strip_tags(value)}", dir: value.dir.to_s)
×
UNCOV
45
        end
×
UNCOV
46
      end
×
47

UNCOV
48
      def should_render_links?(value)
×
UNCOV
49
        return true unless config.browse_link == :name_title
×
UNCOV
50
        document['name_title_browse_s']&.include? value
×
UNCOV
51
      end
×
UNCOV
52
  end
×
UNCOV
53
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