geoblacklight 1.9.1 → 2.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (135) hide show
  1. checksums.yaml +4 -4
  2. data/.circleci/config.yml +2 -2
  3. data/.rubocop.yml +4 -14
  4. data/.rubocop_todo.yml +51 -48
  5. data/README.md +3 -0
  6. data/Rakefile +1 -2
  7. data/app/assets/javascripts/geoblacklight/basemaps.js +3 -3
  8. data/app/assets/javascripts/geoblacklight/downloaders/downloader.js +1 -1
  9. data/app/assets/javascripts/geoblacklight/geoblacklight.js +1 -1
  10. data/app/assets/javascripts/geoblacklight/modules/download.js +1 -1
  11. data/app/assets/javascripts/geoblacklight/modules/home.js +3 -2
  12. data/app/assets/javascripts/geoblacklight/modules/util.js +8 -0
  13. data/app/assets/javascripts/geoblacklight/templates/index_map_download.hbs +19 -0
  14. data/app/assets/javascripts/geoblacklight/templates/index_map_info.hbs +15 -13
  15. data/app/assets/javascripts/geoblacklight/viewers/esri/dynamic_map_layer.js +3 -3
  16. data/app/assets/javascripts/geoblacklight/viewers/esri/feature_layer.js +4 -2
  17. data/app/assets/javascripts/geoblacklight/viewers/index_map.js +20 -12
  18. data/app/assets/javascripts/geoblacklight/viewers/map.js +2 -1
  19. data/app/assets/javascripts/geoblacklight/viewers/wms.js +1 -5
  20. data/app/assets/stylesheets/geoblacklight/_blacklight_overrides.scss +43 -0
  21. data/app/assets/stylesheets/geoblacklight/_geoblacklight.scss +4 -1
  22. data/app/assets/stylesheets/geoblacklight/application.scss +0 -1
  23. data/app/assets/stylesheets/geoblacklight/modules/downloads.scss +33 -13
  24. data/app/assets/stylesheets/geoblacklight/modules/home.scss +22 -19
  25. data/app/assets/stylesheets/geoblacklight/modules/icon-customization.scss +1 -1
  26. data/app/assets/stylesheets/geoblacklight/modules/index_maps.scss +7 -0
  27. data/app/assets/stylesheets/geoblacklight/modules/item.scss +7 -8
  28. data/app/assets/stylesheets/geoblacklight/modules/metadata.scss +9 -0
  29. data/app/assets/stylesheets/geoblacklight/modules/relations.scss +15 -0
  30. data/app/assets/stylesheets/geoblacklight/modules/results.scss +7 -2
  31. data/app/assets/stylesheets/geoblacklight/modules/sidebar.scss +60 -0
  32. data/app/assets/stylesheets/geoblacklight/modules/toolbar.scss +55 -35
  33. data/app/controllers/download_controller.rb +5 -4
  34. data/app/controllers/relation_controller.rb +11 -1
  35. data/app/helpers/carto_helper.rb +2 -9
  36. data/app/helpers/geoblacklight_helper.rb +15 -28
  37. data/app/models/concerns/geoblacklight/solr_document.rb +4 -0
  38. data/app/models/concerns/geoblacklight/spatial_search_behavior.rb +18 -1
  39. data/app/presenters/geoblacklight/document_presenter.rb +2 -2
  40. data/app/views/catalog/_document_action.html.erb +2 -2
  41. data/app/views/catalog/_document_split.html.erb +5 -3
  42. data/app/views/catalog/_downloads_secondary.html.erb +39 -0
  43. data/app/views/catalog/_facet_tag_layout.html.erb +1 -1
  44. data/app/views/catalog/_home_text.html.erb +30 -38
  45. data/app/views/catalog/_index_split_default.html.erb +1 -2
  46. data/app/views/catalog/_metadata.html.erb +3 -3
  47. data/app/views/catalog/_show_default_attribute_table.html.erb +16 -14
  48. data/app/views/catalog/_show_default_viewer_container.html.erb +5 -3
  49. data/app/views/catalog/_show_default_viewer_information.html.erb +3 -1
  50. data/app/views/catalog/_show_downloads.html.erb +12 -9
  51. data/app/views/catalog/_show_tools.html.erb +25 -0
  52. data/app/views/catalog/_web_services.html.erb +1 -1
  53. data/app/views/catalog/_web_services_wfs.html.erb +1 -1
  54. data/app/views/catalog/_web_services_wms.html.erb +1 -1
  55. data/app/views/catalog/index.html.erb +9 -8
  56. data/app/views/relation/_ancestors.html.erb +2 -2
  57. data/app/views/relation/_descendants.html.erb +3 -3
  58. data/app/views/relation/index.html.erb +8 -8
  59. data/app/views/shared/_header_navbar.html.erb +28 -17
  60. data/config/locales/geoblacklight.en.yml +2 -2
  61. data/geoblacklight.gemspec +5 -4
  62. data/lib/generators/geoblacklight/install_generator.rb +3 -12
  63. data/lib/generators/geoblacklight/templates/Procfile +3 -0
  64. data/lib/generators/geoblacklight/templates/catalog_controller.rb +33 -5
  65. data/lib/generators/geoblacklight/templates/package.json +14 -0
  66. data/lib/generators/geoblacklight/templates/settings.yml +15 -1
  67. data/lib/generators/geoblacklight/templates/webpacker.yml +67 -0
  68. data/lib/generators/geoblacklight/webpacker_generator.rb +35 -0
  69. data/lib/geoblacklight.rb +2 -4
  70. data/lib/geoblacklight/controller_override.rb +27 -22
  71. data/lib/geoblacklight/engine.rb +0 -1
  72. data/lib/geoblacklight/version.rb +1 -1
  73. data/lib/tasks/geoblacklight.rake +18 -0
  74. data/schema/geoblacklight-schema.md +72 -59
  75. data/schema/geometry-type-values.md +1 -0
  76. data/schema/references.md +22 -0
  77. data/schema/schema-commentary.md +198 -0
  78. data/schema/subjects.md +41 -0
  79. data/schema/type-values.md +4 -2
  80. data/solr/conf/core.properties +5 -0
  81. data/solr/conf/schema.xml +11 -1
  82. data/solr/conf/solrconfig.xml +1 -1
  83. data/spec/controllers/catalog_controller_spec.rb +17 -1
  84. data/spec/factories/user.rb +2 -2
  85. data/spec/features/download_layer_spec.rb +19 -15
  86. data/spec/features/esri_viewer_spec.rb +2 -2
  87. data/spec/features/home_page_spec.rb +6 -2
  88. data/spec/features/index_map_spec.rb +15 -25
  89. data/spec/features/layer_opacity_spec.rb +1 -1
  90. data/spec/features/layer_preview_spec.rb +3 -2
  91. data/spec/features/linkified_attribute_table_spec.rb +3 -4
  92. data/spec/features/relations_spec.rb +1 -1
  93. data/spec/features/search_bar_spec.rb +2 -2
  94. data/spec/features/search_results_map_spec.rb +2 -2
  95. data/spec/features/search_results_overlap_ratio_spec.rb +55 -0
  96. data/spec/features/search_spec.rb +13 -0
  97. data/spec/features/show_page_metadata_spec.rb +1 -1
  98. data/spec/features/sms_spec.rb +15 -0
  99. data/spec/features/split_view.html.erb_spec.rb +24 -15
  100. data/spec/features/web_services_modal_spec.rb +0 -2
  101. data/spec/fixtures/solr_documents/README.md +38 -0
  102. data/spec/fixtures/solr_documents/esri-image-map-layer.json +39 -18
  103. data/spec/fixtures/solr_documents/index-map-polygon-no-downloadurl.json +37 -0
  104. data/spec/fixtures/solr_documents/index-map-polygon.json +37 -0
  105. data/spec/fixtures/solr_documents/{point_index_map.json → index_map_point.json} +1 -1
  106. data/spec/fixtures/solr_documents/princeton-child1.json +30 -0
  107. data/spec/fixtures/solr_documents/princeton-child2.json +30 -0
  108. data/spec/fixtures/solr_documents/princeton-parent.json +25 -0
  109. data/spec/helpers/carto_helper_spec.rb +1 -20
  110. data/spec/helpers/geoblacklight_helper_spec.rb +4 -22
  111. data/spec/lib/geoblacklight/document_presenter_spec.rb +1 -1
  112. data/spec/lib/geoblacklight/geoblacklight_helper_behavior_spec.rb +1 -1
  113. data/spec/models/concerns/geoblacklight/spatial_search_behavior_spec.rb +10 -0
  114. data/spec/spec_helper.rb +6 -3
  115. data/spec/teaspoon_env.rb +31 -1
  116. data/spec/test_app_templates/lib/generators/test_app_generator.rb +5 -0
  117. data/spec/test_app_templates/solr_documents +1 -0
  118. data/spec/views/catalog/_show_downloads.html.erb_spec.rb +1 -1
  119. data/spec/views/catalog/_show_tools.html.erb_spec.rb +39 -0
  120. data/template.rb +4 -2
  121. data/vendor/assets/images/layers-2x.png +0 -0
  122. data/vendor/assets/images/layers.png +0 -0
  123. data/vendor/assets/images/marker-icon-2x.png +0 -0
  124. data/vendor/assets/images/marker-icon.png +0 -0
  125. data/vendor/assets/images/marker-shadow.png +0 -0
  126. data/vendor/assets/javascripts/esri-leaflet.js.map +1 -0
  127. data/vendor/assets/javascripts/leaflet-src.js.map +1 -0
  128. data/vendor/assets/javascripts/leaflet.js.erb +13922 -0
  129. data/vendor/assets/stylesheets/leaflet.css +635 -0
  130. metadata +87 -33
  131. data/app/assets/stylesheets/geoblacklight/modules/twitter-typeahead.scss +0 -14
  132. data/app/views/catalog/_search_form_no_navbar.html.erb +0 -22
  133. data/app/views/catalog/_show_default.html.erb +0 -13
  134. data/app/views/catalog/_upper_metadata.html.erb +0 -20
  135. data/spec/fixtures/solr_documents/umn_metro_result2.json +0 -39
