umap-project 2.9.0b0__py3-none-any.whl → 2.9.1__py3-none-any.whl

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.
Files changed (204) hide show
  1. umap/__init__.py +1 -1
  2. umap/admin.py +15 -2
  3. umap/locale/br/LC_MESSAGES/django.mo +0 -0
  4. umap/locale/br/LC_MESSAGES/django.po +111 -67
  5. umap/locale/cs_CZ/LC_MESSAGES/django.mo +0 -0
  6. umap/locale/cs_CZ/LC_MESSAGES/django.po +112 -67
  7. umap/locale/el/LC_MESSAGES/django.mo +0 -0
  8. umap/locale/el/LC_MESSAGES/django.po +132 -87
  9. umap/locale/en/LC_MESSAGES/django.po +11 -10
  10. umap/locale/es/LC_MESSAGES/django.mo +0 -0
  11. umap/locale/es/LC_MESSAGES/django.po +117 -71
  12. umap/locale/fr/LC_MESSAGES/django.mo +0 -0
  13. umap/locale/fr/LC_MESSAGES/django.po +11 -10
  14. umap/locale/gl/LC_MESSAGES/django.mo +0 -0
  15. umap/locale/gl/LC_MESSAGES/django.po +219 -173
  16. umap/locale/it/LC_MESSAGES/django.mo +0 -0
  17. umap/locale/it/LC_MESSAGES/django.po +145 -100
  18. umap/locale/nl/LC_MESSAGES/django.mo +0 -0
  19. umap/locale/nl/LC_MESSAGES/django.po +198 -152
  20. umap/locale/pt/LC_MESSAGES/django.mo +0 -0
  21. umap/locale/pt/LC_MESSAGES/django.po +118 -73
  22. umap/locale/zh_TW/LC_MESSAGES/django.mo +0 -0
  23. umap/locale/zh_TW/LC_MESSAGES/django.po +112 -67
  24. umap/middleware.py +30 -1
  25. umap/models.py +20 -10
  26. umap/settings/base.py +2 -1
  27. umap/static/umap/base.css +4 -1
  28. umap/static/umap/css/bar.css +32 -0
  29. umap/static/umap/css/contextmenu.css +14 -2
  30. umap/static/umap/css/form.css +5 -10
  31. umap/static/umap/css/icon.css +39 -3
  32. umap/static/umap/css/panel.css +18 -1
  33. umap/static/umap/css/popup.css +0 -1
  34. umap/static/umap/img/16-white.svg +3 -3
  35. umap/static/umap/img/16.svg +1 -1
  36. umap/static/umap/img/24-white.svg +17 -16
  37. umap/static/umap/img/24.svg +29 -18
  38. umap/static/umap/img/providers/twitter-oauth2.png +0 -0
  39. umap/static/umap/img/source/16-white.svg +4 -4
  40. umap/static/umap/img/source/16.svg +1 -1
  41. umap/static/umap/img/source/24-white.svg +20 -18
  42. umap/static/umap/img/source/24.svg +30 -19
  43. umap/static/umap/js/modules/browser.js +2 -2
  44. umap/static/umap/js/modules/caption.js +4 -4
  45. umap/static/umap/js/modules/data/features.js +80 -32
  46. umap/static/umap/js/modules/data/layer.js +37 -50
  47. umap/static/umap/js/modules/form/builder.js +23 -22
  48. umap/static/umap/js/modules/form/fields.js +13 -5
  49. umap/static/umap/js/modules/formatter.js +6 -2
  50. umap/static/umap/js/modules/help.js +17 -23
  51. umap/static/umap/js/modules/importer.js +5 -2
  52. umap/static/umap/js/modules/permissions.js +6 -2
  53. umap/static/umap/js/modules/rendering/layers/classified.js +1 -1
  54. umap/static/umap/js/modules/rendering/map.js +1 -21
  55. umap/static/umap/js/modules/rendering/ui.js +20 -38
  56. umap/static/umap/js/modules/rules.js +1 -1
  57. umap/static/umap/js/modules/saving.js +5 -0
  58. umap/static/umap/js/modules/schema.js +4 -1
  59. umap/static/umap/js/modules/sync/engine.js +39 -14
  60. umap/static/umap/js/modules/sync/updaters.js +7 -6
  61. umap/static/umap/js/modules/sync/websocket.js +48 -40
  62. umap/static/umap/js/modules/ui/bar.js +84 -0
  63. umap/static/umap/js/modules/ui/contextmenu.js +9 -2
  64. umap/static/umap/js/modules/ui/panel.js +5 -1
  65. umap/static/umap/js/modules/umap.js +85 -44
  66. umap/static/umap/js/umap.controls.js +11 -341
  67. umap/static/umap/locale/am_ET.js +17 -5
  68. umap/static/umap/locale/am_ET.json +17 -5
  69. umap/static/umap/locale/ar.js +17 -5
  70. umap/static/umap/locale/ar.json +17 -5
  71. umap/static/umap/locale/ast.js +17 -5
  72. umap/static/umap/locale/ast.json +17 -5
  73. umap/static/umap/locale/bg.js +17 -5
  74. umap/static/umap/locale/bg.json +17 -5
  75. umap/static/umap/locale/br.js +20 -15
  76. umap/static/umap/locale/br.json +20 -15
  77. umap/static/umap/locale/ca.js +8 -4
  78. umap/static/umap/locale/ca.json +8 -4
  79. umap/static/umap/locale/cs_CZ.js +8 -4
  80. umap/static/umap/locale/cs_CZ.json +8 -4
  81. umap/static/umap/locale/da.js +17 -5
  82. umap/static/umap/locale/da.json +17 -5
  83. umap/static/umap/locale/de.js +8 -4
  84. umap/static/umap/locale/de.json +8 -4
  85. umap/static/umap/locale/el.js +54 -50
  86. umap/static/umap/locale/el.json +54 -50
  87. umap/static/umap/locale/en.js +9 -4
  88. umap/static/umap/locale/en.json +9 -4
  89. umap/static/umap/locale/en_US.json +17 -5
  90. umap/static/umap/locale/es.js +13 -9
  91. umap/static/umap/locale/es.json +13 -9
  92. umap/static/umap/locale/et.js +17 -5
  93. umap/static/umap/locale/et.json +17 -5
  94. umap/static/umap/locale/eu.js +8 -4
  95. umap/static/umap/locale/eu.json +8 -4
  96. umap/static/umap/locale/fa_IR.js +8 -4
  97. umap/static/umap/locale/fa_IR.json +8 -4
  98. umap/static/umap/locale/fi.js +17 -5
  99. umap/static/umap/locale/fi.json +17 -5
  100. umap/static/umap/locale/fr.js +9 -4
  101. umap/static/umap/locale/fr.json +9 -4
  102. umap/static/umap/locale/gl.js +13 -9
  103. umap/static/umap/locale/gl.json +13 -9
  104. umap/static/umap/locale/he.js +17 -5
  105. umap/static/umap/locale/he.json +17 -5
  106. umap/static/umap/locale/hr.js +17 -5
  107. umap/static/umap/locale/hr.json +17 -5
  108. umap/static/umap/locale/hu.js +8 -4
  109. umap/static/umap/locale/hu.json +8 -4
  110. umap/static/umap/locale/id.js +17 -5
  111. umap/static/umap/locale/id.json +17 -5
  112. umap/static/umap/locale/is.js +17 -5
  113. umap/static/umap/locale/is.json +17 -5
  114. umap/static/umap/locale/it.js +31 -27
  115. umap/static/umap/locale/it.json +31 -27
  116. umap/static/umap/locale/ja.js +17 -5
  117. umap/static/umap/locale/ja.json +17 -5
  118. umap/static/umap/locale/ko.js +17 -5
  119. umap/static/umap/locale/ko.json +17 -5
  120. umap/static/umap/locale/lt.js +17 -5
  121. umap/static/umap/locale/lt.json +17 -5
  122. umap/static/umap/locale/ms.js +8 -4
  123. umap/static/umap/locale/ms.json +8 -4
  124. umap/static/umap/locale/nl.js +132 -127
  125. umap/static/umap/locale/nl.json +132 -127
  126. umap/static/umap/locale/no.js +17 -5
  127. umap/static/umap/locale/no.json +17 -5
  128. umap/static/umap/locale/pl.js +8 -4
  129. umap/static/umap/locale/pl.json +8 -4
  130. umap/static/umap/locale/pl_PL.json +17 -5
  131. umap/static/umap/locale/pt.js +38 -33
  132. umap/static/umap/locale/pt.json +38 -33
  133. umap/static/umap/locale/pt_BR.js +17 -5
  134. umap/static/umap/locale/pt_BR.json +17 -5
  135. umap/static/umap/locale/pt_PT.js +8 -4
  136. umap/static/umap/locale/pt_PT.json +8 -4
  137. umap/static/umap/locale/ro.js +17 -5
  138. umap/static/umap/locale/ro.json +17 -5
  139. umap/static/umap/locale/ru.js +17 -5
  140. umap/static/umap/locale/ru.json +17 -5
  141. umap/static/umap/locale/sk_SK.js +17 -5
  142. umap/static/umap/locale/sk_SK.json +17 -5
  143. umap/static/umap/locale/sl.js +17 -5
  144. umap/static/umap/locale/sl.json +17 -5
  145. umap/static/umap/locale/sr.js +17 -5
  146. umap/static/umap/locale/sr.json +17 -5
  147. umap/static/umap/locale/sv.js +17 -5
  148. umap/static/umap/locale/sv.json +17 -5
  149. umap/static/umap/locale/th_TH.js +8 -4
  150. umap/static/umap/locale/th_TH.json +8 -4
  151. umap/static/umap/locale/tr.js +17 -5
  152. umap/static/umap/locale/tr.json +17 -5
  153. umap/static/umap/locale/uk_UA.js +17 -5
  154. umap/static/umap/locale/uk_UA.json +17 -5
  155. umap/static/umap/locale/vi.js +17 -5
  156. umap/static/umap/locale/vi.json +17 -5
  157. umap/static/umap/locale/vi_VN.json +17 -5
  158. umap/static/umap/locale/zh.js +17 -5
  159. umap/static/umap/locale/zh.json +17 -5
  160. umap/static/umap/locale/zh_CN.json +17 -5
  161. umap/static/umap/locale/zh_TW.Big5.json +17 -5
  162. umap/static/umap/locale/zh_TW.js +14 -10
  163. umap/static/umap/locale/zh_TW.json +14 -10
  164. umap/static/umap/map.css +17 -68
  165. umap/static/umap/nav.css +4 -0
  166. umap/static/umap/vars.css +1 -0
  167. umap/static/umap/vendors/dompurify/purify.es.js +138 -354
  168. umap/static/umap/vendors/dompurify/purify.es.mjs.map +1 -1
  169. umap/static/umap/vendors/editable/Leaflet.Editable.js +1 -0
  170. umap/sync/app.py +19 -13
  171. umap/sync/payloads.py +8 -1
  172. umap/templates/auth/user_form.html +2 -2
  173. umap/templates/umap/content_footer.html +1 -1
  174. umap/templates/umap/css.html +0 -2
  175. umap/templates/umap/js.html +0 -1
  176. umap/templates/umap/messages.html +5 -1
  177. umap/templates/umap/search_bar.html +1 -0
  178. umap/tests/integration/test_anonymous_owned_map.py +2 -2
  179. umap/tests/integration/test_basics.py +2 -5
  180. umap/tests/integration/test_categorized_layer.py +4 -8
  181. umap/tests/integration/test_choropleth.py +1 -1
  182. umap/tests/integration/test_conditional_rules.py +3 -3
  183. umap/tests/integration/test_draw_polygon.py +11 -19
  184. umap/tests/integration/test_draw_polyline.py +6 -14
  185. umap/tests/integration/test_edit_datalayer.py +10 -10
  186. umap/tests/integration/test_edit_map.py +27 -1
  187. umap/tests/integration/test_edit_marker.py +5 -5
  188. umap/tests/integration/test_edit_polygon.py +5 -5
  189. umap/tests/integration/test_features_id_generation.py +2 -6
  190. umap/tests/integration/test_import.py +93 -29
  191. umap/tests/integration/test_owned_map.py +1 -1
  192. umap/tests/integration/test_save.py +2 -2
  193. umap/tests/integration/test_tableeditor.py +7 -7
  194. umap/tests/integration/test_view_marker.py +10 -0
  195. umap/tests/integration/test_websocket_sync.py +128 -32
  196. umap/utils.py +4 -1
  197. umap/views.py +0 -9
  198. {umap_project-2.9.0b0.dist-info → umap_project-2.9.1.dist-info}/METADATA +13 -13
  199. {umap_project-2.9.0b0.dist-info → umap_project-2.9.1.dist-info}/RECORD +202 -204
  200. umap/static/umap/vendors/toolbar/leaflet.toolbar.css +0 -1
  201. umap/static/umap/vendors/toolbar/leaflet.toolbar.js +0 -1
  202. {umap_project-2.9.0b0.dist-info → umap_project-2.9.1.dist-info}/WHEEL +0 -0
  203. {umap_project-2.9.0b0.dist-info → umap_project-2.9.1.dist-info}/entry_points.txt +0 -0
  204. {umap_project-2.9.0b0.dist-info → umap_project-2.9.1.dist-info}/licenses/LICENSE +0 -0
