blacklight_range_limit 7.8.1 → 7.8.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 369f9fc8e935d61dcb33f4e4d1a04ceb0fc001bd31fde25a076a3173d87a28c3
4
- data.tar.gz: eaa25cd87127ef727e678f36927ad1a46d7c983a6edaaf378f5cd3a717936fa9
3
+ metadata.gz: c9c6a258b341059e6b61badb2323850e57033bc29d6f03abadfd91e0a34afcf3
4
+ data.tar.gz: 8b3840c1990d7ff721c165104c0be7e585a708008dbebc093e46862a2cf8bf1a
5
5
  SHA512:
6
- metadata.gz: 97e0c3edb2e3648b9c80f295493d2b0f7895d703cb4f9ba33b38d6b268d8d7e2ae4b5fd9418af7dbaca58ab620a9cfec2397c9e7458e4698ad351c11f1555b31
7
- data.tar.gz: 42a9c26cc19444084c7920eea8a65110ca2d5aa1d5eed476c8b85214c718182af69cb404574545ee8fcd729495d10e807c6f1752e25275a849ba19543e0bb0d4
6
+ metadata.gz: 9a465799fe33e06c3ba6655dd55426cdc97b363f0ee7783ce71a9ea61a20767ae65b80020af0c84c39661b57546f682eb75fd7c79927bbfebd6eac78d3e409ce
7
+ data.tar.gz: 8fe559ef62f817a76d494f4839ccf22caf85478a5e55bcf7b9e3210842b26c900824d7bcbd952b4474abe4885ab0f6328f5a70741ef359bb7a08ef6dd72c5bc3
data/VERSION CHANGED
@@ -1 +1 @@
1
- 7.8.1
1
+ 7.8.2
@@ -44,7 +44,6 @@ function min_max(range_element) {
44
44
  min = BlacklightRangeLimit.parseNum($(range_element).find(".min").first().text());
45
45
  max = BlacklightRangeLimit.parseNum($(range_element).find(".max").first().text());
46
46
  }
47
- console.log(min, max)
48
47
  return [min, max]
49
48
  }
50
49
 
@@ -35,7 +35,7 @@
35
35
  facet_field_label(solr_field),
36
36
  range_display(solr_field, my_params),
37
37
  escape_value: false,
38
- remove: remove_range_param(solr_field, my_params)
38
+ remove: search_action_path(remove_range_param(solr_field, my_params))
39
39
  )
40
40
  end
41
41
  end
@@ -87,14 +87,14 @@
87
87
  private
88
88
 
89
89
  def range_params(my_params = params)
90
- return {} unless my_params[:range].is_a?(ActionController::Parameters)
90
+ return {} unless my_params[:range].is_a?(ActionController::Parameters) || my_params[:range].is_a?(Hash)
91
91
 
92
92
  my_params[:range].select do |_solr_field, range_options|
93
93
  next unless range_options
94
94
 
95
- [range_options['missing'],
96
- range_options['begin'],
97
- range_options['end']].any?
95
+ [range_options['missing'].presence,
96
+ range_options['begin'].presence,
97
+ range_options['end'].presence].any?
98
98
  end
99
99
  end
100
100
  end
@@ -9,7 +9,7 @@ module BlacklightRangeLimit
9
9
  end
10
10
 
11
11
  def install_catalog_controller_mixin
12
- inject_into_class 'app/controllers/catalog_controller.rb', CatalogController do
12
+ inject_into_file 'app/controllers/catalog_controller.rb', after: /include Blacklight::Catalog.*$/ do
13
13
  "\n include BlacklightRangeLimit::ControllerOverride\n"
14
14
  end
15
15
  end
@@ -24,7 +24,15 @@ describe "Blacklight Range Limit" do
24
24
  click_link 'View distribution'
25
25
  click_link '2000 to 2008'
26
26
 
27
- expect(page).to have_content "2000 to 2008 ✖ [remove] 12"
27
+ within '.blacklight-pub_date_si' do
28
+ expect(page).to have_content "2000 to 2008 ✖ [remove] 12"
29
+ end
30
+
31
+ within '.constraints-container' do
32
+ expect(page).to have_content '2000 to 2008'
33
+ end
34
+
35
+ expect(page).to have_content '1 - 10 of 12'
28
36
  end
29
37
 
30
38
  it "should not include page parameter" do
@@ -5,7 +5,12 @@ RSpec.describe BlacklightRangeLimit::ViewHelperOverride, type: :helper do
5
5
  before do
6
6
  allow(helper).to receive_messages(
7
7
  facet_field_label: 'Date Range',
8
- remove_range_param: '/remove'
8
+ remove_range_param: {},
9
+ search_action_path: '/catalog',
10
+ blacklight_config: CatalogController.blacklight_config
11
+ )
12
+ allow(controller).to receive_messages(
13
+ search_state_class: Blacklight::SearchState,
9
14
  )
10
15
  end
11
16
 
@@ -82,6 +87,13 @@ RSpec.describe BlacklightRangeLimit::ViewHelperOverride, type: :helper do
82
87
  ActionController::Parameters.new(range: { field_name: { 'wrong' => 'data' } })
83
88
  )
84
89
  ).to eq({})
90
+
91
+ expect(
92
+ helper.send(
93
+ :range_params,
94
+ ActionController::Parameters.new(range: { field_name: { 'begin' => '', 'end' => '' } })
95
+ )
96
+ ).to eq({})
85
97
  end
86
98
 
87
99
  it 'returns the range parameters that are present' do
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: 7.8.1
4
+ version: 7.8.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: 2020-05-21 00:00:00.000000000 Z
12
+ date: 2020-06-26 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: blacklight