blacklight 9.0.0.beta6 → 9.0.0.beta7

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.
Files changed (54) hide show
  1. checksums.yaml +4 -4
  2. data/.github/matrix.json +8 -1
  3. data/.solr_wrapper.yml +1 -1
  4. data/VERSION +1 -1
  5. data/app/assets/javascripts/blacklight/blacklight.esm.js +2 -1
  6. data/app/assets/javascripts/blacklight/blacklight.esm.js.map +1 -1
  7. data/app/assets/javascripts/blacklight/blacklight.js +2 -1
  8. data/app/assets/javascripts/blacklight/blacklight.js.map +1 -1
  9. data/app/components/blacklight/constraints_component.html.erb +3 -8
  10. data/app/components/blacklight/constraints_component.rb +57 -14
  11. data/app/components/blacklight/document/bookmark_component.rb +1 -1
  12. data/app/components/blacklight/document/page_header_component.rb +1 -1
  13. data/app/components/blacklight/document_component.rb +15 -16
  14. data/app/components/blacklight/facet_item_pivot_component.rb +4 -0
  15. data/app/components/blacklight/facets/item_component.rb +3 -0
  16. data/app/components/blacklight/facets/selected_value_component.rb +1 -1
  17. data/app/components/blacklight/header_component.rb +2 -2
  18. data/app/controllers/concerns/blacklight/catalog.rb +8 -4
  19. data/app/javascript/blacklight-frontend/facet_suggest.js +2 -1
  20. data/app/presenters/blacklight/constraint_presenter.rb +22 -0
  21. data/app/presenters/blacklight/facet_item_pivot_presenter.rb +1 -5
  22. data/app/presenters/blacklight/facet_item_presenter.rb +0 -18
  23. data/app/views/catalog/_document.atom.builder +1 -1
  24. data/app/views/catalog/_document.html.erb +1 -1
  25. data/app/views/catalog/_show_main_content.html.erb +1 -1
  26. data/blacklight.gemspec +1 -1
  27. data/config/locales/blacklight.ar.yml +1 -2
  28. data/config/locales/blacklight.ca.yml +1 -2
  29. data/config/locales/blacklight.de.yml +1 -2
  30. data/config/locales/blacklight.en.yml +1 -2
  31. data/config/locales/blacklight.es.yml +1 -2
  32. data/config/locales/blacklight.fr.yml +1 -2
  33. data/config/locales/blacklight.hu.yml +1 -2
  34. data/config/locales/blacklight.it.yml +1 -2
  35. data/config/locales/blacklight.nl.yml +1 -2
  36. data/config/locales/blacklight.pt-BR.yml +1 -2
  37. data/config/locales/blacklight.sq.yml +1 -2
  38. data/config/locales/blacklight.zh.yml +1 -2
  39. data/lib/blacklight/component.rb +5 -1
  40. data/lib/blacklight/configuration/facet_field.rb +2 -0
  41. data/lib/blacklight/configuration.rb +2 -0
  42. data/lib/generators/blacklight/templates/.solr_wrapper.yml +1 -1
  43. data/package.json +1 -1
  44. data/spec/components/blacklight/constraints_component_spec.rb +2 -2
  45. data/spec/components/blacklight/document_component_spec.rb +9 -9
  46. data/spec/components/blacklight/facets/index_navigation_component_spec.rb +2 -1
  47. data/spec/components/blacklight/facets/suggest_component_spec.rb +2 -1
  48. data/spec/features/search_filters_spec.rb +3 -3
  49. data/spec/features/search_spec.rb +3 -3
  50. data/spec/presenters/blacklight/constraint_presenter_spec.rb +32 -0
  51. data/spec/presenters/blacklight/facet_item_presenter_spec.rb +0 -7
  52. data/spec/support/presenter_test_helpers.rb +1 -1
  53. data/spec/views/catalog/index.atom.builder_spec.rb +2 -0
  54. metadata +16 -7
