blacklight 9.0.0.beta4 → 9.0.0.beta6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/VERSION +1 -1
- data/app/assets/builds/blacklight.css +26 -18
- data/app/assets/javascripts/blacklight/blacklight.esm.js +12 -4
- data/app/assets/javascripts/blacklight/blacklight.esm.js.map +1 -1
- data/app/assets/javascripts/blacklight/blacklight.js +12 -4
- data/app/assets/javascripts/blacklight/blacklight.js.map +1 -1
- data/app/assets/stylesheets/blacklight/_facets.scss +25 -25
- data/app/components/blacklight/advanced_search_form_component.html.erb +4 -4
- data/app/components/blacklight/advanced_search_form_component.rb +2 -2
- data/app/components/blacklight/constraint_component.html.erb +1 -5
- data/app/components/blacklight/constraint_component.rb +11 -0
- data/app/components/blacklight/constraints_component.rb +5 -3
- data/app/components/blacklight/document/bookmark_component.html.erb +1 -1
- data/app/components/blacklight/document/bookmark_component.rb +9 -3
- data/app/components/blacklight/document/group_component.html.erb +1 -1
- data/app/components/blacklight/facet_item_pivot_component.rb +2 -2
- data/app/components/blacklight/facets/checkboxes_component.html.erb +4 -4
- data/app/components/blacklight/facets/field_component.html.erb +0 -2
- data/app/components/blacklight/facets/list_component.html.erb +1 -1
- data/app/components/blacklight/facets/list_component.rb +8 -3
- data/app/components/blacklight/facets/pivot_list_component.rb +4 -1
- data/app/components/blacklight/facets/suggest_component.html.erb +1 -1
- data/app/components/blacklight/search_bar_component.html.erb +1 -1
- data/app/components/blacklight/top_navbar_component.html.erb +1 -1
- data/app/controllers/concerns/blacklight/catalog.rb +6 -1
- data/app/helpers/blacklight/catalog_helper_behavior.rb +4 -2
- data/app/helpers/blacklight/facets_helper_behavior.rb +0 -14
- data/app/javascript/blacklight-frontend/button_focus.js +1 -1
- data/app/javascript/blacklight-frontend/checkbox_submit.js +2 -2
- data/app/javascript/blacklight-frontend/modal.js +9 -1
- data/app/presenters/blacklight/facet_field_presenter.rb +9 -0
- data/app/presenters/blacklight/facet_grouped_item_presenter.rb +6 -0
- data/app/presenters/blacklight/facet_item_pivot_presenter.rb +1 -1
- data/app/presenters/blacklight/facet_item_presenter.rb +5 -0
- data/app/views/catalog/_email_form.html.erb +4 -4
- data/app/views/catalog/_sms_form.html.erb +4 -4
- data/app/views/catalog/advanced_search.html.erb +1 -1
- data/app/views/catalog/index.json.jbuilder +5 -3
- data/app/views/layouts/blacklight/base.html.erb +1 -1
- data/config/locales/blacklight.it.yml +1 -1
- data/lib/blacklight/search_state.rb +2 -0
- data/lib/blacklight.rb +1 -1
- data/lib/generators/blacklight/templates/catalog_controller.rb +3 -1
- data/package.json +1 -1
- data/spec/components/blacklight/facet_item_pivot_component_spec.rb +1 -1
- data/spec/components/blacklight/facets/list_component_spec.rb +6 -0
- data/spec/components/blacklight/facets/pivot_list_component_spec.rb +10 -0
- data/spec/features/advanced_search_spec.rb +3 -1
- data/spec/features/facets_spec.rb +5 -5
- data/spec/features/search_filters_spec.rb +3 -1
- metadata +3 -3
data/lib/blacklight.rb
CHANGED
@@ -33,7 +33,7 @@ module Blacklight
|
|
33
33
|
raise "The value for :adapter was not found in the blacklight.yml config"
|
34
34
|
end
|
35
35
|
|
36
|
-
case connection_config&.fetch(:adapter) || 'solr'
|
36
|
+
case connection_config&.fetch(:adapter) || 'solr'
|
37
37
|
when 'solr'
|
38
38
|
Blacklight::Solr::Repository
|
39
39
|
when /::/
|
@@ -119,7 +119,9 @@ class <%= controller_name.classify %>Controller < ApplicationController
|
|
119
119
|
config.add_facet_field 'subject_geo_ssim', label: 'Region'
|
120
120
|
config.add_facet_field 'subject_era_ssim', label: 'Era'
|
121
121
|
|
122
|
-
config.add_facet_field 'example_pivot_field',
|
122
|
+
config.add_facet_field 'example_pivot_field',
|
123
|
+
label: 'Pivot Field',
|
124
|
+
pivot: ['language_ssim', 'subject_geo_ssim', 'subject_ssim'], collapsing: true
|
123
125
|
|
124
126
|
config.add_facet_field 'example_query_facet_field', label: 'Publish Date', :query => {
|
125
127
|
:years_5 => { label: 'within 5 Years', fq: "pub_date_ssim:[#{Time.zone.now.year - 5 } TO *]" },
|
data/package.json
CHANGED
@@ -40,7 +40,7 @@ RSpec.describe Blacklight::FacetItemPivotComponent, type: :component do
|
|
40
40
|
end
|
41
41
|
|
42
42
|
it 'has the facet hierarchy' do
|
43
|
-
expect(page).to have_css 'li ul.
|
43
|
+
expect(page).to have_css 'li.treeitem ul li.treeitem'
|
44
44
|
expect(page).to have_link 'x:1', href: nokogiri_mediated_href(facet_item.facet_item_presenters.first.href)
|
45
45
|
end
|
46
46
|
|
@@ -4,9 +4,15 @@ require 'spec_helper'
|
|
4
4
|
|
5
5
|
RSpec.describe Blacklight::Facets::ListComponent, type: :component do
|
6
6
|
before do
|
7
|
+
allow(facet_field).to receive(:item_presenter).and_return(item_presenter)
|
8
|
+
|
7
9
|
render_inline(described_class.new(facet_field: facet_field))
|
8
10
|
end
|
9
11
|
|
12
|
+
let(:item_presenter) do
|
13
|
+
facet_config.item_presenter.new('stuff', facet_config, vc_test_controller.view_context, facet_field.key)
|
14
|
+
end
|
15
|
+
|
10
16
|
let(:facet_field) do
|
11
17
|
instance_double(
|
12
18
|
Blacklight::FacetFieldPresenter,
|
@@ -4,9 +4,15 @@ require 'spec_helper'
|
|
4
4
|
|
5
5
|
RSpec.describe Blacklight::Facets::PivotListComponent, type: :component do
|
6
6
|
before do
|
7
|
+
allow(facet_field).to receive(:item_presenter).and_return(item_presenter)
|
8
|
+
|
7
9
|
render_inline(described_class.new(facet_field: facet_field))
|
8
10
|
end
|
9
11
|
|
12
|
+
let(:item_presenter) do
|
13
|
+
facet_config.item_presenter.new('stuff', facet_config, vc_test_controller.view_context, facet_field.key)
|
14
|
+
end
|
15
|
+
|
10
16
|
let(:facet_field) do
|
11
17
|
instance_double(
|
12
18
|
Blacklight::FacetFieldPresenter,
|
@@ -37,6 +43,10 @@ RSpec.describe Blacklight::Facets::PivotListComponent, type: :component do
|
|
37
43
|
])
|
38
44
|
end
|
39
45
|
|
46
|
+
it 'renders the facet items top ul with "pivot-facet" class' do
|
47
|
+
expect(page).to have_css 'ul.pivot-facet'
|
48
|
+
end
|
49
|
+
|
40
50
|
it 'renders the facet items with role="tree"' do
|
41
51
|
expect(page).to have_css 'ul.facet-values[role="tree"]'
|
42
52
|
end
|
@@ -69,7 +69,9 @@ RSpec.describe "Blacklight Advanced Search Form" do
|
|
69
69
|
it 'can limit to facets' do
|
70
70
|
fill_in 'Subject', with: 'Women'
|
71
71
|
click_on 'Language'
|
72
|
-
|
72
|
+
within '#facet-language_ssim' do
|
73
|
+
check 'Urdu 3'
|
74
|
+
end
|
73
75
|
click_on 'advanced-search-submit'
|
74
76
|
expect(page).to have_content 'Pākistānī ʻaurat dorāhe par'
|
75
77
|
expect(page).to have_no_content 'Ajikto kŭrŏk chŏrŏk sasimnikka : and 아직도 그럭 저럭 사십니까'
|
@@ -69,14 +69,14 @@ RSpec.describe "Facets" do
|
|
69
69
|
click_on 'Pivot Field'
|
70
70
|
|
71
71
|
within '#facet-example_pivot_field' do
|
72
|
-
expect(page).to have_css('.facet-leaf-node', text: "
|
73
|
-
expect(page).to have_no_css('.facet-select', text: '
|
74
|
-
|
75
|
-
click_on '
|
72
|
+
expect(page).to have_css('.facet-leaf-node', text: "Tibetan 6", normalize_ws: true)
|
73
|
+
expect(page).to have_no_css('.facet-select', text: 'India')
|
74
|
+
first('.facet-toggle-handle').click
|
75
|
+
click_on 'India'
|
76
76
|
end
|
77
77
|
|
78
|
-
expect(page).to have_css('.constraint-value', text: 'Format Book')
|
79
78
|
expect(page).to have_css('.constraint-value', text: 'Language Tibetan')
|
79
|
+
expect(page).to have_css('.constraint-value', text: 'Region India')
|
80
80
|
end
|
81
81
|
|
82
82
|
describe 'heading button focus with Firefox' do
|
@@ -18,7 +18,9 @@ RSpec.describe "Facets" do
|
|
18
18
|
expect(page).to have_css("span.facet-count.selected", text: "6")
|
19
19
|
end
|
20
20
|
|
21
|
-
|
21
|
+
within "#facet-subject_geo_ssim" do
|
22
|
+
click_on "India"
|
23
|
+
end
|
22
24
|
within ("#sortAndPerPage") do
|
23
25
|
expect(page).to have_content "1 - 2 of 2"
|
24
26
|
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: 9.0.0.
|
4
|
+
version: 9.0.0.beta6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jonathan Rochkind
|
@@ -16,7 +16,7 @@ authors:
|
|
16
16
|
- Justin Coyne
|
17
17
|
bindir: exe
|
18
18
|
cert_chain: []
|
19
|
-
date:
|
19
|
+
date: 2025-07-23 00:00:00.000000000 Z
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|
22
22
|
name: rails
|
@@ -1023,7 +1023,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
1023
1023
|
- !ruby/object:Gem::Version
|
1024
1024
|
version: '0'
|
1025
1025
|
requirements: []
|
1026
|
-
rubygems_version: 3.6.
|
1026
|
+
rubygems_version: 3.6.3
|
1027
1027
|
specification_version: 4
|
1028
1028
|
summary: Blacklight provides a discovery interface for any Solr (http://lucene.apache.org/solr)
|
1029
1029
|
index.
|