@@ -17,15 +17,15 @@ pytestmark = pytest.mark.django_db
17
17
  def test_layers_list_is_updated(live_server, tilelayer, page):
18
18
  page.goto(f"{live_server.url}/map/new/")
19
19
  modifier = "Cmd" if platform.system() == "Darwin" else "Ctrl"
20
- page.get_by_role("link", name=f"Import data ({modifier}+I)").click()
20
+ page.get_by_role("button", name=f"Import data ({modifier}+I)").click()
21
21
  # Should work
22
22
  page.locator("[name=layer-id]").select_option(label="Import in a new layer")
23
- page.get_by_role("link", name="Manage layers").click()
23
+ page.get_by_role("button", name="Manage layers").click()
24
24
  page.get_by_role("button", name="Add a layer").click()
25
25
  page.locator('input[name="name"]').click()
26
26
  page.locator('input[name="name"]').fill("foobar")
27
27
  page.wait_for_timeout(300) # Time for the input debounce.
28
- page.get_by_role("link", name=f"Import data ({modifier}+I)").click()
28
+ page.get_by_role("button", name=f"Import data ({modifier}+I)").click()
29
29
  # Should still work
30
30
  page.locator("[name=layer-id]").select_option(label="Import in a new layer")
31
31
  # Now layer should be visible in the options
