geoblacklight 3.0.0 → 3.3.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (88) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/ruby.yml +142 -0
  3. data/.gitignore +8 -0
  4. data/.rubocop.yml +9 -10
  5. data/.rubocop_todo.yml +356 -26
  6. data/README.md +2 -2
  7. data/Rakefile +12 -4
  8. data/app/assets/images/favicon.ico +0 -0
  9. data/app/assets/javascripts/geoblacklight/geoblacklight.js +18 -1
  10. data/app/assets/javascripts/geoblacklight/modules/bookmarks.js +43 -0
  11. data/app/assets/javascripts/geoblacklight/modules/metadata_download_button.js +6 -1
  12. data/app/assets/javascripts/geoblacklight/modules/results.js +7 -8
  13. data/app/assets/javascripts/geoblacklight/modules/util.js +5 -0
  14. data/app/assets/javascripts/geoblacklight/viewers/esri.js +1 -1
  15. data/app/assets/javascripts/geoblacklight/viewers/index_map.js +1 -1
  16. data/app/assets/javascripts/geoblacklight/viewers/map.js +12 -2
  17. data/app/assets/javascripts/geoblacklight/viewers/tms.js +10 -0
  18. data/app/assets/javascripts/geoblacklight/viewers/wms.js +1 -1
  19. data/app/assets/stylesheets/geoblacklight/modules/_blacklight_overrides.scss +1 -1
  20. data/app/assets/stylesheets/geoblacklight/modules/results.scss +1 -1
  21. data/app/helpers/geoblacklight_helper.rb +14 -2
  22. data/app/models/concerns/geoblacklight/solr_document.rb +8 -13
  23. data/app/models/concerns/geoblacklight/spatial_search_behavior.rb +3 -3
  24. data/app/views/catalog/_document_split.html.erb +1 -1
  25. data/app/views/catalog/_home_text.html.erb +1 -1
  26. data/app/views/catalog/_index_split_default.html.erb +1 -1
  27. data/app/views/catalog/_show_default_viewer_container.html.erb +1 -1
  28. data/app/views/download/hgl.html.erb +13 -11
  29. data/app/views/relation/_ancestors.html.erb +2 -2
  30. data/app/views/relation/_descendants.html.erb +2 -2
  31. data/babel.config.json +4 -0
  32. data/bin/coverage.rb +2 -2
  33. data/config/initializers/new_gbl_settings_defaults_3_3.yml +10 -0
  34. data/config/initializers/rails_config.rb +4 -0
  35. data/config/locales/geoblacklight.en.yml +4 -0
  36. data/geoblacklight.gemspec +6 -5
  37. data/jest.config.js +25 -0
  38. data/lib/generators/geoblacklight/install_generator.rb +1 -1
  39. data/lib/generators/geoblacklight/templates/catalog_controller.rb +2 -1
  40. data/lib/generators/geoblacklight/templates/settings.yml +20 -11
  41. data/lib/geoblacklight.rb +1 -2
  42. data/lib/geoblacklight/bounding_box.rb +1 -1
  43. data/lib/geoblacklight/constants.rb +1 -0
  44. data/lib/geoblacklight/download/kmz_download.rb +1 -1
  45. data/lib/geoblacklight/engine.rb +1 -0
  46. data/lib/geoblacklight/geometry.rb +85 -0
  47. data/lib/geoblacklight/item_viewer.rb +5 -1
  48. data/lib/geoblacklight/metadata/base.rb +1 -7
  49. data/lib/geoblacklight/relation/ancestors.rb +2 -2
  50. data/lib/geoblacklight/relation/descendants.rb +1 -1
  51. data/lib/geoblacklight/version.rb +1 -1
  52. data/lib/geoblacklight/wms_layer.rb +1 -4
  53. data/lib/tasks/geoblacklight.rake +5 -0
  54. data/package.json +17 -1
  55. data/setupJest.js +14 -0
  56. data/solr/conf/schema.xml +1 -3
  57. data/spec/config/initializers/rails_config_spec.rb +14 -0
  58. data/spec/controllers/catalog_controller_spec.rb +6 -6
  59. data/spec/features/download_layer_spec.rb +1 -1
  60. data/spec/features/relations_spec.rb +1 -1
  61. data/spec/features/search_results_overlap_ratio_spec.rb +2 -2
  62. data/spec/features/split_view.html.erb_spec.rb +1 -1
  63. data/spec/features/tms_spec.rb +10 -0
  64. data/spec/fixtures/solr_documents/public_iiif_princeton.json +1 -1
  65. data/spec/fixtures/solr_documents/tms.json +29 -0
  66. data/spec/helpers/geoblacklight_helper_spec.rb +30 -4
  67. data/spec/javascripts/geoblacklight_spec.js +0 -6
  68. data/spec/javascripts/metadata_download_button_spec.js +5 -3
  69. data/spec/javascripts/util_spec.js +2 -4
  70. data/spec/lib/geoblacklight/download/kmz_download_spec.rb +2 -2
  71. data/spec/lib/geoblacklight/download_spec.rb +1 -1
  72. data/spec/lib/geoblacklight/geometry_spec.rb +59 -0
  73. data/spec/lib/geoblacklight/item_viewer_spec.rb +12 -0
  74. data/spec/lib/geoblacklight/references_spec.rb +1 -1
  75. data/spec/lib/geoblacklight/relation/ancestors_spec.rb +1 -1
  76. data/spec/lib/geoblacklight/relation/descendants_spec.rb +1 -1
  77. data/spec/test_app_templates/Gemfile.extra +1 -0
  78. data/spec/test_app_templates/lib/generators/test_app_generator.rb +1 -8
  79. data/spec/views/catalog/_document_split.html.erb_spec.rb +1 -1
  80. data/spec/views/catalog/_index_split.html.erb_spec.rb +1 -1
  81. data/spec/views/catalog/_show_tools.html.erb_spec.rb +1 -1
  82. data/template.rb +3 -2
  83. metadata +58 -36
  84. data/.circleci/config.yml +0 -252
  85. data/spec/javascripts/geoblacklight/viewers/esri/tiled_map_layer_spec.js +0 -12
  86. data/spec/javascripts/spec_helper.js +0 -32
  87. data/spec/lib/geoblacklight/controller_override_spec.rb +0 -2
  88. data/spec/teaspoon_env.rb +0 -214
