blacklight_advanced_search 6.4.1 → 8.0.0.alpha2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.github/workflows/ruby.yml +125 -0
- data/.gitignore +1 -0
- data/.rubocop.yml +4 -2
- data/.rubocop_todo.yml +6 -374
- data/Gemfile +3 -8
- data/README.md +46 -60
- data/Rakefile +2 -2
- data/VERSION +1 -1
- data/blacklight_advanced_search.gemspec +6 -7
- data/config/routes.rb +1 -1
- data/lib/blacklight_advanced_search/advanced_query_parser.rb +24 -38
- data/lib/blacklight_advanced_search/advanced_search_builder.rb +27 -24
- data/lib/blacklight_advanced_search/controller.rb +15 -16
- data/lib/blacklight_advanced_search/engine.rb +0 -1
- data/lib/blacklight_advanced_search/redirect_legacy_params_filter.rb +24 -7
- data/lib/blacklight_advanced_search.rb +0 -4
- data/lib/generators/blacklight_advanced_search/install_generator.rb +3 -37
- data/lib/parsing_nesting/grammar.rb +0 -12
- data/solr/conf/schema.xml +326 -573
- data/solr/conf/solrconfig.xml +80 -294
- data/spec/features/blacklight_advanced_search_form_spec.rb +13 -18
- data/spec/lib/advanced_search_builder_spec.rb +11 -9
- data/spec/spec_helper.rb +46 -14
- data/spec/test_app_templates/app/controllers/catalog_controller.rb +5 -7
- metadata +41 -62
- data/.travis.yml +0 -21
- data/app/assets/javascripts/blacklight_advanced_search.js +0 -5
- data/app/assets/stylesheets/blacklight_advanced_search/advanced_results.css +0 -21
- data/app/assets/stylesheets/blacklight_advanced_search/blacklight_advanced_search_styles.css.scss +0 -58
- data/app/assets/stylesheets/blacklight_advanced_search.css +0 -6
- data/app/controllers/advanced_controller.rb +0 -25
- data/app/controllers/blacklight_advanced_search/advanced_controller.rb +0 -25
- data/app/helpers/advanced_helper.rb +0 -4
- data/app/helpers/blacklight_advanced_search/advanced_helper_behavior.rb +0 -57
- data/app/views/advanced/_advanced_search_facets.html.erb +0 -16
- data/app/views/advanced/_advanced_search_facets_as_select.html.erb +0 -30
- data/app/views/advanced/_advanced_search_fields.html.erb +0 -8
- data/app/views/advanced/_advanced_search_form.html.erb +0 -43
- data/app/views/advanced/_advanced_search_help.html.erb +0 -24
- data/app/views/advanced/_advanced_search_submit_btns.html.erb +0 -12
- data/app/views/advanced/_facet_limit.html.erb +0 -15
- data/app/views/advanced/index.html.erb +0 -21
- data/app/views/blacklight_advanced_search/_facet_limit.html.erb +0 -16
- data/config/jetty.yml +0 -4
- data/config/locales/blacklight_advanced_search.en.yml +0 -12
- data/lib/blacklight_advanced_search/catalog_helper_override.rb +0 -30
- data/lib/blacklight_advanced_search/filter_parser.rb +0 -11
- data/lib/blacklight_advanced_search/parsing_nesting_parser.rb +0 -15
- data/lib/blacklight_advanced_search/render_constraints_override.rb +0 -136
- data/lib/generators/blacklight_advanced_search/assets_generator.rb +0 -53
- data/lib/generators/blacklight_advanced_search/templates/advanced_controller.rb +0 -56
- data/lib/generators/blacklight_advanced_search/templates/saved_searches_controller.rb +0 -6
- data/lib/generators/blacklight_advanced_search/templates/search_history_controller.rb +0 -6
- data/solr/sample_solr_documents.yml +0 -2692
- data/spec/helpers/advanced_helper_spec.rb +0 -13
- data/spec/lib/blacklight_advanced_search/render_constraints_override_spec.rb +0 -39
- data/spec/lib/filter_parser_spec.rb +0 -22
@@ -1,13 +0,0 @@
|
|
1
|
-
describe AdvancedHelper do
|
2
|
-
describe '#advanced_search_facet_partial_name' do
|
3
|
-
let(:field) { double(name: "field_name") }
|
4
|
-
it 'should return the configured partial name if present' do
|
5
|
-
expect(helper).to receive(:facet_configuration_for_field).with(field.name).and_return(double(partial: 'partial-name'))
|
6
|
-
expect(helper.advanced_search_facet_partial_name(field)).to eq "partial-name"
|
7
|
-
end
|
8
|
-
it 'should fallback on "catalog/facet_limit" in the absence of a configured partial' do
|
9
|
-
expect(helper).to receive(:facet_configuration_for_field).with(field.name).and_return(nil)
|
10
|
-
expect(helper.advanced_search_facet_partial_name(field)).to eq "catalog/facet_limit"
|
11
|
-
end
|
12
|
-
end
|
13
|
-
end
|
@@ -1,39 +0,0 @@
|
|
1
|
-
describe BlacklightAdvancedSearch::RenderConstraintsOverride, type: :helper do
|
2
|
-
let(:blacklight_config) do
|
3
|
-
Blacklight::Configuration.new do |config|
|
4
|
-
config.add_facet_field 'type'
|
5
|
-
end
|
6
|
-
end
|
7
|
-
|
8
|
-
let(:advanced_query) do
|
9
|
-
BlacklightAdvancedSearch::QueryParser.new(params, blacklight_config)
|
10
|
-
end
|
11
|
-
|
12
|
-
describe "#render_constraints_filters" do
|
13
|
-
before do
|
14
|
-
allow(helper).to receive(:blacklight_config).and_return(blacklight_config)
|
15
|
-
allow(helper).to receive(:advanced_query).and_return(advanced_query)
|
16
|
-
allow(helper).to receive(:search_action_path) do |*args|
|
17
|
-
search_catalog_path(*args)
|
18
|
-
end
|
19
|
-
end
|
20
|
-
|
21
|
-
subject(:rendered) { helper.render_constraints_filters({}) }
|
22
|
-
|
23
|
-
context 'with an array of facet params' do
|
24
|
-
let(:params) { ActionController::Parameters.new f_inclusive: { 'type' => ['a'] } }
|
25
|
-
|
26
|
-
it "renders nothing" do
|
27
|
-
expect(rendered).to have_text 'Remove constraint Type: a'
|
28
|
-
end
|
29
|
-
end
|
30
|
-
|
31
|
-
context 'with scalar facet limit params' do
|
32
|
-
let(:params) { ActionController::Parameters.new f_inclusive: { 'type' => 'a' } }
|
33
|
-
|
34
|
-
it "renders the scalar value" do
|
35
|
-
expect(rendered).to have_text 'Remove constraint Type: a'
|
36
|
-
end
|
37
|
-
end
|
38
|
-
end
|
39
|
-
end
|
@@ -1,22 +0,0 @@
|
|
1
|
-
def setFilters(f)
|
2
|
-
@filters = f
|
3
|
-
end
|
4
|
-
|
5
|
-
## These should be reworked, but attr_reader actually breaks it.
|
6
|
-
# rubocop:disable Style/TrivialAccessors
|
7
|
-
def filters
|
8
|
-
@filters
|
9
|
-
end
|
10
|
-
|
11
|
-
describe "BlacklightAdvancedSearch::FilterParser" do
|
12
|
-
include BlacklightAdvancedSearch::FilterParser
|
13
|
-
|
14
|
-
describe "filter processing" do
|
15
|
-
it "should generate an appropriate fq param" do
|
16
|
-
setFilters(:format => %w(Book Thesis), :location => %w(Online Library))
|
17
|
-
fq_params = generate_solr_fq
|
18
|
-
expect(fq_params.find { |a| a =~ /format\:\((\"Book\"|\"Thesis\") +OR +(\"Thesis\"|\"Book\")/ }).not_to be_nil
|
19
|
-
expect(fq_params.find { |a| a =~ /location\:\((\"Library\"|\"Online\") +OR +(\"Library\"|\"Online\")/ }).not_to be_nil
|
20
|
-
end
|
21
|
-
end
|
22
|
-
end
|