blacklight_range_limit 9.0.0 → 9.1.0
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/.github/workflows/ruby.yml +32 -15
- data/README.md +4 -2
- data/VERSION +1 -1
- data/app/components/blacklight_range_limit/range_facet_component.rb +11 -2
- data/app/components/blacklight_range_limit/range_segments_component.rb +5 -2
- data/blacklight_range_limit.gemspec +1 -1
- data/lib/blacklight_range_limit/routes/range_searchable.rb +0 -1
- data/package.json +1 -1
- data/spec/spec_helper.rb +1 -1
- data/spec/support/presenter_test_helpers.rb +3 -1
- metadata +5 -9
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1eb86d2b4a964fa439b38733a97efb61faa03e3db7a4a51a0ffa4daea379fe9d
|
4
|
+
data.tar.gz: 2444a4e758791ecb567d8f2f3aa0ee16a14a8cd20e3b4652a4b1b565a9511f0f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 423928f6a8c0b71b04a8ac60a4bff7b2581aacb0a398bb4d7c933ba6c87e4b92540871e9709870e8342f7471830995552ba465e2c19357d0fa4b5637b80c5d10
|
7
|
+
data.tar.gz: 9799b189b778c9a34ca56fcb794143f328cbac9cb9ce7df829c18c23146842b6f8c961ac866c7692cc9eef31923dc0d0a012171afe658fe5778e91a5cdd18651
|
data/.github/workflows/ruby.yml
CHANGED
@@ -12,6 +12,8 @@ on:
|
|
12
12
|
branches: [main]
|
13
13
|
pull_request:
|
14
14
|
branches: ['**']
|
15
|
+
schedule:
|
16
|
+
- cron: "0 2 * * TUE"
|
15
17
|
|
16
18
|
jobs:
|
17
19
|
test:
|
@@ -24,8 +26,8 @@ jobs:
|
|
24
26
|
#
|
25
27
|
# * Blacklight: 7, 8, or 9
|
26
28
|
# * Rails: 7 or 8
|
27
|
-
# * sprockets or propshaft(with cssbundling-rails sass)
|
28
|
-
# * importmap-rails or esbuild
|
29
|
+
# * sprockets or propshaft (with cssbundling-rails sass)
|
30
|
+
# * importmap-rails or esbuild (each with sprockets or importmaps)
|
29
31
|
#
|
30
32
|
# We should work with almost every combo of these (even though BL itself
|
31
33
|
# doesn't officially support every one), but we don't test with every one,
|
@@ -42,29 +44,53 @@ jobs:
|
|
42
44
|
ruby: "3.3"
|
43
45
|
additional_name: "/ importmap-rails"
|
44
46
|
additional_engine_cart_rails_options: "--css=bootstrap"
|
47
|
+
|
45
48
|
- rails_version: "~> 8.0.0"
|
46
49
|
blacklight_version: '{ "git": "https://github.com/projectblacklight/blacklight.git" }'
|
47
50
|
ruby: "3.3"
|
48
51
|
additional_name: "/ esbuild"
|
49
52
|
additional_engine_cart_rails_options: "--css=bootstrap --javascript=esbuild"
|
50
53
|
|
54
|
+
# BLACKLIGHT 9, with beta cause that's all that's out as we write this
|
55
|
+
# and with Rails 8.0 only for simplicity
|
56
|
+
#
|
57
|
+
|
58
|
+
- rails_version: "~> 8.0.0"
|
59
|
+
blacklight_version: '~> 9.0.0.beta'
|
60
|
+
ruby: "3.4"
|
61
|
+
additional_name: "/ importmap-rails"
|
62
|
+
additional_engine_cart_rails_options: "--css=bootstrap"
|
63
|
+
|
64
|
+
- rails_version: "~> 8.0.0"
|
65
|
+
blacklight_version: '~> 9.0.0.beta'
|
66
|
+
ruby: "3.4"
|
67
|
+
additional_name: "/ esbuild"
|
68
|
+
additional_engine_cart_rails_options: "--css=bootstrap --javascript=esbuild"
|
51
69
|
|
52
70
|
|
53
71
|
# BLACKLIGHT 8, can test with use importmaps and esbuild
|
54
72
|
#
|
55
73
|
|
74
|
+
- rails_version: "~> 8.0.0"
|
75
|
+
blacklight_version: "~> 8.0"
|
76
|
+
ruby: "3.3"
|
77
|
+
additional_name: "/ importmap-rails, propshaft"
|
78
|
+
additional_engine_cart_rails_options: "-a propshaft --css=bootstrap"
|
79
|
+
|
56
80
|
- rails_version: "7.2.1"
|
57
81
|
blacklight_version: "~> 8.0"
|
58
82
|
ruby: "3.3"
|
59
83
|
additional_name: "/ importmap-rails, sprockets"
|
84
|
+
|
60
85
|
- rails_version: "7.2.1"
|
61
86
|
blacklight_version: "~> 8.0"
|
62
87
|
ruby: "3.3"
|
63
88
|
additional_name: "/ importmap-rails, propshaft"
|
64
89
|
additional_engine_cart_rails_options: "-a propshaft --css=bootstrap"
|
90
|
+
|
65
91
|
- rails_version: "7.2.1"
|
66
92
|
blacklight_version: "~> 8.0"
|
67
|
-
ruby: 3.3
|
93
|
+
ruby: "3.3"
|
68
94
|
additional_engine_cart_rails_options: "-a propshaft --javascript=esbuild --css=bootstrap"
|
69
95
|
additional_name: "/ esbuild, propshaft"
|
70
96
|
|
@@ -73,12 +99,11 @@ jobs:
|
|
73
99
|
# * Blacklight 8 can't easily generate an app with Rails 7 and sprockets and esbuild
|
74
100
|
# (the default layout won't be right), although I think it should work fine.
|
75
101
|
#
|
76
|
-
# * Can't test with
|
77
|
-
# npm package
|
102
|
+
# * Can't test with unreleased Blacklight main and esbuild because the blacklight-frontend
|
103
|
+
# npm package doesn't work from git checkout. So currently can't test with Rails 8
|
78
104
|
# and esbuild.
|
79
105
|
|
80
106
|
|
81
|
-
|
82
107
|
# BLACKLIGHT 7, only test with esbuild, not sure if it supports importmaps, it won't generate it
|
83
108
|
|
84
109
|
- rails_version: "7.2.1"
|
@@ -86,6 +111,7 @@ jobs:
|
|
86
111
|
ruby: "3.3"
|
87
112
|
additional_engine_cart_rails_options: "--javascript=esbuild"
|
88
113
|
additional_name: "/ esbuild, sprockets"
|
114
|
+
|
89
115
|
- rails_version: "7.2.1"
|
90
116
|
blacklight_version: "~> 7.0"
|
91
117
|
ruby: "3.3"
|
@@ -98,15 +124,6 @@ jobs:
|
|
98
124
|
additional_engine_cart_rails_options: "--javascript=esbuild"
|
99
125
|
additional_name: "/ esbuild, sprockets"
|
100
126
|
|
101
|
-
- rails_version: "7.0.8.4"
|
102
|
-
blacklight_version: "~> 7.0"
|
103
|
-
ruby: "3.1"
|
104
|
-
additional_engine_cart_rails_options: "--javascript=esbuild"
|
105
|
-
additional_name: "/ esbuild, sprockets"
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
127
|
|
111
128
|
env:
|
112
129
|
BLACKLIGHT_VERSION: ${{ matrix.blacklight_version || '~> 8.0' }}
|
data/README.md
CHANGED
@@ -173,6 +173,8 @@ bundle exec rspec spec/features/blacklight_range_limit_spec.rb
|
|
173
173
|
|
174
174
|
Once you are done iterating on your test you will need to stop the application server with `Ctrl-C`.
|
175
175
|
|
176
|
-
#
|
176
|
+
# Release process
|
177
177
|
|
178
|
-
|
178
|
+
Make sure you adjust version to match in both `VERSION` *and* `package.json` file.
|
179
|
+
|
180
|
+
Release rubygem with `bundle exec rake release` and also be sure to release npm package by running `npm publish` to push the javascript package to https://npmjs.org/package/blacklight-range-limit
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
9.
|
1
|
+
9.1.0
|
@@ -6,7 +6,16 @@ module BlacklightRangeLimit
|
|
6
6
|
|
7
7
|
def initialize(facet_field:, layout: nil, classes: BlacklightRangeLimit.classes)
|
8
8
|
@facet_field = facet_field
|
9
|
-
@layout = layout == false
|
9
|
+
@layout = if layout == false
|
10
|
+
Blacklight::FacetFieldNoLayoutComponent
|
11
|
+
elsif layout
|
12
|
+
layout
|
13
|
+
elsif defined?(Blacklight::Facets::FacetFieldComponent)
|
14
|
+
Blacklight::Facets::FacetFieldComponent # Blacklight 9
|
15
|
+
else
|
16
|
+
Blacklight::FacetFieldComponent # Blacklight < 9
|
17
|
+
end
|
18
|
+
|
10
19
|
@classes = classes
|
11
20
|
end
|
12
21
|
|
@@ -39,7 +48,7 @@ module BlacklightRangeLimit
|
|
39
48
|
min = @facet_field.selected_range_facet_item&.value&.begin || @facet_field.min
|
40
49
|
max = @facet_field.selected_range_facet_item&.value&.end || @facet_field.max
|
41
50
|
|
42
|
-
return nil unless
|
51
|
+
return nil unless min && max
|
43
52
|
|
44
53
|
range_limit_url(range_start: min, range_end: max)
|
45
54
|
end
|
@@ -3,11 +3,14 @@
|
|
3
3
|
module BlacklightRangeLimit
|
4
4
|
class RangeSegmentsComponent < Blacklight::Component
|
5
5
|
def initialize(facet_field:, facet_items: nil, item_component: nil, classes: [])
|
6
|
-
super
|
6
|
+
super()
|
7
7
|
|
8
8
|
@facet_field = facet_field
|
9
9
|
@facet_items = facet_items || facet_field.try(:range_queries) || []
|
10
|
-
|
10
|
+
# newer versions of BL9 want Blacklight::Facets::ItemComponent -- the older one is supposed
|
11
|
+
# to be deprecated, but in fact may not work so we use newer if avail.
|
12
|
+
@item_component = facet_field.facet_field.item_component ||
|
13
|
+
(defined?(Blacklight::Facets::ItemComponent) ? Blacklight::Facets::ItemComponent : Blacklight::FacetItemComponent)
|
11
14
|
@classes = classes
|
12
15
|
end
|
13
16
|
|
@@ -18,7 +18,7 @@ Gem::Specification.new do |s|
|
|
18
18
|
s.license = 'Apache 2.0'
|
19
19
|
|
20
20
|
s.add_dependency 'blacklight', '>= 7.25.2', '< 9'
|
21
|
-
s.add_dependency 'view_component', ">= 2.54", "<
|
21
|
+
s.add_dependency 'view_component', ">= 2.54", "< 5"
|
22
22
|
|
23
23
|
s.add_development_dependency 'rspec', '~> 3.0'
|
24
24
|
s.add_development_dependency 'rspec-rails'
|
data/package.json
CHANGED
data/spec/spec_helper.rb
CHANGED
@@ -44,8 +44,8 @@ RSpec.configure do |config|
|
|
44
44
|
config.infer_spec_type_from_file_location!
|
45
45
|
|
46
46
|
config.include PresenterTestHelpers, type: :presenter
|
47
|
+
config.include ViewComponent::TestHelpers, type: :presenter
|
47
48
|
config.include ViewComponent::TestHelpers, type: :component
|
48
49
|
|
49
50
|
config.example_status_persistence_file_path = 'spec/examples.txt'
|
50
|
-
|
51
51
|
end
|
@@ -2,7 +2,9 @@
|
|
2
2
|
|
3
3
|
module PresenterTestHelpers
|
4
4
|
def controller
|
5
|
-
|
5
|
+
# view_component 3+ should be just `vc_test_controller_class` when we drop VC 2 support we can
|
6
|
+
# just use that.
|
7
|
+
@controller ||= (respond_to?(:vc_test_controller_class) ? vc_test_controller_class : ApplicationController).new.tap { |c| c.request = request }.extend(Rails.application.routes.url_helpers)
|
6
8
|
end
|
7
9
|
|
8
10
|
def request
|
metadata
CHANGED
@@ -1,15 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: blacklight_range_limit
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 9.
|
4
|
+
version: 9.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jonathan Rochkind
|
8
8
|
- Chris Beer
|
9
|
-
autorequire:
|
10
9
|
bindir: bin
|
11
10
|
cert_chain: []
|
12
|
-
date:
|
11
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
13
12
|
dependencies:
|
14
13
|
- !ruby/object:Gem::Dependency
|
15
14
|
name: blacklight
|
@@ -40,7 +39,7 @@ dependencies:
|
|
40
39
|
version: '2.54'
|
41
40
|
- - "<"
|
42
41
|
- !ruby/object:Gem::Version
|
43
|
-
version: '
|
42
|
+
version: '5'
|
44
43
|
type: :runtime
|
45
44
|
prerelease: false
|
46
45
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -50,7 +49,7 @@ dependencies:
|
|
50
49
|
version: '2.54'
|
51
50
|
- - "<"
|
52
51
|
- !ruby/object:Gem::Version
|
53
|
-
version: '
|
52
|
+
version: '5'
|
54
53
|
- !ruby/object:Gem::Dependency
|
55
54
|
name: rspec
|
56
55
|
requirement: !ruby/object:Gem::Requirement
|
@@ -177,7 +176,6 @@ dependencies:
|
|
177
176
|
- - ">="
|
178
177
|
- !ruby/object:Gem::Version
|
179
178
|
version: 3.13.1
|
180
|
-
description:
|
181
179
|
email:
|
182
180
|
- blacklight-development@googlegroups.com
|
183
181
|
executables: []
|
@@ -268,7 +266,6 @@ homepage: https://github.com/projectblacklight/blacklight_range_limit
|
|
268
266
|
licenses:
|
269
267
|
- Apache 2.0
|
270
268
|
metadata: {}
|
271
|
-
post_install_message:
|
272
269
|
rdoc_options: []
|
273
270
|
require_paths:
|
274
271
|
- lib
|
@@ -283,8 +280,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
283
280
|
- !ruby/object:Gem::Version
|
284
281
|
version: '0'
|
285
282
|
requirements: []
|
286
|
-
rubygems_version: 3.
|
287
|
-
signing_key:
|
283
|
+
rubygems_version: 3.6.9
|
288
284
|
specification_version: 4
|
289
285
|
summary: Blacklight Range Limit plugin
|
290
286
|
test_files:
|