blacklight_heatmaps 1.4.0 → 2.0.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.
@@ -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
 
@@ -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,7 @@
1
- example_id | status | run_time |
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 |
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 |
1
+ example_id | status | run_time |
2
+ --------------------------------------------------- | ------ | --------------- |
3
+ ./spec/features/configurable_basemap_spec.rb[1:1] | failed | 6.26 seconds |
4
+ ./spec/features/configurable_basemap_spec.rb[1:2:1] | failed | 0.04107 seconds |
5
+ ./spec/features/configurable_basemap_spec.rb[1:3:1] | failed | 0.06812 seconds |
6
+ ./spec/features/show_page_map_spec.rb[1:1] | failed | 0.04444 seconds |
7
+ ./spec/features/show_page_map_spec.rb[1:2] | failed | 1.43 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
9
  Bundler.with_clean_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,22 @@
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.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jack Reed
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2025-01-09 00:00:00.000000000 Z
11
+ date: 2025-12-05 00:00:00.000000000 Z
12
12
  dependencies:
13
- - !ruby/object:Gem::Dependency
14
- name: rails
15
- requirement: !ruby/object:Gem::Requirement
16
- requirements:
17
- - - ">="
18
- - !ruby/object:Gem::Version
19
- version: 7.1.4
20
- - - "<"
21
- - !ruby/object:Gem::Version
22
- version: '8'
23
- type: :runtime
24
- prerelease: false
25
- version_requirements: !ruby/object:Gem::Requirement
26
- requirements:
27
- - - ">="
28
- - !ruby/object:Gem::Version
29
- version: 7.1.4
30
- - - "<"
31
- - !ruby/object:Gem::Version
32
- version: '8'
33
13
  - !ruby/object:Gem::Dependency
34
14
  name: blacklight
35
15
  requirement: !ruby/object:Gem::Requirement
36
16
  requirements:
37
17
  - - ">="
38
18
  - !ruby/object:Gem::Version
39
- version: 7.17.1
19
+ version: '8'
40
20
  - - "<"
41
21
  - !ruby/object:Gem::Version
42
22
  version: '9'
@@ -46,7 +26,7 @@ dependencies:
46
26
  requirements:
47
27
  - - ">="
48
28
  - !ruby/object:Gem::Version
49
- version: 7.17.1
29
+ version: '8'
50
30
  - - "<"
51
31
  - !ruby/object:Gem::Version
52
32
  version: '9'
@@ -79,21 +59,27 @@ dependencies:
79
59
  - !ruby/object:Gem::Version
80
60
  version: '0.2'
81
61
  - !ruby/object:Gem::Dependency
82
- name: sqlite3
62
+ name: rails
83
63
  requirement: !ruby/object:Gem::Requirement
84
64
  requirements:
85
65
  - - ">="
86
66
  - !ruby/object:Gem::Version
87
- version: '0'
88
- type: :development
67
+ version: 7.1.4
68
+ - - "<"
69
+ - !ruby/object:Gem::Version
70
+ version: '9'
71
+ type: :runtime
89
72
  prerelease: false
90
73
  version_requirements: !ruby/object:Gem::Requirement
91
74
  requirements:
92
75
  - - ">="
93
76
  - !ruby/object:Gem::Version
94
- version: '0'
77
+ version: 7.1.4
78
+ - - "<"
79
+ - !ruby/object:Gem::Version
80
+ version: '9'
95
81
  - !ruby/object:Gem::Dependency
96
- name: rspec-rails
82
+ name: capybara
97
83
  requirement: !ruby/object:Gem::Requirement
98
84
  requirements:
99
85
  - - ">="
@@ -121,7 +107,7 @@ dependencies:
121
107
  - !ruby/object:Gem::Version
122
108
  version: '2.0'
123
109
  - !ruby/object:Gem::Dependency
124
- name: solr_wrapper
110
+ name: rspec-rails
125
111
  requirement: !ruby/object:Gem::Requirement
126
112
  requirements:
127
113
  - - ">="
@@ -135,7 +121,21 @@ dependencies:
135
121
  - !ruby/object:Gem::Version
136
122
  version: '0'
137
123
  - !ruby/object:Gem::Dependency
138
- name: capybara
124
+ name: selenium-webdriver
125
+ requirement: !ruby/object:Gem::Requirement
126
+ requirements:
127
+ - - "~>"
128
+ - !ruby/object:Gem::Version
129
+ version: '4.11'
130
+ type: :development
131
+ prerelease: false
132
+ version_requirements: !ruby/object:Gem::Requirement
133
+ requirements:
134
+ - - "~>"
135
+ - !ruby/object:Gem::Version
136
+ version: '4.11'
137
+ - !ruby/object:Gem::Dependency
138
+ name: solr_wrapper
139
139
  requirement: !ruby/object:Gem::Requirement
140
140
  requirements:
141
141
  - - ">="
@@ -149,19 +149,19 @@ dependencies:
149
149
  - !ruby/object:Gem::Version
150
150
  version: '0'
151
151
  - !ruby/object:Gem::Dependency
152
- name: selenium-webdriver
152
+ name: sqlite3
153
153
  requirement: !ruby/object:Gem::Requirement
154
154
  requirements:
155
- - - "~>"
155
+ - - ">="
156
156
  - !ruby/object:Gem::Version
157
- version: '4.11'
157
+ version: '0'
158
158
  type: :development
159
159
  prerelease: false
160
160
  version_requirements: !ruby/object:Gem::Requirement
161
161
  requirements:
162
- - - "~>"
162
+ - - ">="
163
163
  - !ruby/object:Gem::Version
164
- version: '4.11'
164
+ version: '0'
165
165
  description: Search and view Blacklight resources on a map.
166
166
  email:
167
167
  - phillipjreed@gmail.com
@@ -205,8 +205,7 @@ files:
205
205
  - lib/blacklight_heatmaps/engine.rb
206
206
  - lib/blacklight_heatmaps/version.rb
207
207
  - 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
208
+ - lib/generators/blacklight_heatmaps/templates/blacklight_heatmaps.css
210
209
  - lib/tasks/blacklight_heatmaps_tasks.rake
211
210
  - spec/examples.txt
212
211
  - spec/features/configurable_basemap_spec.rb
@@ -246,7 +245,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
246
245
  - !ruby/object:Gem::Version
247
246
  version: '0'
248
247
  requirements: []
249
- rubygems_version: 3.5.23
248
+ rubygems_version: 3.5.11
250
249
  signing_key:
251
250
  specification_version: 4
252
251
  summary: Search and view Blacklight resources on a map.
@@ -1 +0,0 @@
1
- //= require blacklight_heatmaps/default
@@ -1 +0,0 @@
1
- @import 'blacklight_heatmaps/default';