blacklight 7.5.0 → 7.8.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (103) hide show
  1. checksums.yaml +4 -4
  2. data/.docker/app/Dockerfile +26 -0
  3. data/.docker/app/entrypoint.sh +6 -0
  4. data/.env +5 -0
  5. data/.gitignore +0 -1
  6. data/.rubocop_todo.yml +26 -37
  7. data/.travis.yml +16 -24
  8. data/Gemfile +4 -1
  9. data/README.md +4 -0
  10. data/VERSION +1 -1
  11. data/app/assets/stylesheets/blacklight/_pagination.scss +4 -0
  12. data/app/components/blacklight/constraint_layout_component.html.erb +23 -0
  13. data/app/components/blacklight/constraint_layout_component.rb +16 -0
  14. data/app/components/blacklight/facet_field_component.html.erb +25 -0
  15. data/app/components/blacklight/facet_field_component.rb +11 -0
  16. data/app/components/blacklight/facet_field_list_component.html.erb +18 -0
  17. data/app/components/blacklight/facet_field_list_component.rb +22 -0
  18. data/app/components/blacklight/facet_field_no_layout_component.rb +13 -0
  19. data/app/components/blacklight/facet_item_component.rb +120 -0
  20. data/app/controllers/concerns/blacklight/catalog.rb +4 -1
  21. data/app/helpers/blacklight/blacklight_helper_behavior.rb +4 -2
  22. data/app/helpers/blacklight/catalog_helper_behavior.rb +2 -4
  23. data/app/helpers/blacklight/configuration_helper_behavior.rb +3 -2
  24. data/app/helpers/blacklight/facets_helper_behavior.rb +84 -48
  25. data/app/helpers/blacklight/render_constraints_helper_behavior.rb +64 -33
  26. data/app/javascript/blacklight/modal.js +1 -1
  27. data/app/models/blacklight/icon.rb +11 -5
  28. data/app/models/concerns/blacklight/document/extensions.rb +3 -0
  29. data/app/models/concerns/blacklight/document/semantic_fields.rb +0 -4
  30. data/app/presenters/blacklight/document_presenter.rb +27 -36
  31. data/app/presenters/blacklight/facet_field_presenter.rb +57 -0
  32. data/app/presenters/blacklight/facet_item_presenter.rb +81 -0
  33. data/app/presenters/blacklight/field_presenter.rb +31 -6
  34. data/app/presenters/blacklight/index_presenter.rb +2 -2
  35. data/app/presenters/blacklight/show_presenter.rb +3 -3
  36. data/app/views/catalog/_citation.html.erb +1 -1
  37. data/app/views/catalog/_constraints.html.erb +2 -2
  38. data/app/views/catalog/_constraints_element.html.erb +5 -24
  39. data/app/views/catalog/_email_form.html.erb +1 -1
  40. data/app/views/catalog/_facet_layout.html.erb +8 -17
  41. data/app/views/catalog/_facet_limit.html.erb +3 -12
  42. data/app/views/catalog/_facet_pagination.html.erb +2 -2
  43. data/app/views/catalog/_facet_pivot.html.erb +4 -4
  44. data/app/views/catalog/_field.json.jbuilder +2 -2
  45. data/app/views/catalog/_index.html.erb +3 -3
  46. data/app/views/catalog/_previous_next_doc.html.erb +5 -5
  47. data/app/views/catalog/_search_form.html.erb +1 -1
  48. data/app/views/catalog/_show.html.erb +3 -3
  49. data/app/views/catalog/_sms_form.html.erb +1 -1
  50. data/app/views/catalog/_sort_and_per_page.html.erb +1 -1
  51. data/app/views/catalog/_start_over.html.erb +1 -0
  52. data/app/views/catalog/_thumbnail.html.erb +1 -1
  53. data/app/views/catalog/index.json.jbuilder +2 -1
  54. data/app/views/catalog/show.html.erb +1 -1
  55. data/app/views/catalog/show.json.jbuilder +2 -1
  56. data/app/views/layouts/blacklight/base.html.erb +2 -2
  57. data/blacklight.gemspec +1 -0
  58. data/config/locales/blacklight.ar.yml +30 -24
  59. data/config/locales/blacklight.de.yml +2 -0
  60. data/config/locales/blacklight.en.yml +2 -0
  61. data/config/locales/blacklight.es.yml +2 -0
  62. data/config/locales/blacklight.fr.yml +2 -0
  63. data/config/locales/blacklight.hu.yml +2 -0
  64. data/config/locales/blacklight.it.yml +2 -0
  65. data/config/locales/blacklight.nl.yml +2 -0
  66. data/config/locales/blacklight.pt-BR.yml +2 -0
  67. data/config/locales/blacklight.sq.yml +2 -0
  68. data/config/locales/blacklight.zh.yml +2 -0
  69. data/docker-compose.yml +35 -0
  70. data/lib/blacklight/configuration/field.rb +5 -4
  71. data/lib/blacklight/engine.rb +2 -6
  72. data/lib/blacklight/nested_open_struct_with_hash_access.rb +1 -1
  73. data/lib/blacklight/search_state.rb +52 -0
  74. data/lib/blacklight/solr/response/facets.rb +2 -0
  75. data/lib/generators/blacklight/assets_generator.rb +10 -0
  76. data/package.json +1 -1
  77. data/spec/{views/catalog/_constraints_element.html.erb_spec.rb → components/blacklight/constraint_layout_component_spec.rb} +22 -12
  78. data/spec/components/blacklight/facet_field_list_component_spec.rb +108 -0
  79. data/spec/components/blacklight/facet_item_component_spec.rb +50 -0
  80. data/spec/controllers/catalog_controller_spec.rb +13 -1
  81. data/spec/features/facets_spec.rb +1 -1
  82. data/spec/helpers/blacklight/configuration_helper_behavior_spec.rb +3 -0
  83. data/spec/helpers/blacklight/facets_helper_behavior_spec.rb +24 -12
  84. data/spec/helpers/blacklight/render_constraints_helper_behavior_spec.rb +4 -23
  85. data/spec/helpers/blacklight_helper_spec.rb +17 -0
  86. data/spec/helpers/catalog_helper_spec.rb +0 -7
  87. data/spec/lib/blacklight/search_state_spec.rb +50 -0
  88. data/spec/models/blacklight/icon_spec.rb +15 -6
  89. data/spec/models/blacklight/solr/response/facets_spec.rb +30 -1
  90. data/spec/presenters/blacklight/document_presenter_spec.rb +22 -62
  91. data/spec/presenters/blacklight/facet_field_presenter_spec.rb +109 -0
  92. data/spec/presenters/blacklight/facet_item_presenter_spec.rb +92 -0
  93. data/spec/presenters/blacklight/field_presenter_spec.rb +268 -0
  94. data/spec/presenters/blacklight/index_presenter_spec.rb +0 -142
  95. data/spec/presenters/blacklight/show_presenter_spec.rb +0 -177
  96. data/spec/spec_helper.rb +2 -0
  97. data/spec/support/presenter_test_helpers.rb +11 -0
  98. data/spec/views/catalog/_facet_group.html.erb_spec.rb +1 -0
  99. data/spec/views/catalog/_previous_next_doc.html.erb_spec.rb +18 -0
  100. data/tasks/blacklight.rake +30 -23
  101. metadata +48 -7
  102. data/Vagrantfile +0 -79
  103. data/provision.sh +0 -30
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: blacklight
3
3
  version: !ruby/object:Gem::Version
