blacklight_heatmaps 1.4.0 → 2.1.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.
@@ -7,11 +7,9 @@ module BlacklightHeatmaps
7
7
  end
8
8
 
9
9
  Mime::Type.register 'application/vnd.heatmaps+json', :heatmaps
10
- if Blacklight::VERSION > '8'
11
- Blacklight::Configuration.default_configuration do
12
- Blacklight::Configuration.default_values[:search_state_fields] ||= []
13
- Blacklight::Configuration.default_values[:search_state_fields] += %i[bbox]
14
- end
10
+ Blacklight::Configuration.default_configuration do
11
+ Blacklight::Configuration.default_values[:search_state_fields] ||= []
12
+ Blacklight::Configuration.default_values[:search_state_fields] += %i[bbox]
15
13
  end
16
14
  end
17
15
 
@@ -1,3 +1,3 @@
1
1
  module BlacklightHeatmaps
2
- VERSION = '1.4.0'
2
+ VERSION = '2.1.0'
3
3
  end
@@ -1,5 +1,3 @@
1
- require 'leaflet-rails'
2
- require 'leaflet-sidebar-rails'
3
1
  require 'blacklight'
4
2
 
5
3
  module BlacklightHeatmaps
@@ -2,18 +2,51 @@ require 'rails/generators'
2
2
 
3
3
  module BlacklightHeatmaps
4
4
  class Install < Rails::Generators::Base
5
- source_root File.expand_path('../templates', __FILE__)
5
+ source_root File.expand_path('templates', __dir__)
6
+ class_option :test, type: :boolean, default: false, aliases: '-t', desc: 'Indicates that app will be installed in a test environment'
6
7
 
7
8
  def copy_styles
8
- copy_file 'blacklight_heatmaps.scss', 'app/assets/stylesheets/blacklight_heatmaps.scss'
9
+ copy_file 'blacklight_heatmaps.css', 'app/assets/stylesheets/blacklight_heatmaps.css'
9
10
  end
10
11
 
11
12
  def inject_js
12
- inject_into_file 'app/assets/javascripts/application.js', after: '//= require blacklight/blacklight' do
13
- "\n// Required by BlacklightHeatmaps" \
14
- "\n//= require leaflet" \
15
- "\n//= require L.Control.Sidebar" \
16
- "\n//= require blacklight_heatmaps/default"
13
+ return unless File.exist?('app/javascript/application.js')
14
+
15
+ inject_into_file 'app/javascript/application.js' do
16
+ <<~JS
17
+ import BlacklightHeatmaps from 'blacklight-heatmaps/app/assets/javascripts/blacklight_heatmaps/default.esm.js'
18
+ window.BlacklightHeatmaps = BlacklightHeatmaps
19
+
20
+ Blacklight.onLoad(function () {
21
+ BlacklightHeatmaps.init()
22
+ })
23
+
24
+ JS
25
+ end
26
+ end
27
+
28
+ def add_packages
29
+ run 'yarn add leaflet'
30
+ run 'yarn add leaflet-sidebar@"^0.2.4"'
31
+
32
+ if ENV['CI']
33
+ run "yarn add file:#{BlacklightHeatmaps::Engine.root}"
34
+ elsif options[:test]
35
+ run 'yarn link "blacklight-heatmaps"'
36
+ else
37
+ run 'yarn add "blacklight-heatmaps"'
38
+ end
39
+ end
40
+
41
+ def add_styles
42
+ return unless File.exist?('app/assets/stylesheets/application.bootstrap.scss')
43
+
44
+ append_to_file 'app/assets/stylesheets/application.bootstrap.scss' do
45
+ <<~CONTENT
46
+ @import "leaflet/dist/leaflet";
47
+ @import "leaflet-sidebar/src/L.Control.Sidebar";
48
+ @import "./blacklight_heatmaps";
49
+ CONTENT
17
50
  end
18
51
  end
19
52
 
@@ -24,7 +57,7 @@ module BlacklightHeatmaps
24
57
  "\n config.heatmap_distErrPct = 0.15 # Default Solr value" \
25
58
  "\n # Basemaps configured include: 'positron', 'darkMatter', 'OpenStreetMap.HOT'" \
26
59
  "\n config.basemap_provider = 'positron'" \
27
- "\n config.show.partials.insert(1, :show_leaflet_map)" \
60
+ "\n config.show.partials = [*config.show.partials, :show_leaflet_map]" \
28
61
  "\n config.index.respond_to.heatmaps = true" \
29
62
  "\n config.view.heatmaps(partials: []," \