@@ -76,7 +76,7 @@ def test_umap_import_from_textarea(live_server, tilelayer, page, settings):
76
76
  page.goto(f"{live_server.url}/map/new/")
77
77
  page.get_by_role("button", name="Open browser").click()
78
78
  page.get_by_title("Import data").click()
79
- textarea = page.locator(".umap-upload textarea")
79
+ textarea = page.locator(".umap-import textarea")
80
80
  path = Path(__file__).parent.parent / "fixtures/test_upload_data.umap"
81
81
  textarea.fill(path.read_text())
82
82
  page.locator('select[name="format"]').select_option("umap")
@@ -111,7 +111,7 @@ def test_import_geojson_from_textarea(tilelayer, live_server, page):
111
111
  button = page.get_by_title("Import data")
112
112
  expect(button).to_be_visible()
113
113
  button.click()
114
- textarea = page.locator(".umap-upload textarea")
114
+ textarea = page.locator(".umap-import textarea")
115
115
  path = Path(__file__).parent.parent / "fixtures/test_upload_data.json"
116
116
  textarea.fill(path.read_text())
117
117
  page.locator('select[name="format"]').select_option("geojson")
@@ -136,7 +136,7 @@ def test_import_invalid_data(tilelayer, live_server, page):
136
136
  button = page.get_by_title("Import data")
