]> git.openstreetmap.org Git - rails.git/commitdiff
Merge remote-tracking branch 'upstream/pull/3747'
authorTom Hughes <tom@compton.nu>
Sun, 9 Oct 2022 17:10:20 +0000 (18:10 +0100)
committerTom Hughes <tom@compton.nu>
Sun, 9 Oct 2022 17:10:20 +0000 (18:10 +0100)
app/assets/javascripts/leaflet.map.js
test/system/index_test.rb
yarn.lock

index b2d4abcb72719fd4b93f4bd218c29e48ebaee441..44aa530d9b39e2dd4aa8399dba5cedbca42b4500 100644 (file)
@@ -261,11 +261,13 @@ L.OSM.Map = L.Map.extend({
 
       L.circleMarker(object.latLng, haloStyle).addTo(this._objectLayer);
 
-      L.marker(object.latLng, {
-        icon: object.icon,
-        opacity: 1,
-        interactive: true
-      }).addTo(this._objectLayer);
+      if (object.icon) {
+        L.marker(object.latLng, {
+          icon: object.icon,
+          opacity: 1,
+          interactive: true
+        }).addTo(this._objectLayer);
+      }
 
       if (callback) callback(this._objectLayer.getBounds());
     } else { // element or changeset handled by L.OSM.DataLayer
index bb23cee60180aed99fbe388898735c80078dc099..1167797c5b8b85781a91e479fa21553c6cc22b6b 100644 (file)
@@ -18,4 +18,23 @@ class IndexTest < ApplicationSystemTestCase
     find("#sidebar .btn-close").click
     assert_no_selector "#editanchor[href*='?note=#{note.id}#']"
   end
+
+  test "can navigate from hidden note to visible note" do
+    sign_in_as(create(:moderator_user))
+    hidden_note = create(:note, :status => "hidden")
+    create(:note_comment, :note => hidden_note, :body => "this-is-a-hidden-note")
+    position = (1.003 * GeoRecord::SCALE).to_i
+    visible_note = create(:note, :latitude => position, :longitude => position)
+    create(:note_comment, :note => visible_note, :body => "this-is-a-visible-note")
+
+    visit root_path(:anchor => "map=15/1/1") # view place of hidden note in case it is not rendered during browse_note_path(hidden_note)
+    visit browse_note_path(hidden_note)
+    find(".leaflet-control.control-layers .control-button").click
+    find("#map-ui .overlay-layers .form-check-label", :text => "Map Notes").click
+    visible_note_marker = find(".leaflet-marker-icon[title=this-is-a-visible-note]")
+    assert_selector "#sidebar", :text => "this-is-a-hidden-note"
+
+    visible_note_marker.click
+    assert_selector "#sidebar", :text => "this-is-a-visible-note"
+  end
 end
index 203572f2595c74b97341f1a722a16d07c2958ae9..2e687f3efe63fb9504d5712fae0aa28f8655f98f 100644 (file)
--- a/yarn.lock
+++ b/yarn.lock
@@ -2,10 +2,10 @@
 # yarn lockfile v1
 
 
-"@eslint/eslintrc@^1.3.2":
-  version "1.3.2"
-  resolved "https://registry.yarnpkg.com/@eslint/eslintrc/-/eslintrc-1.3.2.tgz#58b69582f3b7271d8fa67fe5251767a5b38ea356"
-  integrity sha512-AXYd23w1S/bv3fTs3Lz0vjiYemS08jWkI3hYyS9I1ry+0f+Yjs1wm+sU0BS8qDOPrBIkp4qHYC16I8uVtpLajQ==
+"@eslint/eslintrc@^1.3.3":
+  version "1.3.3"
+  resolved "https://registry.yarnpkg.com/@eslint/eslintrc/-/eslintrc-1.3.3.tgz#2b044ab39fdfa75b4688184f9e573ce3c5b0ff95"
+  integrity sha512-uj3pT6Mg+3t39fvLrj8iuCIJ38zKO9FpGtJ4BBJebJhEwjoT+KLVNCcHT5QC9NGRIEi7fZ0ZR8YRb884auB4Lg==
   dependencies:
     ajv "^6.12.4"
     debug "^4.3.2"
     debug "^4.1.1"
     minimatch "^3.0.4"
 
-"@humanwhocodes/gitignore-to-minimatch@^1.0.2":
-  version "1.0.2"
-  resolved "https://registry.yarnpkg.com/@humanwhocodes/gitignore-to-minimatch/-/gitignore-to-minimatch-1.0.2.tgz#316b0a63b91c10e53f242efb4ace5c3b34e8728d"
-  integrity sha512-rSqmMJDdLFUsyxR6FMtD00nfQKKLFb1kv+qBbOVKqErvloEIJLo5bDTJTQNTYgeyp78JsA7u/NPi5jT1GR/MuA==
-
 "@humanwhocodes/module-importer@^1.0.1":
   version "1.0.1"
   resolved "https://registry.yarnpkg.com/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz#af5b2691a22b44be847b0ca81641c5fb6ad0172c"
@@ -239,13 +234,12 @@ eslint-visitor-keys@^3.3.0:
   integrity sha512-mQ+suqKJVyeuwGYHAdjMFqjCyfl8+Ldnxuyp3ldiMBFKkvytrXUZWaiPCEav8qDHKty44bD+qV1IP4T+w+xXRA==
 
 eslint@^8.0.0:
-  version "8.24.0"
-  resolved "https://registry.yarnpkg.com/eslint/-/eslint-8.24.0.tgz#489516c927a5da11b3979dbfb2679394523383c8"
-  integrity sha512-dWFaPhGhTAiPcCgm3f6LI2MBWbogMnTJzFBbhXVRQDJPkr9pGZvVjlVfXd+vyDcWPA2Ic9L2AXPIQM0+vk/cSQ==
+  version "8.25.0"
+  resolved "https://registry.yarnpkg.com/eslint/-/eslint-8.25.0.tgz#00eb962f50962165d0c4ee3327708315eaa8058b"
+  integrity sha512-DVlJOZ4Pn50zcKW5bYH7GQK/9MsoQG2d5eDH0ebEkE8PbgzTTmtt/VTH9GGJ4BfeZCpBLqFfvsjX35UacUL83A==
   dependencies:
-    "@eslint/eslintrc" "^1.3.2"
+    "@eslint/eslintrc" "^1.3.3"
     "@humanwhocodes/config-array" "^0.10.5"
-    "@humanwhocodes/gitignore-to-minimatch" "^1.0.2"
     "@humanwhocodes/module-importer" "^1.0.1"
     ajv "^6.10.0"
     chalk "^4.0.0"