blacklight 7.5.1 → 7.9.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (108) 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 +25 -36
  7. data/.travis.yml +15 -23
  8. data/Gemfile +4 -1
  9. data/README.md +4 -0
  10. data/VERSION +1 -1
  11. data/app/assets/stylesheets/blacklight/_facets.scss +20 -4
  12. data/app/assets/stylesheets/blacklight/_pagination.scss +4 -0
  13. data/app/components/blacklight/constraint_layout_component.html.erb +23 -0
  14. data/app/components/blacklight/constraint_layout_component.rb +16 -0
  15. data/app/components/blacklight/facet_field_component.html.erb +25 -0
  16. data/app/components/blacklight/facet_field_component.rb +11 -0
  17. data/app/components/blacklight/facet_field_list_component.html.erb +18 -0
  18. data/app/components/blacklight/facet_field_list_component.rb +22 -0
  19. data/app/components/blacklight/facet_field_no_layout_component.rb +13 -0
  20. data/app/components/blacklight/facet_item_component.rb +120 -0
  21. data/app/components/blacklight/facet_item_pivot_component.rb +84 -0
  22. data/app/helpers/blacklight/blacklight_helper_behavior.rb +4 -2
  23. data/app/helpers/blacklight/catalog_helper_behavior.rb +2 -4
  24. data/app/helpers/blacklight/configuration_helper_behavior.rb +3 -2
  25. data/app/helpers/blacklight/facets_helper_behavior.rb +92 -49
  26. data/app/helpers/blacklight/render_constraints_helper_behavior.rb +64 -33
  27. data/app/javascript/blacklight/modal.js +1 -1
  28. data/app/models/blacklight/icon.rb +13 -11
  29. data/app/models/concerns/blacklight/document.rb +0 -10
  30. data/app/models/concerns/blacklight/document/extensions.rb +3 -0
  31. data/app/models/concerns/blacklight/document/semantic_fields.rb +0 -4
  32. data/app/presenters/blacklight/document_presenter.rb +27 -36
  33. data/app/presenters/blacklight/facet_field_presenter.rb +57 -0
  34. data/app/presenters/blacklight/facet_item_presenter.rb +81 -0
  35. data/app/presenters/blacklight/field_presenter.rb +31 -6
  36. data/app/presenters/blacklight/index_presenter.rb +2 -2
  37. data/app/presenters/blacklight/show_presenter.rb +3 -3
  38. data/app/views/catalog/_citation.html.erb +1 -1
  39. data/app/views/catalog/_constraints.html.erb +3 -3
  40. data/app/views/catalog/_constraints_element.html.erb +5 -24
  41. data/app/views/catalog/_email_form.html.erb +1 -1
  42. data/app/views/catalog/_facet_layout.html.erb +8 -17
  43. data/app/views/catalog/_facet_limit.html.erb +3 -12
  44. data/app/views/catalog/_facet_pagination.html.erb +2 -2
  45. data/app/views/catalog/_facet_pivot.html.erb +3 -18
  46. data/app/views/catalog/_field.json.jbuilder +2 -2
  47. data/app/views/catalog/_index.html.erb +3 -3
  48. data/app/views/catalog/_previous_next_doc.html.erb +5 -5
  49. data/app/views/catalog/_search_form.html.erb +1 -1
  50. data/app/views/catalog/_show.html.erb +3 -3
  51. data/app/views/catalog/_sms_form.html.erb +1 -1
  52. data/app/views/catalog/_sort_and_per_page.html.erb +1 -1
  53. data/app/views/catalog/_start_over.html.erb +1 -0
  54. data/app/views/catalog/_thumbnail.html.erb +1 -1
  55. data/app/views/catalog/index.json.jbuilder +2 -1
  56. data/app/views/catalog/show.html.erb +1 -1
  57. data/app/views/catalog/show.json.jbuilder +2 -1
  58. data/app/views/layouts/blacklight/base.html.erb +2 -2
  59. data/blacklight.gemspec +1 -0
  60. data/config/locales/blacklight.ar.yml +33 -24
  61. data/config/locales/blacklight.de.yml +5 -0
  62. data/config/locales/blacklight.en.yml +5 -0
  63. data/config/locales/blacklight.es.yml +5 -0
  64. data/config/locales/blacklight.fr.yml +5 -0
  65. data/config/locales/blacklight.hu.yml +5 -0
  66. data/config/locales/blacklight.it.yml +5 -0
  67. data/config/locales/blacklight.nl.yml +5 -0
  68. data/config/locales/blacklight.pt-BR.yml +5 -0
  69. data/config/locales/blacklight.sq.yml +5 -0
  70. data/config/locales/blacklight.zh.yml +5 -0
  71. data/docker-compose.yml +35 -0
  72. data/lib/blacklight/configuration.rb +35 -8
  73. data/lib/blacklight/configuration/field.rb +5 -4
  74. data/lib/blacklight/engine.rb +2 -6
  75. data/lib/blacklight/search_state.rb +52 -0
  76. data/lib/blacklight/solr/response/facets.rb +2 -0
  77. data/lib/generators/blacklight/assets_generator.rb +10 -0
  78. data/lib/generators/blacklight/templates/catalog_controller.rb +1 -1
  79. data/package-lock.json +4 -4
  80. data/package.json +2 -2
  81. data/spec/{views/catalog/_constraints_element.html.erb_spec.rb → components/blacklight/constraint_layout_component_spec.rb} +22 -12
  82. data/spec/components/blacklight/facet_field_list_component_spec.rb +108 -0
  83. data/spec/components/blacklight/facet_item_component_spec.rb +50 -0
  84. data/spec/components/blacklight/facet_item_pivot_component_spec.rb +66 -0
  85. data/spec/features/facets_spec.rb +21 -1
  86. data/spec/helpers/blacklight/configuration_helper_behavior_spec.rb +3 -0
  87. data/spec/helpers/blacklight/facets_helper_behavior_spec.rb +24 -12
  88. data/spec/helpers/blacklight/render_constraints_helper_behavior_spec.rb +4 -23
  89. data/spec/helpers/blacklight_helper_spec.rb +17 -0
  90. data/spec/helpers/catalog_helper_spec.rb +0 -7
  91. data/spec/lib/blacklight/search_state_spec.rb +50 -0
  92. data/spec/models/blacklight/configuration_spec.rb +4 -0
  93. data/spec/models/blacklight/icon_spec.rb +11 -10
  94. data/spec/models/blacklight/solr/response/facets_spec.rb +30 -1
  95. data/spec/presenters/blacklight/document_presenter_spec.rb +22 -62
  96. data/spec/presenters/blacklight/facet_field_presenter_spec.rb +109 -0
  97. data/spec/presenters/blacklight/facet_item_presenter_spec.rb +92 -0
  98. data/spec/presenters/blacklight/field_presenter_spec.rb +268 -0
  99. data/spec/presenters/blacklight/index_presenter_spec.rb +0 -142
  100. data/spec/presenters/blacklight/show_presenter_spec.rb +0 -177
  101. data/spec/spec_helper.rb +3 -0
  102. data/spec/support/presenter_test_helpers.rb +11 -0
  103. data/spec/views/catalog/_facet_group.html.erb_spec.rb +1 -0
  104. data/spec/views/catalog/_previous_next_doc.html.erb_spec.rb +18 -0
  105. data/tasks/blacklight.rake +30 -23
  106. metadata +51 -7
  107. data/Vagrantfile +0 -79
  108. 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.1