@@ -53,7 +53,7 @@ RSpec.describe "Facets" do
53
53
  expect(page).to have_css("span.facet-count.selected", text: "2")
54
54
  end
55
55
  within "#appliedParams" do
56
- expect(page).to have_content "You searched for:"
56
+ expect(page).to have_content "Your selections:"
57
57
  expect(page).to have_content "history"
58
58
  end
59
59
 
@@ -140,7 +140,7 @@ RSpec.describe "Facets" do
140
140
  expect(page).to have_css("span.facet-count.selected", text: "2")
141
141
  end
142
142
  within "#appliedParams" do
143
- expect(page).to have_content "You searched for:"
143
+ expect(page).to have_content "Your selections:"
144
144
  expect(page).to have_content "history"
145
145
  end
146
146
  end
@@ -164,7 +164,7 @@ RSpec.describe "Facets" do
164
164
  expect(page).to have_css("span.facet-count.selected", text: "2")
165
165
  end
166
166
  within "#appliedParams" do
167
- expect(page).to have_content "You searched for:"
167
+ expect(page).to have_content "Your selections:"
168
168
  expect(page).to have_content "history"
169
169
  end
170
170
  end
@@ -44,7 +44,7 @@ RSpec.describe "Search Page" do
44
44
  Capybara.ignore_hidden_elements = tmp_value
45
45
 
46
46
  within "#appliedParams" do
47
- expect(page).to have_content "You searched for:"
47
+ expect(page).to have_content "Your selections:"
48
48
  expect(page).to have_content "history"
49
49
  end
50
50
 
@@ -74,7 +74,7 @@ RSpec.describe "Search Page" do
74
74
  click_on 'search'
75
75
 
76
76
  within "#appliedParams" do
77
- expect(page).to have_content "You searched for:"
77
+ expect(page).to have_content "Your selections:"
78
78
  expect(page).to have_content "Title"
79
79
  expect(page).to have_content "inmul"
80
80
  end
@@ -104,7 +104,7 @@ RSpec.describe "Search Page" do
104
104
  fill_in "q", with: 'history'
105
105
  click_on 'search'
106
106
  within "#appliedParams" do
107
- expect(page).to have_content "You searched for:"
107
+ expect(page).to have_content "Your selections:"
108
108
  expect(page).to have_content "history"
109
109
  end
110
110
 
@@ -0,0 +1,32 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'spec_helper'
4
+
5
+ RSpec.describe Blacklight::ConstraintPresenter, type: :presenter do
6
+ subject(:presenter) do
7
+ described_class.new(facet_item_presenter: facet_item_presenter, field_label: field_label)
8
+ end
9
+
10
+ let(:facet_item_presenter) do
11
+ instance_double(Blacklight::FacetItemPresenter, label: 'item 1', remove_href: '/catalog')
12
+ end
13
+ let(:field_label) { 'field 1' }
14
+
15
+ describe '#constraint_label' do
16
+ subject { presenter.constraint_label }
17
+
18
+ it { is_expected.to eq 'item 1' }
19
+ end
20
+
21
+ describe '#field_label' do
22
+ subject { presenter.field_label }
23
+
24
+ it { is_expected.to eq 'field 1' }
25
+ end
26
+
27
+ describe '#remove_href' do
28
+ subject { presenter.remove_href }
29
+
30
+ it { is_expected.to eq '/catalog' }
31
+ end
32
+ end
@@ -56,13 +56,6 @@ RSpec.describe Blacklight::FacetItemPresenter, type: :presenter do
56
56
  end
57
57
  end
58
58
 
59
- describe '#constraint_label' do
60
- it 'provides the label for the constraint' do
61
- allow(facet_config).to receive_messages(query: nil, date: nil, helper_method: nil, url_method: nil)
62
- expect(presenter.constraint_label).to eq presenter.label
63
- end
64
- end
65
-
66
59
  describe '#href' do
67
60
  let(:filter_field) { instance_double(Blacklight::SearchState::FilterField, include?: false) }
68
61
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  module PresenterTestHelpers
4
4
  def controller