@@ -63,18 +63,18 @@ GeoBlacklight.Viewer.DynamicMapLayer = GeoBlacklight.Viewer.Esri.extend({
63
63
  url: layer.options.url,
64
64
  useCors: true
65
65
  })
66
- .tolerance(0)
66
+ .tolerance(2)
67
67
  .returnGeometry(false)
68
68
  .on(_this.map)
69
69
  .at(e.latlng);
70
70
 
71
71
  // query specific layer if dynamicLayerId is set
72
72
  if (_this.dynamicLayerId) {
73
- identify.layers('ID: ' + _this.dynamicLayerId);
73
+ identify.layers('all: ' + _this.dynamicLayerId);
74
74
  }
75
75
 
76
76
  identify.run(function(error, featureCollection, response){
77
- if (error) {
77
+ if (error || response['results'] < 1) {
78
78
  _this.appendErrorMessage();
79
79
  } else {
80
80
  _this.populateAttributeTable(featureCollection.features[0]);
@@ -56,14 +56,16 @@ GeoBlacklight.Viewer.FeatureLayer = GeoBlacklight.Viewer.Esri.extend({
56
56
 
57
57
  // inspect on click
58
58
  featureLayer.on('click', function(e) {
59
+ var distance = 3000 / (1 + _this.map.getZoom());
60
+
59
61
  _this.appendLoadingMessage();
60
62
 
61
63
  // query layer at click location
62
64
  featureLayer.query()
63
65
  .returnGeometry(false)
64
- .intersects(e.latlng)
66
+ .nearby(e.latlng, distance)
65
67
  .run(function(error, featureCollection, response) {
66
- if (error) {
68
+ if (error || response['features'] < 1) {
67
69
  _this.appendErrorMessage();
68
70
  } else {
69
71
  _this.populateAttributeTable(featureCollection.features[0]);
@@ -12,25 +12,22 @@ GeoBlacklight.Viewer.IndexMap = GeoBlacklight.Viewer.Map.extend({
12
12
  }
13
13
  },
14
14
  availabilityStyle: function(availability) {
15
- var style = {
16
- radius: 4,
17
- weight: 1,
18
- }
19
- // Style the colors based on availability
20
- if (typeof(availability) === 'undefined') {
21
- return style; // default Leaflet style colorings
22
- }
15
+ var style = {};
16
+ var options = this.data.leafletOptions;
23
17
 
24
- if (availability) {
25
- style.color = '#1eb300';
18
+ // Style the colors based on availability
19
+ if (availability || typeof(availability) === 'undefined') {
20
+ style = options.LAYERS.INDEX.DEFAULT;
26
21
  } else {
27
- style.color = '#b3001e';
22
+ style = options.LAYERS.INDEX.UNAVAILABLE;
28
23
  }
29
24
  return style
30
25
  },
31
26
  addPreviewLayer: function() {
32
27
  var _this = this;
33
28
  var geoJSONLayer;
29
+ var prevLayer = null;
30
+ var options = this.data.leafletOptions;
34
31
  $.getJSON(this.data.url, function(data) {
35
32
  geoJSONLayer = L.geoJson(data,
36
33
  {
@@ -45,9 +42,20 @@ GeoBlacklight.Viewer.IndexMap = GeoBlacklight.Viewer.Map.extend({
45
42
  // If it is available add clickable info
46
43
  if (feature.properties.available !== null) {
47
44
  layer.on('click', function(e) {
45
+ // Change currently selected layer color
46
+ layer.setStyle(options.LAYERS.INDEX.SELECTED);
47
+ // Change previously selected layer color to original color
48
+ if (prevLayer !== null) {
49
+ geoJSONLayer.resetStyle(prevLayer);
50
+ }
51
+ prevLayer = layer;
48
52
  GeoBlacklight.Util.indexMapTemplate(feature.properties, function(html) {
49
53
  $('.viewer-information').html(html);
50
54
  });
55
+ GeoBlacklight.Util.indexMapDownloadTemplate(feature.properties, function(html) {
56
+ $('.js-index-map-feature').remove();
57
+ $('.js-download-list').append(html);
58
+ });
51
59
  });
52
60
  }
53
61
  },
@@ -59,4 +67,4 @@ GeoBlacklight.Viewer.IndexMap = GeoBlacklight.Viewer.Map.extend({
59
67
  _this.map.fitBounds(geoJSONLayer.getBounds());
60
68
  });
61
69
  }
62
- });
70
+ });
@@ -1,12 +1,13 @@
1
1
  //= require geoblacklight/viewers/viewer
2
2
 
3
3
  GeoBlacklight.Viewer.Map = GeoBlacklight.Viewer.extend({
4
+
4
5
  options: {
5
6
  /**
6
7
  * Initial bounds of map
7
8
  * @type {L.LatLngBounds}
8
9
  */
9
- bbox: [[-80, -195], [80, 185]],
10
+ bbox: [[-82, -144], [77, 161]],
10
11
  opacity: 0.75
11
12
  },
12
13
 
@@ -46,16 +46,12 @@ GeoBlacklight.Viewer.Wms = GeoBlacklight.Viewer.Map.extend({
46
46
  X: Math.round(e.containerPoint.x),
47
47
  Y: Math.round(e.containerPoint.y)
48
48
  };
49
-
50
- // Set a ujs adapter to support both rails-ujs and jquery-ujs
51
- var ujs = typeof Rails === 'undefined' ? $.rails : Rails;
52
-
53
49
 
54
50
  $.ajax({
55
51
  type: 'POST',
56
52
  url: '/wms/handle',
57
53
  beforeSend: function(xhr) {
58
- xhr.setRequestHeader('X-CSRF-Token', ujs.csrfToken());
54
+ xhr.setRequestHeader('X-CSRF-Token', Rails.csrfToken());
59
55
  },
60
56
  data: wmsoptions,
61
57
  success: function(data) {
@@ -0,0 +1,43 @@
1
+ /**
2
+ Stylesheet for overriding styles inherited from Blacklight proper
3
+ **/
4
+
5
+ // Begin - Addresses GBL issue #634
6
+ // Emulates font-size for SVG icons and aligns to baseline
7
+ .blacklight-icons {
8
+ display: inline-flex;
9
+ height: $font-size-base;
10
+ width: $font-size-base;
11
+ }
12
+
13
+ .blacklight-icons svg {
14
+ height: 1rem;
15
+ width: 1rem;
16
+ top: .125rem;
17
+ position: relative;
18
+ }
19
+ // End - Addresses GBL issue #634
20
+
21
+ // Begin - Addresses GBL issue #639
22
+ .facet-limit {
23
+ margin-bottom:0;
24
+ }
25
+
26
+ .facets-collapse .card+.card {
27
+ margin-top: 0.5rem;
28
+ }
29
+
30
+ .documents-list .document {
31
+ margin-top:0.5rem;
32
+ padding-top:0.5rem;
33
+ }
34
+ // End - Addresses GBL issue #639
35
+
36
+
37
+ // Begin - Addresses GBL issue #766 - removes flex from display
38
+ .modal-header {
39
+ display: block;
40
+ padding: 15px;
41
+ border-bottom: 1px solid #e9ecef;
42
+ }
43
+ // End - Addresses GBL issue #766
@@ -17,6 +17,7 @@
17
17
  @import 'modules/mixins';
18
18
  @import 'modules/icon-customization';
19
19
  @import 'modules/home';
20
+ @import 'modules/index_maps';
20
21
  @import 'modules/item';
21
22
  @import 'modules/layer_opacity';
22
23
  @import 'modules/metadata';
@@ -27,7 +28,9 @@
27
28
  @import 'modules/results';
28
29
  @import 'modules/geosearch';
29
30
  @import 'modules/search_widgets';
31
+ @import 'modules/sidebar';
30
32
  @import 'modules/toolbar';
33
+ @import 'modules/relations';
31
34
  @import 'modules/web_services';
32
- @import 'modules/twitter-typeahead';
35
+ @import 'blacklight_overrides';
33
36
  @import 'modules/downloads';
@@ -1,3 +1,2 @@
1
- @import 'bootstrap-sprockets';
2
1
  @import 'bootstrap';
3
2
  @import 'geoblacklight/geoblacklight';
@@ -5,15 +5,28 @@
5
5
  }
6
6
  }
7
7
 
8
+ %download-export-links {
9
+ a {
10
+ width: 100%;
11
+ font-weight: 600;
12
+ background-color: $link-color;
13
+ color: #ffffff;
14
+ border-color: darken($link-color, 6.5%);
15
+ white-space: inherit;
16
+ }
17
+ }
18
+
8
19
  @mixin download-export {
9
20
  &-link {
10
21
  &-container {
11
- padding: 4px 15px;
22
+ text-align: center;
23
+ @extend %download-export-links;
12
24
  }
13
25
  }
14
26
  }
15
27
 
16
28
  .downloads {
29
+ @include sidebar-children;
17
30
  @extend %downloads-exports;
18
31
 
19
32
  .download {
@@ -21,17 +34,23 @@
21
34
  }
22
35
  }
23
36
 
37
+ .authentication {
38
+ @include sidebar-children;
39
+ .card-header {
40
+ background-color: inherit;
41
+ border-bottom: inherit;
42
+
43
+ @extend %download-export-links;
44
+ }
45
+ }
46
+
24
47
  .exports {
48
+ @include sidebar-children;
25
49
  @extend %downloads-exports;
26
50
 
27
- .panel-heading {
28
- h3 {
29
- display: inline;
30
- }
31
-
51
+ .card-header {
32
52
  .fa-spinner {
33
- padding-left: 8px;
34
- padding-right: 8px;
53
+ float: right;
35
54
  }
36
55
  }
37
56
 
@@ -41,15 +60,16 @@
41
60
  padding-left: 0px;
42
61
  padding-right: 0px;
43
62
  text-align: center;
63
+ width: 100%;
44
64
 
45
- @media (min-width: $screen-lg-min) {
65
+ @include media-breakpoint-up(xl) {
46
66
  text-align: left;
47
67
  }
48
68
 
49
69
  &-label {
50
- padding: 10px 12px;
70
+ padding: 6px 12px;
51
71
 
52
- @media (min-width: $screen-lg-min) {
72
+ @include media-breakpoint-up(xl) {
53
73
  display: inline-block;
54
74
  }
55
75
  }
@@ -57,13 +77,13 @@
57
77
  &-link {
58
78
  &-container {
59
79
 
60
- @media (min-width: $screen-lg-min) {
80
+ @include media-breakpoint-up(xl) {
61
81
  display: inline-block;
62
82
  float: right;
63
83
  }
64
84
 
65
85
  a {
66
- @media (min-width: $screen-lg-min) {
86
+ @include media-breakpoint-up(xl) {
67
87
  width: inherit;
68
88
  }
69
89
  }
@@ -1,25 +1,28 @@
1
- [data-map="home"] {
2
- height: 400px;
3
- }
4
1
 
5
- .home-search-area {
6
-
7
- h2,
8
- h3 {
9
- text-align: center;
10
- }
11
-
12
- .input-group.search-input-group {
13
- width: 100%;
2
+ .geobl-homepage-masthead {
3
+ .search-query-form {
4
+ max-width: 100%;
14
5
  }
15
6
  }
16
7
 
17
- .category-block {
18
- @extend .col-md-6;
19
- @extend .text-center;
20
- min-height: 240px;
21
-
22
- .category-icon {
23
- font-size: 6em;
8
+ #main-container {
9
+ .category-block {
10
+ min-height: 240px;
11
+
12
+ .category-icon {
13
+ font-size: 6em;
14
+ }
15
+ }
16
+
17
+ [data-map="home"] {
18
+ height: 400px;
19
+
20
+ .leaflet-control-container {
21
+ .search-control {
22
+ a {
23
+ color: $white;
24
+ }
25
+ }
26
+ }
24
27
  }
25
28
  }
@@ -1,7 +1,7 @@
1
1
  // Additional customizations beyond generated FontCustom styles
2
2
 
3
3
  .geoblacklight-icon {
4
- color: $gray-light;
4
+ color: $gray-600;
5
5
  font-size: 1.2em;
6
6
  }
7
7
 
@@ -0,0 +1,7 @@
1
+ .index-map-info {
2
+ margin-top: 20px;
3
+
4
+ dl, dt, dd {
5
+ margin: 5px 0;
6
+ }
7
+ }
@@ -1,10 +1,13 @@
1
1
  #document {
2
- .row {
3
- margin-top: 24px;
4
- margin-bottom: 24px;
2
+ .document-metadata.dl-invert {
3
+ dt {
4
+ font-weight: bold;
5
+ }
6
+ }
5
7
 
8
+ #viewer-container {
6
9
  [data-map="item"] {
7
- height: 440px;
10
+ height: 27.5rem;
8
11
  }
9
12
 
10
13
  [data-inspect="true"][data-available="true"] {
@@ -15,9 +18,5 @@
15
18
  cursor: crosshair;
16
19
  }
17
20
  }
18
-
19
- .download-element {
20
- padding-bottom: 10px;
21
- }
22
21
  }
23
22
  }
@@ -18,5 +18,14 @@
18
18
  display: inline-block;
19
19
  }
20
20
  }
21
+
22
+ // Begin - Addresses GBL issue #766 - adds space betwwen the links in the metadata modal
23
+ .nav>li>a {
24
+ position: relative;
25
+ display: block;
26
+ padding: 10px 15px;
27
+ }
28
+ //End - Addresses GBL issue #766
29
+
21
30
  }
22
31
  }
@@ -0,0 +1,15 @@
1
+ .relations {
2
+ @include sidebar-children;
3
+
4
+ .list-group {
5
+ .relations-ancestors {
6
+ padding-left: 16px;
7
+ padding-right: 16px;
8
+ }
9
+
10
+ .relations-descendants {
11
+ padding-left: 16px;
12
+ padding-right: 16px;
13
+ }
14
+ }
15
+ }
@@ -4,7 +4,9 @@
4
4
 
5
5
  .more-info-area {
6
6
  float: left;
7
+ order:3;
7
8
  max-height: 100px;
9
+ overflow:hidden;
8
10
  }
9
11
 
10
12
  .text-span{
@@ -20,14 +22,17 @@
20
22
  }
21
23
 
22
24
  .status-icons {
23
- float: right;
24
- margin-right: 10px;
25
+ order: 2;
26
+ margin-left: 0.5rem;
25
27
  }
26
28
 
27
29
  .index_title {
30
+ order: 1;
28
31
  @extend .text-span;
29
32
  @extend .hide-overflow;
30
33
  @extend h5;
34
+ font-size:1rem;
35
+ width:80%;
31
36
  }
32
37
 
33
38
  .caret-toggle {