blacklight 7.14.1 → 7.15.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/VERSION +1 -1
- data/app/components/blacklight/advanced_search_form_component.html.erb +46 -0
- data/app/components/blacklight/advanced_search_form_component.rb +75 -0
- data/app/components/blacklight/constraint_component.html.erb +1 -1
- data/app/components/blacklight/constraints_component.rb +36 -17
- data/app/components/blacklight/document/thumbnail_component.html.erb +1 -1
- data/app/components/blacklight/document/thumbnail_component.rb +4 -1
- data/app/components/blacklight/document_component.rb +7 -2
- data/app/components/blacklight/facet_field_checkboxes_component.html.erb +23 -0
- data/app/components/blacklight/facet_field_checkboxes_component.rb +24 -0
- data/app/components/blacklight/facet_field_inclusive_constraint_component.html.erb +6 -0
- data/app/components/blacklight/facet_field_inclusive_constraint_component.rb +29 -0
- data/app/components/blacklight/facet_field_list_component.html.erb +1 -0
- data/app/components/blacklight/facet_item_component.rb +2 -0
- data/app/components/blacklight/search_bar_component.html.erb +4 -0
- data/app/components/blacklight/search_bar_component.rb +4 -2
- data/app/controllers/concerns/blacklight/catalog.rb +6 -0
- data/app/helpers/blacklight/render_constraints_helper_behavior.rb +2 -2
- data/app/presenters/blacklight/clause_presenter.rb +37 -0
- data/app/presenters/blacklight/document_presenter.rb +5 -1
- data/app/presenters/blacklight/facet_field_presenter.rb +4 -0
- data/app/presenters/blacklight/facet_grouped_item_presenter.rb +45 -0
- data/app/presenters/blacklight/facet_item_presenter.rb +32 -20
- data/app/presenters/blacklight/inclusive_facet_item_presenter.rb +16 -0
- data/app/presenters/blacklight/search_bar_presenter.rb +4 -0
- data/app/views/catalog/_advanced_search_form.html.erb +7 -0
- data/app/views/catalog/_advanced_search_help.html.erb +24 -0
- data/app/views/catalog/_search_form.html.erb +1 -0
- data/app/views/catalog/advanced_search.html.erb +17 -0
- data/blacklight.gemspec +1 -1
- data/config/i18n-tasks.yml +1 -0
- data/config/locales/blacklight.en.yml +17 -0
- data/lib/blacklight/configuration.rb +2 -1
- data/lib/blacklight/routes/searchable.rb +1 -0
- data/lib/blacklight/search_builder.rb +2 -0
- data/lib/blacklight/search_state.rb +5 -1
- data/lib/blacklight/search_state/filter_field.rb +17 -7
- data/lib/blacklight/solr/repository.rb +11 -2
- data/lib/blacklight/solr/search_builder_behavior.rb +87 -23
- data/spec/components/blacklight/advanced_search_form_component_spec.rb +51 -0
- data/spec/components/blacklight/document_component_spec.rb +15 -0
- data/spec/components/blacklight/facet_field_checkboxes_component_spec.rb +55 -0
- data/spec/components/blacklight/facet_field_list_component_spec.rb +39 -4
- data/spec/controllers/catalog_controller_spec.rb +9 -0
- data/spec/features/advanced_search_spec.rb +67 -0
- data/spec/lib/blacklight/search_state/filter_field_spec.rb +65 -0
- data/spec/models/blacklight/solr/repository_spec.rb +12 -0
- data/spec/models/blacklight/solr/search_builder_spec.rb +28 -0
- data/spec/presenters/blacklight/clause_presenter_spec.rb +34 -0
- data/spec/presenters/blacklight/document_presenter_spec.rb +13 -0
- data/spec/presenters/blacklight/facet_grouped_item_presenter_spec.rb +41 -0
- metadata +29 -7
@@ -47,4 +47,17 @@ RSpec.describe Blacklight::DocumentPresenter do
|
|
47
47
|
expect(presenter.field_value(field_config, options)).to eq 'abc'
|
48
48
|
end
|
49
49
|
end
|
50
|
+
|
51
|
+
describe '#thumbnail' do
|
52
|
+
it 'returns a thumbnail presenter' do
|
53
|
+
expect(presenter.thumbnail).to be_a_kind_of(Blacklight::ThumbnailPresenter)
|
54
|
+
end
|
55
|
+
|
56
|
+
it 'use the configured thumbnail presenter' do
|
57
|
+
custom_presenter_class = Class.new(Blacklight::ThumbnailPresenter)
|
58
|
+
blacklight_config.index.thumbnail_presenter = custom_presenter_class
|
59
|
+
|
60
|
+
expect(presenter.thumbnail).to be_a_kind_of custom_presenter_class
|
61
|
+
end
|
62
|
+
end
|
50
63
|
end
|
@@ -0,0 +1,41 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
require 'spec_helper'
|
3
|
+
|
4
|
+
RSpec.describe Blacklight::FacetGroupedItemPresenter, type: :presenter do
|
5
|
+
subject(:presenter) do
|
6
|
+
described_class.new(group, facet_item, facet_config, view_context, facet_field, search_state)
|
7
|
+
end
|
8
|
+
|
9
|
+
let(:facet_config) { Blacklight::Configuration::FacetField.new(key: 'key') }
|
10
|
+
let(:facet_field) { instance_double(Blacklight::Solr::Response::Facets::FacetField) }
|
11
|
+
let(:view_context) { controller.view_context }
|
12
|
+
|
13
|
+
let(:facet_item) { 'a' }
|
14
|
+
let(:group) { %w[a b c] }
|
15
|
+
let(:search_state) { Blacklight::SearchState.new(params, Blacklight::Configuration.new) }
|
16
|
+
let(:params) { { f_inclusive: { key: group } } }
|
17
|
+
|
18
|
+
describe '#selected' do
|
19
|
+
it { is_expected.to be_selected }
|
20
|
+
|
21
|
+
context 'when the item is not in the group' do
|
22
|
+
let(:facet_item) { 'd' }
|
23
|
+
|
24
|
+
it { is_expected.not_to be_selected }
|
25
|
+
end
|
26
|
+
|
27
|
+
describe '#href' do
|
28
|
+
it 'removes the item from the "group" of filters' do
|
29
|
+
expect(Rack::Utils.parse_query(URI(presenter.href).query)).to include 'f_inclusive[key][]' => %w[b c]
|
30
|
+
end
|
31
|
+
|
32
|
+
context 'when the item is not in the group' do
|
33
|
+
let(:facet_item) { 'd' }
|
34
|
+
|
35
|
+
it 'adds the item to the "group" of filters' do
|
36
|
+
expect(Rack::Utils.parse_query(URI(presenter.href).query)).to include 'f_inclusive[key][]' => %w[a b c d]
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
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.
|
4
|
+
version: 7.15.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jonathan Rochkind
|
@@ -14,10 +14,10 @@ authors:
|
|
14
14
|
- Dan Funk
|
15
15
|
- Naomi Dushay
|
16
16
|
- Justin Coyne
|
17
|
-
autorequire:
|
17
|
+
autorequire:
|
18
18
|
bindir: exe
|
19
19
|
cert_chain: []
|
20
|
-
date: 2021-01-
|
20
|
+
date: 2021-01-25 00:00:00.000000000 Z
|
21
21
|
dependencies:
|
22
22
|
- !ruby/object:Gem::Dependency
|
23
23
|
name: rails
|
@@ -394,6 +394,8 @@ files:
|
|
394
394
|
- app/assets/stylesheets/blacklight/blacklight.scss
|
395
395
|
- app/assets/stylesheets/blacklight/blacklight_defaults.scss
|
396
396
|
- app/builders/blacklight/action_builder.rb
|
397
|
+
- app/components/blacklight/advanced_search_form_component.html.erb
|
398
|
+
- app/components/blacklight/advanced_search_form_component.rb
|
397
399
|
- app/components/blacklight/constraint_component.html.erb
|
398
400
|
- app/components/blacklight/constraint_component.rb
|
399
401
|
- app/components/blacklight/constraint_layout_component.html.erb
|
@@ -418,10 +420,14 @@ files:
|
|
418
420
|
- app/components/blacklight/document_component.rb
|
419
421
|
- app/components/blacklight/document_metadata_component.html.erb
|
420
422
|
- app/components/blacklight/document_metadata_component.rb
|
423
|
+
- app/components/blacklight/facet_field_checkboxes_component.html.erb
|
424
|
+
- app/components/blacklight/facet_field_checkboxes_component.rb
|
421
425
|
- app/components/blacklight/facet_field_component.html.erb
|
422
426
|
- app/components/blacklight/facet_field_component.rb
|
423
427
|
- app/components/blacklight/facet_field_filter_component.html.erb
|
424
428
|
- app/components/blacklight/facet_field_filter_component.rb
|
429
|
+
- app/components/blacklight/facet_field_inclusive_constraint_component.html.erb
|
430
|
+
- app/components/blacklight/facet_field_inclusive_constraint_component.rb
|
425
431
|
- app/components/blacklight/facet_field_list_component.html.erb
|
426
432
|
- app/components/blacklight/facet_field_list_component.rb
|
427
433
|
- app/components/blacklight/facet_field_no_layout_component.rb
|
@@ -511,10 +517,13 @@ files:
|
|
511
517
|
- app/models/record_mailer.rb
|
512
518
|
- app/models/search.rb
|
513
519
|
- app/models/solr_document.rb
|
520
|
+
- app/presenters/blacklight/clause_presenter.rb
|
514
521
|
- app/presenters/blacklight/document_presenter.rb
|
515
522
|
- app/presenters/blacklight/facet_field_presenter.rb
|
523
|
+
- app/presenters/blacklight/facet_grouped_item_presenter.rb
|
516
524
|
- app/presenters/blacklight/facet_item_presenter.rb
|
517
525
|
- app/presenters/blacklight/field_presenter.rb
|
526
|
+
- app/presenters/blacklight/inclusive_facet_item_presenter.rb
|
518
527
|
- app/presenters/blacklight/index_presenter.rb
|
519
528
|
- app/presenters/blacklight/json_presenter.rb
|
520
529
|
- app/presenters/blacklight/link_alternate_presenter.rb
|
@@ -537,6 +546,8 @@ files:
|
|
537
546
|
- app/views/bookmarks/_clear_bookmarks_widget.html.erb
|
538
547
|
- app/views/bookmarks/_tools.html.erb
|
539
548
|
- app/views/bookmarks/index.html.erb
|
549
|
+
- app/views/catalog/_advanced_search_form.html.erb
|
550
|
+
- app/views/catalog/_advanced_search_help.html.erb
|
540
551
|
- app/views/catalog/_bookmark_control.html.erb
|
541
552
|
- app/views/catalog/_citation.html.erb
|
542
553
|
- app/views/catalog/_constraints.html.erb
|
@@ -583,6 +594,7 @@ files:
|
|
583
594
|
- app/views/catalog/_thumbnail.html.erb
|
584
595
|
- app/views/catalog/_view_type_group.html.erb
|
585
596
|
- app/views/catalog/_zero_results.html.erb
|
597
|
+
- app/views/catalog/advanced_search.html.erb
|
586
598
|
- app/views/catalog/citation.html.erb
|
587
599
|
- app/views/catalog/citation.js.erb
|
588
600
|
- app/views/catalog/email.html.erb
|
@@ -719,11 +731,13 @@ files:
|
|
719
731
|
- lib/generators/blacklight/user_generator.rb
|
720
732
|
- lib/railties/blacklight.rake
|
721
733
|
- package.json
|
734
|
+
- spec/components/blacklight/advanced_search_form_component_spec.rb
|
722
735
|
- spec/components/blacklight/constraint_layout_component_spec.rb
|
723
736
|
- spec/components/blacklight/document/action_component_spec.rb
|
724
737
|
- spec/components/blacklight/document/group_component_spec.rb
|
725
738
|
- spec/components/blacklight/document_component_spec.rb
|
726
739
|
- spec/components/blacklight/document_metadata_component_spec.rb
|
740
|
+
- spec/components/blacklight/facet_field_checkboxes_component_spec.rb
|
727
741
|
- spec/components/blacklight/facet_field_list_component_spec.rb
|
728
742
|
- spec/components/blacklight/facet_item_component_spec.rb
|
729
743
|
- spec/components/blacklight/facet_item_pivot_component_spec.rb
|
@@ -739,6 +753,7 @@ files:
|
|
739
753
|
- spec/controllers/bookmarks_controller_spec.rb
|
740
754
|
- spec/controllers/catalog_controller_spec.rb
|
741
755
|
- spec/controllers/search_history_controller_spec.rb
|
756
|
+
- spec/features/advanced_search_spec.rb
|
742
757
|
- spec/features/alternate_controller_spec.rb
|
743
758
|
- spec/features/autocomplete_spec.rb
|
744
759
|
- spec/features/bookmarks_spec.rb
|
@@ -808,8 +823,10 @@ files:
|
|
808
823
|
- spec/models/record_mailer_spec.rb
|
809
824
|
- spec/models/search_spec.rb
|
810
825
|
- spec/models/solr_document_spec.rb
|
826
|
+
- spec/presenters/blacklight/clause_presenter_spec.rb
|
811
827
|
- spec/presenters/blacklight/document_presenter_spec.rb
|
812
828
|
- spec/presenters/blacklight/facet_field_presenter_spec.rb
|
829
|
+
- spec/presenters/blacklight/facet_grouped_item_presenter_spec.rb
|
813
830
|
- spec/presenters/blacklight/facet_item_presenter_spec.rb
|
814
831
|
- spec/presenters/blacklight/field_presenter_spec.rb
|
815
832
|
- spec/presenters/blacklight/index_presenter_spec.rb
|
@@ -864,7 +881,7 @@ homepage: http://projectblacklight.org/
|
|
864
881
|
licenses:
|
865
882
|
- Apache 2.0
|
866
883
|
metadata: {}
|
867
|
-
post_install_message:
|
884
|
+
post_install_message:
|
868
885
|
rdoc_options: []
|
869
886
|
require_paths:
|
870
887
|
- lib
|
@@ -872,24 +889,26 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
872
889
|
requirements:
|
873
890
|
- - ">="
|
874
891
|
- !ruby/object:Gem::Version
|
875
|
-
version: '2.
|
892
|
+
version: '2.5'
|
876
893
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
877
894
|
requirements:
|
878
895
|
- - ">="
|
879
896
|
- !ruby/object:Gem::Version
|
880
897
|
version: '0'
|
881
898
|
requirements: []
|
882
|
-
rubygems_version: 3.
|
883
|
-
signing_key:
|
899
|
+
rubygems_version: 3.2.3
|
900
|
+
signing_key:
|
884
901
|
specification_version: 4
|
885
902
|
summary: Blacklight provides a discovery interface for any Solr (http://lucene.apache.org/solr)
|
886
903
|
index.
|
887
904
|
test_files:
|
905
|
+
- spec/components/blacklight/advanced_search_form_component_spec.rb
|
888
906
|
- spec/components/blacklight/constraint_layout_component_spec.rb
|
889
907
|
- spec/components/blacklight/document/action_component_spec.rb
|
890
908
|
- spec/components/blacklight/document/group_component_spec.rb
|
891
909
|
- spec/components/blacklight/document_component_spec.rb
|
892
910
|
- spec/components/blacklight/document_metadata_component_spec.rb
|
911
|
+
- spec/components/blacklight/facet_field_checkboxes_component_spec.rb
|
893
912
|
- spec/components/blacklight/facet_field_list_component_spec.rb
|
894
913
|
- spec/components/blacklight/facet_item_component_spec.rb
|
895
914
|
- spec/components/blacklight/facet_item_pivot_component_spec.rb
|
@@ -905,6 +924,7 @@ test_files:
|
|
905
924
|
- spec/controllers/bookmarks_controller_spec.rb
|
906
925
|
- spec/controllers/catalog_controller_spec.rb
|
907
926
|
- spec/controllers/search_history_controller_spec.rb
|
927
|
+
- spec/features/advanced_search_spec.rb
|
908
928
|
- spec/features/alternate_controller_spec.rb
|
909
929
|
- spec/features/autocomplete_spec.rb
|
910
930
|
- spec/features/bookmarks_spec.rb
|
@@ -974,8 +994,10 @@ test_files:
|
|
974
994
|
- spec/models/record_mailer_spec.rb
|
975
995
|
- spec/models/search_spec.rb
|
976
996
|
- spec/models/solr_document_spec.rb
|
997
|
+
- spec/presenters/blacklight/clause_presenter_spec.rb
|
977
998
|
- spec/presenters/blacklight/document_presenter_spec.rb
|
978
999
|
- spec/presenters/blacklight/facet_field_presenter_spec.rb
|
1000
|
+
- spec/presenters/blacklight/facet_grouped_item_presenter_spec.rb
|
979
1001
|
- spec/presenters/blacklight/facet_item_presenter_spec.rb
|
980
1002
|
- spec/presenters/blacklight/field_presenter_spec.rb
|
981
1003
|
- spec/presenters/blacklight/index_presenter_spec.rb
|