blacklight_range_limit 6.3.1 → 6.3.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/assets/javascripts/blacklight_range_limit/range_limit_slider.js +9 -0
- data/app/helpers/range_limit_helper.rb +2 -2
- data/app/views/blacklight_range_limit/_range_limit_panel.html.erb +1 -1
- data/spec/features/blacklight_range_limit_spec.rb +8 -0
- data/spec/helpers/blacklight_range_limit_helper_spec.rb +18 -0
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 74c3ef45b20cef3fca718c010b4b015ba4973889
|
4
|
+
data.tar.gz: 8827ea0b53689f8a2bea2eece4ecc8a4bcd769d5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4f3336c92e6b2c28745dc80513806608238ab481ae4505882e24f62496062837ce2a6abec8f83a8fc6ec3e0fe751b31abf4776c81141ef82e31ffd4c6032cd02
|
7
|
+
data.tar.gz: bf309b780be21450e436813ca200cea230a02a56c98b91c94a25b4a92a8b620f4343a97842b0772a6147cd1c0bb30df224fa3170dcbc080087d155099cec3311
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
6.3.
|
1
|
+
6.3.2
|
@@ -44,6 +44,15 @@ $(".range_limit .profile .range.slider_js").each(function() {
|
|
44
44
|
slider_el.css("width", "100%");
|
45
45
|
}
|
46
46
|
}
|
47
|
+
|
48
|
+
// Slider change should update text input values.
|
49
|
+
var parent = $(this).parent();
|
50
|
+
var form = $(parent).closest(".limit_content").find("form.range_limit");
|
51
|
+
$(parent).closest(".limit_content").find(".profile .range").on("slide", function(event, ui) {
|
52
|
+
var values = $(event.target).data("slider").getValue();
|
53
|
+
form.find("input.range_begin").val(values[0]);
|
54
|
+
form.find("input.range_end").val(values[1]);
|
55
|
+
});
|
47
56
|
}
|
48
57
|
|
49
58
|
begin_el.val(min);
|
@@ -63,7 +63,7 @@ module RangeLimitHelper
|
|
63
63
|
end
|
64
64
|
|
65
65
|
def add_range_missing(solr_field, my_params = params)
|
66
|
-
my_params = Blacklight::SearchState.new(my_params, blacklight_config).to_h
|
66
|
+
my_params = Blacklight::SearchState.new(my_params.except(:page), blacklight_config).to_h
|
67
67
|
my_params["range"] ||= {}
|
68
68
|
my_params["range"][solr_field] ||= {}
|
69
69
|
my_params["range"][solr_field]["missing"] = "true"
|
@@ -77,7 +77,7 @@ module RangeLimitHelper
|
|
77
77
|
end
|
78
78
|
|
79
79
|
def add_range(solr_field, from, to, my_params = params)
|
80
|
-
my_params = Blacklight::SearchState.new(my_params, blacklight_config).to_h
|
80
|
+
my_params = Blacklight::SearchState.new(my_params.except(:page), blacklight_config).to_h
|
81
81
|
my_params["range"] ||= {}
|
82
82
|
my_params["range"][solr_field] ||= {}
|
83
83
|
|
@@ -30,7 +30,7 @@
|
|
30
30
|
|
31
31
|
<% unless params["range"] && params["range"][solr_field] && params["range"][solr_field]["missing"] %>
|
32
32
|
<%= form_tag search_action_path, :method => :get, class: [BlacklightRangeLimit.classes[:form], "range_#{solr_field}"].join(' ') do %>
|
33
|
-
<%= render_hash_as_hidden_fields(search_state.params_for_search) %>
|
33
|
+
<%= render_hash_as_hidden_fields(search_state.params_for_search.except(:page)) %>
|
34
34
|
|
35
35
|
<!-- we need to include a dummy search_field parameter if none exists,
|
36
36
|
to trick blacklight into displaying actual search results instead
|
@@ -27,6 +27,14 @@ describe "Blacklight Range Limit" do
|
|
27
27
|
expect(page).to have_content "2000 to 2008 [remove] 12"
|
28
28
|
end
|
29
29
|
|
30
|
+
it "should not include page parameter" do
|
31
|
+
visit search_catalog_path(page: 2)
|
32
|
+
click_link 'View distribution'
|
33
|
+
click_link '2000 to 2008'
|
34
|
+
click_button 'Limit'
|
35
|
+
expect(page.current_url).not_to include('page')
|
36
|
+
end
|
37
|
+
|
30
38
|
context 'when I18n translation is available' do
|
31
39
|
before do
|
32
40
|
I18n.backend.store_translations(:en, blacklight: {search: {fields: {facet: {pub_date_sort: 'Publication Date I18n'}}}})
|
@@ -16,4 +16,22 @@ describe "Blacklight Range Limit Helper" do
|
|
16
16
|
expect(html_maxlength_6).to have_css 'input.form-control.range_begin#range_pub_date_begin[maxlength="6"]'
|
17
17
|
end
|
18
18
|
|
19
|
+
context "when building requests" do
|
20
|
+
let(:config) { Blacklight::Configuration.new }
|
21
|
+
before do
|
22
|
+
allow(helper).to receive(:blacklight_config).and_return(config)
|
23
|
+
end
|
24
|
+
|
25
|
+
it "should exclude page when adding a range" do
|
26
|
+
params = { q: '', page: '2' }
|
27
|
+
updated_params = helper.add_range('test', '1900', '1995', params)
|
28
|
+
expect(updated_params).not_to include(:page)
|
29
|
+
end
|
30
|
+
|
31
|
+
it "should exclude page when adding a missing range" do
|
32
|
+
params = { q: '', page: '2' }
|
33
|
+
updated_params = helper.add_range_missing('test', params)
|
34
|
+
expect(updated_params).not_to include(:page)
|
35
|
+
end
|
36
|
+
end
|
19
37
|
end
|
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: 6.3.
|
4
|
+
version: 6.3.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: 2017-12-
|
12
|
+
date: 2017-12-21 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|
@@ -245,7 +245,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
245
245
|
version: '0'
|
246
246
|
requirements: []
|
247
247
|
rubyforge_project:
|
248
|
-
rubygems_version: 2.6.
|
248
|
+
rubygems_version: 2.6.10
|
249
249
|
signing_key:
|
250
250
|
specification_version: 4
|
251
251
|
summary: Blacklight Range Limit plugin
|