geoblacklight 3.2.0 → 3.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (83) 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/results.scss +1 -1
  20. data/app/helpers/geoblacklight_helper.rb +13 -1
  21. data/app/models/concerns/geoblacklight/solr_document.rb +8 -13
  22. data/app/models/concerns/geoblacklight/spatial_search_behavior.rb +3 -3
  23. data/app/views/catalog/_document_split.html.erb +1 -1
  24. data/app/views/catalog/_index_split_default.html.erb +1 -1
  25. data/app/views/catalog/_show_default_viewer_container.html.erb +1 -1
  26. data/app/views/download/hgl.html.erb +13 -11
  27. data/app/views/relation/_ancestors.html.erb +2 -2
  28. data/app/views/relation/_descendants.html.erb +2 -2
  29. data/babel.config.json +4 -0
  30. data/config/initializers/new_gbl_settings_defaults_3_3.yml +10 -0
  31. data/config/initializers/rails_config.rb +4 -0
  32. data/config/locales/geoblacklight.en.yml +4 -0
  33. data/geoblacklight.gemspec +4 -2
  34. data/jest.config.js +25 -0
  35. data/lib/generators/geoblacklight/install_generator.rb +1 -1
  36. data/lib/generators/geoblacklight/templates/catalog_controller.rb +1 -1
  37. data/lib/generators/geoblacklight/templates/settings.yml +20 -11
  38. data/lib/geoblacklight.rb +1 -2
  39. data/lib/geoblacklight/bounding_box.rb +1 -1
  40. data/lib/geoblacklight/constants.rb +1 -0
  41. data/lib/geoblacklight/download/kmz_download.rb +1 -1
  42. data/lib/geoblacklight/geometry.rb +70 -0
  43. data/lib/geoblacklight/item_viewer.rb +5 -1
  44. data/lib/geoblacklight/metadata/base.rb +1 -7
  45. data/lib/geoblacklight/relation/ancestors.rb +2 -2
  46. data/lib/geoblacklight/relation/descendants.rb +1 -1
  47. data/lib/geoblacklight/version.rb +1 -1
  48. data/lib/geoblacklight/wms_layer.rb +1 -4
  49. data/lib/tasks/geoblacklight.rake +5 -0
  50. data/package.json +17 -1
  51. data/setupJest.js +14 -0
  52. data/solr/conf/schema.xml +1 -3
  53. data/spec/config/initializers/rails_config_spec.rb +14 -0
  54. data/spec/controllers/catalog_controller_spec.rb +6 -6
  55. data/spec/features/download_layer_spec.rb +1 -1
  56. data/spec/features/relations_spec.rb +1 -1
  57. data/spec/features/search_results_overlap_ratio_spec.rb +2 -2
  58. data/spec/features/split_view.html.erb_spec.rb +1 -1
  59. data/spec/features/tms_spec.rb +10 -0
  60. data/spec/fixtures/solr_documents/public_iiif_princeton.json +1 -1
  61. data/spec/fixtures/solr_documents/tms.json +29 -0
  62. data/spec/helpers/geoblacklight_helper_spec.rb +30 -4
  63. data/spec/javascripts/geoblacklight_spec.js +0 -6
  64. data/spec/javascripts/metadata_download_button_spec.js +5 -3
  65. data/spec/javascripts/util_spec.js +2 -4
  66. data/spec/lib/geoblacklight/download/kmz_download_spec.rb +2 -2
  67. data/spec/lib/geoblacklight/download_spec.rb +1 -1
  68. data/spec/lib/geoblacklight/geometry_spec.rb +48 -0
  69. data/spec/lib/geoblacklight/item_viewer_spec.rb +12 -0
  70. data/spec/lib/geoblacklight/references_spec.rb +1 -1
  71. data/spec/lib/geoblacklight/relation/ancestors_spec.rb +1 -1
  72. data/spec/lib/geoblacklight/relation/descendants_spec.rb +1 -1
  73. data/spec/test_app_templates/Gemfile.extra +1 -0
  74. data/spec/test_app_templates/lib/generators/test_app_generator.rb +0 -7
  75. data/spec/views/catalog/_document_split.html.erb_spec.rb +1 -1
  76. data/spec/views/catalog/_index_split.html.erb_spec.rb +1 -1
  77. data/template.rb +1 -0
  78. metadata +62 -26
  79. data/.circleci/config.yml +0 -256
  80. data/spec/javascripts/geoblacklight/viewers/esri/tiled_map_layer_spec.js +0 -12
  81. data/spec/javascripts/spec_helper.js +0 -32
  82. data/spec/lib/geoblacklight/controller_override_spec.rb +0 -2
  83. data/spec/teaspoon_env.rb +0 -214