4
- version: 7.5.0
4
+ version: 7.8.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jonathan Rochkind
@@ -17,7 +17,7 @@ authors:
17
17
  autorequire:
18
18
  bindir: exe
19
19
  cert_chain: []
20
- date: 2019-12-18 00:00:00.000000000 Z
20
+ date: 2020-06-01 00:00:00.000000000 Z
21
21
  dependencies:
22
22
  - !ruby/object:Gem::Dependency
23
23
  name: rails
@@ -95,6 +95,20 @@ dependencies:
95
95
  - - ">="
96
96
  - !ruby/object:Gem::Version
97
97
  version: '0'
98
+ - !ruby/object:Gem::Dependency
99
+ name: view_component
100
+ requirement: !ruby/object:Gem::Requirement
101
+ requirements:
102
+ - - ">="
103
+ - !ruby/object:Gem::Version
104
+ version: '0'
105
+ type: :runtime
106
+ prerelease: false
107
+ version_requirements: !ruby/object:Gem::Requirement
108
+ requirements:
109
+ - - ">="
110
+ - !ruby/object:Gem::Version
111
+ version: '0'
98
112
  - !ruby/object:Gem::Dependency
99
113
  name: rsolr
100
114
  requirement: !ruby/object:Gem::Requirement
@@ -294,6 +308,9 @@ executables: []
294
308
  extensions: []
295
309
  extra_rdoc_files: []
296
310
  files:
311
+ - ".docker/app/Dockerfile"
312
+ - ".docker/app/entrypoint.sh"
313
+ - ".env"
297
314
  - ".gitignore"
