blacklight_range_limit 8.2.1 → 8.2.2
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/presenters/blacklight_range_limit/filter_field.rb +2 -3
- data/spec/presenters/filter_field_spec.rb +12 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 96efdd2c39ae998b673a2fb74ffbccad22029baf46d3e712550c84c726b93d82
|
4
|
+
data.tar.gz: a27043d01e1b52f8d7a9a648e14aed7c71c6f42c0b94f7329f77a128d8867659
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e933468fe64cbabfdc2a0d7e9dbdd9ff1980e8c7537538ae275b5f49b95759bab53f08980f4d6438aa9dfb667ed7ae119d748e1e57b6cd9b6b36029991f0e5e8
|
7
|
+
data.tar.gz: adfc06b26edefc9f9389c4c111830905af993256877fbc58acd91784fcd09cecf815360172e30b71a8242ccf5a398fe86ced25c5ec05523acf9931437d80fd27
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
8.2.
|
1
|
+
8.2.2
|
@@ -50,17 +50,16 @@ module BlacklightRangeLimit
|
|
50
50
|
def values(except: [])
|
51
51
|
params = search_state.params
|
52
52
|
param_key = filters_key
|
53
|
-
return [] unless params.dig(param_key, config.key)
|
54
|
-
|
55
53
|
range = if params.dig(param_key, config.key).is_a? Range
|
56
54
|
params.dig(param_key, config.key)
|
57
|
-
|
55
|
+
elsif params.dig(param_key, config.key).is_a? Hash
|
58
56
|
begins = Array(params.dig(param_key, config.key, :begin)).map(&:presence)
|
59
57
|
ends = Array(params.dig(param_key, config.key, :end)).map(&:presence)
|
60
58
|
begins.zip(ends).map { |b_bound, e_bound| Range.new(b_bound&.to_i, e_bound&.to_i) if b_bound && e_bound }.compact
|
61
59
|
end
|
62
60
|
|
63
61
|
f = except.include?(:filters) ? [] : Array(range)
|
62
|
+
|
64
63
|
f_missing = [] if except.include?(:missing)
|
65
64
|
f_missing ||= [Blacklight::SearchState::FilterField::MISSING] if params.dig(filters_key, "-#{key}")&.any? { |v| v == Blacklight::Engine.config.blacklight.facet_missing_param }
|
66
65
|
|
@@ -57,7 +57,7 @@ RSpec.describe BlacklightRangeLimit::FilterField do
|
|
57
57
|
end
|
58
58
|
end
|
59
59
|
|
60
|
-
context 'with
|
60
|
+
context 'with empty data' do
|
61
61
|
let(:param_values) { { range: { some_field: { begin: '', end: '' } } } }
|
62
62
|
|
63
63
|
describe '#values' do
|
@@ -67,6 +67,17 @@ RSpec.describe BlacklightRangeLimit::FilterField do
|
|
67
67
|
end
|
68
68
|
end
|
69
69
|
|
70
|
+
context 'with missing data' do
|
71
|
+
let(:param_values) { { range: { '-some_field': ['[* TO *]']} } }
|
72
|
+
|
73
|
+
describe '#values' do
|
74
|
+
it 'uses the missing special value' do
|
75
|
+
expect(filter.values).to eq [Blacklight::SearchState::FilterField::MISSING]
|
76
|
+
end
|
77
|
+
end
|
78
|
+
end
|
79
|
+
|
80
|
+
|
70
81
|
context 'with array-mangled data' do
|
71
82
|
let(:param_values) { { range: { some_field: { begin: { '0' => '2013' }, end: { '0' => '2022' } } } } }
|
72
83
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: blacklight_range_limit
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 8.2.
|
4
|
+
version: 8.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jonathan Rochkind
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2022-06
|
12
|
+
date: 2022-07-06 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: blacklight
|