Skip to content

Commit 3de4fb4

Browse files
committed
Merge branch 'main' into revert_facet_search_builder
2 parents 802213e + e019ac7 commit 3de4fb4

File tree

15 files changed

+70
-60
lines changed

15 files changed

+70
-60
lines changed

.github/matrix.json

Lines changed: 13 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,65 +1,51 @@
11
{
22
"ruby": ["3.4"],
3-
"rails_version": ["7.1.5.1", "7.2.2.1"],
3+
"rails_version": ["8.1.1"],
44
"bootstrap_version": [null],
55
"view_component_version": ["~> 4.0"],
66
"api": [null],
7-
"additional_engine_cart_rails_options": [""],
7+
"additional_engine_cart_rails_options": ["--css=bootstrap"],
88
"additional_name": [""],
99
"include": [
1010
{
11-
"ruby": "3.4",
12-
"rails_version": "8.1.0",
13-
"additional_engine_cart_rails_options": "--css=bootstrap"
14-
},
15-
{
16-
"ruby": "3.4",
17-
"rails_version": "8.1.0",
11+
"rails_version": "8.1.1",
1812
"additional_engine_cart_rails_options": "--css=bootstrap --js=esbuild",
1913
"additional_name": "| esbuild"
2014
},
2115
{
22-
"ruby": "3.4",
23-
"rails_version": "8.0.3",
16+
"rails_version": "8.0.4",
2417
"additional_engine_cart_rails_options": "--css=bootstrap",
2518
"view_component_version": "~> 3.0",
2619
"additional_name": "ViewComponent 3"
2720
},
2821
{
2922
"ruby": "3.3",
30-
"rails_version": "8.0.3",
23+
"rails_version": "8.0.4",
3124
"additional_engine_cart_rails_options": "--css=bootstrap"
25+
"additional_name": "| Rails 8.0 + Ruby 3.3"
3226
},
3327
{
34-
"ruby": "3.3",
35-
"rails_version": "8.0.3",
28+
"ruby": "3.4",
29+
"rails_version": "8.0.4",
3630
"additional_engine_cart_rails_options": "--css=bootstrap --js=esbuild",
3731
"additional_name": "| esbuild"
3832
},
3933
{
4034
"ruby": "3.2",
41-
"rails_version": "7.1.5.1",
35+
"rails_version": "8.0.4",
4236
"solr_version": "8.11.2",
43-
"additional_name": "| Solr 8.11.2"
44-
},
45-
{
46-
"ruby": "3.3",
47-
"rails_version": "7.1.5.1",
48-
"additional_name": "| Propshaft",
49-
"additional_engine_cart_rails_options": "-a propshaft --css=bootstrap"
37+
"additional_name": "| Solr 8.11.2 and Ruby 3.2"
5038
},
5139
{
52-
"ruby": "3.3",
53-
"rails_version": "7.1.5.1",
40+
"rails_version": "8.1.1",
5441
"api": "true",
5542
"additional_engine_cart_rails_options": "--api --skip-yarn",
5643
"additional_name": "| API"
5744
},
5845
{
59-
"ruby": "3.3",
60-
"rails_version": "7.2.2.1",
46+
"rails_version": "7.2.3",
6147
"additional_engine_cart_rails_options": "-a propshaft --css=bootstrap --js=esbuild",
62-
"additional_name": "| Propshaft, esbuild"
48+
"additional_name": "| Rails 7.2 + Propshaft, esbuild"
6349
}
6450
]
6551
}

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@ Blacklight assumes a modern browser with support for [Baseline 2023](https://web
4848

4949
## Dependencies
5050

51-
* [Ruby](https://www.ruby-lang.org/) 3.1+
52-
* [Ruby on Rails](https://rubyonrails.org/) 6.1+
51+
* [Ruby](https://www.ruby-lang.org/) 3.2+
52+
* [Ruby on Rails](https://rubyonrails.org/) 7.2+
5353

5454
Blacklight aims to support the currently [supported versions of Ruby](https://www.ruby-lang.org/en/downloads/branches/) and the [supported versions of Ruby on Rails](https://guides.rubyonrails.org/maintenance_policy.html). We aim to keep our [test configuration](blob/main/.github/workflows/ruby.yml) up to date with these supported versions.
5555

app/components/blacklight/facets/filters_component.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
module Blacklight::Facets
44
class FiltersComponent < Blacklight::Component
55
# @param [Blacklight::FacetFieldPresenter] presenter
6-
def initialize(presenter:, classes: 'facet-filters card card-body bg-light p-3 mb-3 border-0',
6+
def initialize(presenter:, classes: 'facet-filters mt-1 mb-3',
77
suggestions_component: Blacklight::Facets::SuggestComponent,
88
index_navigation_component: Blacklight::Facets::IndexNavigationComponent)
99
@presenter = presenter
Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,17 @@
1-
<label class="form-label" for="facet_suggest_<%= key %>">
2-
<%= I18n.t('blacklight.search.facets.suggest.label', field_label: label) %>
3-
</label>
4-
<%= text_field_tag "facet_suggest_#{key}",
5-
nil,
6-
class: "facet-suggest form-control mb-3",
7-
data: {
8-
facet_field: key,
9-
facet_search_context: helpers.search_facet_path(id: key)
10-
},
11-
placeholder: I18n.t('blacklight.search.form.search.placeholder')
12-
%>
1+
<div class="input-group">
2+
<label class="input-group-text" for="facet_suggest_<%= key %>">
3+
<%= I18n.t('blacklight.search.facets.suggest.label', field_label: label.downcase.pluralize) %>
4+
</label>
5+
<%= search_field_tag "facet_suggest_#{key}",
6+
nil,
7+
class: "facet-suggest form-control",
8+
data: {
9+
facet_field: key,
10+
facet_search_context: helpers.search_facet_path(id: key)
11+
},
12+
placeholder: I18n.t('blacklight.search.facets.suggest.placeholder')
13+
%>
14+
<span class="input-group-text">
15+
<%= render Blacklight::Icons::SearchComponent.new %>
16+
</span>
17+
</div>

app/javascript/blacklight-frontend/checkbox_submit.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
attribute (HTML5-style doc-*) that contains the id/primary key
1111
of the object in question -- used by plugin for a unique value for
1212
DOM id's.
13-
Uses HTML for a checkbox compatible with Bootstrap 4.
13+
Uses HTML for a checkbox compatible with Bootstrap.
1414
new CheckboxSubmit(document.querySelector('form.something')).render()
1515
*/
1616
export default class CheckboxSubmit {
@@ -36,7 +36,7 @@ export default class CheckboxSubmit {
3636
}).then((json) => {
3737
this.labelTarget.removeAttribute('disabled')
3838
this.checkboxTarget.removeAttribute('disabled')
39-
// For accessibility return keyboard focus
39+
// For accessibility return keyboard focus
4040
// back to the checkbox after form submission
4141
this.checkboxTarget.focus()
4242
this.updateStateFor(!this.checked)

app/javascript/blacklight-frontend/facet_suggest.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,13 @@ const FacetSuggest = async (e) => {
1616

1717
// Drop facet.page so a filtered suggestion list will always start on page 1
1818
url.searchParams.delete('facet.page');
19+
// add our queryFragment for facet filtering
20+
url.searchParams.append('query_fragment', queryFragment);
21+
1922
const facetSearchParams = url.searchParams.toString();
2023
const basePathComponent = url.pathname.split('/')[1];
2124

22-
const urlToFetch = `/${basePathComponent}/facet_suggest/${facetField}/${queryFragment}?${facetSearchParams}`;
25+
const urlToFetch = `/${basePathComponent}/facet_suggest/${facetField}?${facetSearchParams}`;
2326

2427
const response = await fetch(urlToFetch);
2528
if (response.ok) {

app/services/blacklight/search_service.rb

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,10 @@ def search_state_class
2222
@search_state.class
2323
end
2424

25-
# a solr query method
26-
# @yield [search_builder] optional block yields configured SearchBuilder, caller can modify or create new SearchBuilder to be used. Block should return SearchBuilder to be used.
25+
# Fetch query results from solr
26+
# @yield [search_builder] optional block yields configured SearchBuilder, caller can modify or create new
27+
# SearchBuilder to be used. Block should return SearchBuilder to be used.
28+
# This is used in blacklight_range_limit
2729
# @return [Blacklight::Solr::Response] the solr response object
2830
def search_results
2931
builder = search_builder.with(search_state)

lib/blacklight/configuration.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ def initialized_default_configuration?
4747
property :header_component, default: Blacklight::HeaderComponent
4848
property :full_width_layout, default: false
4949

50-
# bootstrap_version may be set to 4 or 5
5150
bootstrap_version = ENV['BOOTSTRAP_VERSION'].presence || "5"
5251
property :bootstrap_version, default: /(\d)(?:\.\d){0,2}/.match(bootstrap_version)[1].to_i
5352

lib/blacklight/routes/searchable.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ def call(mapper, _options = {})
1818
mapper.get "opensearch"
1919
mapper.get 'suggest', as: 'suggest_index'
2020
mapper.get "facet/:id", action: 'facet', as: 'facet'
21-
mapper.get "facet_suggest/:id/(:query_fragment)", action: 'facet', as: 'facet_suggest', defaults: { only_values: true }
21+
mapper.get "facet_suggest/:id", action: 'facet', as: 'facet_suggest', defaults: { only_values: true }
2222
end
2323
end
2424
end

lib/blacklight/search_builder.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ def where(conditions)
5959

6060
##
6161
# Append additional processor chain directives
62+
# This is used in blacklight_range_limit
6263
def append(*addl_processor_chain)
6364
params_will_change!
6465
builder = self.class.new(processor_chain + addl_processor_chain, scope)

0 commit comments

Comments
 (0)