@@ -1,12 +0,0 @@
1
- //= require geoblacklight
2
-
3
- describe('setupInspection', function() {
4
- describe('Inspect attribute on the map', function() {
5
- it('identifyFeatures is defined', function() {
6
- expect(L.esri.identifyFeatures).toBeDefined();
7
- });
8
- it('Tasks is not defined', function() {
9
- expect(L.esri.Tasks).toBeUndefined();
10
- });
11
- });
12
- });
@@ -1,32 +0,0 @@
1
- // Teaspoon includes some support files, but you can use anything from your own support path too.
2
- // require support/jasmine-jquery-1.7.0
3
- // require support/jasmine-jquery-2.0.0
4
- // require support/jasmine-jquery-2.1.0
5
- // require support/sinon
6
- // require support/your-support-file
7
- //
8
- // PhantomJS (Teaspoons default driver) doesn't have support for Function.prototype.bind, which has caused confusion.
9
- // Use this polyfill to avoid the confusion.
10
- //= require support/bind-poly
11
- //
12
- // You can require your own javascript files here. By default this will include everything in application, however you
13
- // may get better load performance if you require the specific files that are being used in the spec that tests them.
14
- //= require application
15
- //
16
- // Deferring execution
17
- // If you're using CommonJS, RequireJS or some other asynchronous library you can defer execution. Call
18
- // Teaspoon.execute() after everything has been loaded. Simple example of a timeout:
19
- //
20
- // Teaspoon.defer = true
21
- // setTimeout(Teaspoon.execute, 1000)
22
- //
23
- // Matching files
24
- // By default Teaspoon will look for files that match _spec.{js,js.coffee,.coffee}. Add a filename_spec.js file in your
25
- // spec path and it'll be included in the default suite automatically. If you want to customize suites, check out the
26
- // configuration in teaspoon_env.rb
27
- //
28
- // Manifest
29
- // If you'd rather require your spec files manually (to control order for instance) you can disable the suite matcher in
30
- // the configuration and use this file as a manifest.
31
- //
32
- // For more information: http://github.com/modeset/teaspoon
@@ -1,2 +0,0 @@
1
- # frozen_string_literal: true
2
- require 'spec_helper'
data/spec/teaspoon_env.rb DELETED
@@ -1,214 +0,0 @@
1
- # frozen_string_literal: true
2
- unless defined?(Rails)
3
- ENV['RAILS_ROOT'] = File.expand_path('../../', __FILE__)
4
- require File.expand_path('../../config/environment', __FILE__)
5
- end
6
-
7
- # Teaspoon doesn't allow you to pass client driver options to the Selenium WebDriver. This monkey patch
8
- # is a temporary fix until this PR is merged: https://github.com/jejacks0n/teaspoon/pull/519.
9
- require 'teaspoon/driver/selenium'
10
-
11
- Teaspoon::Driver::Selenium.class_eval do
12
- def run_specs(runner, url)
13
- driver = ::Selenium::WebDriver.for(
14
- driver_options[:client_driver],
15
- **driver_options[:selenium_options].to_hash.to_options
16
- )
17
- driver.navigate.to(url)
18
-
19
- ::Selenium::WebDriver::Wait.new(driver_options).until do
20
- done = driver.execute_script('return window.Teaspoon && window.Teaspoon.finished')
21
- driver.execute_script('return window.Teaspoon && window.Teaspoon.getMessages() || []').each do |line|
22
- runner.process("#{line}\n")
23
- end
24
- done
25
- end
26
- ensure
27
- driver&.quit
28
- end
29
- end
30
-
31
- Teaspoon.configure do |config|
32
- # Determines where the Teaspoon routes will be mounted. Changing this to "/jasmine" would allow you to browse to
33
- # `http://localhost:3000/jasmine` to run your tests.
34
- config.mount_at = '/teaspoon'
35
-
36
- # Specifies the root where Teaspoon will look for files. If you're testing an engine using a dummy application it can
37
- # be useful to set this to your engines root (e.g. `Teaspoon::Engine.root`).
38
- # Note: Defaults to `Rails.root` if nil.
39
- config.root = Geoblacklight::Engine.root
40
-
41
- # Paths that will be appended to the Rails assets paths
42
- # Note: Relative to `config.root`.
43
- config.asset_paths = ['spec/javascripts', 'spec/javascripts/stylesheets']
44
-
45
- # Fixtures are rendered through a controller, which allows using HAML, RABL/JBuilder, etc. Files in these paths will
46
- # be rendered as fixtures.
47
- config.fixture_paths = ['spec/javascripts/fixtures']
48
-
49
- # SUITES
50
- #
51
- # You can modify the default suite configuration and create new suites here. Suites are isolated from one another.
52
- #
53
- # When defining a suite you can provide a name and a block. If the name is left blank, :default is assumed. You can
54
- # omit various directives and the ones defined in the default suite will be used.
55
- #
56
- # To run a specific suite
57
- # - in the browser: http://localhost/teaspoon/[suite_name]
58
- # - with the rake task: rake teaspoon suite=[suite_name]
59
- # - with the cli: teaspoon --suite=[suite_name]
60
- config.suite do |suite|
61
- # Specify the framework you would like to use. This allows you to select versions, and will do some basic setup for
62
- # you -- which you can override with the directives below. This should be specified first, as it can override other
63
- # directives.
64
- # Note: If no version is specified, the latest is assumed.
65
- #
66
- # Versions: 1.3.1, 2.0.3, 2.1.3, 2.2.0
67
- suite.use_framework :jasmine, '2.2.0'
68
-
69
- # Specify a file matcher as a regular expression and all matching files will be loaded when the suite is run. These
70
- # files need to be within an asset path. You can add asset paths using the `config.asset_paths`.
71
- suite.matcher = '{spec/javascripts,app/assets}/**/*_spec.{js,js.coffee,coffee}'
72
-
73
- # Load additional JS files, but requiring them in your spec helper is the preferred way to do this.
74
- # suite.javascripts = []
75
-
76
- # You can include your own stylesheets if you want to change how Teaspoon looks.
77
- # Note: Spec related CSS can and should be loaded using fixtures.
78
- # suite.stylesheets = ["teaspoon"]
79
-
80
- # This suites spec helper, which can require additional support files. This file is loaded before any of your test
81
- # files are loaded.
82
- suite.helper = 'spec_helper'
83
-
84
- # Partial to be rendered in the head tag of the runner. You can use the provided ones or define your own by creating
85
- # a `_boot.html.erb` in your fixtures path, and adjust the config to `"/boot"` for instance.
86
- #
87
- # Available: boot, boot_require_js
88
- suite.boot_partial = 'boot'
89
-
90
- # Partial to be rendered in the body tag of the runner. You can define your own to create a custom body structure.
91
- suite.body_partial = 'body'
92
-
93
- # Hooks allow you to use `Teaspoon.hook("fixtures")` before, after, or during your spec run. This will make a
94
- # synchronous Ajax request to the server that will call all of the blocks you've defined for that hook name.
95
- # suite.hook :fixtures, &proc{}
96
-
97
- # Determine whether specs loaded into the test harness should be embedded as individual script tags or concatenated
98
- # into a single file. Similar to Rails' asset `debug: true` and `config.assets.debug = true` options. By default,
99
- # Teaspoon expands all assets to provide more valuable stack traces that reference individual source files.
100
- # suite.expand_assets = true
101
- end
102
-
103
- # Example suite. Since we're just filtering to files already within the root test/javascripts, these files will also
104
- # be run in the default suite -- but can be focused into a more specific suite.
105
- # config.suite :targeted do |suite|
106
- # suite.matcher = "spec/javascripts/targeted/*_spec.{js,js.coffee,coffee}"
107
- # end
108
-
109
- # CONSOLE RUNNER SPECIFIC
110
- #
111
- # These configuration directives are applicable only when running via the rake task or command line interface. These
112
- # directives can be overridden using the command line interface arguments or with ENV variables when using the rake
113
- # task.
114
- #
115
- # Command Line Interface:
116
- # teaspoon --driver=phantomjs --server-port=31337 --fail-fast=true --format=junit --suite=my_suite /spec/file_spec.js
117
- #
118
- # Rake:
119
- # teaspoon DRIVER=phantomjs SERVER_PORT=31337 FAIL_FAST=true FORMATTERS=junit suite=my_suite
120
-
121
- # Specify which headless driver to use. Supports PhantomJS and Selenium Webdriver.
122
- #
123
- # Available: :phantomjs, :selenium, :capybara_webkit
124
- # PhantomJS: https://github.com/modeset/teaspoon/wiki/Using-PhantomJS
125
- # Selenium Webdriver: https://github.com/modeset/teaspoon/wiki/Using-Selenium-WebDriver
126
- # Capybara Webkit: https://github.com/modeset/teaspoon/wiki/Using-Capybara-Webkit
127
- config.driver = :selenium
128
- config.driver_options = {
129
- client_driver: :chrome,
130
- selenium_options: {
131
- options: Selenium::WebDriver::Chrome::Options.new(args: ['headless', 'disable-gpu'])
132
- }
133
- }
134
-
135
- # Specify additional options for the driver.
136
- #
137
- # PhantomJS: https://github.com/modeset/teaspoon/wiki/Using-PhantomJS
138
- # Selenium Webdriver: https://github.com/modeset/teaspoon/wiki/Using-Selenium-WebDriver
139
- # Capybara Webkit: https://github.com/modeset/teaspoon/wiki/Using-Capybara-Webkit
140
- # config.driver_options = nil
141
-
142
- # Specify the timeout for the driver. Specs are expected to complete within this time frame or the run will be
143
- # considered a failure. This is to avoid issues that can arise where tests stall.
144
- # config.driver_timeout = 180
145
-
146
- # Specify a server to use with Rack (e.g. thin, mongrel). If nil is provided Rack::Server is used.
147
- # config.server = nil
148
-
149
- # Specify a port to run on a specific port, otherwise Teaspoon will use a random available port.
150
- # config.server_port = nil
151
-
152
- # Timeout for starting the server in seconds. If your server is slow to start you may have to bump this, or you may
153
- # want to lower this if you know it shouldn't take long to start.
154
- # config.server_timeout = 20
155
-
156
- # Force Teaspoon to fail immediately after a failing suite. Can be useful to make Teaspoon fail early if you have
157
- # several suites, but in environments like CI this may not be desirable.
158
- # config.fail_fast = true
159
-
160
- # Specify the formatters to use when outputting the results.
161
- # Note: Output files can be specified by using `"junit>/path/to/output.xml"`.
162
- #
163
- # Available: :dot, :clean, :documentation, :json, :junit, :pride, :rspec_html, :snowday, :swayze_or_oprah, :tap, :tap_y, :teamcity
164
- # config.formatters = [:dot]
165
-
166
- # Specify if you want color output from the formatters.
167
- # config.color = true
168
-
169
- # Teaspoon pipes all console[log/debug/error] to $stdout. This is useful to catch places where you've forgotten to
170
- # remove them, but in verbose applications this may not be desirable.
171
- # config.suppress_log = false
172
-
173
- # COVERAGE REPORTS / THRESHOLD ASSERTIONS
174
- #
175
- # Coverage reports requires Istanbul (https://github.com/gotwarlost/istanbul) to add instrumentation to your code and
176
- # display coverage statistics.
177
- #
178
- # Coverage configurations are similar to suites. You can define several, and use different ones under different
179
- # conditions.
180
- #
181
- # To run with a specific coverage configuration
182
- # - with the rake task: rake teaspoon USE_COVERAGE=[coverage_name]
183
- # - with the cli: teaspoon --coverage=[coverage_name]
184
-
185
- # Specify that you always want a coverage configuration to be used. Otherwise, specify that you want coverage
186
- # on the CLI.
187
- # Set this to "true" or the name of your coverage config.
188
- # config.use_coverage = nil
189
-
190
- # You can have multiple coverage configs by passing a name to config.coverage.
191
- # e.g. config.coverage :ci do |coverage|
192
- # The default coverage config name is :default.
193
- config.coverage do |coverage|
194
- # Which coverage reports Istanbul should generate. Correlates directly to what Istanbul supports.
195
- #
196
- # Available: text-summary, text, html, lcov, lcovonly, cobertura, teamcity
197
- # coverage.reports = ["text-summary", "html"]
198
-
199
- # The path that the coverage should be written to - when there's an artifact to write to disk.
200
- # Note: Relative to `config.root`.
201
- # coverage.output_path = "coverage"
202
-
203
- # Assets to be ignored when generating coverage reports. Accepts an array of filenames or regular expressions. The
204
- # default excludes assets from vendor, gems and support libraries.
205
- # coverage.ignore = [%r{/lib/ruby/gems/}, %r{/vendor/assets/}, %r{/support/}, %r{/(.+)_helper.}]
206
-
207
- # Various thresholds requirements can be defined, and those thresholds will be checked at the end of a run. If any
208
- # aren't met the run will fail with a message. Thresholds can be defined as a percentage (0-100), or nil.
209
- # coverage.statements = nil
210
- # coverage.functions = nil
211
- # coverage.branches = nil
212
- # coverage.lines = nil
213
- end
214
- end