• 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/models/advanced_form_search_builder.rb
1
# frozen_string_literal: true
2
# This class is responsible for building a solr query
3
# that renders an advanced search form
UNCOV
4
class AdvancedFormSearchBuilder < SearchBuilder
×
UNCOV
5
  self.default_processor_chain += %i[use_advanced_configuration only_request_advanced_facets no_documents do_not_limit_configured_facets]
×
6

UNCOV
7
  def use_advanced_configuration(solr_params)
×
UNCOV
8
    solr_params.update(solr_params) do |key, value|
×
UNCOV
9
      key_as_string = key.to_s
×
UNCOV
10
      next value unless blacklight_config.dig('advanced_search', 'form_solr_parameters', key_as_string)
×
11

UNCOV
12
      blacklight_config.advanced_search.form_solr_parameters[key_as_string]
×
UNCOV
13
    end
×
UNCOV
14
  end
×
15

16
  # :reek:FeatureEnvy
UNCOV
17
  def only_request_advanced_facets(solr_params)
×
UNCOV
18
    solr_params['facet.field'] = facet_fields
×
UNCOV
19
    %w[facet.pivot facet.query stats stats.field].each { |unneeded_field| solr_params.delete unneeded_field }
×
UNCOV
20
  end
×
21

22
  # :reek:UtilityFunction
UNCOV
23
  def no_documents(solr_params)
×
UNCOV
24
    solr_params['rows'] = 0
×
UNCOV
25
  end
×
26

UNCOV
27
  def do_not_limit_configured_facets(solr_params)
×
28
    # -1 means do not limit
UNCOV
29
    limit_configuration = facet_fields.to_h { |field| ["f.#{field}.facet.limit", '-1'] }
×
UNCOV
30
    solr_params.merge! limit_configuration
×
UNCOV
31
  end
×
32

UNCOV
33
  private
×
34

UNCOV
35
    def facet_fields
×
UNCOV
36
      blacklight_config.advanced_search[:form_solr_parameters]['facet.field']
×
UNCOV
37
    end
×
UNCOV
38
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