5
- @controller ||= ViewComponent::Base.test_controller.constantize.new.tap { |c| c.request = request }.extend(Rails.application.routes.url_helpers)
5
+ @controller ||= ApplicationController.new.tap { |c| c.request = request }.extend(Rails.application.routes.url_helpers)
6
6
  end
7
7
 
8
8
  def request
@@ -96,6 +96,8 @@ RSpec.describe "catalog/index" do
96
96
  context 'with a custom template' do
97
97
  before do
98
98
  my_template = Class.new(ViewComponent::Base) do
99
+ def initialize(**); end
100
+
99
101
  def call
100
102
  'whatever content'.html_safe
101
103
  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.beta6
4
+ version: 9.0.0.beta7
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: 2025-07-23 00:00:00.000000000 Z
19
+ date: 1980-01-02 00:00:00.000000000 Z
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
22
22
  name: rails
@@ -112,16 +112,22 @@ dependencies:
112
112
  name: view_component
113
113
  requirement: !ruby/object:Gem::Requirement
114
114
  requirements:
115
- - - "~>"
115
+ - - ">="
116
+ - !ruby/object:Gem::Version
117
+ version: '3.0'
118
+ - - "<"
116
119
  - !ruby/object:Gem::Version
117
- version: '3.9'
120
+ version: '5.0'
118
121
  type: :runtime
119
122
  prerelease: false
120
123
  version_requirements: !ruby/object:Gem::Requirement
121
124
  requirements:
122
- - - "~>"
125
+ - - ">="
126
+ - !ruby/object:Gem::Version
127
+ version: '3.0'
128
+ - - "<"
123
129
  - !ruby/object:Gem::Version
124
- version: '3.9'
130
+ version: '5.0'
125
131
  - !ruby/object:Gem::Dependency
126
132
  name: zeitwerk
127
133
  requirement: !ruby/object:Gem::Requirement
@@ -632,6 +638,7 @@ files:
632
638
  - app/models/search_builder.rb
633
639
  - app/models/solr_document.rb
634
640
  - app/presenters/blacklight/clause_presenter.rb
641
+ - app/presenters/blacklight/constraint_presenter.rb
635
642
  - app/presenters/blacklight/document_presenter.rb
636
643
  - app/presenters/blacklight/facet_checkbox_item_presenter.rb
637
644
  - app/presenters/blacklight/facet_field_presenter.rb
@@ -960,6 +967,7 @@ files:
960
967
  - spec/models/search_spec.rb
961
968
  - spec/models/solr_document_spec.rb
962
969
  - spec/presenters/blacklight/clause_presenter_spec.rb
970
+ - spec/presenters/blacklight/constraint_presenter_spec.rb
963
971
  - spec/presenters/blacklight/document_presenter_spec.rb
964
972
  - spec/presenters/blacklight/facet_checkbox_item_presenter_spec.rb
965
973
  - spec/presenters/blacklight/facet_field_presenter_spec.rb
@@ -1023,7 +1031,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
1023
1031
  - !ruby/object:Gem::Version
1024
1032
  version: '0'
1025
1033
  requirements: []
1026
- rubygems_version: 3.6.3
1034
+ rubygems_version: 3.6.9
1027
1035
  specification_version: 4
1028
1036
  summary: Blacklight provides a discovery interface for any Solr (http://lucene.apache.org/solr)
1029
1037
  index.
@@ -1144,6 +1152,7 @@ test_files:
1144
1152
  - spec/models/search_spec.rb
1145
1153
  - spec/models/solr_document_spec.rb
1146
1154
  - spec/presenters/blacklight/clause_presenter_spec.rb
1155
+ - spec/presenters/blacklight/constraint_presenter_spec.rb
1147
1156
  - spec/presenters/blacklight/document_presenter_spec.rb
1148
1157
  - spec/presenters/blacklight/facet_checkbox_item_presenter_spec.rb
1149
1158
  - spec/presenters/blacklight/facet_field_presenter_spec.rb