data/babel.config.json ADDED
@@ -0,0 +1,4 @@
1
+ {
2
+ "plugins": ["@babel/plugin-transform-runtime"],
3
+ "presets": ["@babel/preset-env"]
4
+ }
@@ -0,0 +1,10 @@
1
+ # New GeoBlacklight v3.3 Solr field mappings
2
+ FIELDS:
3
+ :IDENTIFIER: 'dc_identifier_s'
4
+ :LANGUAGE: 'dc_language_s'
5
+ :LAYER_MODIFIED: 'layer_modified_dt'
6
+ :OVERLAP_FIELD: 'solr_bboxtype'
7
+ :SOURCE: 'dc_source_sm'
8
+ :SUPPRESSED: 'suppressed_b'
9
+ :TYPE: 'dc_type_s'
10
+ :UNIQUE_KEY: 'layer_slug_s'
@@ -2,3 +2,7 @@
2
2
  Config.setup do |config|
3
3
  config.const_name = 'Settings'
4
4
  end
5
+
6
+ # GeoBlacklight v3.3 - New Settings.FIELDS values
7
+ Settings.prepend_source!(File.expand_path('new_gbl_settings_defaults_3_3.yml', __dir__))
8
+ Settings.reload!
@@ -64,6 +64,7 @@ en:
64
64
  data_dictionary: 'Documentation'
65
65
  services: 'Web services'
66
66
  services_close: 'Close'
67
+ tms: 'Tile Map Service'
67
68
  relations:
68
69
  ancestor: 'Source Datasets'
69
70
  descendant: 'Derived Datasets'
@@ -104,6 +105,9 @@ en:
104
105
  tiled_map_layer:
105
106
  title: ArcGIS Tiled Map Layer
106
107
  content: An ArcGIS Tiled Map Layer Service displays set of web-accessible tiles that reside on a server.
108
+ tms:
109
+ title: Tile Map Service
110
+ content: A Tile Map Service displays georeferenced map tiles as an image on a map.
107
111
  wms:
108
112
  title: Web Map Service (WMS)
109
113
  content: A Web Map Service displays a geospatial dataset as map images.
@@ -29,6 +29,7 @@ Gem::Specification.new do |spec|
29
29
  spec.add_dependency 'geo_combine', '~> 0.4'
30
30
  spec.add_dependency 'mime-types'
31
31
  spec.add_dependency 'handlebars_assets'
32
+ spec.add_dependency 'rgeo-geojson'
32
33
 
33
34
  spec.add_development_dependency 'solr_wrapper'
34
35
  spec.add_development_dependency 'rails-controller-testing'
@@ -38,8 +39,9 @@ Gem::Specification.new do |spec|
38
39
  spec.add_development_dependency 'webdrivers'
39
40
  spec.add_development_dependency 'factory_bot_rails'
40
41
  spec.add_development_dependency 'database_cleaner', '~> 1.3'
41
- spec.add_development_dependency 'bixby'
42
42
  spec.add_development_dependency 'simplecov', '~> 0.17.1'
43
43
  spec.add_development_dependency 'foreman'
44
- spec.add_development_dependency 'teaspoon'
44
+ spec.add_development_dependency 'rubocop', '~> 1.10'
45
+ spec.add_development_dependency 'rubocop-rails', '~> 2.9'
46
+ spec.add_development_dependency 'rubocop-rspec', '~> 2.2'
45
47
  end
data/jest.config.js ADDED
@@ -0,0 +1,25 @@
1
+ const util = require('util');
2
+ const exec = util.promisify(require('child_process').exec);
3
+
4
+ module.exports = async () => {
5
+ console.log('Getting asset pipeline lookup path from Rails');
6
+ const { stdout, stderr } = await exec('bundle exec rake geoblacklight:asset_paths');
7
+ if (stderr) {
8
+ console.error(stderr);
9
+ }
10
+ const paths = stdout.trim().split('\n');
11
+ return {
12
+ moduleDirectories: [
13
+ 'node_modules',
14
+ 'spec/javascripts',
15
+ ...paths,
16
+ ],
17
+ rootDir: './',
18
+ setupFilesAfterEnv: [
19
+ '<rootDir>/setupJest.js',
20
+ ],
21
+ testMatch: [
22
+ '<rootDir>/spec/javascripts/**/*_spec.js',
23
+ ],
24
+ };
25
+ };
@@ -56,7 +56,7 @@ module Geoblacklight
56
56
 
