blacklight_range_limit 7.3.2 → 7.4.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 451f955c7139901dea83fdc42af224ae655d4faaa02af17daf412e9e9d0f5814
4
- data.tar.gz: ad3e1e7c612e3093f7de4c6a8af6356b7f0ec17e0c4bb3f812ac03aca314cd0e
3
+ metadata.gz: aafe9f1b4d756244ccd5bb1959e5f2199e50b7fbd0d7f7d175ee1c4ab9289dd2
4
+ data.tar.gz: 074d426035ad95446508c855bbfde9816c2a827a1cfa997100cb1de33df82413
5
5
  SHA512:
6
- metadata.gz: 283f0872004cf567817be1211a8765a32e0aa4e963d5a4a1a85d0d1916951bb5c5ea79e5516f1d5291cc180601cc2df1ff5dca40c9e41445b63c1d55a3990473
7
- data.tar.gz: bccd344d331fb8142a9e2f9782b3f30a0771c3c2f74afead717f0a810ca94bcf9907f87b45270ec8a6fad6dc89ce0fff69d16ba8a69f3ff2387898eed840c675
6
+ metadata.gz: b86814bfd16aa175d118d81f2c4b81cffb9d2891169939c34b852bca7b5e364f9251c18676e2f6665a2e22d38c94bd07cc8eeda937d14b5ce4f187f286764d68
7
+ data.tar.gz: fae0f6d0069a9ed48eda9f2a13f69ade7188c4b30c7c7eb2b83e003841d70e4d6a03df055cee740390b20633ff60c626fcaa65c8e084a592595e4a013b561cca
data/VERSION CHANGED
@@ -1 +1 @@
1
- 7.3.2
1
+ 7.4.0
@@ -200,7 +200,7 @@ Blacklight.onLoad(function() {
200
200
  //xaxis: { ticks: x_ticks },
201
201
  xaxis: { tickDecimals: 0 }, // force integer ticks
202
202
  series: { lines: { fill: true, steps: true }},
203
- grid: {clickable: true, hoverable: true, autoHighlight: false},
203
+ grid: {clickable: true, hoverable: true, autoHighlight: false, margin: { left: -14, right: -12 }},
204
204
  selection: {mode: "x"}
205
205
  }));
206
206
  }
