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.
Files changed (58) hide show
  1. checksums.yaml +5 -5
  2. data/.github/workflows/ruby.yml +125 -0
  3. data/.gitignore +1 -0
  4. data/.rubocop.yml +4 -2
  5. data/.rubocop_todo.yml +6 -374
  6. data/Gemfile +3 -8
  7. data/README.md +46 -60
  8. data/Rakefile +2 -2
  9. data/VERSION +1 -1
  10. data/blacklight_advanced_search.gemspec +6 -7
  11. data/config/routes.rb +1 -1
  12. data/lib/blacklight_advanced_search/advanced_query_parser.rb +24 -38
  13. data/lib/blacklight_advanced_search/advanced_search_builder.rb +27 -24
  14. data/lib/blacklight_advanced_search/controller.rb +15 -16
  15. data/lib/blacklight_advanced_search/engine.rb +0 -1
  16. data/lib/blacklight_advanced_search/redirect_legacy_params_filter.rb +24 -7
  17. data/lib/blacklight_advanced_search.rb +0 -4
  18. data/lib/generators/blacklight_advanced_search/install_generator.rb +3 -37
  19. data/lib/parsing_nesting/grammar.rb +0 -12
  20. data/solr/conf/schema.xml +326 -573
  21. data/solr/conf/solrconfig.xml +80 -294
  22. data/spec/features/blacklight_advanced_search_form_spec.rb +13 -18
  23. data/spec/lib/advanced_search_builder_spec.rb +11 -9
  24. data/spec/spec_helper.rb +46 -14
  25. data/spec/test_app_templates/app/controllers/catalog_controller.rb +5 -7
  26. metadata +41 -62
  27. data/.travis.yml +0 -21
  28. data/app/assets/javascripts/blacklight_advanced_search.js +0 -5
  29. data/app/assets/stylesheets/blacklight_advanced_search/advanced_results.css +0 -21
  30. data/app/assets/stylesheets/blacklight_advanced_search/blacklight_advanced_search_styles.css.scss +0 -58
  31. data/app/assets/stylesheets/blacklight_advanced_search.css +0 -6
  32. data/app/controllers/advanced_controller.rb +0 -25
  33. data/app/controllers/blacklight_advanced_search/advanced_controller.rb +0 -25
  34. data/app/helpers/advanced_helper.rb +0 -4
  35. data/app/helpers/blacklight_advanced_search/advanced_helper_behavior.rb +0 -57
  36. data/app/views/advanced/_advanced_search_facets.html.erb +0 -16
  37. data/app/views/advanced/_advanced_search_facets_as_select.html.erb +0 -30
  38. data/app/views/advanced/_advanced_search_fields.html.erb +0 -8
  39. data/app/views/advanced/_advanced_search_form.html.erb +0 -43
  40. data/app/views/advanced/_advanced_search_help.html.erb +0 -24
  41. data/app/views/advanced/_advanced_search_submit_btns.html.erb +0 -12
  42. data/app/views/advanced/_facet_limit.html.erb +0 -15
  43. data/app/views/advanced/index.html.erb +0 -21
  44. data/app/views/blacklight_advanced_search/_facet_limit.html.erb +0 -16
  45. data/config/jetty.yml +0 -4
  46. data/config/locales/blacklight_advanced_search.en.yml +0 -12
  47. data/lib/blacklight_advanced_search/catalog_helper_override.rb +0 -30
  48. data/lib/blacklight_advanced_search/filter_parser.rb +0 -11
  49. data/lib/blacklight_advanced_search/parsing_nesting_parser.rb +0 -15
  50. data/lib/blacklight_advanced_search/render_constraints_override.rb +0 -136
  51. data/lib/generators/blacklight_advanced_search/assets_generator.rb +0 -53
  52. data/lib/generators/blacklight_advanced_search/templates/advanced_controller.rb +0 -56
  53. data/lib/generators/blacklight_advanced_search/templates/saved_searches_controller.rb +0 -6
  54. data/lib/generators/blacklight_advanced_search/templates/search_history_controller.rb +0 -6
  55. data/solr/sample_solr_documents.yml +0 -2692
  56. data/spec/helpers/advanced_helper_spec.rb +0 -13
  57. data/spec/lib/blacklight_advanced_search/render_constraints_override_spec.rb +0 -39
  58. data/spec/lib/filter_parser_spec.rb +0 -22