57
57
  def add_unique_key
58
58
  inject_into_file 'app/models/solr_document.rb', after: "# self.unique_key = 'id'" do
59
- "\n self.unique_key = 'layer_slug_s'"
59
+ "\n self.unique_key = Settings.FIELDS.UNIQUE_KEY"
60
60
  end
61
61
  end
62
62
 
@@ -29,7 +29,7 @@ class CatalogController < ApplicationController
29
29
  #
30
30
  config.default_document_solr_params = {
31
31
  :qt => 'document',
32
- :q => '{!raw f=layer_slug_s v=$id}'
32
+ :q => "{!raw f=#{Settings.FIELDS.UNIQUE_KEY} v=$id}"
33
33
  }
34
34
 
35
35
 
@@ -21,24 +21,31 @@ OVERLAP_RATIO_BOOST: '2'
21
21
 
22
22
  # Solr field mappings
23
23
  FIELDS:
24
+ :CREATOR: 'dc_creator_sm'
25
+ :DESCRIPTION: 'dc_description_s'
24
26
  :FILE_FORMAT: 'dc_format_s'
27
+ :GEOM_TYPE: 'layer_geom_type_s'
25
28
  :GEOMETRY: 'solr_geom'
26
- :WXS_IDENTIFIER: 'layer_id_s'
27
- :RIGHTS: 'dc_rights_s'
29
+ :IDENTIFIER: 'dc_identifier_s'
30
+ :ISSUED: 'dct_issued_s'
31
+ :LANGUAGE: 'dc_language_s'
32
+ :LAYER_MODIFIED: 'layer_modified_dt'
33
+ :OVERLAP_FIELD: 'solr_bboxtype'
34
+ :PART_OF: 'dct_isPartOf_sm'
35
+ :PUBLISHER: 'dc_publisher_s'
28
36
  :PROVENANCE: 'dct_provenance_s'
29
- :GEOM_TYPE: 'layer_geom_type_s'
37
+ :REFERENCES: 'dct_references_s'
38
+ :RIGHTS: 'dc_rights_s'
30
39
  :SPATIAL_COVERAGE: 'dct_spatial_sm'
31
40
  :SUBJECT: 'dc_subject_sm'
32
- :REFERENCES: 'dct_references_s'
33
- :YEAR: 'solr_year_i'
34
- :CREATOR: 'dc_creator_sm'
35
- :DESCRIPTION: 'dc_description_s'
36
- :PUBLISHER: 'dc_publisher_s'
37
- :PART_OF: 'dct_isPartOf_sm'
41
+ :SOURCE: 'dc_source_sm'
42
+ :SUPPRESSED: 'suppressed_b'
38
43
  :TEMPORAL: 'dct_temporal_sm'
39
44
  :TITLE: 'dc_title_s'
40
- :SOURCE: 'dc_source_sm'
41
- :ISSUED: 'dct_issued_s'
45
+ :TYPE: 'dc_type_s'
46
+ :UNIQUE_KEY: 'layer_slug_s'
47
+ :WXS_IDENTIFIER: 'layer_id_s'
48
+ :YEAR: 'solr_year_i'
42
49
 
43
50
  # Institution deployed at
44
51
  INSTITUTION: 'Stanford'
@@ -62,6 +69,7 @@ USE_GEOM_FOR_RELATIONS_ICON: false
62
69
  # Web services shown in tool panel
63
70
  WEBSERVICES_SHOWN:
64
71
  - 'wms'
72
+ - 'tms'
65
73
  - 'wfs'
66
74
  - 'iiif'
67
75
  - 'feature_layer'
@@ -122,4 +130,5 @@ HELP_TEXT:
122
130
  - 'index_map'
123
131
  - 'tiled_map_layer'
124
132
  - 'wms'
133
+ - 'tms'
125
134
  - 'oembed'
data/lib/geoblacklight.rb CHANGED
@@ -6,9 +6,9 @@ module Geoblacklight
6
6
  require 'geoblacklight/bounding_box'