@@ -72,7 +72,7 @@ function isInt(n) {
72
72
  var begin_el = form.find("input.range_begin");
73
73
  var end_el = form.find("input.range_end");
74
74
 
75
- var placeholder_input = $('<input type="text" data-slider-placeholder="true" style="width:100%;">').appendTo(range_element);
75
+ var placeholder_input = $('<input type="hidden" data-slider-placeholder="true" />').appendTo(range_element);
76
76
 
77
77
  // make sure slider is loaded
78
78
  if (placeholder_input.slider !== undefined) {
@@ -3,13 +3,18 @@ form.range_limit {
3
3
  line-height: 3;
4
4
  }
5
5
 
6
+ .range_limit .range-limit-input-group {
7
+ max-width: 350px;
8
+ width: 100% !important;
9
+ }
10
+
6
11
  .range_limit input.range_begin, .range_limit input.range_end {
7
12
  display: inline-block;
8
13
  width: 4.5em;
9
14
  }
10
15
 
11
16
  .limit_content .subsection {
12
- margin-top: 1em;
17
+ margin-top: 0.5em;
13
18
  }
14
19
 
15
20
  .hover_legend {
@@ -21,6 +26,14 @@ form.range_limit {
21
26
  background: #e8cfac;
22
27
  }
23
28
 
29
+ .slider_js .slider-horizontal {
30
+ width: 100% !important;
31
+ }
32
+
33
+ .chart_js .flot-x-axis {
34
+ font-size: 14px;
35
+ }
36
+
24
37
  .modal-body .view_larger {
25
38
  display: none;
26
39
  }
@@ -14,9 +14,9 @@ module RangeLimitHelper
14
14
 
15
15
  default = params["range"][solr_field][type] if params["range"] && params["range"][solr_field] && params["range"][solr_field][type]
16
16
 
17
- html = label_tag("range[#{solr_field}][#{type}]", input_label, class: 'sr-only') if input_label.present?
18
- html ||= ''.html_safe
19
- html += text_field_tag("range[#{solr_field}][#{type}]", default, :maxlength=>maxlength, :class => "form-control range_#{type}")
17
+ html = text_field_tag("range[#{solr_field}][#{type}]", default, :maxlength=>maxlength, :class => "form-control text-center range_#{type}")
18
+ html += label_tag("range[#{solr_field}][#{type}]", input_label, class: 'sr-only') if input_label.present?
19
+ html
20
20
  end
21
21
 
22
22
  # type is 'min' or 'max'
@@ -56,13 +56,16 @@
56
56
  <% end %>
57
57
  </div>
58
58
 
59
- <%= form_tag search_action_path, :method => :get, class: [BlacklightRangeLimit.classes[:form], "range_#{field_name}"].join(' ') do %>
59
+ <%= form_tag search_action_path, :method => :get, class: [BlacklightRangeLimit.classes[:form], "range_#{field_name} d-flex justify-content-center"].join(' ') do %>
60
60
  <%= render_hash_as_hidden_fields(search_state.params_for_search.except(:page)) %>
61
- <%= content_tag :label, t('blacklight.range_limit.date_range_label'), class: 'range_limit_label' %>
62
- <div class="d-inline-block">
63
- <%= render_range_input(field_name, :begin, input_label_range_begin, maxlength) %> – <%= render_range_input(field_name, :end, input_label_range_end, maxlength) %>
61
+ <%= content_tag :label, t('blacklight.range_limit.date_range_label'), class: 'range_limit_label sr-only' %>
62
+ <div class="input-group input-group-sm mb-3 flex-nowrap range-limit-input-group">
63
+ <%= render_range_input(field_name, :begin, input_label_range_begin, maxlength) %>
64
+ <%= render_range_input(field_name, :end, input_label_range_end, maxlength) %>
65
+ <div class="input-group-append">
66
+ <%= submit_tag t('blacklight.range_limit.submit_limit'), class: BlacklightRangeLimit.classes[:submit] %>
67
+ </div>
64
68
  </div>
65
- <%= submit_tag t('blacklight.range_limit.submit_limit'), class: BlacklightRangeLimit.classes[:submit] %>
66
69
  <% end %>
67
70
 
68
71
  <%= link_to t('blacklight.range_limit.view_larger', field_name: label),
@@ -70,17 +73,19 @@
70
73
  class: 'view_larger mt-1',
71
74
  data: { blacklight_modal: 'trigger' } %>
72
75
 
73
- <% if (stats = stats_for_field(field_name)) && stats["missing"] > 0 %>
74
- <ul class="missing list-unstyled facet-values subsection">
75
- <li>
76
- <span class="facet-label">
77
- <%= link_to t('blacklight.range_limit.missing'), search_action_url(add_range_missing(field_name).except(:controller, :action)) %>
78
- </span>
79
- <%# note important there be no whitespace inside facet-count to avoid
80
- bug in some versions of Blacklight (including 7.1.0.alpha) %>
81
- <span class="facet-count"><%= number_with_delimiter(stats["missing"]) %></span>
82
- </li>
83
- </ul>
76
+ <% unless request.xhr? %>
77
+ <% if (stats = stats_for_field(field_name)) && stats["missing"] > 0 %>
78
+ <ul class="missing list-unstyled facet-values subsection">
79
+ <li>
80
+ <span class="facet-label">
81
+ <%= link_to t('blacklight.range_limit.missing'), search_action_url(add_range_missing(field_name).except(:controller, :action)) %>
82
+ </span>
83
+ <%# note important there be no whitespace inside facet-count to avoid
84
+ bug in some versions of Blacklight (including 7.1.0.alpha) %>
85
+ <span class="facet-count"><%= number_with_delimiter(stats["missing"]) %></span>
86
+ </li>
87
+ </ul>
88
+ <% end %>
84
89
  <% end %>
85
90
  <% end %>
86
91
  </div>
@@ -0,0 +1,14 @@
1
+ ar:
2
+ blacklight:
3
+ range_limit:
4
+ range_begin: "%{field_label} بداية المدة"
5
+ range_end: "%{field_label} نهاية المدة"
6
+ submit_limit: 'تطبيق'
7
+ remove_limit: 'حذف'
8
+ missing: 'غير معروف'
9
+ view_distribution: 'عرض التوزيع'
10
+ view_larger: 'عرض بحجم أكبر »'
11
+ date_range_label: 'الفترة التاريخية:'
12
+ results_range_html: 'تمتد النتائج الحالية من <span class="min">%{min}</span> إلى<span class="max">%{max}</span>'
13
+ single_html: '<span class="single">%{begin}</span>'
14
+ range_html: '<span class="from">%{begin}</span> إلى<span class="to">%{end}</span>'
@@ -3,7 +3,7 @@ en:
3
3
  range_limit:
4
4
  range_begin: "%{field_label} range begin"
5
5
  range_end: "%{field_label} range end"
6
- submit_limit: 'Limit'
6
+ submit_limit: 'Apply'
7
7
  remove_limit: 'remove'
8
8
  missing: 'Unknown'
9
9
  view_distribution: 'View distribution'
@@ -48,7 +48,7 @@
48
48
  alternative_title_tsim
49
49
  active_fedora_model_ssi
50
50
  title_tsim
51
- author_tsimesim
51
+ author_tsim
52
52
  subject_tsim
53
53
  all_text_timv
54
54
  </str>
@@ -20,4 +20,32 @@ describe 'JavaScript', js: true do
20
20
  expect(page).to have_css '.flot-base'
21
21
  end
22
22
  end
23
+
24
+ describe '"Unknown" link' do
25
+ context 'when in the facet (e.g. non-xhr)' do
26
+ it 'is displayed' do
27
+ visit search_catalog_path
28
+
29
+ click_button 'Publication Date Sort'
30
+
31
+ within 'ul.subsection.missing' do
32
+ expect(page).to have_link 'Unknown'
33
+ end
34
+ end
35
+ end
36
+
37
+ context 'when in the modal (e.g. via xhr)' do
38
+ it 'is not displayed' do
39
+ visit search_catalog_path
40
+
41
+ click_button 'Publication Date Sort'
42
+ sleep(1) # resize is debounced
43
+ click_link 'View larger »'
44
+
45
+ within '.modal-body' do
46
+ expect(page).not_to have_css 'ul.subsection.missing'
47
+ end
48
+ end
49
+ end
50
+ end
23
51
  end
@@ -8,7 +8,7 @@ describe "Blacklight Range Limit" do
8
8
  expect(page).to have_selector 'input.range_end'
9
9
  expect(page).to have_selector 'label.sr-only[for="range_pub_date_si_begin"]', :text => 'Publication Date Sort range begin'
10
10
  expect(page).to have_selector 'label.sr-only[for="range_pub_date_si_end"]', :text => 'Publication Date Sort range end'
11
- expect(page).to have_button 'Limit'
11
+ expect(page).to have_button 'Apply'
12
12
  end
13
13
 
14
14
  it "should provide distribution information" do
@@ -31,7 +31,7 @@ describe "Blacklight Range Limit" do
31
31
  visit search_catalog_path(page: 2)
32
32
  click_link 'View distribution'
33
33
  click_link '2000 to 2008'
34
- click_button 'Limit'
34
+ click_button 'Apply'
35
35
  expect(page.current_url).not_to include('page')
36
36
  end
37
37
 
@@ -0,0 +1,2 @@
1
+ id: 'unknown_doc_id'
2
+ title_tsim: 'Unknown year doc'
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.3.2
4
+ version: 7.4.0
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: 2019-11-27 00:00:00.000000000 Z
12
+ date: 2019-12-11 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: blacklight
@@ -180,6 +180,7 @@ files:
180
180
  - app/views/blacklight_range_limit/range_segments.html.erb
181
181
  - blacklight_range_limit.gemspec
182
182
  - config/jetty.yml
183
+ - config/locales/blacklight_range_limit.ar.yml
183
184
  - config/locales/blacklight_range_limit.en.yml
184
185
  - config/routes.rb
185
186
  - config/solr.yml
@@ -217,6 +218,7 @@ files:
217
218
  - solr/sample_solr_documents.yml
218
219
  - spec/features/a_javascript_spec.rb
219
220
  - spec/features/blacklight_range_limit_spec.rb
221
+ - spec/fixtures/solr_documents/unknown_year.yml
220
222
  - spec/fixtures/solr_documents/zero_year.yml
221
223
  - spec/helpers/blacklight_range_limit_helper_spec.rb
222
224
  - spec/lib/blacklight_range_limit/segment_calculation_spec.rb
@@ -260,6 +262,7 @@ summary: Blacklight Range Limit plugin
260
262
  test_files:
261
263
  - spec/features/a_javascript_spec.rb
262
264
  - spec/features/blacklight_range_limit_spec.rb
265
+ - spec/fixtures/solr_documents/unknown_year.yml
263
266
  - spec/fixtures/solr_documents/zero_year.yml
264
267
  - spec/helpers/blacklight_range_limit_helper_spec.rb
265
268
  - spec/lib/blacklight_range_limit/segment_calculation_spec.rb