30
63
  "\n color_ramp: ['#ffffcc', '#a1dab4', '#41b6c4', '#2c7fb8', '#253494']," \
@@ -0,0 +1,11 @@
1
+ .blacklight-heatmaps-show-map {
2
+ height: 500px;
3
+ }
4
+
5
+ .blacklight-heatmaps-index-map {
6
+ height: 500px;
7
+ }
8
+
9
+ .view-icon-heatmaps {
10
+ &:before { content: "\e135"; }
11
+ }
data/spec/examples.txt CHANGED
@@ -1,31 +1,31 @@
1
1
  example_id | status | run_time |
2
2
  --------------------------------------------------------------------------------------- | ------ | --------------- |
3
- ./spec/features/configurable_basemap_spec.rb[1:1] | passed | 0.17827 seconds |
4
- ./spec/features/configurable_basemap_spec.rb[1:2:1] | passed | 0.13454 seconds |
5
- ./spec/features/configurable_basemap_spec.rb[1:3:1] | passed | 0.20226 seconds |
6
- ./spec/features/index_page_map_spec.rb[1:1] | passed | 6.44 seconds |
7
- ./spec/features/show_page_map_spec.rb[1:1] | passed | 3.96 seconds |
8
- ./spec/features/show_page_map_spec.rb[1:2] | passed | 0.3658 seconds |
9
- ./spec/helpers/blacklight/maps_helper_spec.rb[1:1:1] | passed | 0.00472 seconds |
10
- ./spec/helpers/blacklight/maps_helper_spec.rb[1:2:1] | passed | 0.00154 seconds |
11
- ./spec/models/concerns/blacklight_heatmaps/bounding_box_spec.rb[1:1:1] | passed | 0.00006 seconds |
3
+ ./spec/features/configurable_basemap_spec.rb[1:1] | passed | 0.14694 seconds |
4
+ ./spec/features/configurable_basemap_spec.rb[1:2:1] | passed | 0.11166 seconds |
5
+ ./spec/features/configurable_basemap_spec.rb[1:3:1] | passed | 0.31798 seconds |
6
+ ./spec/features/index_page_map_spec.rb[1:1] | passed | 1.49 seconds |
7
+ ./spec/features/show_page_map_spec.rb[1:1] | passed | 1.3 seconds |
8
+ ./spec/features/show_page_map_spec.rb[1:2] | passed | 0.0998 seconds |
9
+ ./spec/helpers/blacklight/maps_helper_spec.rb[1:1:1] | passed | 0.00343 seconds |
10
+ ./spec/helpers/blacklight/maps_helper_spec.rb[1:2:1] | passed | 0.00095 seconds |
11
+ ./spec/models/concerns/blacklight_heatmaps/bounding_box_spec.rb[1:1:1] | passed | 0.00008 seconds |
12
12
  ./spec/models/concerns/blacklight_heatmaps/bounding_box_spec.rb[1:2:1] | passed | 0.00006 seconds |
