• 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/processors/orangelight/series_link_processor.rb
1
# frozen_string_literal: true
2
module Orangelight
×
3
  class SeriesLinkProcessor < Blacklight::Rendering::AbstractStep
×
4
    include ActionView::Helpers::UrlHelper
×
5

6
    def render
×
7
      return next_step(values) unless config.series_link
×
8
      values.map! do |title|
×
9
        # rubocop:disable Rails/OutputSafety
10
        title = "#{title} #{more_in_this_series_link(title)}".html_safe if more_in_this_series_field_contains? title
×
11
        # rubocop:enable Rails/OutputSafety
12
        title
×
13
      end
×
14
      next_step(values)
×
15
    end
×
16

17
    private
×
18

19
      # Generate a query link for all items within a given series using a title
20
      # @param title [String] the title of the series
21
      # @return [String] the link markup
22
      def more_in_this_series_link(title)
×
23
        link_to('[More in this series]', advanced_search_series_link(title),
×
24
                class: 'more-in-series',
×
25
                'data-original-title' => "More in series: #{title}",
×
26
                dir: title.dir.to_s)
×
27
      end
×
28

29
      def advanced_search_series_link(title)
×
30
        no_parens = authorized_form_of_title(title).gsub(/[()]/, '')
×
31
        path = '/catalog'
×
32
        query = {
×
33
          "clause[0][field]": 'in_series',
×
34
          "clause[0][query]": no_parens,
×
35
          "commit": "Search"
×
36
        }.to_query
×
37
        URI::HTTP.build(path:, query:).request_uri
×
38
      end
×
39

40
      def more_in_this_series_field_contains?(title)
×
41
        document['more_in_this_series_t'].present? && authorized_form_of_title(title)
×
42
      end
×
43

44
      def authorized_form_of_title(title)
×
45
        document['more_in_this_series_t'].find { |series_title| title.starts_with?(series_title) }
×
46
      end
×
47
  end
×
48
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