137
137
  expect(button).to_be_visible()
138
138
  button.click()
139
- textarea = page.locator(".umap-upload textarea")
139
+ textarea = page.locator(".umap-import textarea")
140
140
  textarea.fill("invalid data")
141
141
  for format in ["geojson", "csv", "gpx", "kml", "georss", "osm", "umap"]:
142
142
  page.locator('select[name="format"]').select_option(format)
@@ -156,7 +156,7 @@ def test_import_kml_from_textarea(tilelayer, live_server, page):
156
156
  button = page.get_by_title("Import data")
157
157
  expect(button).to_be_visible()
158
158
  button.click()
159
- textarea = page.locator(".umap-upload textarea")
159
+ textarea = page.locator(".umap-import textarea")
160
160
  path = Path(__file__).parent.parent / "fixtures/test_upload_data.kml"
161
161
  textarea.fill(path.read_text())
162
162
  page.locator('select[name="format"]').select_option("kml")
@@ -180,7 +180,7 @@ def test_import_gpx_from_textarea(tilelayer, live_server, page, settings):
180
180
  button = page.get_by_title("Import data")
181
181
  expect(button).to_be_visible()
182
182
  button.click()
183
- textarea = page.locator(".umap-upload textarea")
183
+ textarea = page.locator(".umap-import textarea")
184
184
  path = Path(__file__).parent.parent / "fixtures/test_upload_data.gpx"
185
185
  textarea.fill(path.read_text())
186
186
  page.locator('select[name="format"]').select_option("gpx")
@@ -237,7 +237,7 @@ def test_import_osm_from_textarea(tilelayer, live_server, page):
237
237
  button = page.get_by_title("Import data")
238
238
  expect(button).to_be_visible()
239
239
  button.click()
240
- textarea = page.locator(".umap-upload textarea")
240
+ textarea = page.locator(".umap-import textarea")
241
241
  path = Path(__file__).parent.parent / "fixtures/test_upload_data_osm.json"
242
242
  textarea.fill(path.read_text())
243
243
  page.locator('select[name="format"]').select_option("osm")
@@ -257,7 +257,7 @@ def test_import_csv_from_textarea(tilelayer, live_server, page):
257
257
  button = page.get_by_title("Import data")
258
258
  expect(button).to_be_visible()
259
259
  button.click()
260
- textarea = page.locator(".umap-upload textarea")
260
+ textarea = page.locator(".umap-import textarea")
261
261
  path = Path(__file__).parent.parent / "fixtures/test_upload_data.csv"
262
262
  textarea.fill(path.read_text())
263
263
  page.locator('select[name="format"]').select_option("csv")
@@ -276,7 +276,7 @@ def test_can_import_in_existing_datalayer(live_server, datalayer, page, openmap)
276
276
  expect(layers).to_have_count(1)
277
277
  page.get_by_role("button", name="Edit").click()
278
278
  page.get_by_title("Import data").click()
279
- textarea = page.locator(".umap-upload textarea")
279
+ textarea = page.locator(".umap-import textarea")
280
280
  path = Path(__file__).parent.parent / "fixtures/test_upload_data.csv"
281
281
  textarea.fill(path.read_text())
282
282
  page.locator('select[name="format"]').select_option("csv")
@@ -297,7 +297,7 @@ def test_can_replace_datalayer_data(live_server, datalayer, page, openmap):
297
297
  expect(layers).to_have_count(1)
298
298
  page.get_by_role("button", name="Edit").click()
299
299
  page.get_by_title("Import data").click()
300
- textarea = page.locator(".umap-upload textarea")
300
+ textarea = page.locator(".umap-import textarea")
301
301
  path = Path(__file__).parent.parent / "fixtures/test_upload_data.csv"