13
- ./spec/models/concerns/blacklight_heatmaps/bounding_box_spec.rb[1:3:1] | passed | 0.00011 seconds |
14
- ./spec/models/concerns/blacklight_heatmaps/bounding_box_spec.rb[1:4:1] | passed | 0.00006 seconds |
15
- ./spec/models/concerns/blacklight_heatmaps/geometry_parser_spec.rb[1:1:1:1] | passed | 0.00008 seconds |
16
- ./spec/models/concerns/blacklight_heatmaps/geometry_parser_spec.rb[1:1:2:1] | passed | 0.00006 seconds |
17
- ./spec/models/concerns/blacklight_heatmaps/geometry_parser_spec.rb[1:1:3:1] | passed | 0.00099 seconds |
18
- ./spec/models/concerns/blacklight_heatmaps/geometry_solr_document_spec.rb[1:1:1] | passed | 0.00017 seconds |
19
- ./spec/models/concerns/blacklight_heatmaps/geometry_solr_document_spec.rb[1:2:1] | passed | 0.00007 seconds |
20
- ./spec/models/concerns/blacklight_heatmaps/geometry_solr_document_spec.rb[1:3:1] | passed | 0.00883 seconds |
21
- ./spec/models/concerns/blacklight_heatmaps/geometry_solr_document_spec.rb[1:4:1] | passed | 0.00012 seconds |
22
- ./spec/models/concerns/blacklight_heatmaps/point_spec.rb[1:1:1] | passed | 0.01197 seconds |
23
- ./spec/models/concerns/blacklight_heatmaps/point_spec.rb[1:2:1] | passed | 0.00049 seconds |
24
- ./spec/models/concerns/blacklight_heatmaps/solr_facet_heatmap_behavior_spec.rb[1:1:1:1] | passed | 0.00126 seconds |
25
- ./spec/models/concerns/blacklight_heatmaps/solr_facet_heatmap_behavior_spec.rb[1:1:2:1] | passed | 0.02643 seconds |
26
- ./spec/models/concerns/blacklight_heatmaps/solr_facet_heatmap_behavior_spec.rb[1:2:1] | passed | 0.00102 seconds |
27
- ./spec/models/concerns/blacklight_heatmaps/solr_facet_heatmap_behavior_spec.rb[1:3:1] | passed | 0.001 seconds |
28
- ./spec/models/concerns/blacklight_heatmaps/solr_facet_heatmap_behavior_spec.rb[1:4:1] | passed | 0.00108 seconds |
29
- ./spec/views/catalog/_document_heatmaps.html.erb_spec.rb[1:1] | passed | 0.02604 seconds |
30
- ./spec/views/catalog/_show_leaflet_map_default.html.erb_spec.rb[1:1:1] | passed | 0.00276 seconds |
31
- ./spec/views/catalog/_show_leaflet_map_default.html.erb_spec.rb[1:2:1] | passed | 0.00097 seconds |
13
+ ./spec/models/concerns/blacklight_heatmaps/bounding_box_spec.rb[1:3:1] | passed | 0.00007 seconds |
14
+ ./spec/models/concerns/blacklight_heatmaps/bounding_box_spec.rb[1:4:1] | passed | 0.0001 seconds |
15
+ ./spec/models/concerns/blacklight_heatmaps/geometry_parser_spec.rb[1:1:1:1] | passed | 0.00009 seconds |
16
+ ./spec/models/concerns/blacklight_heatmaps/geometry_parser_spec.rb[1:1:2:1] | passed | 0.0001 seconds |
17
+ ./spec/models/concerns/blacklight_heatmaps/geometry_parser_spec.rb[1:1:3:1] | passed | 0.0011 seconds |
18
+ ./spec/models/concerns/blacklight_heatmaps/geometry_solr_document_spec.rb[1:1:1] | passed | 0.00044 seconds |
19
+ ./spec/models/concerns/blacklight_heatmaps/geometry_solr_document_spec.rb[1:2:1] | passed | 0.00017 seconds |
20
+ ./spec/models/concerns/blacklight_heatmaps/geometry_solr_document_spec.rb[1:3:1] | passed | 0.00017 seconds |
21
+ ./spec/models/concerns/blacklight_heatmaps/geometry_solr_document_spec.rb[1:4:1] | passed | 0.00013 seconds |
22
+ ./spec/models/concerns/blacklight_heatmaps/point_spec.rb[1:1:1] | passed | 0.00007 seconds |
23
+ ./spec/models/concerns/blacklight_heatmaps/point_spec.rb[1:2:1] | passed | 0.00039 seconds |
24
+ ./spec/models/concerns/blacklight_heatmaps/solr_facet_heatmap_behavior_spec.rb[1:1:1:1] | passed | 0.00164 seconds |
25
+ ./spec/models/concerns/blacklight_heatmaps/solr_facet_heatmap_behavior_spec.rb[1:1:2:1] | passed | 0.00347 seconds |
26
+ ./spec/models/concerns/blacklight_heatmaps/solr_facet_heatmap_behavior_spec.rb[1:2:1] | passed | 0.00153 seconds |
27
+ ./spec/models/concerns/blacklight_heatmaps/solr_facet_heatmap_behavior_spec.rb[1:3:1] | passed | 0.00214 seconds |
28
+ ./spec/models/concerns/blacklight_heatmaps/solr_facet_heatmap_behavior_spec.rb[1:4:1] | passed | 0.00146 seconds |
29
+ ./spec/views/catalog/_document_heatmaps.html.erb_spec.rb[1:1] | passed | 0.00188 seconds |
30
+ ./spec/views/catalog/_show_leaflet_map_default.html.erb_spec.rb[1:1:1] | passed | 0.01013 seconds |
31
+ ./spec/views/catalog/_show_leaflet_map_default.html.erb_spec.rb[1:2:1] | passed | 0.00161 seconds |
@@ -4,17 +4,25 @@ class TestAppGenerator < Rails::Generators::Base
4
4
  source_root './spec/test_app_templates'
5
5
 
6
6
  def add_gems