7
7
  require 'geoblacklight/catalog_helper_override'
8
8
  require 'geoblacklight/constants'
9
- # require 'geoblacklight/controller_override'
10
9
  require 'geoblacklight/exceptions'
11
10
  require 'geoblacklight/geoblacklight_helper_behavior'
11
+ require 'geoblacklight/geometry'
12
12
  require 'geoblacklight/view_helper_override'
13
13
  require 'geoblacklight/item_viewer'
14
14
  require 'geoblacklight/wms_layer'
@@ -36,7 +36,6 @@ module Geoblacklight
36
36
  require 'geoblacklight/relation/relation_response'
37
37
 
38
38
  def self.inject!
39
- # CatalogController.send(:include, Geoblacklight::ControllerOverride)
40
39
  CatalogController.send(:include, Geoblacklight::CatalogHelperOverride)
41
40
  CatalogController.send(:include, Geoblacklight::ViewHelperOverride)
42
41
  CatalogController.send(:helper, Geoblacklight::ViewHelperOverride) unless
@@ -28,7 +28,7 @@ module Geoblacklight
28
28
  # @param [String] bbox as "W S E N"
29
29
  # @return [Geoblacklight::BoundingBox]
30
30
  def self.from_rectangle(rectangle)
31
- rectangle_array = rectangle.split(' ')
31
+ rectangle_array = rectangle.split
32
32
  message = 'Bounding box should be a string in Solr rectangle syntax e.g."W S E N"'
33
33
  fail Geoblacklight::Exceptions::WrongBoundingBoxFormat, message if rectangle_array.count != 4
34
34
  new(
@@ -16,6 +16,7 @@ module Geoblacklight
16
16
  wcs: 'http://www.opengis.net/def/serviceType/ogc/wcs',
17
17
  wfs: 'http://www.opengis.net/def/serviceType/ogc/wfs',
18
18
  wms: 'http://www.opengis.net/def/serviceType/ogc/wms',
19
+ tms: 'https://wiki.osgeo.org/wiki/Tile_Map_Service_Specification',
19
20
  hgl: 'http://schema.org/DownloadAction',
20
21
  feature_layer: 'urn:x-esri:serviceType:ArcGIS#FeatureLayer',
21
22
  tiled_map_layer: 'urn:x-esri:serviceType:ArcGIS#TiledMapLayer',
@@ -9,7 +9,7 @@ module Geoblacklight
9
9
  width: 2000, height: 2000 }.freeze
10
10
 
11
11
  def initialize(document, options = {})
12
- bbox_wsen = document.bounding_box_as_wsen.split(' ').join(', ')
12
+ bbox_wsen = document.geometry.bounding_box
13
13
  request_params = KMZ_DOWNLOAD_PARAMS.merge(layers: document[:layer_id_s], bbox: bbox_wsen)