298
315
  - ".hound.yml"
299
316
  - ".jshintrc"
@@ -309,7 +326,6 @@ files:
309
326
  - README.md
310
327
  - Rakefile
311
328
  - VERSION
312
- - Vagrantfile
313
329
  - app/assets/images/blacklight/list.svg
314
330
  - app/assets/images/blacklight/logo.png
315
331
  - app/assets/images/blacklight/search.svg
@@ -336,6 +352,14 @@ files:
336
352
  - app/assets/stylesheets/blacklight/blacklight.scss
337
353
  - app/assets/stylesheets/blacklight/blacklight_defaults.scss
338
354
  - app/builders/blacklight/action_builder.rb
355
+ - app/components/blacklight/constraint_layout_component.html.erb
356
+ - app/components/blacklight/constraint_layout_component.rb
357
+ - app/components/blacklight/facet_field_component.html.erb
358
+ - app/components/blacklight/facet_field_component.rb
359
+ - app/components/blacklight/facet_field_list_component.html.erb
360
+ - app/components/blacklight/facet_field_list_component.rb
361
+ - app/components/blacklight/facet_field_no_layout_component.rb
362
+ - app/components/blacklight/facet_item_component.rb
339
363
  - app/controllers/bookmarks_controller.rb
340
364
  - app/controllers/catalog_controller.rb
341
365
  - app/controllers/concerns/blacklight/base.rb
@@ -394,6 +418,8 @@ files:
394
418
  - app/models/search.rb
395
419
  - app/models/solr_document.rb
396
420
  - app/presenters/blacklight/document_presenter.rb
421
+ - app/presenters/blacklight/facet_field_presenter.rb
422
+ - app/presenters/blacklight/facet_item_presenter.rb
397
423
  - app/presenters/blacklight/field_presenter.rb
398
424
  - app/presenters/blacklight/index_presenter.rb
399
425
  - app/presenters/blacklight/json_presenter.rb
@@ -459,6 +485,7 @@ files:
459
485
  - app/views/catalog/_sms_form.html.erb
460
486
  - app/views/catalog/_sort_and_per_page.html.erb
461
487
  - app/views/catalog/_sort_widget.html.erb
488
+ - app/views/catalog/_start_over.html.erb
462
489
  - app/views/catalog/_thumbnail.html.erb
463
490
  - app/views/catalog/_view_type_group.html.erb
464
491
  - app/views/catalog/_zero_results.html.erb
@@ -518,6 +545,7 @@ files:
518
545
  - db/migrate/20140202020201_create_searches.rb
519
546
  - db/migrate/20140202020202_create_bookmarks.rb
520
547
  - db/migrate/20140320000000_add_polymorphic_type_to_bookmarks.rb
548
+ - docker-compose.yml
521
549
  - lib/blacklight.rb
522
550
  - lib/blacklight/abstract_repository.rb
523
551
  - lib/blacklight/configuration.rb
@@ -593,7 +621,9 @@ files:
593
621
  - lib/railties/blacklight.rake
594
622
  - package-lock.json
595
623
  - package.json
596
- - provision.sh
624
+ - spec/components/blacklight/constraint_layout_component_spec.rb
625
+ - spec/components/blacklight/facet_field_list_component_spec.rb
626
+ - spec/components/blacklight/facet_item_component_spec.rb
597
627
  - spec/controllers/alternate_controller_spec.rb
598
628
  - spec/controllers/application_controller_spec.rb
599
629
  - spec/controllers/blacklight/base_spec.rb
@@ -671,6 +701,9 @@ files:
671
701
  - spec/models/search_spec.rb
672
702
  - spec/models/solr_document_spec.rb
673
703
  - spec/presenters/blacklight/document_presenter_spec.rb
704
+ - spec/presenters/blacklight/facet_field_presenter_spec.rb
705
+ - spec/presenters/blacklight/facet_item_presenter_spec.rb
706
+ - spec/presenters/blacklight/field_presenter_spec.rb
674
707
  - spec/presenters/blacklight/index_presenter_spec.rb
675
708
  - spec/presenters/blacklight/json_presenter_spec.rb
676
709
  - spec/presenters/blacklight/link_alternate_presenter_spec.rb
@@ -684,10 +717,10 @@ files:
684
717
  - spec/support/controller_level_helpers.rb
685
718
  - spec/support/features.rb
686
719
  - spec/support/features/session_helpers.rb