7
- gem 'blacklight', ENV.fetch('BLACKLIGHT_VERSION', '~> 7.0')
7
+ gem 'blacklight', ENV.fetch('BLACKLIGHT_VERSION', '~> 8.0')
8
8
 
9
- Bundler.with_clean_env do
9
+ Bundler.with_unbundled_env do
10
10
  run 'bundle install'
11
11
  end
12
12
  end
13
13
 
14
+ # This makes the assets available in the test app so that changes made in
15
+ # local development can be picked up automatically
16
+ def link_frontend
17
+ inside('..') do
18
+ run 'yarn unlink ; yarn link'
19
+ end
20
+ end
21
+
14
22
  def run_blacklight_generator
15
23
  say_status('warning', 'GENERATING BL', :yellow)
16
24
 
17
- generate 'blacklight:install', '--devise'
25
+ generate 'blacklight:install'
18
26
  end
19
27
 
20
28
  # if you need to generate any additional configuration
@@ -22,15 +30,6 @@ class TestAppGenerator < Rails::Generators::Base
22
30
  # after setting up the application
23
31
 
24
32
  def install_engine
25
- generate 'blacklight_heatmaps:install'
26
- end
27
-
28
- # Temporarily force js assets to fall back to sprockets
29
- def clean_up_js_builds
30
- return unless File.exist?('app/assets/builds')
31
-
32
- append_to_file 'app/assets/config/manifest.js', "\n//= link application.js\n" if File.exist?('app/assets/config/manifest.js')
33
- gsub_file 'app/assets/config/manifest.js', '//= link_tree ../builds', ''
34
- remove_dir 'app/assets/builds'
33
+ generate 'blacklight_heatmaps:install', '--test'
35
34
  end
36
35
  end
metadata CHANGED
@@ -1,42 +1,41 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: blacklight_heatmaps
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.0
4
+ version: 2.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jack Reed
8
- autorequire:
9
8
  bindir: bin
10
9
  cert_chain: []
11
- date: 2025-01-09 00:00:00.000000000 Z
10
+ date: 1980-01-02 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
- name: rails
13
+ name: blacklight
15
14
  requirement: !ruby/object:Gem::Requirement
16
15
  requirements:
17
16
  - - ">="
18
17
  - !ruby/object:Gem::Version
19
- version: 7.1.4
18
+ version: '8'
20
19
  - - "<"
21
20
  - !ruby/object:Gem::Version
22
- version: '8'
21
+ version: '10'
23
22
  type: :runtime
24
23
  prerelease: false
25
24
  version_requirements: !ruby/object:Gem::Requirement
26
25
  requirements:
27
26
  - - ">="
28
27
  - !ruby/object:Gem::Version
29
- version: 7.1.4
28
+ version: '8'
30
29
  - - "<"
31
30
  - !ruby/object:Gem::Version
32
- version: '8'
31
+ version: '10'
33
32
  - !ruby/object:Gem::Dependency
34
- name: blacklight
33
+ name: rails
35
34
  requirement: !ruby/object:Gem::Requirement
36
35
  requirements:
37
36
  - - ">="
38
37
  - !ruby/object:Gem::Version
39
- version: 7.17.1
38
+ version: '8.1'
40
39
  - - "<"
41
40
  - !ruby/object:Gem::Version
42
41
  version: '9'
@@ -46,52 +45,38 @@ dependencies:
46
45
  requirements:
47
46
  - - ">="
48
47
  - !ruby/object:Gem::Version
49
- version: 7.17.1
48
+ version: '8.1'
50
49
  - - "<"
51
50
  - !ruby/object:Gem::Version
52
51
  version: '9'
53
52
  - !ruby/object:Gem::Dependency
54
- name: leaflet-rails
53
+ name: capybara
55
54
  requirement: !ruby/object:Gem::Requirement
56
55
  requirements:
57
- - - "~>"
56
+ - - ">="
58
57
  - !ruby/object:Gem::Version
59
- version: 1.3.0
60
- type: :runtime
58
+ version: '0'
59
+ type: :development
61
60
  prerelease: false
62
61
  version_requirements: !ruby/object:Gem::Requirement
63
62
  requirements:
64
- - - "~>"
63
+ - - ">="
65
64
  - !ruby/object:Gem::Version
66
- version: 1.3.0
65
+ version: '0'
67
66
  - !ruby/object:Gem::Dependency
68
- name: leaflet-sidebar-rails
67
+ name: engine_cart
69
68
  requirement: !ruby/object:Gem::Requirement
70
69
  requirements:
71
70
  - - "~>"
72
71
  - !ruby/object:Gem::Version
