• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

pulibrary / orangelight / d68932d3-8e77-4281-9135-ea3890373458

24 Aug 2023 03:07PM UTC coverage: 95.315% (-0.1%) from 95.433%
d68932d3-8e77-4281-9135-ea3890373458

Pull #3700

circleci

web-flow
Merge branch 'main' into i3412_built_in_advanced_search_form
Pull Request #3700: I3412 built in advanced search form

19 of 24 new or added lines in 1 file covered. (79.17%)

4 existing lines in 1 file now uncovered.

5574 of 5848 relevant lines covered (95.31%)

1416.0 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

79.17
/app/components/orangelight/advanced_search_form_component.rb
1
# frozen_string_literal: true
2

3
class Orangelight::AdvancedSearchFormComponent < Blacklight::AdvancedSearchFormComponent
2✔
4
  def sort_fields_select
2✔
5
    options = sort_fields.values.map { |field_config| [helpers.sort_field_label(field_config.key), field_config.key] }
98✔
6
    return unless options.any?
14✔
7

8
    select_tag(:sort, options_for_select(options, params[:sort]), class: "sort-select", aria: { labelledby: 'advanced-search-sort-label' })
14✔
9
  end
10

11
  def initialize_search_filter_controls
2✔
12
    fields = blacklight_config.facet_fields.select { |_k, v| v.include_in_advanced_search || v.include_in_advanced_search.nil? }
560✔
13

14
    fields.each do |_k, config|
7✔
15
      config.advanced_search_component = Orangelight::FacetFieldCheckboxesComponent
553✔
16
      display_facet = @response.aggregations[config.field]
553✔
17
      with_search_filter_control(config:, display_facet:)
553✔
18
    end
19
  end
20

21
  def pub_date_field
2✔
22
    blacklight_config.facet_fields['pub_date_start_sort']
21✔
23
  end
24

25
  def pub_date_presenter
2✔
26
    view_context.facet_field_presenter(pub_date_field, {})
14✔
27
  end
28

29
  def initialize_search_field_controls
2✔
30
    search_fields.values.each.with_index do |field, index|
7✔
31
      with_search_field_control do
70✔
NEW
32
        fields_for_etc(index:, field:)
×
33
      end
34
    end
35
  end
36

37
  def fields_for_etc(index:, field:)
2✔
NEW
38
    fields_for('clause[]', index, include_id: false) do |foo|
×
NEW
39
      content_tag(:div, class: 'form-group advanced-search-field row mb-3') do
×
NEW
40
        foo.label(:query, field.display_label('search'), class: "col-sm-3 col-form-label text-md-right") +
×
41
          content_tag(:div, class: 'col-sm-9') do
NEW
42
            foo.hidden_field(:field, value: field.key) +
×
43
              foo.text_field(:query, value: query_for_search_clause(field.key), class: 'form-control')
44
          end
45
      end
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