blacklight_range_limit 6.3.1 → 6.3.2

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a1d33929c3b467aabfd05e1c4660ee0dbb35fabe
4
- data.tar.gz: 4a719dc548eeb70113bda1eb649beb66297c1255
3
+ metadata.gz: 74c3ef45b20cef3fca718c010b4b015ba4973889
4
+ data.tar.gz: 8827ea0b53689f8a2bea2eece4ecc8a4bcd769d5
5
5
  SHA512:
6
- metadata.gz: 05fe6917efeddcdb3ba73f8e6573c93e9deaf3afa6e97cc5501fdc9c43152904c90c9cc8268fcfbfdc9847ac86ee1433b976eaa2d4828aa458a0bca78fc53a5e
7
- data.tar.gz: 396513669cc7fd2d57c1d4cd51a660e640084cc5959f3954ec7b0765c0faa7d3eb3528b167aa3aa110dd9b71aa2c16032805655d3e6c899e2dc1d61ee393ba6f
6
+ metadata.gz: 4f3336c92e6b2c28745dc80513806608238ab481ae4505882e24f62496062837ce2a6abec8f83a8fc6ec3e0fe751b31abf4776c81141ef82e31ffd4c6032cd02
7
+ data.tar.gz: bf309b780be21450e436813ca200cea230a02a56c98b91c94a25b4a92a8b620f4343a97842b0772a6147cd1c0bb30df224fa3170dcbc080087d155099cec3311
data/VERSION CHANGED
@@ -1 +1 @@
1
- 6.3.1
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.1
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-14 00:00:00.000000000 Z
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.11
248
+ rubygems_version: 2.6.10
249
249
  signing_key:
250
250
  specification_version: 4
251
251
  summary: Blacklight Range Limit plugin