14
14
  super(document, {
15
15
  type: 'kmz',
@@ -0,0 +1,70 @@
1
+ # frozen_string_literal: true
2
+ require 'rgeo'
3
+ require 'rgeo-geojson'
4
+
5
+ module Geoblacklight
6
+ # Transforms and parses geometry expressed in WKT or CSW WKT ENVELOPE syntax
7
+ class Geometry
8
+ attr_reader :geom
9
+
10
+ # @param [String] geom WKT or WKT ENVELOPE syntax formatted string
11
+ def initialize(geom)
12
+ @geom = geom
13
+ end
14
+
15
+ # Convert geometry to GeoJSON
16
+ # @return [String]
17
+ def geojson
18
+ obj = factory.parse_wkt(geometry_as_wkt)
19
+ RGeo::GeoJSON.encode(obj).to_json
20
+ rescue RGeo::Error::ParseError
21
+ ''
22
+ end
23
+
24
+ # Generate a wsen bounding box from the geometry
25
+ # @return [String] bounding box as comma delimited wsen "w, s, e, n"
26
+ def bounding_box
27
+ obj = factory.parse_wkt(geometry_as_wkt)
28
+
29
+ # Get the minimum bounding box for the geometry as a Polygon
30
+ bbox = obj.envelope
31
+
32
+ # Return as wsen string
33
+ minx = bbox.coordinates[0][0][0]
34
+ miny = bbox.coordinates[0][0][1]
35
+ maxx = bbox.coordinates[0][1][0]
36
+ maxy = bbox.coordinates[0][2][1]
37
+ "#{minx}, #{miny}, #{maxx}, #{maxy}"
38
+ rescue RGeo::Error::ParseError
39
+ ''
40
+ end
41
+
42
+ private
43
+
44
+ # Convert WKT ENVELOPE string to WKT POLYGON string
45
+ # @return [String]
46
+ def envelope_to_polygon
47
+ exp = /^\s*ENVELOPE\(
48
+ \s*([-.\d]+)\s*,
49
+ \s*([-.\d]+)\s*,
50
+ \s*([-.\d]+)\s*,
51
+ \s*([-.\d]+)\s*
52
+ \)\s*$/x # uses 'x' option for free-spacing mode
53
+ bbox_match = exp.match(geom)
54
+ minx, maxx, maxy, miny = bbox_match.captures
55
+ "POLYGON ((#{minx} #{maxy}, #{minx} #{miny}, #{maxx} #{miny}, #{maxx} #{maxy}, #{minx} #{maxy}))"
56
+ end
57
+
58
+ def factory
59
+ @factory ||= RGeo::Cartesian.factory
60
+ end
61
+
62
+ # Return geometry as valid WKT string
63
+ # @return [String]
64
+ def geometry_as_wkt
65
+ return geom unless geom.match?(/ENVELOPE/)
66
+
67
+ envelope_to_polygon
68
+ end
69
+ end
70
+ end
@@ -47,8 +47,12 @@ module Geoblacklight
47
47
  @references.oembed
48
48
  end
49
49
 
50
+ def tms
51
+ @references.tms
52
+ end
53
+
50
54
  def viewer_preference
51
- [oembed, index_map, wms, iiif, tiled_map_layer, dynamic_map_layer,
55
+ [oembed, index_map, tms, wms, iiif, tiled_map_layer, dynamic_map_layer,
52
56
  image_map_layer, feature_layer].compact.map(&:to_hash).first
53
57
  end
54
58
  end
@@ -55,13 +55,7 @@ module Geoblacklight
55
55
  return response.body unless response.nil? || response.status == 404
56
56
  Geoblacklight.logger.error "Could not reach #{@reference.endpoint}"
57
57
  ''
58
- rescue Faraday::ConnectionFailed => error
59
- Geoblacklight.logger.error error.inspect
60
- ''
61
- rescue Faraday::TimeoutError => error
62
- Geoblacklight.logger.error error.inspect
63
- ''
64
- rescue OpenSSL::SSL::SSLError => error
58
+ rescue Faraday::ConnectionFailed, Faraday::TimeoutError, OpenSSL::SSL::SSLError => error
65
59
  Geoblacklight.logger.error error.inspect
66
60
  ''
67
61
  end
@@ -8,8 +8,8 @@ module Geoblacklight
8
8
  end
9
9
 
10
10
  def create_search_params
11
- { fq: ["{!join from=#{Settings.FIELDS.SOURCE} to=layer_slug_s}layer_slug_s:#{@search_id}"],
12
- fl: [Settings.FIELDS.TITLE, 'layer_slug_s', Settings.FIELDS.GEOM_TYPE] }
11
+ { fq: ["{!join from=#{Settings.FIELDS.SOURCE} to=#{Settings.FIELDS.UNIQUE_KEY}}#{Settings.FIELDS.UNIQUE_KEY}:#{@search_id}"],
12
+ fl: [Settings.FIELDS.TITLE, Settings.FIELDS.UNIQUE_KEY, Settings.FIELDS.GEOM_TYPE] }
13
13
  end
14
14
 
15
15
  def execute_query
@@ -9,7 +9,7 @@ module Geoblacklight
9
9
 
10
10
  def create_search_params
11
11
  { fq: "#{Settings.FIELDS.SOURCE}:#{@search_id}",
12
- fl: [Settings.FIELDS.TITLE, 'layer_slug_s', Settings.FIELDS.GEOM_TYPE] }
12
+ fl: [Settings.FIELDS.TITLE, Settings.FIELDS.UNIQUE_KEY, Settings.FIELDS.GEOM_TYPE] }
13
13
  end
14
14
 
15
15
  def execute_query
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  module Geoblacklight
3
- VERSION = '3.2.0'
3
+ VERSION = '3.3.0'
4
4
  end
@@ -25,10 +25,7 @@ module Geoblacklight
25
25
  request.options.timeout = Settings.TIMEOUT_WMS
26
26
  request.options.open_timeout = Settings.TIMEOUT_WMS
27
27
  end
28
- rescue Faraday::ConnectionFailed => error
29
- Geoblacklight.logger.error error.inspect
30
- { error: error.inspect }
31
- rescue Faraday::TimeoutError => error
28
+ rescue Faraday::ConnectionFailed, Faraday::TimeoutError => error
32
29
  Geoblacklight.logger.error error.inspect
33
30
  { error: error.inspect }
34
31
  end
@@ -106,4 +106,9 @@ namespace :geoblacklight do
106
106
  Rake::Task['geoblacklight:index:seed'].invoke
107
107
  end
108
108
  end
109
+
110
+ desc 'Stdout output asset paths'
111
+ task application_asset_paths: [:environment] do
112
+ puts Rails.application.config.assets.paths
113
+ end
109
114
  end
data/package.json CHANGED
@@ -1,4 +1,20 @@
1
1
  {
2
2
  "name": "geoblacklight",
3
- "version": "2.1.2"
3
+ "version": "2.1.2",
4
+ "private": true,
5
+ "license": "Apache-2.0",
6
+ "private": true,
7
+ "scripts": {
8
+ "test": "jest -c jest.config.js"
9
+ },
10
+ "devDependencies": {
11
+ "@babel/cli": "^7.12.16",
12
+ "@babel/core": "^7.12.16",
13
+ "@babel/plugin-transform-runtime": "^7.12.15",
14
+ "@babel/preset-env": "^7.12.16",
15
+ "@testing-library/dom": "^7.29.4",
16
+ "@testing-library/jest-dom": "^5.11.9",
17
+ "jest": "^26.6.3",
18
+ "jest-fixtures": "^0.6.0"
19
+ }
4
20
  }
data/setupJest.js ADDED
@@ -0,0 +1,14 @@
1
+ import { JSDOM } from 'jsdom';
2
+ import $ from 'jquery';
3
+ const GeoBlacklight = require('./app/assets/javascripts/geoblacklight/geoblacklight');
4
+
5
+ const jsdom = new JSDOM('<html></html>', { pretendToBeVisual: true });
6
+ const { window } = jsdom;
7
+
8
+ global.GeoBlacklight = GeoBlacklight;
9
+ global.window = window;
10
+ global.jQuery = $;
11
+ global.$ = global.jQuery;
12
+
13
+ import * as L from 'leaflet.js.erb';
14
+ global.leaflet = L;
data/solr/conf/schema.xml CHANGED
@@ -143,13 +143,11 @@
143
143
  <fieldType name="location" class="solr.LatLonType" subFieldSuffix="_d"/>
144
144
 
145
145
  <fieldType name="location_rpt" class="solr.SpatialRecursivePrefixTreeFieldType"
146
- geo="true" distErrPct="0.025" maxDistErr="0.001" distanceUnits="kilometers"/>
146
+ geo="true" distErrPct="0.025" maxDistErr="0.001" distanceUnits="kilometers" />
147
147
  <!-- Adding field type for bboxField that enables, among other things, overlap ratio calculations -->
148
148
  <fieldType name="bbox" class="solr.BBoxField"
149
149
  geo="true" distanceUnits="kilometers" numberType="pdouble" />
150
150
  <fieldType name="pdouble" class="solr.DoublePointField" docValues="true"/>
151
-
152
-
153
151
  </types>
154
152
 
155
153
  <!-- for scoring formula -->
@@ -0,0 +1,14 @@
1
+ # frozen_string_literal: true
2
+ require 'spec_helper'
3
+
4
+ describe 'Config' do
5
+ it 'Loads new v3.3 Settings.FIELDS defaults' do
6
+ expect(Settings.FIELDS.IDENTIFIER).to eq 'dc_identifier_s'
7
+ expect(Settings.FIELDS.LANGUAGE).to eq 'dc_language_s'
8
+ expect(Settings.FIELDS.LAYER_MODIFIED).to eq 'layer_modified_dt'
9
+ expect(Settings.FIELDS.SOURCE).to eq 'dc_source_sm'
10
+ expect(Settings.FIELDS.SUPPRESSED).to eq 'suppressed_b'
11
+ expect(Settings.FIELDS.TYPE).to eq 'dc_type_s'
12
+ expect(Settings.FIELDS.UNIQUE_KEY).to eq 'layer_slug_s'
13
+ end
14
+ end