720
+ - spec/support/presenter_test_helpers.rb
687
721
  - spec/test_app_templates/Gemfile.extra
688
722
  - spec/test_app_templates/lib/generators/test_app_generator.rb
689
723
  - spec/views/catalog/_constraints.html.erb_spec.rb
690
- - spec/views/catalog/_constraints_element.html.erb_spec.rb
691
724
  - spec/views/catalog/_document.html.erb_spec.rb
692
725
  - spec/views/catalog/_document_list.html.erb_spec.rb
693
726
  - spec/views/catalog/_facet_group.html.erb_spec.rb
@@ -697,6 +730,7 @@ files:
697
730
  - spec/views/catalog/_index.html.erb_spec.rb
698
731
  - spec/views/catalog/_index_header.html.erb_spec.rb
699
732
  - spec/views/catalog/_paginate_compact.html.erb_spec.rb
733
+ - spec/views/catalog/_previous_next_doc.html.erb_spec.rb
700
734
  - spec/views/catalog/_search_header.erb_spec.rb
701
735
  - spec/views/catalog/_show.html.erb_spec.rb
702
736
  - spec/views/catalog/_show_sidebar.erb_spec.rb
@@ -737,12 +771,15 @@ required_rubygems_version: !ruby/object:Gem::Requirement
737
771
  - !ruby/object:Gem::Version
738
772
  version: '0'
739
773
  requirements: []
740
- rubygems_version: 3.1.1
774
+ rubygems_version: 3.1.2
741
775
  signing_key:
742
776
  specification_version: 4