4
+ version: 7.9.0
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: 2020-01-30 00:00:00.000000000 Z
20
+ date: 2020-06-23 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,15 @@ 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
363
+ - app/components/blacklight/facet_item_pivot_component.rb
339
364
  - app/controllers/bookmarks_controller.rb
340
365
  - app/controllers/catalog_controller.rb
341
366
  - app/controllers/concerns/blacklight/base.rb
@@ -394,6 +419,8 @@ files:
394
419
  - app/models/search.rb
395
420
  - app/models/solr_document.rb
396
421
  - app/presenters/blacklight/document_presenter.rb
422
+ - app/presenters/blacklight/facet_field_presenter.rb
423
+ - app/presenters/blacklight/facet_item_presenter.rb
397
424
  - app/presenters/blacklight/field_presenter.rb
398
425
  - app/presenters/blacklight/index_presenter.rb
399
426
  - app/presenters/blacklight/json_presenter.rb
@@ -459,6 +486,7 @@ files:
459
486
  - app/views/catalog/_sms_form.html.erb
460
487
  - app/views/catalog/_sort_and_per_page.html.erb
461
488
  - app/views/catalog/_sort_widget.html.erb
489
+ - app/views/catalog/_start_over.html.erb
462
490
  - app/views/catalog/_thumbnail.html.erb
463
491
  - app/views/catalog/_view_type_group.html.erb
464
492
  - app/views/catalog/_zero_results.html.erb
@@ -518,6 +546,7 @@ files:
518
546
  - db/migrate/20140202020201_create_searches.rb
519
547
  - db/migrate/20140202020202_create_bookmarks.rb
520
548
  - db/migrate/20140320000000_add_polymorphic_type_to_bookmarks.rb
549
+ - docker-compose.yml
521
550
  - lib/blacklight.rb
522
551
  - lib/blacklight/abstract_repository.rb
523
552
  - lib/blacklight/configuration.rb
@@ -593,7 +622,10 @@ files:
593
622
  - lib/railties/blacklight.rake
594
623
  - package-lock.json
595
624
  - package.json
596
- - provision.sh
625
+ - spec/components/blacklight/constraint_layout_component_spec.rb
626
+ - spec/components/blacklight/facet_field_list_component_spec.rb
627
+ - spec/components/blacklight/facet_item_component_spec.rb
628
+ - spec/components/blacklight/facet_item_pivot_component_spec.rb
597
629
  - spec/controllers/alternate_controller_spec.rb
598
630
  - spec/controllers/application_controller_spec.rb
599
631
  - spec/controllers/blacklight/base_spec.rb
