blacklight-maps 0.5.2 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (74) hide show
  1. checksums.yaml +5 -5
  2. data/.gitignore +2 -0
  3. data/.rubocop.yml +99 -0
  4. data/.solr_wrapper.yml +7 -0
  5. data/.travis.yml +19 -16
  6. data/Gemfile +40 -7
  7. data/README.md +13 -12
  8. data/Rakefile +35 -32
  9. data/app/assets/images/blacklight/maps.svg +1 -0
  10. data/app/assets/javascripts/blacklight-maps.js +1 -4
  11. data/app/assets/javascripts/blacklight-maps/blacklight-maps-browse.js +7 -8
  12. data/app/assets/stylesheets/blacklight_maps/blacklight-maps.scss +1 -2
  13. data/app/assets/stylesheets/blacklight_maps/default.scss +7 -10
  14. data/app/helpers/blacklight/blacklight_maps_helper_behavior.rb +81 -86
  15. data/app/helpers/blacklight_maps_helper.rb +2 -0
  16. data/app/views/catalog/_show_maplet_default.html.erb +8 -9
  17. data/app/views/catalog/map.html.erb +2 -2
  18. data/blacklight-maps.gemspec +27 -26
  19. data/config/locales/blacklight-maps-zh.yml +7 -7
  20. data/config/locales/blacklight-maps.ar.yml +21 -0
  21. data/config/locales/blacklight-maps.de.yml +21 -0
  22. data/config/locales/blacklight-maps.en.yml +1 -1
  23. data/config/locales/blacklight-maps.es.yml +21 -0
  24. data/config/locales/blacklight-maps.fr.yml +8 -8
  25. data/config/locales/blacklight-maps.hu.yml +21 -0
  26. data/config/locales/blacklight-maps.it.yml +8 -8
  27. data/config/locales/blacklight-maps.nl.yml +21 -0
  28. data/config/locales/blacklight-maps.pt-BR.yml +21 -0
  29. data/config/locales/blacklight-maps.sq.yml +21 -0
  30. data/config/routes.rb +3 -2
  31. data/lib/blacklight/maps.rb +8 -2
  32. data/lib/blacklight/maps/controller.rb +27 -0
  33. data/lib/blacklight/maps/engine.rb +12 -13
  34. data/lib/blacklight/maps/export.rb +112 -93
  35. data/lib/blacklight/maps/geometry.rb +30 -18
  36. data/lib/blacklight/maps/maps_search_builder.rb +4 -3
  37. data/lib/blacklight/maps/render_constraints_override.rb +63 -29
  38. data/lib/blacklight/maps/version.rb +3 -1
  39. data/lib/generators/blacklight_maps/install_generator.rb +38 -31
  40. data/lib/generators/blacklight_maps/templates/search_history_controller.rb +2 -0
  41. data/{solr_conf → lib/generators/blacklight_maps/templates/solr}/conf/schema.xml +0 -0
  42. data/{solr_conf → lib/generators/blacklight_maps/templates/solr}/conf/solrconfig.xml +0 -0
  43. data/lib/railties/blacklight_maps.rake +10 -7
  44. data/spec/controllers/catalog_controller_spec.rb +20 -10
  45. data/spec/fixtures/sample_solr_documents.yml +909 -906
  46. data/spec/helpers/blacklight_maps_helper_spec.rb +60 -108
  47. data/spec/lib/blacklight/maps/export_spec.rb +109 -143
  48. data/spec/lib/blacklight/maps/geometry_spec.rb +34 -21
  49. data/spec/lib/blacklight/maps/maps_search_builder_spec.rb +17 -21
  50. data/spec/lib/blacklight/maps/render_constraints_override_spec.rb +42 -69
  51. data/spec/spec_helper.rb +19 -21
  52. data/spec/system/index_view_spec.rb +127 -0
  53. data/spec/system/initial_view_spec.rb +28 -0
  54. data/spec/system/map_view_spec.rb +50 -0
  55. data/spec/system/show_view_maplet_spec.rb +78 -0
  56. data/spec/test_app_templates/lib/generators/test_app_generator.rb +6 -21
  57. data/vendor/assets/images/layers-2x.png +0 -0
  58. data/vendor/assets/images/layers.png +0 -0
  59. data/vendor/assets/images/marker-icon-2x.png +0 -0
  60. data/vendor/assets/images/marker-icon.png +0 -0
  61. data/vendor/assets/images/marker-shadow.png +0 -0
  62. data/vendor/assets/javascripts/leaflet.js.erb +13922 -0
  63. data/vendor/assets/javascripts/leaflet.markercluster.js +3 -0
  64. data/vendor/assets/stylesheets/MarkerCluster.Default.css +60 -0
  65. data/vendor/assets/stylesheets/MarkerCluster.css +14 -0
  66. data/vendor/assets/stylesheets/leaflet.css +635 -0
  67. metadata +86 -91
  68. data/config/jetty.yml +0 -7
  69. data/lib/blacklight/maps/controller_override.rb +0 -20
  70. data/lib/generators/blacklight_maps/templates/saved_searches_controller.rb +0 -5
  71. data/spec/features/initial_view_spec.rb +0 -21
  72. data/spec/features/maps_spec.rb +0 -202
  73. data/spec/features/show_view_maplet_spec.rb +0 -93
  74. data/spec/test_app_templates/Gemfile.extra +0 -5