743
777
  summary: Blacklight provides a discovery interface for any Solr (http://lucene.apache.org/solr)
744
778
  index.
745
779
  test_files:
780
+ - spec/components/blacklight/constraint_layout_component_spec.rb
781
+ - spec/components/blacklight/facet_field_list_component_spec.rb
782
+ - spec/components/blacklight/facet_item_component_spec.rb
746
783
  - spec/controllers/alternate_controller_spec.rb
747
784
  - spec/controllers/application_controller_spec.rb
748
785
  - spec/controllers/blacklight/base_spec.rb
@@ -820,6 +857,9 @@ test_files:
820
857
  - spec/models/search_spec.rb
821
858
  - spec/models/solr_document_spec.rb
822
859
  - spec/presenters/blacklight/document_presenter_spec.rb
860
+ - spec/presenters/blacklight/facet_field_presenter_spec.rb
861
+ - spec/presenters/blacklight/facet_item_presenter_spec.rb
862
+ - spec/presenters/blacklight/field_presenter_spec.rb
823
863
  - spec/presenters/blacklight/index_presenter_spec.rb
824
864
  - spec/presenters/blacklight/json_presenter_spec.rb
825
865
  - spec/presenters/blacklight/link_alternate_presenter_spec.rb
@@ -833,10 +873,10 @@ test_files:
833
873
  - spec/support/controller_level_helpers.rb
834
874
  - spec/support/features.rb
835
875
  - spec/support/features/session_helpers.rb
876
+ - spec/support/presenter_test_helpers.rb
836
877
  - spec/test_app_templates/Gemfile.extra
837
878
  - spec/test_app_templates/lib/generators/test_app_generator.rb
838
879
  - spec/views/catalog/_constraints.html.erb_spec.rb
839
- - spec/views/catalog/_constraints_element.html.erb_spec.rb
840
880
  - spec/views/catalog/_document.html.erb_spec.rb
841
881
  - spec/views/catalog/_document_list.html.erb_spec.rb
842
882
  - spec/views/catalog/_facet_group.html.erb_spec.rb
@@ -846,6 +886,7 @@ test_files:
846
886
  - spec/views/catalog/_index.html.erb_spec.rb
847
887
  - spec/views/catalog/_index_header.html.erb_spec.rb
848
888
  - spec/views/catalog/_paginate_compact.html.erb_spec.rb
889
+ - spec/views/catalog/_previous_next_doc.html.erb_spec.rb
849
890
  - spec/views/catalog/_search_header.erb_spec.rb
850
891
  - spec/views/catalog/_show.html.erb_spec.rb
851
892
  - spec/views/catalog/_show_sidebar.erb_spec.rb
@@ -1,79 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- # -*- mode: ruby -*-
4
- # vi: set ft=ruby :
5
-
6
- # All Vagrant configuration is done below. The "2" in Vagrant.configure
7
- # configures the configuration version (we support older styles for
8
- # backwards compatibility). Please don't change it unless you know what
9
- # you're doing.
10
- Vagrant.configure(2) do |config|
11
- # The most common configuration options are documented and commented below.
12
- # For a complete reference, please see the online documentation at
13
- # https://docs.vagrantup.com.
14
-
15
- # Every Vagrant development environment requires a box. You can search for
16
- # boxes at https://atlas.hashicorp.com/search.
17
- config.vm.box = "bento/centos-7.1"
18
- config.vm.hostname = "blacklight"
19
- config.vm.synced_folder ".", "/home/vagrant/sync", type: 'virtualbox'
20
-
21
- # Disable automatic box update checking. If you disable this, then
22
- # boxes will only be checked for updates when the user runs
23
- # `vagrant box outdated`. This is not recommended.
24
- # config.vm.box_check_update = false
25
-
26
- # Create a forwarded port mapping which allows access to a specific port
27
- # within the machine from a port on the host machine. In the example below,
28
- # accessing "localhost:8080" will access port 80 on the guest machine.
29
- # config.vm.network "forwarded_port", guest: 80, host: 8080
30
- config.vm.network "forwarded_port", guest: 8983, host: 8983, auto_correct: true
31
- config.vm.network "forwarded_port", guest: 3000, host: 3000, auto_correct: true
32
-
33
- # Create a private network, which allows host-only access to the machine
34
- # using a specific IP.
35
- # config.vm.network "private_network", ip: "192.168.33.10"
36
-
37
- # Create a public network, which generally matched to bridged network.
38
- # Bridged networks make the machine appear as another physical device on
39
- # your network.
40
- # config.vm.network "public_network"
41
-
42
- # Share an additional folder to the guest VM. The first argument is
43
- # the path on the host to the actual folder. The second argument is
44
- # the path on the guest to mount the folder. And the optional third
45
- # argument is a set of non-required options.
46
- # config.vm.synced_folder "../data", "/vagrant_data"
47
-
48
- # Provider-specific configuration so you can fine-tune various
49
- # backing providers for Vagrant. These expose provider-specific options.
50
- # Example for VirtualBox:
51
- #
52
- # config.vm.provider "virtualbox" do |vb|
53
- # # Display the VirtualBox GUI when booting the machine
54
- # vb.gui = true
55
- #
56
- # # Customize the amount of memory on the VM:
57
- # vb.memory = "1024"
58
- # end
59
- #
60
- # View the documentation for the provider you are using for more
61
- # information on available options.
62
-
63
- # Define a Vagrant Push strategy for pushing to Atlas. Other push strategies
64
- # such as FTP and Heroku are also available. See the documentation at
65
- # https://docs.vagrantup.com/v2/push/atlas.html for more information.
66
- # config.push.define "atlas" do |push|
67
- # push.app = "YOUR_ATLAS_USERNAME/YOUR_APPLICATION_NAME"
68
- # end
69
-
70
- # Enable provisioning with a shell script. Additional provisioners such as
71
- # Puppet, Chef, Ansible, Salt, and Docker are also available. Please see the
72
- # documentation for more information about their specific syntax and use.
73
- # config.vm.provision "shell", inline: <<-SHELL
74
- # sudo apt-get update
75
- # sudo apt-get install -y apache2
76
- # SHELL
77
-
78
- config.vm.provision "shell", path: "provision.sh"
79
- end
@@ -1,30 +0,0 @@
1
- #!/usr/bin/env bash
2
-
3
- # This script is used by the Vagrant file to provision the box
4
-
5
- # Install server dependencies
6
- sudo yum install -y epel-release
7
- sudo yum install -y curl git java-1.8.0-openjdk-devel nodejs yum-utils gcc bzip2 kernel-devel dkms
8
-
9
- # Install RVM and Ruby
10
- su - vagrant -c 'gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3'
11
- su - vagrant -c 'curl -sSL https://get.rvm.io | bash -s stable'
12
- su - vagrant -c 'rvm 2.2.3 --install --default'
13
-
14
- # Install bundler gem and bundle install
15
- su - vagrant -c 'gem install bundler'
16
- su - vagrant -c 'cd /home/vagrant/sync && bundle install'
17
-
18
- # Create the test application
19
- su - vagrant -c 'cd /home/vagrant/sync && rake engine_cart:generate'
20
-
21
- # Output some instructions on what to do next
22
- echo "
23
- Now to start Solr and Blacklight run the following from within the Blacklight directory:
24
-
25
- vagrant ssh
26
- cd /home/vagrant/sync
27
- rake blacklight:server[\"-b 0.0.0.0\"]
28
-
29
- Now you can make changes to Blacklight and see the results.
30
- "