@@ -671,6 +703,9 @@ files:
671
703
  - spec/models/search_spec.rb
672
704
  - spec/models/solr_document_spec.rb
673
705
  - spec/presenters/blacklight/document_presenter_spec.rb
706
+ - spec/presenters/blacklight/facet_field_presenter_spec.rb
707
+ - spec/presenters/blacklight/facet_item_presenter_spec.rb
708
+ - spec/presenters/blacklight/field_presenter_spec.rb
674
709
  - spec/presenters/blacklight/index_presenter_spec.rb
675
710
  - spec/presenters/blacklight/json_presenter_spec.rb
676
711
  - spec/presenters/blacklight/link_alternate_presenter_spec.rb
@@ -684,10 +719,10 @@ files:
684
719
  - spec/support/controller_level_helpers.rb
685
720
  - spec/support/features.rb
686
721
  - spec/support/features/session_helpers.rb
722
+ - spec/support/presenter_test_helpers.rb
687
723
  - spec/test_app_templates/Gemfile.extra
688
724
  - spec/test_app_templates/lib/generators/test_app_generator.rb
689
725
  - spec/views/catalog/_constraints.html.erb_spec.rb
690
- - spec/views/catalog/_constraints_element.html.erb_spec.rb
691
726
  - spec/views/catalog/_document.html.erb_spec.rb
692
727
  - spec/views/catalog/_document_list.html.erb_spec.rb
693
728
  - spec/views/catalog/_facet_group.html.erb_spec.rb
@@ -697,6 +732,7 @@ files:
697
732
  - spec/views/catalog/_index.html.erb_spec.rb
698
733
  - spec/views/catalog/_index_header.html.erb_spec.rb
699
734
  - spec/views/catalog/_paginate_compact.html.erb_spec.rb
735
+ - spec/views/catalog/_previous_next_doc.html.erb_spec.rb
700
736
  - spec/views/catalog/_search_header.erb_spec.rb
701
737
  - spec/views/catalog/_show.html.erb_spec.rb
702
738
  - spec/views/catalog/_show_sidebar.erb_spec.rb
@@ -737,12 +773,16 @@ required_rubygems_version: !ruby/object:Gem::Requirement
737
773
  - !ruby/object:Gem::Version
738
774
  version: '0'
739
775
  requirements: []
740
- rubygems_version: 3.1.1
776
+ rubygems_version: 3.1.2
741
777
  signing_key:
742
778
  specification_version: 4
743
779
  summary: Blacklight provides a discovery interface for any Solr (http://lucene.apache.org/solr)
744
780
  index.
745
781
  test_files:
782
+ - spec/components/blacklight/constraint_layout_component_spec.rb
783
+ - spec/components/blacklight/facet_field_list_component_spec.rb
784
+ - spec/components/blacklight/facet_item_component_spec.rb
785
+ - spec/components/blacklight/facet_item_pivot_component_spec.rb
746
786
  - spec/controllers/alternate_controller_spec.rb
747
787
  - spec/controllers/application_controller_spec.rb
748
788
  - spec/controllers/blacklight/base_spec.rb
@@ -820,6 +860,9 @@ test_files:
820
860
  - spec/models/search_spec.rb
821
861
  - spec/models/solr_document_spec.rb
822
862
  - spec/presenters/blacklight/document_presenter_spec.rb
863
+ - spec/presenters/blacklight/facet_field_presenter_spec.rb
864
+ - spec/presenters/blacklight/facet_item_presenter_spec.rb
865
+ - spec/presenters/blacklight/field_presenter_spec.rb
823
866
  - spec/presenters/blacklight/index_presenter_spec.rb
824
867
  - spec/presenters/blacklight/json_presenter_spec.rb
825
868
  - spec/presenters/blacklight/link_alternate_presenter_spec.rb
@@ -833,10 +876,10 @@ test_files:
833
876
  - spec/support/controller_level_helpers.rb
834
877
  - spec/support/features.rb
835
878
  - spec/support/features/session_helpers.rb
879
+ - spec/support/presenter_test_helpers.rb
836
880
  - spec/test_app_templates/Gemfile.extra
837
881
  - spec/test_app_templates/lib/generators/test_app_generator.rb
838
882
  - spec/views/catalog/_constraints.html.erb_spec.rb
839
- - spec/views/catalog/_constraints_element.html.erb_spec.rb
840
883
  - spec/views/catalog/_document.html.erb_spec.rb
841
884
  - spec/views/catalog/_document_list.html.erb_spec.rb
842
885
  - spec/views/catalog/_facet_group.html.erb_spec.rb
@@ -846,6 +889,7 @@ test_files:
846
889
  - spec/views/catalog/_index.html.erb_spec.rb
847
890
  - spec/views/catalog/_index_header.html.erb_spec.rb
848
891
  - spec/views/catalog/_paginate_compact.html.erb_spec.rb
892
+ - spec/views/catalog/_previous_next_doc.html.erb_spec.rb
849
893
  - spec/views/catalog/_search_header.erb_spec.rb
850
894
  - spec/views/catalog/_show.html.erb_spec.rb
851
895
  - 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
- "