@@ -4,10 +4,6 @@ module BlacklightAdvancedSearch
4
4
  class InstallGenerator < Rails::Generators::Base
5
5
  source_root File.expand_path('../templates', __FILE__)
6
6
 
7
- def inject_asset_requires
8
- generate "blacklight_advanced_search:assets"
9
- end
10
-
11
7
  def inject_search_builder
12
8
  inject_into_file 'app/models/search_builder.rb', after: /include Blacklight::Solr::SearchBuilderBehavior.*$/ do
13
9
  "\n include BlacklightAdvancedSearch::AdvancedSearchBuilder" \
@@ -15,51 +11,21 @@ module BlacklightAdvancedSearch
15
11
  end
16
12
  end
17
13
 
18
- def install_catalog_controller_mixin
19
- inject_into_class "app/controllers/catalog_controller.rb", "CatalogController" do
20
- " include BlacklightAdvancedSearch::Controller\n"
21
- end
22
- end
23
-
24
14
  def configuration
25
15
  inject_into_file 'app/controllers/catalog_controller.rb', after: "configure_blacklight do |config|" do
26
16
  "\n # default advanced config values" \
27
17
  "\n config.advanced_search ||= Blacklight::OpenStructWithHashAccess.new" \
18
+ "\n config.advanced_search[:enabled] = true" \
19
+ "\n config.advanced_search[:form_solr_paramters] = {}" \
28
20
  "\n # config.advanced_search[:qt] ||= 'advanced'" \
29
- "\n config.advanced_search[:url_key] ||= 'advanced'" \
30
- "\n config.advanced_search[:query_parser] ||= 'dismax'" \
31
- "\n config.advanced_search[:form_solr_parameters] ||= {}\n"
21
+ "\n config.advanced_search[:query_parser] ||= 'dismax'"
32
22
  end
33
23
  end
34
24
 
35
- def install_search_history_controller
36
- copy_file "search_history_controller.rb", "app/controllers/search_history_controller.rb"
37
- end
38
-
39
- def install_saved_searches_controller
40
- copy_file "saved_searches_controller.rb", "app/controllers/saved_searches_controller.rb"
41
- end
42
-
43
25
  def inject_routes
44
26
  inject_into_file 'config/routes.rb', after: /mount Blacklight::Engine.*$/ do
45
27
  "\n mount BlacklightAdvancedSearch::Engine => '/'\n"
46
28
  end
47
29
  end
48
-
49
- def install_localized_search_form
50
- return unless options[:force] || yes?("Install local search form with advanced link? (y/N)", :green)
51
- # We're going to copy the search from from actual currently loaded
52
- # Blacklight into local app as custom local override -- but add our link at the end too.
53
- source_file = File.read(File.join(Blacklight.root, "app/views/catalog/_search_form.html.erb"))
54
-
55
- new_file_contents = source_file + <<-EOF.strip_heredoc
56
- \n\n
57
- <div class="navbar-form">
58
- <%= link_to 'More options', blacklight_advanced_search_engine.advanced_search_path(search_state.to_h), class: 'advanced_search btn btn-default'%>
59
- </div>
60
- EOF
61
-
62
- create_file("app/views/catalog/_search_form.html.erb", new_file_contents)
63
- end
64
30
  end
65
31
  end
@@ -1,17 +1,5 @@
1
- require 'rubygems'
2
1
  require 'parslet'
3
2
 
4
- # Parslet uses Object#tap, which is in ruby 1.8.7+, but not 1.8.6.
5
- # But it's easy enough to implement in pure ruby, let's monkey patch
6
- # it in if it's not there, so we'll still work with 1.8.6
7
- unless Object.method_defined?(:tap)
8
- class Object
9
- def tap
10
- yield(self)
11
- self
12
- end
13
- end
14
- end
15
3
  module ParsingNesting
16
4
  class Grammar < Parslet::Parser
17
5
  root :query