geoblacklight 4.7.0 → 5.0.0.pre.alpha.11
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 +4 -4
- data/.github/workflows/build-demo-app.yml +153 -0
- data/.github/workflows/prune-containers.yml +19 -0
- data/.github/workflows/ruby.yml +54 -55
- data/.gitignore +2 -2
- data/CONTRIBUTING.md +62 -44
- data/Gemfile +3 -27
- data/Rakefile +42 -67
- data/app/assets/images/blacklight/logo.svg +31 -1
- data/app/assets/stylesheets/geoblacklight/geoblacklight.scss +1 -2
- data/app/assets/stylesheets/geoblacklight/modules/_base.scss +1 -1
- data/app/assets/stylesheets/geoblacklight/modules/_blacklight_overrides.scss +24 -26
- data/app/assets/stylesheets/geoblacklight/modules/downloads.scss +13 -0
- data/app/assets/stylesheets/geoblacklight/modules/home.scss +2 -17
- data/app/assets/stylesheets/geoblacklight/modules/icon-customization.scss +48 -23
- data/app/assets/stylesheets/geoblacklight/modules/index_maps.scss +1 -15
- data/app/assets/stylesheets/geoblacklight/modules/item.scss +13 -11
- data/app/assets/stylesheets/geoblacklight/modules/layer_opacity.scss +3 -3
- data/app/assets/stylesheets/geoblacklight/modules/leaflet.scss +4 -0
- data/app/assets/stylesheets/geoblacklight/modules/modal.scss +0 -15
- data/app/assets/stylesheets/geoblacklight/modules/results.scss +10 -19
- data/app/assets/stylesheets/geoblacklight/modules/sidebar.scss +2 -2
- data/app/components/blacklight/icons/american_geographical_society_library_uwm_libraries_component.rb +46 -0
- data/app/components/blacklight/icons/arizona_component.rb +24 -0
- data/app/components/blacklight/icons/arrow_circle_down_component.rb +23 -0
- data/app/components/blacklight/icons/baruch_cuny_component.rb +23 -0
- data/app/components/blacklight/icons/book_component.rb +23 -0
- data/app/components/blacklight/icons/bookmark_component.rb +23 -0
- data/app/components/blacklight/icons/cd_rom_component.rb +23 -0
- data/app/components/blacklight/icons/child_item_component.rb +23 -0
- data/app/components/blacklight/icons/circle_info_solid_component.rb +23 -0
- data/app/components/blacklight/icons/citation_component.rb +23 -0
- data/app/components/blacklight/icons/collection_component.rb +23 -0
- data/app/components/blacklight/icons/collections_component.rb +24 -0
- data/app/components/blacklight/icons/columbia_component.rb +23 -0
- data/app/components/blacklight/icons/cornell_component.rb +25 -0
- data/app/components/blacklight/icons/datasets_component.rb +27 -0
- data/app/components/blacklight/icons/dvd_rom_component.rb +23 -0
- data/app/components/blacklight/icons/email_component.rb +23 -0
- data/app/components/blacklight/icons/esri_globe_component.rb +51 -0
- data/app/components/blacklight/icons/fire_solid_component.rb +23 -0
- data/app/components/blacklight/icons/george_mason_component.rb +24 -0
- data/app/components/blacklight/icons/globe_component.rb +23 -0
- data/app/components/blacklight/icons/harvard_component.rb +23 -0
- data/app/components/blacklight/icons/home_component.rb +23 -0
- data/app/components/blacklight/icons/iiif_drag_drop_component.rb +31 -0
- data/app/components/blacklight/icons/image_component.rb +23 -0
- data/app/components/blacklight/icons/imagery_component.rb +24 -0
- data/app/components/blacklight/icons/indiana_component.rb +23 -0
- data/app/components/blacklight/icons/leaf_component.rb +23 -0
- data/app/components/blacklight/icons/lewis_clark_component.rb +25 -0
- data/app/components/blacklight/icons/lightbulb_solid_component.rb +23 -0
- data/app/components/blacklight/icons/line_component.rb +24 -0
- data/app/components/blacklight/icons/map_component.rb +23 -0
- data/app/components/blacklight/icons/map_marker_component.rb +23 -0
- data/app/components/blacklight/icons/maps_component.rb +24 -0
- data/app/components/blacklight/icons/massgis_component.rb +23 -0
- data/app/components/blacklight/icons/metadata_component.rb +23 -0
- data/app/components/blacklight/icons/michigan_state_university_component.rb +25 -0
- data/app/components/blacklight/icons/mit_component.rb +23 -0
- data/app/components/blacklight/icons/mixed_component.rb +25 -0
- data/app/components/blacklight/icons/multilinestring_component.rb +26 -0
- data/app/components/blacklight/icons/multipoint_component.rb +23 -0
- data/app/components/blacklight/icons/multipolygon_component.rb +26 -0
- data/app/components/blacklight/icons/northwestern_university_component.rb +24 -0
- data/app/components/blacklight/icons/nyu_component.rb +26 -0
- data/app/components/blacklight/icons/pagelines_brands_component.rb +23 -0
- data/app/components/blacklight/icons/paper_map_component.rb +23 -0
- data/app/components/blacklight/icons/parent_item_component.rb +23 -0
- data/app/components/blacklight/icons/pennsylvania_state_university_component.rb +25 -0
- data/app/components/blacklight/icons/point_component.rb +23 -0
- data/app/components/blacklight/icons/polygon_component.rb +24 -0
- data/app/components/blacklight/icons/polyline_component.rb +26 -0
- data/app/components/blacklight/icons/princeton_component.rb +23 -0
- data/app/components/blacklight/icons/public_component.rb +23 -0
- data/app/components/blacklight/icons/purdue_university_component.rb +25 -0
- data/app/components/blacklight/icons/raster_component.rb +23 -0
- data/app/components/blacklight/icons/restricted_component.rb +23 -0
- data/app/components/blacklight/icons/rutgers_component.rb +25 -0
- data/app/components/blacklight/icons/sms_component.rb +23 -0
- data/app/components/blacklight/icons/stanford_component.rb +23 -0
- data/app/components/blacklight/icons/table_component.rb +23 -0
- data/app/components/blacklight/icons/tags_component.rb +23 -0
- data/app/components/blacklight/icons/texas_component.rb +23 -0
- data/app/components/blacklight/icons/the_ohio_state_university_component.rb +26 -0
- data/app/components/blacklight/icons/triangle_exclamation_solid_component.rb +23 -0
- data/app/components/blacklight/icons/tufts_component.rb +23 -0
- data/app/components/blacklight/icons/ucla_component.rb +23 -0
- data/app/components/blacklight/icons/university_of_california_berkeley_component.rb +24 -0
- data/app/components/blacklight/icons/university_of_chicago_component.rb +25 -0
- data/app/components/blacklight/icons/university_of_colorado_boulder_component.rb +26 -0
- data/app/components/blacklight/icons/university_of_illinois_urbana_champaign_component.rb +25 -0
- data/app/components/blacklight/icons/university_of_iowa_component.rb +24 -0
- data/app/components/blacklight/icons/university_of_maryland_component.rb +24 -0
- data/app/components/blacklight/icons/university_of_michigan_component.rb +24 -0
- data/app/components/blacklight/icons/university_of_minnesota_component.rb +24 -0
- data/app/components/blacklight/icons/university_of_nebraska_lincoln_component.rb +27 -0
- data/app/components/blacklight/icons/university_of_wisconsin_madison_component.rb +24 -0
- data/app/components/blacklight/icons/uva_component.rb +23 -0
- data/app/components/blacklight/icons/web_services_component.rb +23 -0
- data/app/components/blacklight/icons/websites_component.rb +24 -0
- data/app/components/geoblacklight/arcgis_component.html.erb +3 -0
- data/app/components/geoblacklight/arcgis_component.rb +25 -0
- data/app/components/geoblacklight/attribute_table_component.html.erb +17 -0
- data/app/components/geoblacklight/attribute_table_component.rb +17 -0
- data/app/components/geoblacklight/data_dictionary_download_component.html.erb +3 -0
- data/app/components/geoblacklight/data_dictionary_download_component.rb +16 -0
- data/app/components/geoblacklight/display_note_component.rb +1 -1
- data/app/components/geoblacklight/document/citation_component.html.erb +1 -0
- data/app/components/geoblacklight/document/citation_component.rb +19 -0
- data/app/components/geoblacklight/document/sidebar_component.html.erb +12 -0
- data/app/components/geoblacklight/document/sidebar_component.rb +8 -0
- data/app/components/geoblacklight/document_component.html.erb +43 -0
- data/app/components/geoblacklight/document_component.rb +6 -0
- data/app/components/geoblacklight/download_links_component.html.erb +31 -0
- data/app/components/geoblacklight/download_links_component.rb +80 -0
- data/app/components/geoblacklight/header_component.html.erb +14 -0
- data/app/components/geoblacklight/header_component.rb +9 -0
- data/app/components/geoblacklight/header_icons_component.html.erb +3 -0
- data/app/components/geoblacklight/header_icons_component.rb +29 -0
- data/app/components/geoblacklight/iiif_drag_drop_component.html.erb +3 -0
- data/app/components/geoblacklight/iiif_drag_drop_component.rb +16 -0
- data/app/components/geoblacklight/index_map_inspect_component.rb +15 -0
- data/app/components/geoblacklight/index_map_legend_component.html.erb +14 -0
- data/app/components/geoblacklight/index_map_legend_component.rb +17 -0
- data/app/components/geoblacklight/item_map_viewer_component.html.erb +1 -0
- data/app/components/geoblacklight/item_map_viewer_component.rb +87 -0
- data/app/components/geoblacklight/location_leaflet_map_component.html.erb +1 -0
- data/app/components/geoblacklight/location_leaflet_map_component.rb +49 -0
- data/app/components/geoblacklight/login_link_component.html.erb +5 -0
- data/app/components/geoblacklight/login_link_component.rb +17 -0
- data/app/components/geoblacklight/relations_component.html.erb +23 -0
- data/app/components/geoblacklight/relations_component.rb +25 -0
- data/app/components/geoblacklight/search_result_component.html.erb +44 -0
- data/app/components/geoblacklight/search_result_component.rb +28 -0
- data/app/components/geoblacklight/static_map_component.html.erb +9 -0
- data/app/components/geoblacklight/static_map_component.rb +36 -0
- data/app/components/geoblacklight/viewer_help_text_component.html.erb +1 -0
- data/app/components/geoblacklight/viewer_help_text_component.rb +46 -0
- data/app/components/geoblacklight/web_services_component.html.erb +1 -0
- data/app/components/geoblacklight/web_services_component.rb +26 -0
- data/app/{views/catalog/_web_services_default.html.erb → components/geoblacklight/web_services_default_component.html.erb} +3 -5
- data/app/components/geoblacklight/web_services_default_component.rb +11 -0
- data/app/components/geoblacklight/web_services_link_component.html.erb +3 -0
- data/app/components/geoblacklight/web_services_link_component.rb +22 -0
- data/app/{views/catalog/_web_services_wfs.html.erb → components/geoblacklight/web_services_wfs_component.html.erb} +4 -7
- data/app/components/geoblacklight/web_services_wfs_component.rb +12 -0
- data/app/components/geoblacklight/web_services_wms_component.html.erb +10 -0
- data/app/components/geoblacklight/web_services_wms_component.rb +12 -0
- data/app/controllers/download_controller.rb +8 -29
- data/app/controllers/relation_controller.rb +0 -1
- data/app/helpers/geoblacklight_helper.rb +10 -247
- data/app/javascript/geoblacklight/controllers/clipboard_controller.js +11 -0
- data/app/javascript/geoblacklight/controllers/clover_viewer_controller.js +47 -0
- data/app/javascript/geoblacklight/controllers/downloads_controller.js +56 -0
- data/app/javascript/geoblacklight/controllers/leaflet_viewer_controller.js +217 -0
- data/app/javascript/geoblacklight/controllers/oembed_viewer_controller.js +18 -0
- data/app/javascript/geoblacklight/controllers/openlayers_viewer_controller.js +63 -0
- data/app/javascript/geoblacklight/controllers/search_results_controller.js +50 -0
- data/app/javascript/geoblacklight/core.js +69 -0
- data/app/javascript/geoblacklight/index.js +29 -0
- data/app/javascript/geoblacklight/initializers/metadata_download.js +54 -0
- data/app/javascript/geoblacklight/initializers/popovers.js +11 -0
- data/app/javascript/geoblacklight/initializers/relations.js +40 -0
- data/app/javascript/geoblacklight/initializers/tooltips.js +55 -0
- data/app/javascript/geoblacklight/initializers/truncation.js +45 -0
- data/app/javascript/geoblacklight/leaflet/basemaps.js +74 -0
- data/app/javascript/geoblacklight/leaflet/constants.js +18 -0
- data/app/javascript/geoblacklight/leaflet/controls/geosearch.js +160 -0
- data/app/javascript/geoblacklight/leaflet/controls/layer_opacity.js +120 -0
- data/app/javascript/geoblacklight/leaflet/inspection.js +195 -0
- data/app/javascript/geoblacklight/leaflet/layer_index_map.js +120 -0
- data/app/javascript/geoblacklight/leaflet/layer_wmts.js +59 -0
- data/app/javascript/geoblacklight/leaflet/layers.js +153 -0
- data/app/javascript/geoblacklight/leaflet/utils.js +83 -0
- data/app/javascript/geoblacklight/openlayers/basemaps.js +47 -0
- data/app/javascript/geoblacklight/openlayers/layers.js +44 -0
- data/app/models/concerns/geoblacklight/solr_document/citation.rb +20 -15
- data/app/models/concerns/geoblacklight/solr_document/inspection.rb +1 -1
- data/app/models/concerns/geoblacklight/solr_document.rb +23 -59
- data/app/presenters/geoblacklight/bbox_item_presenter.rb +1 -1
- data/app/views/catalog/_citation.html.erb +16 -33
- data/app/views/catalog/_document_split.html.erb +18 -3
- data/app/views/catalog/_home_text.html.erb +2 -2
- data/app/views/catalog/_metadata.html.erb +1 -1
- data/app/views/catalog/index.html.erb +8 -4
- data/app/views/catalog/metadata/_markup.html.erb +1 -1
- data/app/views/catalog/metadata.html.erb +14 -13
- data/app/views/catalog/web_services.html.erb +19 -28
- data/app/views/relation/index.html.erb +2 -12
- data/app/views/relation/index.json.jbuilder +1 -1
- data/compose.yml +14 -0
- data/config/importmap.rb +20 -0
- data/config/locales/geoblacklight.en.yml +15 -24
- data/geoblacklight.gemspec +8 -8
- data/lib/generators/geoblacklight/assets/importmap_generator.rb +87 -0
- data/lib/generators/geoblacklight/assets/vite_generator.rb +90 -0
- data/lib/generators/geoblacklight/assets_generator.rb +12 -37
- data/lib/generators/geoblacklight/install_generator.rb +11 -63
- data/lib/generators/geoblacklight/templates/assets/_customizations.scss +13 -19
- data/lib/generators/geoblacklight/templates/assets/application.js +17 -0
- data/lib/generators/geoblacklight/templates/assets/application.scss +9 -4
- data/lib/generators/geoblacklight/templates/assets/geoblacklight.scss +11 -0
- data/lib/generators/geoblacklight/templates/base.html.erb +9 -12
- data/lib/generators/geoblacklight/templates/catalog_controller.rb +11 -18
- data/lib/generators/geoblacklight/templates/demo-app/Dockerfile +31 -0
- data/lib/generators/geoblacklight/templates/demo-app/compose.yml +26 -0
- data/lib/generators/geoblacklight/templates/demo-app/start-server.sh +21 -0
- data/lib/generators/geoblacklight/templates/package.json +7 -1
- data/lib/generators/geoblacklight/templates/settings.yml +45 -59
- data/lib/generators/geoblacklight/templates/vite.config.ts +22 -7
- data/lib/geoblacklight/bounding_box.rb +16 -0
- data/lib/geoblacklight/constants.rb +0 -1
- data/lib/geoblacklight/download/csv_download.rb +22 -0
- data/lib/geoblacklight/download/geojson_download.rb +1 -1
- data/lib/geoblacklight/download/geotiff_download.rb +1 -1
- data/lib/geoblacklight/download/kmz_download.rb +1 -1
- data/lib/geoblacklight/download/shapefile_download.rb +1 -1
- data/lib/geoblacklight/download.rb +1 -1
- data/lib/geoblacklight/engine.rb +15 -20
- data/lib/geoblacklight/geometry.rb +0 -7
- data/lib/geoblacklight/item_viewer.rb +1 -8
- data/lib/geoblacklight/metadata/base.rb +2 -1
- data/lib/geoblacklight/references.rb +27 -23
- data/lib/geoblacklight/routes/downloadable.rb +0 -1
- data/lib/geoblacklight/routes.rb +0 -3
- data/lib/geoblacklight/version.rb +1 -1
- data/lib/geoblacklight/wms_layer/feature_info_response.rb +9 -6
- data/lib/geoblacklight.rb +6 -47
- data/lib/tasks/geoblacklight.rake +24 -77
- data/package.json +22 -16
- data/solr/conf/schema.xml +15 -13
- data/solr/conf/solrconfig.xml +6 -4
- data/spec/components/blacklight/icons/american_geographical_society_library_uwm_libraries_component_spec.rb +15 -0
- data/spec/components/blacklight/icons/arizona_component_spec.rb +15 -0
- data/spec/components/blacklight/icons/arrow_circle_down_component_spec.rb +15 -0
- data/spec/components/blacklight/icons/baruch_cuny_component_spec.rb +15 -0
- data/spec/components/blacklight/icons/book_component_spec.rb +15 -0
- data/spec/components/blacklight/icons/bookmark_component_spec.rb +15 -0
- data/spec/components/blacklight/icons/cd_rom_component_spec.rb +15 -0
- data/spec/components/blacklight/icons/child_item_component_spec.rb +15 -0
- data/spec/components/blacklight/icons/circle_info_solid_component_spec.rb +15 -0
- data/spec/components/blacklight/icons/citation_component_spec.rb +15 -0
- data/spec/components/blacklight/icons/collection_component_spec.rb +15 -0
- data/spec/components/blacklight/icons/collections_component_spec.rb +15 -0
- data/spec/components/blacklight/icons/columbia_component_spec.rb +15 -0
- data/spec/components/blacklight/icons/cornell_component_spec.rb +15 -0
- data/spec/components/blacklight/icons/datasets_component_spec.rb +15 -0
- data/spec/components/blacklight/icons/dvd_rom_component_spec.rb +15 -0
- data/spec/components/blacklight/icons/email_component_spec.rb +15 -0
- data/spec/components/blacklight/icons/esri_globe_component_spec.rb +15 -0
- data/spec/components/blacklight/icons/fire_solid_component_spec.rb +15 -0
- data/spec/components/blacklight/icons/george_mason_component_spec.rb +15 -0
- data/spec/components/blacklight/icons/globe_component_spec.rb +15 -0
- data/spec/components/blacklight/icons/harvard_component_spec.rb +15 -0
- data/spec/components/blacklight/icons/home_component_spec.rb +15 -0
- data/spec/components/blacklight/icons/iiif_drag_drop_component_spec.rb +15 -0
- data/spec/components/blacklight/icons/image_component_spec.rb +15 -0
- data/spec/components/blacklight/icons/imagery_component_spec.rb +15 -0
- data/spec/components/blacklight/icons/indiana_component_spec.rb +15 -0
- data/spec/components/blacklight/icons/leaf_component_spec.rb +15 -0
- data/spec/components/blacklight/icons/lewis_clark_component_spec.rb +15 -0
- data/spec/components/blacklight/icons/lightbulb_solid_component_spec.rb +15 -0
- data/spec/components/blacklight/icons/line_component_spec.rb +15 -0
- data/spec/components/blacklight/icons/map_component_spec.rb +15 -0
- data/spec/components/blacklight/icons/map_marker_component_spec.rb +15 -0
- data/spec/components/blacklight/icons/maps_component_spec.rb +15 -0
- data/spec/components/blacklight/icons/massgis_component_spec.rb +15 -0
- data/spec/components/blacklight/icons/metadata_component_spec.rb +15 -0
- data/spec/components/blacklight/icons/michigan_state_university_component_spec.rb +15 -0
- data/spec/components/blacklight/icons/mit_component_spec.rb +15 -0
- data/spec/components/blacklight/icons/mixed_component_spec.rb +15 -0
- data/spec/components/blacklight/icons/multilinestring_component_spec.rb +15 -0
- data/spec/components/blacklight/icons/multipoint_component_spec.rb +15 -0
- data/spec/components/blacklight/icons/multipolygon_component_spec.rb +15 -0
- data/spec/components/blacklight/icons/northwestern_university_component_spec.rb +15 -0
- data/spec/components/blacklight/icons/nyu_component_spec.rb +15 -0
- data/spec/components/blacklight/icons/pagelines_brands_component_spec.rb +15 -0
- data/spec/components/blacklight/icons/paper_map_component_spec.rb +15 -0
- data/spec/components/blacklight/icons/parent_item_component_spec.rb +15 -0
- data/spec/components/blacklight/icons/pennsylvania_state_university_component_spec.rb +15 -0
- data/spec/components/blacklight/icons/point_component_spec.rb +15 -0
- data/spec/components/blacklight/icons/polygon_component_spec.rb +15 -0
- data/spec/components/blacklight/icons/polyline_component_spec.rb +15 -0
- data/spec/components/blacklight/icons/princeton_component_spec.rb +15 -0
- data/spec/components/blacklight/icons/public_component_spec.rb +15 -0
- data/spec/components/blacklight/icons/purdue_university_component_spec.rb +15 -0
- data/spec/components/blacklight/icons/raster_component_spec.rb +15 -0
- data/spec/components/blacklight/icons/restricted_component_spec.rb +15 -0
- data/spec/components/blacklight/icons/rutgers_component_spec.rb +15 -0
- data/spec/components/blacklight/icons/sms_component_spec.rb +15 -0
- data/spec/components/blacklight/icons/stanford_component_spec.rb +15 -0
- data/spec/components/blacklight/icons/table_component_spec.rb +15 -0
- data/spec/components/blacklight/icons/tags_component_spec.rb +15 -0
- data/spec/components/blacklight/icons/texas_component_spec.rb +15 -0
- data/spec/components/blacklight/icons/the_ohio_state_university_component_spec.rb +15 -0
- data/spec/components/blacklight/icons/triangle_exclamation_solid_component_spec.rb +15 -0
- data/spec/components/blacklight/icons/tufts_component_spec.rb +15 -0
- data/spec/components/blacklight/icons/ucla_component_spec.rb +15 -0
- data/spec/components/blacklight/icons/university_of_california_berkeley_component_spec.rb +15 -0
- data/spec/components/blacklight/icons/university_of_chicago_component_spec.rb +15 -0
- data/spec/components/blacklight/icons/university_of_colorado_boulder_component_spec.rb +15 -0
- data/spec/components/blacklight/icons/university_of_illinois_urbana_champaign_component_spec.rb +15 -0
- data/spec/components/blacklight/icons/university_of_iowa_component_spec.rb +15 -0
- data/spec/components/blacklight/icons/university_of_maryland_component_spec.rb +15 -0
- data/spec/components/blacklight/icons/university_of_michigan_component_spec.rb +15 -0
- data/spec/components/blacklight/icons/university_of_minnesota_component_spec.rb +15 -0
- data/spec/components/blacklight/icons/university_of_nebraska_lincoln_component_spec.rb +15 -0
- data/spec/components/blacklight/icons/university_of_wisconsin_madison_component_spec.rb +15 -0
- data/spec/components/blacklight/icons/uva_component_spec.rb +15 -0
- data/spec/components/blacklight/icons/web_services_component_spec.rb +15 -0
- data/spec/components/blacklight/icons/websites_component_spec.rb +15 -0
- data/spec/components/geoblacklight/arcgis_component_spec.rb +31 -0
- data/spec/components/geoblacklight/attribute_table_component_spec.rb +37 -0
- data/spec/components/geoblacklight/citation_component_spec.rb +37 -0
- data/spec/components/geoblacklight/document_component_spec.rb +92 -0
- data/spec/components/geoblacklight/download_links_component_spec.rb +102 -0
- data/spec/components/geoblacklight/header_icons_component_spec.rb +56 -0
- data/spec/components/geoblacklight/iiif_drag_drop_component_spec.rb +30 -0
- data/spec/components/geoblacklight/index_map_legend_component_spec.rb +42 -0
- data/spec/components/geoblacklight/item_map_viewer_component_spec.rb +36 -0
- data/spec/components/geoblacklight/login_link_component_spec.rb +33 -0
- data/spec/{lib/geoblacklight/document_presenter_spec.rb → components/geoblacklight/search_result_component_spec.rb} +19 -11
- data/spec/components/geoblacklight/static_map_component_spec.rb +22 -0
- data/spec/components/geoblacklight/viewer_help_text_component_spec.rb +28 -0
- data/spec/components/geoblacklight/web_services_component_spec.rb +45 -0
- data/spec/controllers/download_controller_spec.rb +12 -35
- data/spec/features/axe_spec.rb +66 -0
- data/spec/features/bookmarks_spec.rb +1 -1
- data/spec/features/citations_spec.rb +7 -3
- data/spec/features/configurable_basemap_spec.rb +0 -56
- data/spec/features/download_layer_spec.rb +24 -39
- data/spec/features/esri_viewer_spec.rb +1 -1
- data/spec/features/exports_spec.rb +0 -15
- data/spec/features/{full_screen_controll_spec.rb → full_screen_control_spec.rb} +6 -6
- data/spec/features/home_page_spec.rb +12 -7
- data/spec/features/iiif_viewer_spec.rb +1 -1
- data/spec/features/index_map_spec.rb +16 -9
- data/spec/features/{split_view.html.erb_spec.rb → index_view_spec.rb} +15 -13
- data/spec/features/layer_inspection_spec.rb +2 -2
- data/spec/features/layer_preview_spec.rb +1 -1
- data/spec/features/missing_metadata_spec.rb +5 -5
- data/spec/features/oembed_spec.rb +2 -2
- data/spec/features/saved_searches_spec.rb +4 -1
- data/spec/features/search_results_complex_geometry_spec.rb +2 -2
- data/spec/features/search_results_icons_spec.rb +3 -3
- data/spec/features/search_results_map_spec.rb +4 -36
- data/spec/features/search_results_overlap_ratio_spec.rb +1 -1
- data/spec/features/show_page_download_spec.rb +0 -8
- data/spec/features/tilejson_spec.rb +2 -2
- data/spec/features/web_services_modal_spec.rb +57 -39
- data/spec/features/wmts_spec.rb +4 -4
- data/spec/fixtures/solr_documents/README.md +2 -1
- data/spec/fixtures/solr_documents/complex-geom.json +61 -0
- data/spec/fixtures/solr_documents/esri-tiled_map_layer.json +45 -24
- data/spec/fixtures/solr_documents/harvard_raster.json +1 -1
- data/spec/fixtures/solr_documents/multiple-downloads.json +1 -0
- data/spec/helpers/geoblacklight_helper_spec.rb +8 -173
- data/spec/lib/geoblacklight/download/csv_download_spec.rb +21 -0
- data/spec/lib/geoblacklight/geometry_spec.rb +0 -15
- data/spec/lib/geoblacklight/reference_spec.rb +17 -19
- data/spec/lib/geoblacklight/references_spec.rb +30 -40
- data/spec/lib/geoblacklight/wms_layer/feature_info_response_spec.rb +8 -6
- data/spec/lib/geoblacklight/wms_layer_spec.rb +14 -0
- data/spec/models/concerns/geoblacklight/solr_document/citation_spec.rb +1 -17
- data/spec/models/concerns/geoblacklight/solr_document_spec.rb +1 -69
- data/spec/spec_helper.rb +2 -31
- data/spec/test_app_templates/lib/generators/test_app_generator.rb +4 -4
- data/template.rb +13 -11
- data/test/leaflet/layers.test.js +17 -0
- data/vite.config.ts +34 -23
- metadata +315 -273
- data/.hound.yml +0 -8
- data/.jshintignore +0 -2
- data/.jshintrc +0 -67
- data/.solr_wrapper +0 -7
- data/app/assets/images/blacklight/american-geographical-society-library-uwm-libraries.svg +0 -26
- data/app/assets/images/blacklight/arrow-circle-down.svg +0 -3
- data/app/assets/images/blacklight/baruch-cuny.svg +0 -3
- data/app/assets/images/blacklight/book.svg +0 -3
- data/app/assets/images/blacklight/bookmark.svg +0 -3
- data/app/assets/images/blacklight/cd-rom.svg +0 -3
- data/app/assets/images/blacklight/chicago.svg +0 -4
- data/app/assets/images/blacklight/child-item.svg +0 -3
- data/app/assets/images/blacklight/circle-info-solid.svg +0 -1
- data/app/assets/images/blacklight/citation.svg +0 -3
- data/app/assets/images/blacklight/collection.svg +0 -3
- data/app/assets/images/blacklight/collections.svg +0 -4
- data/app/assets/images/blacklight/columbia.svg +0 -3
- data/app/assets/images/blacklight/cornell.svg +0 -5
- data/app/assets/images/blacklight/datasets.svg +0 -7
- data/app/assets/images/blacklight/dvd-rom.svg +0 -3
- data/app/assets/images/blacklight/email.svg +0 -3
- data/app/assets/images/blacklight/esri-globe.svg +0 -31
- data/app/assets/images/blacklight/fire-solid.svg +0 -1
- data/app/assets/images/blacklight/geoblacklight-icons.json +0 -3312
- data/app/assets/images/blacklight/george-mason.svg +0 -4
- data/app/assets/images/blacklight/globe.svg +0 -3
- data/app/assets/images/blacklight/harvard.svg +0 -3
- data/app/assets/images/blacklight/home.svg +0 -3
- data/app/assets/images/blacklight/illinois.svg +0 -4
- data/app/assets/images/blacklight/image.svg +0 -3
- data/app/assets/images/blacklight/imagery.svg +0 -4
- data/app/assets/images/blacklight/indiana.svg +0 -3
- data/app/assets/images/blacklight/iowa.svg +0 -3
- data/app/assets/images/blacklight/leaf.svg +0 -3
- data/app/assets/images/blacklight/lewis-clark.svg +0 -5
- data/app/assets/images/blacklight/lightbulb-solid.svg +0 -1
- data/app/assets/images/blacklight/line.svg +0 -4
- data/app/assets/images/blacklight/map-marker.svg +0 -3
- data/app/assets/images/blacklight/map.svg +0 -3
- data/app/assets/images/blacklight/maps.svg +0 -4
- data/app/assets/images/blacklight/maryland.svg +0 -3
- data/app/assets/images/blacklight/massgis.svg +0 -3
- data/app/assets/images/blacklight/metadata.svg +0 -3
- data/app/assets/images/blacklight/michigan-state-university.svg +0 -5
- data/app/assets/images/blacklight/michigan-state.svg +0 -4
- data/app/assets/images/blacklight/michigan.svg +0 -3
- data/app/assets/images/blacklight/minnesota.svg +0 -3
- data/app/assets/images/blacklight/mit.svg +0 -3
- data/app/assets/images/blacklight/mixed.svg +0 -5
- data/app/assets/images/blacklight/multilinestring.svg +0 -6
- data/app/assets/images/blacklight/multipoint.svg +0 -3
- data/app/assets/images/blacklight/multipolygon.svg +0 -6
- data/app/assets/images/blacklight/nebraska.svg +0 -4
- data/app/assets/images/blacklight/northwestern-university.svg +0 -5
- data/app/assets/images/blacklight/nyu.svg +0 -6
- data/app/assets/images/blacklight/ohio-state.svg +0 -5
- data/app/assets/images/blacklight/pagelines-brands.svg +0 -3
- data/app/assets/images/blacklight/paper-map.svg +0 -3
- data/app/assets/images/blacklight/parent-item.svg +0 -3
- data/app/assets/images/blacklight/penn-state.svg +0 -4
- data/app/assets/images/blacklight/pennsylvania-state-university.svg +0 -5
- data/app/assets/images/blacklight/point.svg +0 -3
- data/app/assets/images/blacklight/polygon.svg +0 -4
- data/app/assets/images/blacklight/polyline.svg +0 -6
- data/app/assets/images/blacklight/princeton.svg +0 -3
- data/app/assets/images/blacklight/public.svg +0 -3
- data/app/assets/images/blacklight/purdue-university.svg +0 -5
- data/app/assets/images/blacklight/purdue.svg +0 -4
- data/app/assets/images/blacklight/raster.svg +0 -3
- data/app/assets/images/blacklight/restricted.svg +0 -3
- data/app/assets/images/blacklight/rutgers.svg +0 -5
- data/app/assets/images/blacklight/search.svg +0 -5
- data/app/assets/images/blacklight/sms.svg +0 -3
- data/app/assets/images/blacklight/stanford.svg +0 -3
- data/app/assets/images/blacklight/table.svg +0 -3
- data/app/assets/images/blacklight/tags.svg +0 -3
- data/app/assets/images/blacklight/texas.svg +0 -3
- data/app/assets/images/blacklight/the-ohio-state-university.svg +0 -6
- data/app/assets/images/blacklight/triangle-exclamation-solid.svg +0 -1
- data/app/assets/images/blacklight/tufts.svg +0 -3
- data/app/assets/images/blacklight/ucla.svg +0 -3
- data/app/assets/images/blacklight/university-of-arizona.svg +0 -4
- data/app/assets/images/blacklight/university-of-california-berkeley.svg +0 -4
- data/app/assets/images/blacklight/university-of-chicago.svg +0 -5
- data/app/assets/images/blacklight/university-of-colorado-boulder.svg +0 -6
- data/app/assets/images/blacklight/university-of-illinois-urbana-champaign.svg +0 -5
- data/app/assets/images/blacklight/university-of-iowa.svg +0 -4
- data/app/assets/images/blacklight/university-of-maryland.svg +0 -4
- data/app/assets/images/blacklight/university-of-michigan.svg +0 -4
- data/app/assets/images/blacklight/university-of-minnesota.svg +0 -4
- data/app/assets/images/blacklight/university-of-nebraska-lincoln.svg +0 -7
- data/app/assets/images/blacklight/university-of-wisconsin-madison.svg +0 -4
- data/app/assets/images/blacklight/uva.svg +0 -3
- data/app/assets/images/blacklight/web_services.svg +0 -3
- data/app/assets/images/blacklight/websites.svg +0 -4
- data/app/assets/images/blacklight/wisconsin.svg +0 -3
- data/app/assets/javascripts/geoblacklight/basemaps.js +0 -63
- data/app/assets/javascripts/geoblacklight/controls/fullscreen.js +0 -8
- data/app/assets/javascripts/geoblacklight/controls/opacity.js +0 -6
- data/app/assets/javascripts/geoblacklight/controls.js +0 -1
- data/app/assets/javascripts/geoblacklight/downloaders/downloader.js +0 -61
- data/app/assets/javascripts/geoblacklight/downloaders/hgl_downloader.js +0 -32
- data/app/assets/javascripts/geoblacklight/downloaders.js +0 -1
- data/app/assets/javascripts/geoblacklight/geoblacklight.js +0 -60
- data/app/assets/javascripts/geoblacklight/modules/bookmarks.js +0 -43
- data/app/assets/javascripts/geoblacklight/modules/download.js +0 -11
- data/app/assets/javascripts/geoblacklight/modules/geosearch.js +0 -133
- data/app/assets/javascripts/geoblacklight/modules/help_text.js +0 -7
- data/app/assets/javascripts/geoblacklight/modules/home.js +0 -16
- data/app/assets/javascripts/geoblacklight/modules/item.js +0 -32
- data/app/assets/javascripts/geoblacklight/modules/layer_opacity.js +0 -68
- data/app/assets/javascripts/geoblacklight/modules/metadata.js +0 -15
- data/app/assets/javascripts/geoblacklight/modules/metadata_download_button.js +0 -58
- data/app/assets/javascripts/geoblacklight/modules/relations.js +0 -14
- data/app/assets/javascripts/geoblacklight/modules/results.js +0 -81
- data/app/assets/javascripts/geoblacklight/modules/svg_tooltips.js +0 -31
- data/app/assets/javascripts/geoblacklight/modules/util.js +0 -48
- data/app/assets/javascripts/geoblacklight/modules.js +0 -1
- data/app/assets/javascripts/geoblacklight/templates/index_map_download.hbs +0 -19
- data/app/assets/javascripts/geoblacklight/templates/index_map_info.hbs +0 -61
- data/app/assets/javascripts/geoblacklight/viewers/cog.js +0 -5
- data/app/assets/javascripts/geoblacklight/viewers/esri/dynamic_map_layer.js +0 -85
- data/app/assets/javascripts/geoblacklight/viewers/esri/feature_layer.js +0 -76
- data/app/assets/javascripts/geoblacklight/viewers/esri/image_map_layer.js +0 -14
- data/app/assets/javascripts/geoblacklight/viewers/esri/tiled_map_layer.js +0 -50
- data/app/assets/javascripts/geoblacklight/viewers/esri.js +0 -78
- data/app/assets/javascripts/geoblacklight/viewers/iiif.js +0 -25
- data/app/assets/javascripts/geoblacklight/viewers/index_map.js +0 -71
- data/app/assets/javascripts/geoblacklight/viewers/map.js +0 -94
- data/app/assets/javascripts/geoblacklight/viewers/oembed.js +0 -13
- data/app/assets/javascripts/geoblacklight/viewers/pmtiles.js +0 -5
- data/app/assets/javascripts/geoblacklight/viewers/tilejson.js +0 -33
- data/app/assets/javascripts/geoblacklight/viewers/tms.js +0 -10
- data/app/assets/javascripts/geoblacklight/viewers/viewer.js +0 -68
- data/app/assets/javascripts/geoblacklight/viewers/wms.js +0 -74
- data/app/assets/javascripts/geoblacklight/viewers/wmts.js +0 -85
- data/app/assets/javascripts/geoblacklight/viewers/xyz.js +0 -10
- data/app/assets/javascripts/geoblacklight/viewers.js +0 -1
- data/app/assets/stylesheets/geoblacklight/modules/mixins.scss +0 -5
- data/app/helpers/arcgis_helper.rb +0 -17
- data/app/helpers/blacklight_helper.rb +0 -15
- data/app/helpers/carto_helper.rb +0 -36
- data/app/helpers/geoblacklight/geoblacklight_helper_behavior.rb +0 -24
- data/app/javascript/clover/clover_initializer.js +0 -29
- data/app/javascript/index.js +0 -7
- data/app/javascript/openlayers/basemaps.js +0 -27
- data/app/javascript/openlayers/ol_initializer.js +0 -131
- data/app/javascript/stylesheets/openlayers.css +0 -1
- data/app/models/concerns/geoblacklight/solr_document/carto.rb +0 -24
- data/app/presenters/geoblacklight/document_presenter.rb +0 -34
- data/app/views/catalog/_arcgis.html.erb +0 -4
- data/app/views/catalog/_carto.html.erb +0 -4
- data/app/views/catalog/_data_dictionary.html.erb +0 -5
- data/app/views/catalog/_downloads_collapse.html.erb +0 -30
- data/app/views/catalog/_header_icons.html.erb +0 -3
- data/app/views/catalog/_index_split_default.html.erb +0 -30
- data/app/views/catalog/_results_pagination.html.erb +0 -12
- data/app/views/catalog/_show_default_attribute_table.html.erb +0 -19
- data/app/views/catalog/_show_default_display_note.html.erb +0 -7
- data/app/views/catalog/_show_default_viewer_container.html.erb +0 -28
- data/app/views/catalog/_show_downloads.html.erb +0 -26
- data/app/views/catalog/_show_header_default.html.erb +0 -4
- data/app/views/catalog/_show_sidebar.html.erb +0 -16
- data/app/views/catalog/_show_sidebar_static_map.html.erb +0 -13
- data/app/views/catalog/_show_web_services.html.erb +0 -11
- data/app/views/catalog/_web_services.html.erb +0 -9
- data/app/views/catalog/_web_services_wms.html.erb +0 -13
- data/app/views/download/hgl.html.erb +0 -27
- data/app/views/relation/_relations.html.erb +0 -15
- data/app/views/shared/_header_navbar.html.erb +0 -46
- data/babel.config.json +0 -4
- data/jest.config.js +0 -25
- data/lib/generators/geoblacklight/templates/assets/_blacklight.scss +0 -1
- data/lib/generators/geoblacklight/templates/assets/_geoblacklight.scss +0 -1
- data/lib/generators/geoblacklight/templates/assets/geoblacklight.js +0 -9
- data/lib/generators/geoblacklight/templates/clover.js +0 -5
- data/lib/generators/geoblacklight/templates/ol.js +0 -6
- data/lib/generators/geoblacklight/templates/package-test.json +0 -10
- data/lib/generators/geoblacklight/templates/settings.gbl_v1.yml +0 -195
- data/lib/geoblacklight/deprecated_configuration.rb +0 -519
- data/lib/geoblacklight/download/hgl_download.rb +0 -25
- data/lib/geoblacklight/view_helper_override.rb +0 -27
- data/setupJest.js +0 -14
- data/spec/helpers/arcgis_helper_spec.rb +0 -16
- data/spec/helpers/carto_helper_spec.rb +0 -13
- data/spec/helpers/geoblacklight/geoblacklight_helper_behavior_spec.rb +0 -27
- data/spec/javascripts/util_spec.js +0 -10
- data/spec/lib/geoblacklight/deprecated_configuration_spec.rb +0 -597
- data/spec/lib/geoblacklight/download/hgl_download_spec.rb +0 -62
- data/spec/lib/geoblacklight/view_helper_override_spec.rb +0 -30
- data/spec/models/concerns/geoblacklight/solr_document/carto_spec.rb +0 -43
- data/spec/test_app_templates/Gemfile.extra +0 -2
- data/spec/views/catalog/_document_split.html.erb_spec.rb +0 -7
- data/spec/views/catalog/_index_split.html.erb_spec.rb +0 -7
- data/spec/views/catalog/_results_pagination.html.erb_spec.rb +0 -11
- data/spec/views/catalog/_show_downloads.html.erb_spec.rb +0 -43
- data/spec/views/catalog/_show_tools.html.erb_spec.rb +0 -38
- data/vendor/assets/images/fullscreen.png +0 -0
- data/vendor/assets/images/fullscreen@2x.png +0 -0
- data/vendor/assets/images/layers-2x.png +0 -0
- data/vendor/assets/images/layers.png +0 -0
- data/vendor/assets/images/marker-icon-2x.png +0 -0
- data/vendor/assets/images/marker-icon.png +0 -0
- data/vendor/assets/images/marker-shadow.png +0 -0
- data/vendor/assets/javascripts/Leaflet.fullscreen.js +0 -152
- data/vendor/assets/javascripts/esri-leaflet.js +0 -12
- data/vendor/assets/javascripts/esri-leaflet.js.map +0 -1
- data/vendor/assets/javascripts/leaflet-iiif.js +0 -323
- data/vendor/assets/javascripts/leaflet-src.js.erb +0 -14126
- data/vendor/assets/javascripts/leaflet-src.js.map +0 -1
- data/vendor/assets/javascripts/native.history.js +0 -1
- data/vendor/assets/stylesheets/leaflet.css +0 -640
- data/vendor/assets/stylesheets/leaflet.fullscreen.css +0 -40
- /data/app/{views/catalog/_show_default_viewer_information.html.erb → components/geoblacklight/index_map_inspect_component.html.erb} +0 -0
|
@@ -1,597 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
require "spec_helper"
|
|
4
|
-
|
|
5
|
-
describe Geoblacklight::DeprecatedConfiguration do
|
|
6
|
-
let(:root) { Pathname.new(Dir.mktmpdir) }
|
|
7
|
-
|
|
8
|
-
after { FileUtils.remove_entry(root) }
|
|
9
|
-
|
|
10
|
-
def write_view(path, contents = "")
|
|
11
|
-
full = root.join("app", "views", path)
|
|
12
|
-
FileUtils.mkdir_p(full.dirname)
|
|
13
|
-
File.write(full, contents)
|
|
14
|
-
full.to_s
|
|
15
|
-
end
|
|
16
|
-
|
|
17
|
-
describe ".warn_about_templates" do
|
|
18
|
-
it "warns about an overridden template, naming the file and its replacement" do
|
|
19
|
-
write_view("catalog/_show_sidebar.html.erb")
|
|
20
|
-
|
|
21
|
-
expect(Geoblacklight.deprecation).to receive(:warn).with(
|
|
22
|
-
"app/views/catalog/_show_sidebar.html.erb overrides catalog/_show_sidebar, which is " \
|
|
23
|
-
"removed in GeoBlacklight 5; use Geoblacklight::Document::SidebarComponent instead"
|
|
24
|
-
)
|
|
25
|
-
|
|
26
|
-
described_class.warn_about_templates(root)
|
|
27
|
-
end
|
|
28
|
-
|
|
29
|
-
it "warns about a template with no replacement" do
|
|
30
|
-
write_view("catalog/_show_default_viewer_information.html.erb")
|
|
31
|
-
|
|
32
|
-
expect(Geoblacklight.deprecation).to receive(:warn).with(/it is removed without replacement/)
|
|
33
|
-
|
|
34
|
-
described_class.warn_about_templates(root)
|
|
35
|
-
end
|
|
36
|
-
|
|
37
|
-
# The masthead moves to a component, and Blacklight has no shared/_header_navbar
|
|
38
|
-
# of its own, so there is no upstream copy for an application to override.
|
|
39
|
-
it "points the site masthead at config.header_component" do
|
|
40
|
-
write_view("shared/_header_navbar.html.erb")
|
|
41
|
-
|
|
42
|
-
expect(Geoblacklight.deprecation).to receive(:warn).with(
|
|
43
|
-
"app/views/shared/_header_navbar.html.erb overrides shared/_header_navbar, which is " \
|
|
44
|
-
"removed in GeoBlacklight 5; set config.header_component to a subclass of " \
|
|
45
|
-
"Geoblacklight::HeaderComponent instead"
|
|
46
|
-
)
|
|
47
|
-
|
|
48
|
-
described_class.warn_about_templates(root)
|
|
49
|
-
end
|
|
50
|
-
|
|
51
|
-
# Geoblacklight::HeaderComponent is the site masthead; this partial is the
|
|
52
|
-
# document heading, which GeoBlacklight 5 renders from a slot instead.
|
|
53
|
-
it "points the document heading at the DocumentComponent title slot" do
|
|
54
|
-
write_view("catalog/_show_header_default.html.erb")
|
|
55
|
-
|
|
56
|
-
expect(Geoblacklight.deprecation).to receive(:warn).with(
|
|
57
|
-
/use the title slot of Geoblacklight::DocumentComponent instead/
|
|
58
|
-
)
|
|
59
|
-
|
|
60
|
-
described_class.warn_about_templates(root)
|
|
61
|
-
end
|
|
62
|
-
|
|
63
|
-
# The partial's only job is to render a DisplayNoteComponent per note, and that
|
|
64
|
-
# component still exists, so it is the unit an application should override.
|
|
65
|
-
it "points the display note at the component the partial already rendered" do
|
|
66
|
-
write_view("catalog/_show_default_display_note.html.erb")
|
|
67
|
-
|
|
68
|
-
expect(Geoblacklight.deprecation).to receive(:warn).with(
|
|
69
|
-
/use Geoblacklight::DisplayNoteComponent instead/
|
|
70
|
-
)
|
|
71
|
-
|
|
72
|
-
described_class.warn_about_templates(root)
|
|
73
|
-
end
|
|
74
|
-
|
|
75
|
-
it "does not warn when the application has no overrides" do
|
|
76
|
-
expect(Geoblacklight.deprecation).not_to receive(:warn)
|
|
77
|
-
|
|
78
|
-
described_class.warn_about_templates(root)
|
|
79
|
-
end
|
|
80
|
-
|
|
81
|
-
it "does not warn about templates GeoBlacklight 5 keeps" do
|
|
82
|
-
write_view("catalog/_home_text.html.erb")
|
|
83
|
-
|
|
84
|
-
expect(Geoblacklight.deprecation).not_to receive(:warn)
|
|
85
|
-
|
|
86
|
-
described_class.warn_about_templates(root)
|
|
87
|
-
end
|
|
88
|
-
|
|
89
|
-
it "does not mistake a similarly named template for an override" do
|
|
90
|
-
write_view("catalog/_show_sidebar_extra.html.erb")
|
|
91
|
-
|
|
92
|
-
expect(Geoblacklight.deprecation).not_to receive(:warn)
|
|
93
|
-
|
|
94
|
-
described_class.warn_about_templates(root)
|
|
95
|
-
end
|
|
96
|
-
|
|
97
|
-
it "finds overrides regardless of template handler" do
|
|
98
|
-
write_view("relation/_relations.html.haml")
|
|
99
|
-
|
|
100
|
-
expect(Geoblacklight.deprecation).to receive(:warn).with(
|
|
101
|
-
/_relations\.html\.haml overrides relation\/_relations/
|
|
102
|
-
)
|
|
103
|
-
|
|
104
|
-
described_class.warn_about_templates(root)
|
|
105
|
-
end
|
|
106
|
-
end
|
|
107
|
-
|
|
108
|
-
describe ".warn_about_locale_keys" do
|
|
109
|
-
def write_locale(contents, name: "geoblacklight.en.yml")
|
|
110
|
-
full = root.join("config", "locales", name)
|
|
111
|
-
FileUtils.mkdir_p(full.dirname)
|
|
112
|
-
File.write(full, contents)
|
|
113
|
-
end
|
|
114
|
-
|
|
115
|
-
it "warns about a translation GeoBlacklight 5 stops looking up" do
|
|
116
|
-
write_locale(<<~YAML)
|
|
117
|
-
en:
|
|
118
|
-
geoblacklight:
|
|
119
|
-
citation:
|
|
120
|
-
retrieved_from: "Downloaded from %{document_url}"
|
|
121
|
-
YAML
|
|
122
|
-
|
|
123
|
-
expect(Geoblacklight.deprecation).to receive(:warn).with(
|
|
124
|
-
"config/locales/geoblacklight.en.yml defines geoblacklight.citation.retrieved_from, which " \
|
|
125
|
-
"GeoBlacklight 5 no longer looks up; GeoBlacklight 5 ends a citation with the document's " \
|
|
126
|
-
"identifier URL, its schema.org/url reference or the catalog URL, rather than with a translated suffix"
|
|
127
|
-
)
|
|
128
|
-
|
|
129
|
-
described_class.warn_about_locale_keys(root)
|
|
130
|
-
end
|
|
131
|
-
|
|
132
|
-
it "names the replacement key for a renamed provider icon" do
|
|
133
|
-
write_locale("en:\n blacklight:\n icon:\n chicago: The University of Chicago\n")
|
|
134
|
-
|
|
135
|
-
expect(Geoblacklight.deprecation).to receive(:warn).with(
|
|
136
|
-
/blacklight\.icon\.chicago.*looks up blacklight\.icon\.university-of-chicago instead/
|
|
137
|
-
)
|
|
138
|
-
|
|
139
|
-
described_class.warn_about_locale_keys(root)
|
|
140
|
-
end
|
|
141
|
-
|
|
142
|
-
it "matches a translation into any locale, not just English" do
|
|
143
|
-
write_locale("de:\n geoblacklight:\n tools:\n open_carto: In Carto oeffnen\n")
|
|
144
|
-
|
|
145
|
-
expect(Geoblacklight.deprecation).to receive(:warn).with(/defines geoblacklight\.tools\.open_carto/)
|
|
146
|
-
|
|
147
|
-
described_class.warn_about_locale_keys(root)
|
|
148
|
-
end
|
|
149
|
-
|
|
150
|
-
it "does not warn about translations GeoBlacklight 5 keeps" do
|
|
151
|
-
write_locale("en:\n geoblacklight:\n home:\n title: My Portal\n")
|
|
152
|
-
|
|
153
|
-
expect(Geoblacklight.deprecation).not_to receive(:warn)
|
|
154
|
-
|
|
155
|
-
described_class.warn_about_locale_keys(root)
|
|
156
|
-
end
|
|
157
|
-
|
|
158
|
-
it "does not warn when the application has no locale files of its own" do
|
|
159
|
-
expect(Geoblacklight.deprecation).not_to receive(:warn)
|
|
160
|
-
|
|
161
|
-
described_class.warn_about_locale_keys(root)
|
|
162
|
-
end
|
|
163
|
-
|
|
164
|
-
it "ignores a locale file it cannot parse" do
|
|
165
|
-
write_locale("en:\n geoblacklight:\n : not valid: [\n")
|
|
166
|
-
|
|
167
|
-
expect(Geoblacklight.deprecation).not_to receive(:warn)
|
|
168
|
-
expect { described_class.warn_about_locale_keys(root) }.not_to raise_error
|
|
169
|
-
end
|
|
170
|
-
|
|
171
|
-
it "ignores a locale file that is not a mapping" do
|
|
172
|
-
write_locale("--- just a string\n")
|
|
173
|
-
|
|
174
|
-
expect(Geoblacklight.deprecation).not_to receive(:warn)
|
|
175
|
-
|
|
176
|
-
described_class.warn_about_locale_keys(root)
|
|
177
|
-
end
|
|
178
|
-
end
|
|
179
|
-
|
|
180
|
-
describe ".warn_about_jquery_animations" do
|
|
181
|
-
it "warns about the line the 4.x install generator injected" do
|
|
182
|
-
write_view("layouts/application.html.erb",
|
|
183
|
-
"<head>\n <%= javascript_tag '$.fx.off = true;' if Rails.env.test? %>\n</head>")
|
|
184
|
-
|
|
185
|
-
expect(Geoblacklight.deprecation).to receive(:warn).with(
|
|
186
|
-
"app/views/layouts/application.html.erb turns jQuery animations off with $.fx.off, which the " \
|
|
187
|
-
"GeoBlacklight 4 install generator added; GeoBlacklight 5 does not ship jQuery, so remove that " \
|
|
188
|
-
'javascript_tag line or the test environment raises "$ is not defined"'
|
|
189
|
-
)
|
|
190
|
-
|
|
191
|
-
described_class.warn_about_jquery_animations(root)
|
|
192
|
-
end
|
|
193
|
-
|
|
194
|
-
it "finds the line in any layout, not just the application layout" do
|
|
195
|
-
write_view("layouts/blacklight/base.html.erb", "<%= javascript_tag '$.fx.off = true;' %>")
|
|
196
|
-
|
|
197
|
-
expect(Geoblacklight.deprecation).to receive(:warn).with(
|
|
198
|
-
%r{layouts/blacklight/base\.html\.erb turns jQuery animations off}
|
|
199
|
-
)
|
|
200
|
-
|
|
201
|
-
described_class.warn_about_jquery_animations(root)
|
|
202
|
-
end
|
|
203
|
-
|
|
204
|
-
it "does not warn about a layout that does not mention jQuery" do
|
|
205
|
-
write_view("layouts/application.html.erb", "<head><%= csrf_meta_tags %></head>")
|
|
206
|
-
|
|
207
|
-
expect(Geoblacklight.deprecation).not_to receive(:warn)
|
|
208
|
-
|
|
209
|
-
described_class.warn_about_jquery_animations(root)
|
|
210
|
-
end
|
|
211
|
-
|
|
212
|
-
it "does not warn when the application has no layouts" do
|
|
213
|
-
expect(Geoblacklight.deprecation).not_to receive(:warn)
|
|
214
|
-
|
|
215
|
-
described_class.warn_about_jquery_animations(root)
|
|
216
|
-
end
|
|
217
|
-
|
|
218
|
-
it "never lets an unreadable layout stop the application booting" do
|
|
219
|
-
layout = write_view("layouts/application.html.erb", "<%= javascript_tag '$.fx.off = true;' %>")
|
|
220
|
-
allow(File).to receive(:read).and_call_original
|
|
221
|
-
allow(File).to receive(:read).with(layout).and_raise(Errno::EACCES)
|
|
222
|
-
|
|
223
|
-
expect(Geoblacklight.deprecation).not_to receive(:warn)
|
|
224
|
-
|
|
225
|
-
expect { described_class.warn_about_jquery_animations(root) }.not_to raise_error
|
|
226
|
-
end
|
|
227
|
-
end
|
|
228
|
-
|
|
229
|
-
describe ".warn_about_relationship_keys" do
|
|
230
|
-
it "names the stale keys and their replacements in a single warning" do
|
|
231
|
-
allow(described_class).to receive(:setting_present?).and_return(false)
|
|
232
|
-
allow(described_class).to receive(:setting_present?).with("RELATIONSHIPS_SHOWN.MEMBER_OF").and_return(true)
|
|
233
|
-
allow(described_class).to receive(:setting_present?).with("RELATIONSHIPS_SHOWN.REPLACED_BY").and_return(true)
|
|
234
|
-
|
|
235
|
-
expect(Geoblacklight.deprecation).to receive(:warn).once.with(
|
|
236
|
-
/Settings\.RELATIONSHIPS_SHOWN defines MEMBER_OF, REPLACED_BY, which GeoBlacklight 4\.1 replaced/
|
|
237
|
-
)
|
|
238
|
-
|
|
239
|
-
described_class.warn_about_relationship_keys
|
|
240
|
-
end
|
|
241
|
-
|
|
242
|
-
it "maps REPLACED_BY onto REPLACES_DESCENDANTS rather than a key of its own" do
|
|
243
|
-
allow(described_class).to receive(:setting_present?).and_return(false)
|
|
244
|
-
allow(described_class).to receive(:setting_present?).with("RELATIONSHIPS_SHOWN.REPLACED_BY").and_return(true)
|
|
245
|
-
|
|
246
|
-
expect(Geoblacklight.deprecation).to receive(:warn).with(
|
|
247
|
-
/Rename to REPLACES_DESCENDANTS/
|
|
248
|
-
)
|
|
249
|
-
|
|
250
|
-
described_class.warn_about_relationship_keys
|
|
251
|
-
end
|
|
252
|
-
|
|
253
|
-
it "stays quiet for a settings file on the current shape" do
|
|
254
|
-
allow(described_class).to receive(:setting_present?).and_return(false)
|
|
255
|
-
|
|
256
|
-
expect(Geoblacklight.deprecation).not_to receive(:warn)
|
|
257
|
-
|
|
258
|
-
described_class.warn_about_relationship_keys
|
|
259
|
-
end
|
|
260
|
-
end
|
|
261
|
-
|
|
262
|
-
describe ".warn_about_settings" do
|
|
263
|
-
it "warns about a removed setting that the application has set" do
|
|
264
|
-
allow(described_class).to receive(:setting_present?).and_return(false)
|
|
265
|
-
allow(described_class).to receive(:setting_present?).with("CARTO_ONECLICK_LINK").and_return(true)
|
|
266
|
-
|
|
267
|
-
expect(Geoblacklight.deprecation).to receive(:warn).with(
|
|
268
|
-
"Settings.CARTO_ONECLICK_LINK is deprecated and will be removed in GeoBlacklight 5; " \
|
|
269
|
-
"the Carto OneClick integration is removed without replacement"
|
|
270
|
-
)
|
|
271
|
-
|
|
272
|
-
described_class.warn_about_settings
|
|
273
|
-
end
|
|
274
|
-
|
|
275
|
-
it "does not warn about a removed setting the application has not set" do
|
|
276
|
-
allow(described_class).to receive(:setting_present?).and_return(false)
|
|
277
|
-
|
|
278
|
-
expect(Geoblacklight.deprecation).not_to receive(:warn)
|
|
279
|
-
|
|
280
|
-
described_class.warn_about_settings
|
|
281
|
-
end
|
|
282
|
-
end
|
|
283
|
-
|
|
284
|
-
describe ".warn_about_changed_settings" do
|
|
285
|
-
it "warns when a setting still holds the GeoBlacklight 4 default" do
|
|
286
|
-
allow(described_class).to receive(:setting_value).and_return(:something_else)
|
|
287
|
-
allow(described_class).to receive(:setting_value).with("TIMEOUT_DOWNLOAD").and_return(16)
|
|
288
|
-
|
|
289
|
-
expect(Geoblacklight.deprecation).to receive(:warn).with(
|
|
290
|
-
"Settings.TIMEOUT_DOWNLOAD is set to the GeoBlacklight 4 default 16, which is deprecated; " \
|
|
291
|
-
"GeoBlacklight 5 uses 180 because 16 seconds is too short for many generated downloads"
|
|
292
|
-
)
|
|
293
|
-
|
|
294
|
-
described_class.warn_about_changed_settings
|
|
295
|
-
end
|
|
296
|
-
|
|
297
|
-
it "leaves a setting alone once the application has chosen its own value" do
|
|
298
|
-
allow(described_class).to receive(:setting_value).and_return("a deliberate choice")
|
|
299
|
-
|
|
300
|
-
expect(Geoblacklight.deprecation).not_to receive(:warn)
|
|
301
|
-
|
|
302
|
-
described_class.warn_about_changed_settings
|
|
303
|
-
end
|
|
304
|
-
|
|
305
|
-
it "does not confuse a nil setting with the old default" do
|
|
306
|
-
allow(described_class).to receive(:setting_value).and_return(nil)
|
|
307
|
-
|
|
308
|
-
expect(Geoblacklight.deprecation).not_to receive(:warn)
|
|
309
|
-
|
|
310
|
-
described_class.warn_about_changed_settings
|
|
311
|
-
end
|
|
312
|
-
end
|
|
313
|
-
|
|
314
|
-
describe ".warn_about_required_settings" do
|
|
315
|
-
it "warns when a setting GeoBlacklight 5 requires is missing" do
|
|
316
|
-
allow(described_class).to receive(:setting_value).and_return(nil)
|
|
317
|
-
|
|
318
|
-
expect(Geoblacklight.deprecation).to receive(:warn).with(
|
|
319
|
-
/Settings\.DOWNLOAD_FORMATS\.VECTOR is not set; GeoBlacklight 5 requires it/
|
|
320
|
-
)
|
|
321
|
-
|
|
322
|
-
described_class.warn_about_required_settings
|
|
323
|
-
end
|
|
324
|
-
|
|
325
|
-
it "stays quiet once the setting is supplied" do
|
|
326
|
-
allow(described_class).to receive(:setting_value).and_return(["Shapefile"])
|
|
327
|
-
|
|
328
|
-
expect(Geoblacklight.deprecation).not_to receive(:warn)
|
|
329
|
-
|
|
330
|
-
described_class.warn_about_required_settings
|
|
331
|
-
end
|
|
332
|
-
end
|
|
333
|
-
|
|
334
|
-
describe ".setting_value" do
|
|
335
|
-
it "returns the value of a top level setting" do
|
|
336
|
-
expect(described_class.setting_value("TIMEOUT_DOWNLOAD")).to eq Settings.TIMEOUT_DOWNLOAD
|
|
337
|
-
end
|
|
338
|
-
|
|
339
|
-
it "walks a dotted path, including symbol-keyed settings" do
|
|
340
|
-
expect(described_class.setting_value("WMS_PARAMS.INFO_FORMAT")).to eq Settings.WMS_PARAMS.INFO_FORMAT
|
|
341
|
-
end
|
|
342
|
-
|
|
343
|
-
it "is nil when the setting is absent" do
|
|
344
|
-
expect(described_class.setting_value("NO_SUCH_SETTING")).to be_nil
|
|
345
|
-
end
|
|
346
|
-
|
|
347
|
-
it "is nil when an ancestor of the path is absent" do
|
|
348
|
-
expect(described_class.setting_value("NO_SUCH_SETTING.NOR_THIS_ONE")).to be_nil
|
|
349
|
-
end
|
|
350
|
-
end
|
|
351
|
-
|
|
352
|
-
describe ".setting_present?" do
|
|
353
|
-
it "is true for a setting that is present" do
|
|
354
|
-
expect(described_class.setting_present?("CARTO_ONECLICK_LINK")).to be true
|
|
355
|
-
end
|
|
356
|
-
|
|
357
|
-
it "is true for a nested setting that is present" do
|
|
358
|
-
expect(described_class.setting_present?("LEAFLET.VIEWERS")).to be true
|
|
359
|
-
end
|
|
360
|
-
|
|
361
|
-
it "is false for a setting that is absent" do
|
|
362
|
-
expect(described_class.setting_present?("NO_SUCH_SETTING")).to be false
|
|
363
|
-
end
|
|
364
|
-
|
|
365
|
-
it "is false when an ancestor of a nested setting is absent" do
|
|
366
|
-
expect(described_class.setting_present?("NO_SUCH_SETTING.NOR_THIS_ONE")).to be false
|
|
367
|
-
end
|
|
368
|
-
end
|
|
369
|
-
|
|
370
|
-
describe ".warn_about_helper_override" do
|
|
371
|
-
it "warns when the application has copied GeoblacklightHelper into app/helpers" do
|
|
372
|
-
FileUtils.mkdir_p(root.join("app", "helpers"))
|
|
373
|
-
File.write(root.join("app", "helpers", "geoblacklight_helper.rb"), "")
|
|
374
|
-
|
|
375
|
-
expect(Geoblacklight.deprecation).to receive(:warn).with(
|
|
376
|
-
/app\/helpers\/geoblacklight_helper\.rb overrides GeoblacklightHelper, which shadows GeoBlacklight's own copy/
|
|
377
|
-
)
|
|
378
|
-
|
|
379
|
-
described_class.warn_about_helper_override(root)
|
|
380
|
-
end
|
|
381
|
-
|
|
382
|
-
it "stays quiet when the application uses GeoBlacklight's helper" do
|
|
383
|
-
expect(Geoblacklight.deprecation).not_to receive(:warn)
|
|
384
|
-
|
|
385
|
-
described_class.warn_about_helper_override(root)
|
|
386
|
-
end
|
|
387
|
-
end
|
|
388
|
-
|
|
389
|
-
describe ".warn_about_stale_setting_values" do
|
|
390
|
-
it "warns when a setting lists a value that stops matching in GeoBlacklight 5" do
|
|
391
|
-
allow(described_class).to receive(:setting_value).and_return([])
|
|
392
|
-
allow(described_class).to receive(:setting_value).with("SIDEBAR_STATIC_MAP").and_return(["iiif", "map"])
|
|
393
|
-
|
|
394
|
-
expect(Geoblacklight.deprecation).to receive(:warn).with(
|
|
395
|
-
/Settings\.SIDEBAR_STATIC_MAP lists "map", which never matches in GeoBlacklight 5/
|
|
396
|
-
)
|
|
397
|
-
|
|
398
|
-
described_class.warn_about_stale_setting_values
|
|
399
|
-
end
|
|
400
|
-
|
|
401
|
-
it "stays quiet for the default setting values" do
|
|
402
|
-
allow(described_class).to receive(:setting_value).and_return(["iiif", "iiif_manifest"])
|
|
403
|
-
|
|
404
|
-
expect(Geoblacklight.deprecation).not_to receive(:warn)
|
|
405
|
-
|
|
406
|
-
described_class.warn_about_stale_setting_values
|
|
407
|
-
end
|
|
408
|
-
|
|
409
|
-
it "tolerates a setting that is absent" do
|
|
410
|
-
allow(described_class).to receive(:setting_value).and_return(nil)
|
|
411
|
-
|
|
412
|
-
expect(Geoblacklight.deprecation).not_to receive(:warn)
|
|
413
|
-
|
|
414
|
-
described_class.warn_about_stale_setting_values
|
|
415
|
-
end
|
|
416
|
-
end
|
|
417
|
-
|
|
418
|
-
describe ".warn_about_document_overrides" do
|
|
419
|
-
def only_defines(reader, owner, source: "/my/app/app/models/concerns/overrides.rb")
|
|
420
|
-
allow(SolrDocument).to receive(:method_defined?).and_return(false)
|
|
421
|
-
allow(SolrDocument).to receive(:private_method_defined?).and_return(false)
|
|
422
|
-
allow(SolrDocument).to receive(:method_defined?).with(reader).and_return(true)
|
|
423
|
-
allow(SolrDocument).to receive(:instance_method).with(reader)
|
|
424
|
-
.and_return(instance_double(UnboundMethod, owner: owner, source_location: source && [source, 1]))
|
|
425
|
-
end
|
|
426
|
-
|
|
427
|
-
it "stays quiet for a stock SolrDocument" do
|
|
428
|
-
expect(Geoblacklight.deprecation).not_to receive(:warn)
|
|
429
|
-
|
|
430
|
-
described_class.warn_about_document_overrides
|
|
431
|
-
end
|
|
432
|
-
|
|
433
|
-
it "warns when an application module overrides a reader" do
|
|
434
|
-
stub_const("MyDocumentOverrides", Module.new)
|
|
435
|
-
only_defines("display_note", MyDocumentOverrides)
|
|
436
|
-
|
|
437
|
-
expect(Geoblacklight.deprecation).to receive(:warn).with(
|
|
438
|
-
/MyDocumentOverrides#display_note overrides Geoblacklight::SolrDocument#display_note/
|
|
439
|
-
)
|
|
440
|
-
|
|
441
|
-
described_class.warn_about_document_overrides
|
|
442
|
-
end
|
|
443
|
-
|
|
444
|
-
it "stays quiet when the reader is defined in the SolrDocument class body" do
|
|
445
|
-
only_defines("title", SolrDocument)
|
|
446
|
-
|
|
447
|
-
expect(Geoblacklight.deprecation).not_to receive(:warn)
|
|
448
|
-
|
|
449
|
-
described_class.warn_about_document_overrides
|
|
450
|
-
end
|
|
451
|
-
|
|
452
|
-
it "stays quiet when GeoBlacklight itself owns the reader" do
|
|
453
|
-
only_defines("display_note", Geoblacklight::SolrDocument)
|
|
454
|
-
|
|
455
|
-
expect(Geoblacklight.deprecation).not_to receive(:warn)
|
|
456
|
-
|
|
457
|
-
described_class.warn_about_document_overrides
|
|
458
|
-
end
|
|
459
|
-
|
|
460
|
-
it "ignores a reader that is implemented in C, such as Kernel#format" do
|
|
461
|
-
only_defines("format", Kernel, source: nil)
|
|
462
|
-
|
|
463
|
-
expect(Geoblacklight.deprecation).not_to receive(:warn)
|
|
464
|
-
|
|
465
|
-
described_class.warn_about_document_overrides
|
|
466
|
-
end
|
|
467
|
-
|
|
468
|
-
it "tolerates a reader that cannot be resolved" do
|
|
469
|
-
allow(SolrDocument).to receive(:method_defined?).and_return(true)
|
|
470
|
-
allow(SolrDocument).to receive(:instance_method).and_raise(NameError)
|
|
471
|
-
|
|
472
|
-
expect(Geoblacklight.deprecation).not_to receive(:warn)
|
|
473
|
-
|
|
474
|
-
described_class.warn_about_document_overrides
|
|
475
|
-
end
|
|
476
|
-
end
|
|
477
|
-
|
|
478
|
-
describe ".warn_about_catalog_controller" do
|
|
479
|
-
it "reports everything the application's CatalogController needs, as one warning" do
|
|
480
|
-
expect(Geoblacklight.deprecation).to receive(:warn).once.with(
|
|
481
|
-
/\Aapp\/controllers\/catalog_controller\.rb needs these changes before GeoBlacklight 5: /
|
|
482
|
-
)
|
|
483
|
-
|
|
484
|
-
described_class.warn_about_catalog_controller
|
|
485
|
-
end
|
|
486
|
-
|
|
487
|
-
it "stays quiet once there is nothing left to change" do
|
|
488
|
-
allow(described_class).to receive(:catalog_controller_problems).and_return([])
|
|
489
|
-
|
|
490
|
-
expect(Geoblacklight.deprecation).not_to receive(:warn)
|
|
491
|
-
|
|
492
|
-
described_class.warn_about_catalog_controller
|
|
493
|
-
end
|
|
494
|
-
|
|
495
|
-
it "never lets a broken controller stop the application booting" do
|
|
496
|
-
allow(described_class).to receive(:catalog_controller_problems).and_raise("boom")
|
|
497
|
-
|
|
498
|
-
expect { described_class.warn_about_catalog_controller }.not_to raise_error
|
|
499
|
-
end
|
|
500
|
-
end
|
|
501
|
-
|
|
502
|
-
describe ".catalog_controller_problems" do
|
|
503
|
-
subject(:problems) { described_class.catalog_controller_problems(CatalogController) }
|
|
504
|
-
|
|
505
|
-
it "flags the removed document presenter" do
|
|
506
|
-
expect(problems).to include(/config\.index\.document_presenter_class = Geoblacklight::DocumentPresenter/)
|
|
507
|
-
end
|
|
508
|
-
|
|
509
|
-
it "flags every removed show partial the controller still lists" do
|
|
510
|
-
expect(problems).to include(
|
|
511
|
-
/remove show_default_display_note, show_default_viewer_container, show_default_attribute_table, show_default_viewer_information/
|
|
512
|
-
)
|
|
513
|
-
end
|
|
514
|
-
|
|
515
|
-
it "flags each show tool that is still registered with a partial" do
|
|
516
|
-
expect(problems).to include(/register the :arcgis show tool with a `component:`/)
|
|
517
|
-
expect(problems).to include(/register the :data_dictionary show tool with a `component:`/)
|
|
518
|
-
expect(problems).to include(/register the :carto show tool with a `component:`/)
|
|
519
|
-
end
|
|
520
|
-
|
|
521
|
-
it "flags the components the controller has to start setting" do
|
|
522
|
-
expect(problems).to include(/config\.show\.document_component = Geoblacklight::DocumentComponent/)
|
|
523
|
-
expect(problems).to include(/config\.index\.document_component = Geoblacklight::SearchResultComponent/)
|
|
524
|
-
expect(problems).to include(/config\.header_component = Geoblacklight::HeaderComponent/)
|
|
525
|
-
end
|
|
526
|
-
|
|
527
|
-
it "flags the web_services destructuring" do
|
|
528
|
-
expect(problems).to include(/@response, @documents = action_documents/)
|
|
529
|
-
end
|
|
530
|
-
|
|
531
|
-
it "is empty for a controller that has already been migrated" do
|
|
532
|
-
config = CatalogController.blacklight_config.deep_copy
|
|
533
|
-
config.index.document_presenter_class = Blacklight::IndexPresenter
|
|
534
|
-
config.show.partials = [:show_header, :show]
|
|
535
|
-
config.show.document_component = Blacklight::DocumentComponent
|
|
536
|
-
config.index.document_component = Blacklight::DocumentComponent
|
|
537
|
-
config.header_component = Class.new
|
|
538
|
-
described_class::SHOW_TOOL_PARTIALS.each { |tool| config.show.document_actions.delete(tool.to_sym) }
|
|
539
|
-
controller = class_double(CatalogController, blacklight_config: config)
|
|
540
|
-
allow(described_class).to receive(:web_services_problem).with(controller).and_return(nil)
|
|
541
|
-
|
|
542
|
-
expect(described_class.catalog_controller_problems(controller)).to be_empty
|
|
543
|
-
end
|
|
544
|
-
end
|
|
545
|
-
|
|
546
|
-
describe ".web_services_problem" do
|
|
547
|
-
it "is nil when the controller source cannot be located" do
|
|
548
|
-
controller = class_double(
|
|
549
|
-
CatalogController,
|
|
550
|
-
instance_method: instance_double(UnboundMethod, source_location: nil)
|
|
551
|
-
)
|
|
552
|
-
|
|
553
|
-
expect(described_class.web_services_problem(controller)).to be_nil
|
|
554
|
-
end
|
|
555
|
-
|
|
556
|
-
it "is nil rather than raising when the source cannot be read" do
|
|
557
|
-
controller = class_double(CatalogController)
|
|
558
|
-
allow(controller).to receive(:instance_method).and_raise("boom")
|
|
559
|
-
|
|
560
|
-
expect(described_class.web_services_problem(controller)).to be_nil
|
|
561
|
-
end
|
|
562
|
-
end
|
|
563
|
-
|
|
564
|
-
describe ".warn!" do
|
|
565
|
-
it "checks templates, removed settings, changed defaults and required settings" do
|
|
566
|
-
expect(described_class).to receive(:warn_about_templates).with(root)
|
|
567
|
-
expect(described_class).to receive(:warn_about_settings)
|
|
568
|
-
expect(described_class).to receive(:warn_about_changed_settings)
|
|
569
|
-
expect(described_class).to receive(:warn_about_required_settings)
|
|
570
|
-
expect(described_class).to receive(:warn_about_stale_setting_values)
|
|
571
|
-
expect(described_class).to receive(:warn_about_helper_override).with(root)
|
|
572
|
-
expect(described_class).to receive(:warn_about_locale_keys).with(root)
|
|
573
|
-
expect(described_class).to receive(:warn_about_jquery_animations).with(root)
|
|
574
|
-
expect(described_class).to receive(:warn_about_relationship_keys)
|
|
575
|
-
expect(described_class).to receive(:warn_about_document_overrides)
|
|
576
|
-
expect(described_class).to receive(:warn_about_catalog_controller)
|
|
577
|
-
|
|
578
|
-
described_class.warn!(root)
|
|
579
|
-
end
|
|
580
|
-
|
|
581
|
-
it "skips the template check when there is no application root" do
|
|
582
|
-
expect(described_class).not_to receive(:warn_about_templates)
|
|
583
|
-
allow(described_class).to receive(:warn_about_settings)
|
|
584
|
-
allow(described_class).to receive(:warn_about_changed_settings)
|
|
585
|
-
allow(described_class).to receive(:warn_about_required_settings)
|
|
586
|
-
allow(described_class).to receive(:warn_about_stale_setting_values)
|
|
587
|
-
expect(described_class).not_to receive(:warn_about_helper_override)
|
|
588
|
-
expect(described_class).not_to receive(:warn_about_locale_keys)
|
|
589
|
-
expect(described_class).not_to receive(:warn_about_jquery_animations)
|
|
590
|
-
allow(described_class).to receive(:warn_about_relationship_keys)
|
|
591
|
-
allow(described_class).to receive(:warn_about_document_overrides)
|
|
592
|
-
allow(described_class).to receive(:warn_about_catalog_controller)
|
|
593
|
-
|
|
594
|
-
described_class.warn!(nil)
|
|
595
|
-
end
|
|
596
|
-
end
|
|
597
|
-
end
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
require "spec_helper"
|
|
4
|
-
|
|
5
|
-
describe Geoblacklight::HglDownload do
|
|
6
|
-
subject(:download) { described_class.new(document, options) }
|
|
7
|
-
|
|
8
|
-
let(:document) { SolrDocument.new(Settings.FIELDS.ID => "test", Settings.FIELDS.WXS_IDENTIFIER => "cite:harvard-test") }
|
|
9
|
-
let(:options) { "foo@example.com" }
|
|
10
|
-
|
|
11
|
-
describe "#initialize" do
|
|
12
|
-
it "initializes as an HglDownload object with specific options" do
|
|
13
|
-
expect(download).to be_an described_class
|
|
14
|
-
options = download.instance_variable_get(:@options)
|
|
15
|
-
expect(options[:request_params]["LayerName"]).to eq "harvard-test"
|
|
16
|
-
expect(options[:request_params]["UserEmail"]).to eq "foo@example.com"
|
|
17
|
-
end
|
|
18
|
-
it "merges custom options" do
|
|
19
|
-
download = described_class.new(document, "foo@example.com", timeout: 33)
|
|
20
|
-
options = download.instance_variable_get(:@options)
|
|
21
|
-
expect(options[:timeout]).to eq 33
|
|
22
|
-
end
|
|
23
|
-
end
|
|
24
|
-
|
|
25
|
-
describe "#get" do
|
|
26
|
-
let(:references_field) { Settings.FIELDS.REFERENCES }
|
|
27
|
-
let(:references_values) do
|
|
28
|
-
{
|
|
29
|
-
"http://www.opengis.net/def/serviceType/ogc/wms" => "http://www.example.com/wms"
|
|
30
|
-
}
|
|
31
|
-
end
|
|
32
|
-
let(:options) do
|
|
33
|
-
{
|
|
34
|
-
:service_type => "wms",
|
|
35
|
-
references_field => references_values.to_json
|
|
36
|
-
}
|
|
37
|
-
end
|
|
38
|
-
let(:faraday_connection) { instance_double(Faraday::Connection) }
|
|
39
|
-
let(:faraday_response) { instance_double(Faraday::Response) }
|
|
40
|
-
let(:faraday_request) { instance_double(Faraday::Request) }
|
|
41
|
-
let(:faraday_request_options) { OpenStruct.new(timeout: nil, open_timeout: nil) }
|
|
42
|
-
let(:reference) { instance_double(Geoblacklight::Reference) }
|
|
43
|
-
# Methods cannot be stubbed which are automatically generated from Hash keys
|
|
44
|
-
let(:references) { double("references") }
|
|
45
|
-
let(:endpoint) { "http://www.example.com/wms" }
|
|
46
|
-
|
|
47
|
-
before do
|
|
48
|
-
allow(reference).to receive(:endpoint).and_return(endpoint)
|
|
49
|
-
allow(references).to receive(:hgl).and_return(reference)
|
|
50
|
-
allow(document).to receive(:references).and_return(references)
|
|
51
|
-
allow(faraday_request).to receive(:params=)
|
|
52
|
-
allow(faraday_request).to receive(:options).and_return(faraday_request_options)
|
|
53
|
-
end
|
|
54
|
-
|
|
55
|
-
it "downloads the file and generates a message for the client" do
|
|
56
|
-
allow(faraday_connection).to receive(:get).and_yield(faraday_request).and_return(faraday_response)
|
|
57
|
-
allow(Faraday).to receive(:new).with(url: endpoint).and_return(faraday_connection)
|
|
58
|
-
|
|
59
|
-
expect(download.get).to eq faraday_response
|
|
60
|
-
end
|
|
61
|
-
end
|
|
62
|
-
end
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
require "spec_helper"
|
|
4
|
-
|
|
5
|
-
class GeoblacklightControllerTestClass
|
|
6
|
-
include AbstractController::Translation
|
|
7
|
-
|
|
8
|
-
attr_accessor :params
|
|
9
|
-
end
|
|
10
|
-
|
|
11
|
-
describe Geoblacklight::ViewHelperOverride do
|
|
12
|
-
let(:fake_controller) do
|
|
13
|
-
GeoblacklightControllerTestClass.new
|
|
14
|
-
.extend(described_class)
|
|
15
|
-
end
|
|
16
|
-
|
|
17
|
-
describe "render_search_to_s_bbox" do
|
|
18
|
-
it "returns an empty string for no bbox" do
|
|
19
|
-
fake_controller.params = {}
|
|
20
|
-
expect(fake_controller.render_search_to_s_bbox(fake_controller.params)).to eq ""
|
|
21
|
-
end
|
|
22
|
-
it "returns render_search_to_s_element when bbox is present" do
|
|
23
|
-
fake_controller.params = {bbox: "123"}
|
|
24
|
-
params = {"bbox" => "123"}
|
|
25
|
-
expect(fake_controller).to receive(:render_search_to_s_element)
|
|
26
|
-
expect(fake_controller).to receive(:render_filter_value)
|
|
27
|
-
fake_controller.render_search_to_s_bbox(params)
|
|
28
|
-
end
|
|
29
|
-
end
|
|
30
|
-
end
|