302
302
  textarea.fill(path.read_text())
303
303
  page.locator('select[name="format"]').select_option("csv")
@@ -318,7 +318,7 @@ def test_can_import_in_new_datalayer(live_server, datalayer, page, openmap):
318
318
  expect(layers).to_have_count(1)
319
319
  page.get_by_role("button", name="Edit").click()
320
320
  page.get_by_title("Import data").click()
321
- textarea = page.locator(".umap-upload textarea")
321
+ textarea = page.locator(".umap-import textarea")
322
322
  path = Path(__file__).parent.parent / "fixtures/test_upload_data.csv"
323
323
  textarea.fill(path.read_text())
324
324
  page.locator("select[name=format]").select_option("csv")
@@ -364,7 +364,7 @@ def test_should_remove_dot_in_property_names(live_server, page, settings, tilela
364
364
  }
365
365
  page.goto(f"{live_server.url}/map/new/")
366
366
  page.get_by_title("Import data").click()
367
- textarea = page.locator(".umap-upload textarea")
367
+ textarea = page.locator(".umap-import textarea")
368
368
  textarea.fill(json.dumps(data))
369
369
  page.locator('select[name="format"]').select_option("geojson")
370
370
  page.get_by_role("button", name="Import data", exact=True).click()
@@ -425,7 +425,7 @@ def test_import_geometry_collection(live_server, page, tilelayer):
425
425
  button = page.get_by_title("Import data")
426
426
  expect(button).to_be_visible()
427
427
  button.click()
428
- textarea = page.locator(".umap-upload textarea")
428
+ textarea = page.locator(".umap-import textarea")
429
429
  textarea.fill(json.dumps(data))
430
430
  page.locator('select[name="format"]').select_option("geojson")
431
431
  page.get_by_role("button", name="Import data", exact=True).click()
@@ -459,7 +459,7 @@ def test_import_multipolygon(live_server, page, tilelayer):
459
459
  button = page.get_by_title("Import data")
460
460
  expect(button).to_be_visible()
461
461
  button.click()
462
- textarea = page.locator(".umap-upload textarea")
462
+ textarea = page.locator(".umap-import textarea")
463
463
  textarea.fill(json.dumps(data))
464
464
  page.locator('select[name="format"]').select_option("geojson")
465
465
  page.get_by_role("button", name="Import data", exact=True).click()
@@ -491,7 +491,7 @@ def test_import_multipolyline(live_server, page, tilelayer):
491
491
  button = page.get_by_title("Import data")
492
492
  expect(button).to_be_visible()
493
493
  button.click()
494
- textarea = page.locator(".umap-upload textarea")
494
+ textarea = page.locator(".umap-import textarea")
495
495
  textarea.fill(json.dumps(data))
496
496
  page.locator('select[name="format"]').select_option("geojson")
497
497
  page.get_by_role("button", name="Import data", exact=True).click()
@@ -500,13 +500,77 @@ def test_import_multipolyline(live_server, page, tilelayer):
500
500
  expect(paths).to_have_count(1)
501
501
 
502
502
 
503
+ def test_should_not_import_empty_coordinates(live_server, page, tilelayer):
504
+ data = {
505
+ "type": "FeatureCollection",
506
+ "features": [
507
+ {
508
+ "type": "Feature",
509
+ "properties": {"name": "An empty polygon"},
510
+ "geometry": {
511
+ "type": "Polygon",
512
+ "coordinates": [],
513
+ },
514
+ },
515
+ {
516
+ "type": "Feature",
517
+ "properties": {"name": "An empty linestring"},
518
+ "geometry": {
519
+ "type": "LineString",
520
+ "coordinates": [],
521
+ },
522
+ },
523
+ {
524
+ "type": "Feature",
525
+ "properties": {"name": "An empty point"},
526
+ "geometry": {
527
+ "type": "Point",
528
+ "coordinates": [],
529
+ },
530
+ },
531
+ {
532
+ "geometry": {
533
+ "type": "Point",
534
+ "coordinates": [6.922931671142578, 47.481161607175736],
535
+ },
536
+ "type": "Feature",
537
+ "properties": {"name": "A point"},
538
+ },
539
+ {
540
+ "geometry": {
541
+ "type": "LineString",
542
+ "coordinates": [
543
+ [2.4609375, 48.88639177703194],
544
+ [2.48291015625, 48.76343113791796],
545
+ [2.164306640625, 48.719961222646276],
546
+ ],
547
+ },
548
+ "type": "Feature",
549
+ "properties": {
550
+ "name": "A linestring",
551
+ },
552
+ },
553
+ ],
554
+ }
555
+ page.goto(f"{live_server.url}/map/new/")
556
+ page.get_by_title("Open browser").click()
557
+ page.get_by_title("Import data").click()
558
+ textarea = page.locator(".umap-import textarea")
559
+ textarea.fill(json.dumps(data))
560
+ page.locator('select[name="format"]').select_option("geojson")
561
+ page.get_by_role("button", name="Import data", exact=True).click()
562
+ page.locator("#map").click(button="right")
563
+ page.get_by_role("button", name="browse data").click()
564
+ expect(page.locator("li.feature")).to_have_count(2)
565
+
566
+
503
567
  def test_import_csv_without_valid_latlon_headers(tilelayer, live_server, page):