@@ -1,93 +0,0 @@
1
- require 'spec_helper'
2
-
3
- describe "catalog#show view", js: true do
4
-
5
- before :each do
6
- CatalogController.blacklight_config = Blacklight::Configuration.new
7
- CatalogController.configure_blacklight do |config|
8
- # add maplet to show view partials
9
- config.show.partials << :show_maplet
10
- end
11
- end
12
-
13
- describe "item with point feature" do
14
-
15
- before :each do
16
- visit solr_document_path("00314247")
17
- end
18
-
19
- it "should display the maplet" do
20
- expect(page).to have_selector("#blacklight-show-map-container")
21
- end
22
-
23
- it "should have a single marker icon" do
24
- expect(page).to have_selector(".leaflet-marker-icon", count: 1)
25
- end
26
-
27
- describe "click marker icon" do
28
-
29
- before { find(".leaflet-marker-icon").click }
30
-
31
- it "should show a popup with correct content" do
32
- expect(page).to have_selector("div.leaflet-popup-content-wrapper")
33
- expect(page).to have_content("Japan")
34
- end
35
-
36
- end
37
-
38
- end
39
-
40
- describe "item with point and bbox features" do
41
-
42
- before :each do
43
- visit solr_document_path("2008308175")
44
- end
45
-
46
- it "should show the correct mapped item count" do
47
- expect(page).to have_selector(".mapped-count .badge", text: "2")
48
- end
49
-
50
- it "should show a bounding box and a point marker" do
51
- expect(page).to have_selector(".leaflet-overlay-pane path.leaflet-clickable")
52
- expect(page).to have_selector(".leaflet-marker-icon")
53
- end
54
-
55
- describe "click bbox path" do
56
-
57
- before do
58
- 0.upto(4) { find("a.leaflet-control-zoom-in").click } #so bbox not covered by point
59
- find(".leaflet-overlay-pane svg").click
60
- end
61
-
62
- it "should show a popup with correct content" do
63
- expect(page).to have_selector("div.leaflet-popup-content-wrapper")
64
- expect(page).to have_content("[68.162386, 6.7535159, 97.395555, 35.5044752]")
65
- end
66
-
67
- end
68
-
69
- end
70
-
71
- describe "item with bbox feature" do
72
-
73
- before :each do
74
- CatalogController.configure_blacklight do |config|
75
- # set zoom config so we can test whether setMapBounds() is correct
76
- config.view.maps.maxzoom = 8
77
- config.view.maps.show_initial_zoom = 10
78
- end
79
- visit solr_document_path("2009373514")
80
- end
81
-
82
- it "should display a bounding box" do
83
- expect(page).to have_selector(".leaflet-overlay-pane path.leaflet-clickable")
84
- end
85
-
86
- it "should zoom to the correct map bounds" do
87
- # if setMapBounds() zoom >= maxzoom, zoom-in control will be disabled
88
- expect(page).to have_selector(".leaflet-control-zoom-in.leaflet-disabled")
89
- end
90
-
91
- end
92
-
93
- end
@@ -1,5 +0,0 @@
1
- # extra gems to load into the test app go here
2
-
3
- gem 'leaflet-rails'
4
-
5
- gem 'leaflet-markercluster-rails'