73
- version: '0.2'
74
- type: :runtime
75
- prerelease: false
76
- version_requirements: !ruby/object:Gem::Requirement
77
- requirements:
78
- - - "~>"
79
- - !ruby/object:Gem::Version
80
- version: '0.2'
81
- - !ruby/object:Gem::Dependency
82
- name: sqlite3
83
- requirement: !ruby/object:Gem::Requirement
84
- requirements:
85
- - - ">="
86
- - !ruby/object:Gem::Version
87
- version: '0'
72
+ version: '2.0'
88
73
  type: :development
89
74
  prerelease: false
90
75
  version_requirements: !ruby/object:Gem::Requirement
91
76
  requirements:
92
- - - ">="
77
+ - - "~>"
93
78
  - !ruby/object:Gem::Version
94
- version: '0'
79
+ version: '2.0'
95
80
  - !ruby/object:Gem::Dependency
96
81
  name: rspec-rails
97
82
  requirement: !ruby/object:Gem::Requirement
@@ -107,19 +92,19 @@ dependencies:
107
92
  - !ruby/object:Gem::Version
108
93
  version: '0'
109
94
  - !ruby/object:Gem::Dependency
110
- name: engine_cart
95
+ name: selenium-webdriver
111
96
  requirement: !ruby/object:Gem::Requirement
112
97
  requirements:
113
98
  - - "~>"
114
99
  - !ruby/object:Gem::Version
115
- version: '2.0'
100
+ version: '4.11'
116
101
  type: :development
117
102
  prerelease: false
118
103
  version_requirements: !ruby/object:Gem::Requirement
119
104
  requirements:
120
105
  - - "~>"
121
106
  - !ruby/object:Gem::Version
122
- version: '2.0'
107
+ version: '4.11'
123
108
  - !ruby/object:Gem::Dependency
124
109
  name: solr_wrapper
125
110
  requirement: !ruby/object:Gem::Requirement
@@ -135,7 +120,7 @@ dependencies:
135
120
  - !ruby/object:Gem::Version
136
121
  version: '0'
137
122
  - !ruby/object:Gem::Dependency
138
- name: capybara
123
+ name: sqlite3
139
124
  requirement: !ruby/object:Gem::Requirement
140
125
  requirements:
141
126
  - - ">="
@@ -148,20 +133,6 @@ dependencies:
148
133
  - - ">="
149
134
  - !ruby/object:Gem::Version
150
135
  version: '0'
151
- - !ruby/object:Gem::Dependency
152
- name: selenium-webdriver
153
- requirement: !ruby/object:Gem::Requirement
154
- requirements:
155
- - - "~>"
156
- - !ruby/object:Gem::Version
157
- version: '4.11'
158
- type: :development
159
- prerelease: false
160
- version_requirements: !ruby/object:Gem::Requirement
161
- requirements:
162
- - - "~>"
163
- - !ruby/object:Gem::Version
164
- version: '4.11'
165
136
  description: Search and view Blacklight resources on a map.
166
137
  email:
167
138
  - phillipjreed@gmail.com
@@ -205,8 +176,7 @@ files:
205
176
  - lib/blacklight_heatmaps/engine.rb
206
177
  - lib/blacklight_heatmaps/version.rb
207
178
  - lib/generators/blacklight_heatmaps/install_generator.rb
208
- - lib/generators/blacklight_heatmaps/templates/blacklight_heatmaps.js
209
- - lib/generators/blacklight_heatmaps/templates/blacklight_heatmaps.scss
179
+ - lib/generators/blacklight_heatmaps/templates/blacklight_heatmaps.css
210
180
  - lib/tasks/blacklight_heatmaps_tasks.rake
211
181
  - spec/examples.txt
212
182
  - spec/features/configurable_basemap_spec.rb
@@ -231,7 +201,6 @@ homepage: https://github.com/sul-dlss/blacklight_heatmaps
231
201
  licenses:
232
202
  - Apache
233
203
  metadata: {}
234
- post_install_message:
235
204
  rdoc_options: []
236
205
  require_paths:
237
206
  - lib
@@ -246,8 +215,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
246
215
  - !ruby/object:Gem::Version
247
216
  version: '0'
248
217
  requirements: []
249
- rubygems_version: 3.5.23
250
- signing_key:
218
+ rubygems_version: 4.0.10
251
219
  specification_version: 4
252
220
  summary: Search and view Blacklight resources on a map.
253
221
  test_files:
@@ -1 +0,0 @@
1
- //= require blacklight_heatmaps/default
@@ -1 +0,0 @@
1
- @import 'blacklight_heatmaps/default';