504
568
  page.goto(f"{live_server.url}/map/new/")
505
569
  page.get_by_title("Open browser").click()
506
570
  layers = page.locator(".umap-browser .datalayer")
507
571
  markers = page.locator(".leaflet-marker-icon")
508
572
  page.get_by_title("Import data").click()
509
- textarea = page.locator(".umap-upload textarea")
573
+ textarea = page.locator(".umap-import textarea")
510
574
  textarea.fill("a,b,c\n12.23,48.34,mypoint\n12.23,48.34,mypoint2")
511
575
  page.locator('select[name="format"]').select_option("csv")
512
576
  page.get_by_role("button", name="Import data", exact=True).click()
@@ -523,7 +587,7 @@ def test_import_csv_with_commas_in_latlon(tilelayer, live_server, page, settings
523
587
  layers = page.locator(".umap-browser .datalayer")
524
588
  markers = page.locator(".leaflet-marker-icon")
525
589
  page.get_by_title("Import data").click()
526
- textarea = page.locator(".umap-upload textarea")
590
+ textarea = page.locator(".umap-import textarea")
527
591
  textarea.fill("lat;lon;foobar\n12,24;48,34;mypoint\n12,23;48,35;mypoint2")
528
592
  page.locator('select[name="format"]').select_option("csv")
529
593
  page.get_by_role("button", name="Import data", exact=True).click()
@@ -571,14 +635,14 @@ def test_create_remote_data(page, live_server, tilelayer):
571
635
  page.route("*/**/ajax-proxy/**", handle)
572
636
  page.goto(f"{live_server.url}/map/new/")
573
637
  expect(page.locator(".leaflet-marker-icon")).to_be_hidden()
574
- page.get_by_role("link", name="Import data").click()
638
+ page.get_by_role("button", name="Import data").click()
575
639
  page.get_by_placeholder("Provide an URL here").click()
576
640
  page.get_by_placeholder("Provide an URL here").fill("https://remote.org/data.json")
577
641
  page.locator("[name=format]").select_option("geojson")
578
642
  page.get_by_role("radio", name="Link to the layer as remote data").click()
579
643
  page.get_by_role("button", name="Import data", exact=True).click()
580
644
  expect(page.locator(".leaflet-marker-icon")).to_be_visible()
581
- page.get_by_role("link", name="Manage layers").click()
645
+ page.get_by_role("button", name="Manage layers").click()
582
646
  page.get_by_role("button", name="Edit", exact=True).click()
583
647
  page.locator("summary").filter(has_text="Remote data").click()
584
648
  expect(page.locator('.panel input[name="url"]')).to_have_value(
@@ -608,14 +672,14 @@ def test_import_geojson_from_url(page, live_server, tilelayer):
608
672
  page.route("https://remote.org/data.json", handle)
609
673
  page.goto(f"{live_server.url}/map/new/")
610
674
  expect(page.locator(".leaflet-marker-icon")).to_be_hidden()
611
- page.get_by_role("link", name="Import data").click()
675
+ page.get_by_role("button", name="Import data").click()
612
676
  page.get_by_placeholder("Provide an URL here").click()
613
677
  page.get_by_placeholder("Provide an URL here").fill("https://remote.org/data.json")
614
678
  page.locator("[name=format]").select_option("geojson")
615
679
  page.get_by_role("radio", name="Copy into the layer").click()
616
680
  page.get_by_role("button", name="Import data", exact=True).click()
617
681
  expect(page.locator(".leaflet-marker-icon")).to_be_visible()
618
- page.get_by_role("link", name="Manage layers").click()
682
+ page.get_by_role("button", name="Manage layers").click()
619
683
  page.get_by_role("button", name="Edit", exact=True).click()
620
684
  page.locator("summary").filter(has_text="Remote data").click()
621
685
  expect(page.locator('.panel input[name="url"]')).to_have_value("")
@@ -626,7 +690,7 @@ def test_overpass_import_with_bbox(page, live_server, tilelayer, settings):
626
690
  "overpass": {"url": "https://my.overpass.io/interpreter"}
627
691
  }
628
692
  page.goto(f"{live_server.url}/map/new/")
629
- page.get_by_role("link", name="Import data").click()
693
+ page.get_by_role("button", name="Import data").click()
630
694
  page.get_by_role("button", name="Import helpers").click()
631
695
  page.get_by_role("button", name="Overpass").click()
632
696
  page.get_by_placeholder("amenity=drinking_water").fill("building")
@@ -677,7 +741,7 @@ def test_overpass_import_retains_boundary(page, live_server, tilelayer, settings
677
741
  # Intercept the route
678
742
  page.route(re.compile("https://foobar.io/api.*"), handle)
679
743
  page.goto(f"{live_server.url}/map/new/")
680
- page.get_by_role("link", name="Import data").click()
744
+ page.get_by_role("button", name="Import data").click()
681
745
  page.get_by_role("button", name="Import helpers").click()
682
746
  page.get_by_role("button", name="Overpass").click()
683
747
  page.get_by_placeholder("amenity=drinking_water").fill("building")
@@ -732,7 +796,7 @@ def test_import_from_datasets(page, live_server, tilelayer, settings):
732
796
  page.route("https://remote.org/data.json", handle)
733
797
  page.goto(f"{live_server.url}/map/new/")
734
798
  expect(page.locator(".leaflet-marker-icon")).to_be_hidden()
735
- page.get_by_role("link", name="Import data").click()
799
+ page.get_by_title("Import data").click()
736
800
  page.get_by_role("button", name="Import helpers").click()
737
801
  page.get_by_role("button", name="Datasets").click()
738
802
  page.get_by_role("dialog").get_by_role("combobox").select_option(
@@ -740,7 +804,7 @@ def test_import_from_datasets(page, live_server, tilelayer, settings):
740
804
  )
741
805
  page.get_by_role("button", name="Choose this dataset").click()
742
806
  page.get_by_label("Copy into the layer").check()
743
- page.get_by_role("button", name="Import data").click()
807
+ page.get_by_role("button", name="Import data", exact=True).click()
744
808
  expect(page.locator(".leaflet-marker-icon")).to_be_visible()
745
809
  page.get_by_role("button", name="Open browser").click()
746
810
  expect(page.locator("h5").get_by_text("Good data")).to_be_visible()
@@ -758,7 +822,7 @@ def test_import_osm_relation(tilelayer, live_server, page):
758
822
  button = page.get_by_title("Import data")
759
823
  expect(button).to_be_visible()
760
824
  button.click()
761
- textarea = page.locator(".umap-upload textarea")
825
+ textarea = page.locator(".umap-import textarea")
762
826
  file_path = Path(__file__).parent.parent / "fixtures/test_import_osm_relation.json"
763
827
  textarea.fill(file_path.read_text())
764
828
  page.locator('select[name="format"]').select_option("osm")
@@ -778,7 +842,7 @@ def test_import_georss_from_textarea(tilelayer, live_server, page):
778
842
  button = page.get_by_title("Import data")
779
843
  expect(button).to_be_visible()
780
844
  button.click()
781
- textarea = page.locator(".umap-upload textarea")
845
+ textarea = page.locator(".umap-import textarea")
782
846
  path = Path(__file__).parent.parent / "fixtures/test_upload_georss.xml"
783
847
  textarea.fill(path.read_text())
784
848
  page.locator('select[name="format"]').select_option("georss")
@@ -239,7 +239,7 @@ def test_can_delete_datalayer(live_server, map, login, datalayer):
239
239
  markers = page.locator(".leaflet-marker-icon")
240
240
  expect(layers).to_have_count(1)
241
241
  expect(markers).to_have_count(1)
242
- page.get_by_role("link", name="Manage layers").click()
242
+ page.get_by_role("button", name="Manage layers").click()
243
243
  page.locator(".panel.right").get_by_title("Delete layer").click()
244
244
  page.get_by_role("button", name="OK").click()
245
245
  with page.expect_response(re.compile(r".*/datalayer/delete/.*")):
@@ -5,7 +5,7 @@ def test_reseting_map_would_remove_from_save_queue(
5
5
  live_server, openmap, page, datalayer
6
6
  ):
7
7
  page.goto(f"{live_server.url}{openmap.get_absolute_url()}?edit")
8
- page.get_by_role("link", name="Edit map name and caption").click()
8
+ page.get_by_role("button", name="Edit map name and caption").click()
9
9
  requests = []
10
10
 
11
11
  def register_request(request):
@@ -20,7 +20,7 @@ def test_reseting_map_would_remove_from_save_queue(
20
20
  page.get_by_role("button", name="OK").click()
21
21
  page.wait_for_timeout(500)
22
22
  page.get_by_role("button", name="Edit").click()
23
- page.get_by_role("link", name="Manage layers").click()
23
+ page.get_by_role("button", name="Manage layers").click()
24
24
  page.get_by_role("button", name="Edit", exact=True).click()
25
25
  page.locator('input[name="name"]').click()
26
26
  page.locator('input[name="name"]').fill("new datalayer name")
@@ -67,7 +67,7 @@ DATALAYER_DATA = {
67
67
 
68
68
  def test_table_editor(live_server, openmap, datalayer, page):
69
69
  page.goto(f"{live_server.url}{openmap.get_absolute_url()}?edit")
70
- page.get_by_role("link", name="Manage layers").click()
70
+ page.get_by_role("button", name="Manage layers").click()
71
71
  page.locator(".panel").get_by_title("Edit properties in a table").click()
72
72
  page.get_by_text("Add a new property").click()
73
73
  page.locator("dialog").locator("input").fill("newprop")
@@ -89,7 +89,7 @@ def test_table_editor(live_server, openmap, datalayer, page):
89
89
 
90
90
  def test_cannot_add_existing_property_name(live_server, openmap, datalayer, page):
91
91
  page.goto(f"{live_server.url}{openmap.get_absolute_url()}?edit")
92
- page.get_by_role("link", name="Manage layers").click()
92
+ page.get_by_role("button", name="Manage layers").click()
93
93
  page.locator(".panel").get_by_title("Edit properties in a table").click()
94
94
  page.get_by_text("Add a new property").click()
95
95
  page.locator("dialog").locator("input").fill("name")
@@ -102,7 +102,7 @@ def test_cannot_add_existing_property_name(live_server, openmap, datalayer, page
102
102
 
103
103
  def test_cannot_add_property_with_a_dot(live_server, openmap, datalayer, page):
104
104
  page.goto(f"{live_server.url}{openmap.get_absolute_url()}?edit")
105
- page.get_by_role("link", name="Manage layers").click()
105
+ page.get_by_role("button", name="Manage layers").click()
106
106
  page.locator(".panel").get_by_title("Edit properties in a table").click()
107
107
  page.get_by_text("Add a new property").click()
108
108
  page.locator("dialog").locator("input").fill("foo.bar")
@@ -115,7 +115,7 @@ def test_cannot_add_property_with_a_dot(live_server, openmap, datalayer, page):
115
115
 
116
116
  def test_rename_property(live_server, openmap, datalayer, page):
117
117
  page.goto(f"{live_server.url}{openmap.get_absolute_url()}?edit")
118
- page.get_by_role("link", name="Manage layers").click()
118
+ page.get_by_role("button", name="Manage layers").click()
119
119
  page.locator(".panel").get_by_title("Edit properties in a table").click()
120
120
  expect(page.locator("table th button[data-property=name]")).to_have_count(1)
121
121
  page.locator("thead button[data-property=name]").click()
@@ -129,7 +129,7 @@ def test_rename_property(live_server, openmap, datalayer, page):
129
129
  def test_delete_selected_rows(live_server, openmap, page):
130
130
  DataLayerFactory(map=openmap, data=DATALAYER_DATA)
131
131
  page.goto(f"{live_server.url}{openmap.get_absolute_url()}?edit#6/48.093/1.890")
132
- page.get_by_role("link", name="Manage layers").click()
132
+ page.get_by_role("button", name="Manage layers").click()
133
133
  page.locator(".panel").get_by_title("Edit properties in a table").click()
134
134
  expect(page.locator("tbody tr")).to_have_count(4)
135
135
  expect(page.locator(".leaflet-marker-icon")).to_have_count(4)
@@ -143,7 +143,7 @@ def test_delete_selected_rows(live_server, openmap, page):
143
143
  def test_delete_all_rows(live_server, openmap, page):
144
144
  DataLayerFactory(map=openmap, data=DATALAYER_DATA)
145
145
  page.goto(f"{live_server.url}{openmap.get_absolute_url()}?edit#6/48.093/1.890")
146
- page.get_by_role("link", name="Manage layers").click()
146
+ page.get_by_role("button", name="Manage layers").click()
147
147
  page.locator(".panel").get_by_title("Edit properties in a table").click()
148
148
  expect(page.locator("tbody tr")).to_have_count(4)
149
149
  expect(page.locator(".leaflet-marker-icon")).to_have_count(4)
@@ -159,7 +159,7 @@ def test_filter_and_delete_rows(live_server, openmap, page):
159
159
  panel = page.locator(".panel.left.on")
160
160
  table = page.locator(".panel.full table")
161
161
  page.goto(f"{live_server.url}{openmap.get_absolute_url()}?edit#6/48.093/1.890")
162
- page.get_by_role("link", name="Manage layers").click()
162
+ page.get_by_role("button", name="Manage layers").click()
163
163
  page.locator(".panel").get_by_title("Edit properties in a table").click()
164
164
  expect(table.locator("tbody tr")).to_have_count(4)
165
165
  expect(page.locator(".leaflet-marker-icon")).to_have_count(4)
@@ -181,3 +181,13 @@ def test_only_visible_markers_are_added_to_dom(live_server, map, page):
181
181
  )
182
182
  expect(markers).to_have_count(1)
183
183
  expect(tooltips).to_have_count(1)
184
+
185
+
186
+ def test_should_display_tooltip_on_hover(live_server, map, page, bootstrap):
187
+ map.settings["properties"]["showLabel"] = None
188
+ map.settings["properties"]["labelKey"] = "Foo {name}"
189
+ map.save()
190
+ page.goto(f"{live_server.url}{map.get_absolute_url()}")
191
+ expect(page.get_by_text("Foo test marker")).to_be_hidden()
192
+ page.locator(".leaflet-marker-icon").hover()
193
+ expect(page.get_by_text("Foo test marker")).to_be_visible()