umap-project 2.2.2__py3-none-any.whl → 2.3.0__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.

Potentially problematic release.


This version of umap-project might be problematic. Click here for more details.

Files changed (144) hide show
  1. umap/__init__.py +1 -1
  2. umap/static/umap/base.css +83 -44
  3. umap/static/umap/css/icon.css +6 -0
  4. umap/static/umap/css/panel.css +9 -4
  5. umap/static/umap/img/16.svg +2 -2
  6. umap/static/umap/img/source/16.svg +3 -3
  7. umap/static/umap/js/modules/browser.js +63 -22
  8. umap/static/umap/js/modules/facets.js +14 -39
  9. umap/static/umap/js/modules/orderable.js +1 -1
  10. umap/static/umap/js/modules/schema.js +4 -4
  11. umap/static/umap/js/modules/urls.js +1 -1
  12. umap/static/umap/js/modules/utils.js +9 -1
  13. umap/static/umap/js/umap.controls.js +15 -11
  14. umap/static/umap/js/umap.core.js +17 -15
  15. umap/static/umap/js/umap.features.js +8 -2
  16. umap/static/umap/js/umap.forms.js +92 -33
  17. umap/static/umap/js/umap.js +19 -24
  18. umap/static/umap/js/umap.layer.js +3 -6
  19. umap/static/umap/locale/am_ET.js +11 -12
  20. umap/static/umap/locale/am_ET.json +11 -12
  21. umap/static/umap/locale/ar.js +11 -12
  22. umap/static/umap/locale/ar.json +11 -12
  23. umap/static/umap/locale/ast.js +11 -12
  24. umap/static/umap/locale/ast.json +11 -12
  25. umap/static/umap/locale/bg.js +11 -12
  26. umap/static/umap/locale/bg.json +11 -12
  27. umap/static/umap/locale/br.js +11 -12
  28. umap/static/umap/locale/br.json +11 -12
  29. umap/static/umap/locale/ca.js +11 -12
  30. umap/static/umap/locale/ca.json +11 -12
  31. umap/static/umap/locale/cs_CZ.js +11 -12
  32. umap/static/umap/locale/cs_CZ.json +11 -12
  33. umap/static/umap/locale/da.js +11 -12
  34. umap/static/umap/locale/da.json +11 -12
  35. umap/static/umap/locale/de.js +11 -12
  36. umap/static/umap/locale/de.json +11 -12
  37. umap/static/umap/locale/el.js +11 -12
  38. umap/static/umap/locale/el.json +11 -12
  39. umap/static/umap/locale/en.js +11 -12
  40. umap/static/umap/locale/en.json +11 -12
  41. umap/static/umap/locale/en_US.json +11 -12
  42. umap/static/umap/locale/es.js +11 -12
  43. umap/static/umap/locale/es.json +11 -12
  44. umap/static/umap/locale/et.js +11 -12
  45. umap/static/umap/locale/et.json +11 -12
  46. umap/static/umap/locale/eu.js +27 -16
  47. umap/static/umap/locale/eu.json +27 -16
  48. umap/static/umap/locale/fa_IR.js +11 -12
  49. umap/static/umap/locale/fa_IR.json +11 -12
  50. umap/static/umap/locale/fi.js +11 -12
  51. umap/static/umap/locale/fi.json +11 -12
  52. umap/static/umap/locale/fr.js +11 -12
  53. umap/static/umap/locale/fr.json +11 -12
  54. umap/static/umap/locale/gl.js +11 -12
  55. umap/static/umap/locale/gl.json +11 -12
  56. umap/static/umap/locale/he.js +11 -12
  57. umap/static/umap/locale/he.json +11 -12
  58. umap/static/umap/locale/hr.js +11 -12
  59. umap/static/umap/locale/hr.json +11 -12
  60. umap/static/umap/locale/hu.js +29 -30
  61. umap/static/umap/locale/hu.json +29 -30
  62. umap/static/umap/locale/id.js +11 -12
  63. umap/static/umap/locale/id.json +11 -12
  64. umap/static/umap/locale/is.js +11 -12
  65. umap/static/umap/locale/is.json +11 -12
  66. umap/static/umap/locale/it.js +11 -12
  67. umap/static/umap/locale/it.json +11 -12
  68. umap/static/umap/locale/ja.js +11 -12
  69. umap/static/umap/locale/ja.json +11 -12
  70. umap/static/umap/locale/ko.js +11 -12
  71. umap/static/umap/locale/ko.json +11 -12
  72. umap/static/umap/locale/lt.js +11 -12
  73. umap/static/umap/locale/lt.json +11 -12
  74. umap/static/umap/locale/ms.js +20 -21
  75. umap/static/umap/locale/ms.json +20 -21
  76. umap/static/umap/locale/nl.js +11 -12
  77. umap/static/umap/locale/nl.json +11 -12
  78. umap/static/umap/locale/no.js +11 -12
  79. umap/static/umap/locale/no.json +11 -12
  80. umap/static/umap/locale/pl.js +11 -12
  81. umap/static/umap/locale/pl.json +11 -12
  82. umap/static/umap/locale/pl_PL.json +11 -12
  83. umap/static/umap/locale/pt.js +11 -12
  84. umap/static/umap/locale/pt.json +11 -12
  85. umap/static/umap/locale/pt_BR.js +11 -12
  86. umap/static/umap/locale/pt_BR.json +11 -12
  87. umap/static/umap/locale/pt_PT.js +11 -12
  88. umap/static/umap/locale/pt_PT.json +11 -12
  89. umap/static/umap/locale/ro.js +11 -12
  90. umap/static/umap/locale/ro.json +11 -12
  91. umap/static/umap/locale/ru.js +11 -12
  92. umap/static/umap/locale/ru.json +11 -12
  93. umap/static/umap/locale/si.js +240 -227
  94. umap/static/umap/locale/si.json +240 -227
  95. umap/static/umap/locale/sk_SK.js +11 -12
  96. umap/static/umap/locale/sk_SK.json +11 -12
  97. umap/static/umap/locale/sl.js +11 -12
  98. umap/static/umap/locale/sl.json +11 -12
  99. umap/static/umap/locale/sr.js +11 -12
  100. umap/static/umap/locale/sr.json +11 -12
  101. umap/static/umap/locale/sv.js +11 -12
  102. umap/static/umap/locale/sv.json +11 -12
  103. umap/static/umap/locale/th_TH.js +11 -12
  104. umap/static/umap/locale/th_TH.json +11 -12
  105. umap/static/umap/locale/tr.js +11 -12
  106. umap/static/umap/locale/tr.json +11 -12
  107. umap/static/umap/locale/uk_UA.js +11 -12
  108. umap/static/umap/locale/uk_UA.json +11 -12
  109. umap/static/umap/locale/vi.js +11 -12
  110. umap/static/umap/locale/vi.json +11 -12
  111. umap/static/umap/locale/vi_VN.json +11 -12
  112. umap/static/umap/locale/zh.js +11 -12
  113. umap/static/umap/locale/zh.json +11 -12
  114. umap/static/umap/locale/zh_CN.json +11 -12
  115. umap/static/umap/locale/zh_TW.Big5.json +11 -12
  116. umap/static/umap/locale/zh_TW.js +11 -12
  117. umap/static/umap/locale/zh_TW.json +11 -12
  118. umap/static/umap/map.css +17 -2
  119. umap/static/umap/unittests/utils.js +7 -0
  120. umap/static/umap/vars.css +10 -0
  121. umap/static/umap/vendors/dompurify/purify.es.js +54 -5
  122. umap/static/umap/vendors/dompurify/purify.es.mjs.map +1 -1
  123. umap/tests/integration/conftest.py +5 -4
  124. umap/tests/integration/test_browser.py +7 -0
  125. umap/tests/integration/test_choropleth.py +1 -1
  126. umap/tests/integration/test_draw_polygon.py +6 -0
  127. umap/tests/integration/test_draw_polyline.py +6 -0
  128. umap/tests/integration/test_edit_datalayer.py +5 -5
  129. umap/tests/integration/test_edit_map.py +4 -4
  130. umap/tests/integration/test_edit_marker.py +6 -6
  131. umap/tests/integration/test_edit_polygon.py +6 -6
  132. umap/tests/integration/test_facets_browser.py +82 -13
  133. {umap_project-2.2.2.dist-info → umap_project-2.3.0.dist-info}/METADATA +8 -7
  134. {umap_project-2.2.2.dist-info → umap_project-2.3.0.dist-info}/RECORD +137 -144
  135. {umap_project-2.2.2.dist-info → umap_project-2.3.0.dist-info}/WHEEL +1 -1
  136. umap/.DS_Store +0 -0
  137. umap/static/.DS_Store +0 -0
  138. umap/static/umap/.DS_Store +0 -0
  139. umap/static/umap/favicons/.DS_Store +0 -0
  140. umap/static/umap/fonts/.DS_Store +0 -0
  141. umap/tests/.DS_Store +0 -0
  142. umap/tests/integration/.DS_Store +0 -0
  143. {umap_project-2.2.2.dist-info → umap_project-2.3.0.dist-info}/entry_points.txt +0 -0
  144. {umap_project-2.2.2.dist-info → umap_project-2.3.0.dist-info}/licenses/LICENSE +0 -0
@@ -1,14 +1,15 @@
1
1
  import os
2
2
 
3
3
  import pytest
4
+ from playwright.sync_api import expect
4
5
 
5
6
 
6
7
  @pytest.fixture(autouse=True)
7
8
  def set_timeout(context):
8
- context.set_default_timeout(int(os.environ.get("PLAYWRIGHT_TIMEOUT", 7500)))
9
- context.set_default_navigation_timeout(
10
- int(os.environ.get("PLAYWRIGHT_TIMEOUT", 7500))
11
- )
9
+ timeout = int(os.environ.get("PLAYWRIGHT_TIMEOUT", 7500))
10
+ context.set_default_timeout(timeout)
11
+ context.set_default_navigation_timeout(timeout)
12
+ expect.set_options(timeout=timeout)
12
13
 
13
14
 
14
15
  @pytest.fixture(autouse=True)
@@ -77,6 +77,7 @@ def test_data_browser_should_be_filterable(live_server, page, bootstrap, map):
77
77
  paths = page.locator(".leaflet-overlay-pane path")
78
78
  expect(markers).to_have_count(1)
79
79
  expect(paths).to_have_count(2)
80
+ page.locator(".filters summary").click()
80
81
  filter_ = page.locator("input[name='filter']")
81
82
  expect(filter_).to_be_visible()
82
83
  filter_.type("poly")
@@ -103,6 +104,7 @@ def test_data_browser_should_be_filterable(live_server, page, bootstrap, map):
103
104
  def test_data_browser_can_show_only_visible_features(live_server, page, bootstrap, map):
104
105
  # Zoom on France
105
106
  page.goto(f"{live_server.url}{map.get_absolute_url()}#6/51.000/2.000")
107
+ page.locator(".filters summary").click()
106
108
  el = page.get_by_text("Current map view")
107
109
  expect(el).to_be_visible()
108
110
  el.click()
@@ -114,6 +116,7 @@ def test_data_browser_can_show_only_visible_features(live_server, page, bootstra
114
116
  def test_data_browser_can_mix_filter_and_bbox(live_server, page, bootstrap, map):
115
117
  # Zoom on north west
116
118
  page.goto(f"{live_server.url}{map.get_absolute_url()}#4/61.98/-2.68")
119
+ page.locator(".filters summary").click()
117
120
  el = page.get_by_text("Current map view")
118
121
  expect(el).to_be_visible()
119
122
  el.click()
@@ -131,6 +134,7 @@ def test_data_browser_can_mix_filter_and_bbox(live_server, page, bootstrap, map)
131
134
  def test_data_browser_bbox_limit_should_be_dynamic(live_server, page, bootstrap, map):
132
135
  # Zoom on Europe
133
136
  page.goto(f"{live_server.url}{map.get_absolute_url()}#6/51.000/2.000")
137
+ page.locator(".filters summary").click()
134
138
  el = page.get_by_text("Current map view")
135
139
  expect(el).to_be_visible()
136
140
  el.click()
@@ -156,6 +160,7 @@ def test_data_browser_bbox_filter_should_be_persistent(
156
160
  ):
157
161
  # Zoom on Europe
158
162
  page.goto(f"{live_server.url}{map.get_absolute_url()}#6/51.000/2.000")
163
+ page.locator(".filters summary").click()
159
164
  el = page.get_by_text("Current map view")
160
165
  expect(el).to_be_visible()
161
166
  el.click()
@@ -181,6 +186,7 @@ def test_data_browser_bbox_filtered_is_clickable(live_server, page, bootstrap, m
181
186
  popup = page.locator(".leaflet-popup")
182
187
  # Zoom on Europe
183
188
  page.goto(f"{live_server.url}{map.get_absolute_url()}#6/51.000/2.000")
189
+ page.locator(".filters summary").click()
184
190
  el = page.get_by_text("Current map view")
185
191
  expect(el).to_be_visible()
186
192
  el.click()
@@ -202,6 +208,7 @@ def test_data_browser_with_variable_in_name(live_server, page, bootstrap, map):
202
208
  expect(page.get_by_text("one point in france (point)")).to_be_visible()
203
209
  expect(page.get_by_text("one line in new zeland (line)")).to_be_visible()
204
210
  expect(page.get_by_text("one polygon in greenland (polygon)")).to_be_visible()
211
+ page.locator(".filters summary").click()
205
212
  filter_ = page.locator("input[name='filter']")
206
213
  expect(filter_).to_be_visible()
207
214
  filter_.type("foobar") # Hide all
@@ -50,7 +50,7 @@ def test_basic_choropleth_map_with_custom_brewer(openmap, live_server, page):
50
50
  page.get_by_role("button", name="Edit").click()
51
51
  page.get_by_role("link", name="Manage layers").click()
52
52
  page.locator(".panel").get_by_title("Edit", exact=True).click()
53
- page.get_by_role("heading", name="Choropleth: settings").click()
53
+ page.get_by_text("Choropleth: settings").click()
54
54
  page.locator('select[name="brewer"]').select_option("Greens")
55
55
 
56
56
  # Hauts-de-France
@@ -83,6 +83,8 @@ def test_clicking_esc_should_finish_polygon(page, live_server, tilelayer):
83
83
  page.keyboard.press("Escape")
84
84
  expect(lines).to_have_count(1)
85
85
  expect(guide).to_have_count(0)
86
+ # Should have opened edit form panel
87
+ expect(page.locator(".panel").get_by_text("Feature properties")).to_be_visible()
86
88
 
87
89
 
88
90
  def test_clicking_esc_should_delete_polygon_if_empty(page, live_server, tilelayer):
@@ -106,6 +108,8 @@ def test_clicking_esc_should_delete_polygon_if_empty(page, live_server, tilelaye
106
108
  page.keyboard.press("Escape")
107
109
  expect(lines).to_have_count(0)
108
110
  expect(guide).to_have_count(0)
111
+ # Should not have opened edit form panel
112
+ expect(page.locator(".panel").get_by_text("Feature properties")).to_be_hidden()
109
113
 
110
114
 
111
115
  def test_clicking_esc_should_delete_polygon_if_invalid(page, live_server, tilelayer):
@@ -137,6 +141,8 @@ def test_clicking_esc_should_delete_polygon_if_invalid(page, live_server, tilela
137
141
  page.keyboard.press("Escape")
138
142
  expect(lines).to_have_count(0)
139
143
  expect(guide).to_have_count(0)
144
+ # Should not have opened edit form panel
145
+ expect(page.locator(".panel").get_by_text("Feature properties")).to_be_hidden()
140
146
 
141
147
 
142
148
  def test_can_draw_multi(live_server, page, tilelayer):
@@ -83,6 +83,8 @@ def test_clicking_esc_should_finish_line(page, live_server, tilelayer):
83
83
  page.keyboard.press("Escape")
84
84
  expect(lines).to_have_count(1)
85
85
  expect(guide).to_have_count(0)
86
+ # Should have opened edit form panel
87
+ expect(page.locator(".panel").get_by_text("Feature properties")).to_be_visible()
86
88
 
87
89
 
88
90
  def test_clicking_esc_should_delete_line_if_empty(page, live_server, tilelayer):
@@ -110,6 +112,8 @@ def test_clicking_esc_should_delete_line_if_empty(page, live_server, tilelayer):
110
112
  page.keyboard.press("Escape")
111
113
  expect(lines).to_have_count(0)
112
114
  expect(guide).to_have_count(0)
115
+ # Should not have opened edit form panel
116
+ expect(page.locator(".panel").get_by_text("Feature properties")).to_be_hidden()
113
117
 
114
118
 
115
119
  def test_clicking_esc_should_delete_line_if_invalid(page, live_server, tilelayer):
@@ -135,6 +139,8 @@ def test_clicking_esc_should_delete_line_if_invalid(page, live_server, tilelayer
135
139
  page.keyboard.press("Escape")
136
140
  expect(lines).to_have_count(0)
137
141
  expect(guide).to_have_count(0)
142
+ # Should not have opened edit form panel
143
+ expect(page.locator(".panel").get_by_text("Feature properties")).to_be_hidden()
138
144
 
139
145
 
140
146
  def test_can_draw_multi(live_server, page, tilelayer):
@@ -80,7 +80,7 @@ def test_can_clone_datalayer(live_server, openmap, login, datalayer, page):
80
80
  expect(markers).to_have_count(1)
81
81
  page.get_by_role("link", name="Manage layers").click()
82
82
  page.locator(".panel.right").get_by_title("Edit", exact=True).click()
83
- page.get_by_role("heading", name="Advanced actions").click()
83
+ page.get_by_text("Advanced actions").click()
84
84
  page.get_by_role("button", name="Clone").click()
85
85
  expect(layers).to_have_count(2)
86
86
  expect(markers).to_have_count(2)
@@ -104,7 +104,7 @@ def test_can_change_icon_class(live_server, openmap, page):
104
104
  page.get_by_role("link", name="Manage layers").click()
105
105
  expect(page.locator(".umap-circle-icon")).to_be_hidden()
106
106
  page.locator(".panel.right").get_by_title("Edit", exact=True).click()
107
- page.get_by_role("heading", name="Shape properties").click()
107
+ page.get_by_text("Shape properties").click()
108
108
  page.locator(".umap-field-iconClass a.define").click()
109
109
  page.get_by_text("Circle").click()
110
110
  expect(page.locator(".umap-circle-icon")).to_be_visible()
@@ -165,14 +165,14 @@ def test_can_restore_version(live_server, openmap, page, datalayer):
165
165
  marker = page.locator(".leaflet-marker-icon")
166
166
  expect(marker).to_have_class(re.compile(".*umap-ball-icon.*"))
167
167
  marker.click(modifiers=["Shift"])
168
- page.get_by_role("heading", name="Shape properties").click()
168
+ page.get_by_text("Shape properties").click()
169
169
  page.locator("#umap-feature-shape-properties").get_by_text("Default").click()
170
170
  with page.expect_response(re.compile(".*/datalayer/update/.*")):
171
171
  page.get_by_role("button", name="Save").click()
172
172
  expect(marker).to_have_class(re.compile(".*umap-div-icon.*"))
173
173
  page.get_by_role("link", name="Manage layers").click()
174
174
  page.locator(".panel.right").get_by_title("Edit", exact=True).click()
175
- page.get_by_role("heading", name="Versions").click()
175
+ page.get_by_text("Versions").click()
176
176
  page.once("dialog", lambda dialog: dialog.accept())
177
177
  page.get_by_role("button", name="Restore this version").last.click()
178
178
  expect(marker).to_have_class(re.compile(".*umap-ball-icon.*"))
@@ -182,4 +182,4 @@ def test_can_edit_layer_on_ctrl_shift_click(live_server, openmap, page, datalaye
182
182
  modifier = "Meta" if platform.system() == "Darwin" else "Control"
183
183
  page.goto(f"{live_server.url}{openmap.get_absolute_url()}?edit")
184
184
  page.locator(".leaflet-marker-icon").click(modifiers=[modifier, "Shift"])
185
- expect(page.get_by_role("heading", name="Layer properties")).to_be_visible()
185
+ expect(page.get_by_text("Layer properties")).to_be_visible()
@@ -58,7 +58,7 @@ def test_zoomcontrol_impacts_ui(live_server, page, tilelayer):
58
58
  expect(zoom_out).to_be_visible()
59
59
 
60
60
  # Hide them
61
- page.get_by_role("heading", name="User interface options").click()
61
+ page.get_by_text("User interface options").click()
62
62
  hide_zoom_controls = (
63
63
  page.locator("div")
64
64
  .filter(has_text=re.compile(r"^Display the zoom control"))
@@ -90,7 +90,7 @@ def test_map_color_impacts_data(live_server, page, tilelayer):
90
90
  expect(marker_pane_p1).to_have_count(1)
91
91
 
92
92
  # Change the default color
93
- page.get_by_role("heading", name="Shape properties").click()
93
+ page.get_by_text("Shape properties").click()
94
94
  page.locator("#umap-feature-shape-properties").get_by_text("define").first.click()
95
95
  page.get_by_title("Lime", exact=True).click()
96
96
 
@@ -108,7 +108,7 @@ def test_limitbounds_impacts_ui(live_server, page, tilelayer):
108
108
  expect(gear_icon).to_be_visible()
109
109
  gear_icon.click()
110
110
 
111
- page.get_by_role("heading", name="Limit bounds").click()
111
+ page.get_by_text("Limit bounds").click()
112
112
  default_zoom_url = f"{live_server.url}/en/map/new/#5/51.110/7.053"
113
113
  page.goto(default_zoom_url)
114
114
  page.get_by_role("button", name="Use current bounds").click()
@@ -183,7 +183,7 @@ def test_sortkey_impacts_datalayerindex(map, live_server, page):
183
183
  # Change the default sortkey to be "key"
184
184
  page.get_by_role("button", name="Edit").click()
185
185
  page.get_by_role("link", name="Map advanced properties").click()
186
- page.get_by_role("heading", name="Default properties").click()
186
+ page.get_by_text("Default properties").click()
187
187
 
188
188
  # Click "define"
189
189
  page.locator(".panel .umap-field-sortKey .define").click()
@@ -36,7 +36,7 @@ def test_can_edit_on_shift_click(live_server, openmap, page, datalayer):
36
36
  modifier = "Meta" if platform.system() == "Darwin" else "Control"
37
37
  page.goto(f"{live_server.url}{openmap.get_absolute_url()}?edit")
38
38
  page.locator(".leaflet-marker-icon").click(modifiers=[modifier, "Shift"])
39
- expect(page.get_by_role("heading", name="Layer properties")).to_be_visible()
39
+ expect(page.get_by_text("Layer properties")).to_be_visible()
40
40
 
41
41
 
42
42
  def test_marker_style_should_have_precedence(live_server, openmap, page, bootstrap):
@@ -45,7 +45,7 @@ def test_marker_style_should_have_precedence(live_server, openmap, page, bootstr
45
45
  # Change colour at layer level
46
46
  page.get_by_role("link", name="Manage layers").click()
47
47
  page.locator(".panel").get_by_title("Edit", exact=True).click()
48
- page.get_by_role("heading", name="Shape properties").click()
48
+ page.get_by_text("Shape properties").click()
49
49
  page.locator(".umap-field-color .define").click()
50
50
  expect(page.locator(".leaflet-marker-icon .icon_container")).to_have_css(
51
51
  "background-color", "rgb(0, 0, 139)"
@@ -57,7 +57,7 @@ def test_marker_style_should_have_precedence(live_server, openmap, page, bootstr
57
57
 
58
58
  # Now change at marker level, it should take precedence
59
59
  page.locator(".leaflet-marker-icon").click(modifiers=["Shift"])
60
- page.get_by_role("heading", name="Shape properties").click()
60
+ page.get_by_text("Shape properties").click()
61
61
  page.locator("#umap-feature-shape-properties").get_by_text("define").first.click()
62
62
  page.get_by_title("GoldenRod", exact=True).click()
63
63
  expect(page.locator(".leaflet-marker-icon .icon_container")).to_have_css(
@@ -67,7 +67,7 @@ def test_marker_style_should_have_precedence(live_server, openmap, page, bootstr
67
67
  # Now change again at layer level again, it should not change the marker color
68
68
  page.get_by_role("link", name="Manage layers").click()
69
69
  page.locator(".panel").get_by_title("Edit", exact=True).click()
70
- page.get_by_role("heading", name="Shape properties").click()
70
+ page.get_by_text("Shape properties").click()
71
71
  page.locator(".umap-field-color input").click()
72
72
  page.get_by_title("DarkViolet").first.click()
73
73
  expect(page.locator(".leaflet-marker-icon .icon_container")).to_have_css(
@@ -87,12 +87,12 @@ def test_should_update_open_popup_on_edit(live_server, openmap, page, bootstrap)
87
87
  expect(page.locator(".umap-icon-active")).to_be_hidden()
88
88
  page.locator(".leaflet-marker-icon").click()
89
89
  expect(page.locator(".leaflet-popup-content-wrapper")).to_be_visible()
90
- expect(page.get_by_role("heading", name="test marker")).to_be_visible()
90
+ expect(page.get_by_text("test marker")).to_be_visible()
91
91
  expect(page.get_by_text("Some description")).to_be_visible()
92
92
  page.get_by_role("button", name="Edit").click()
93
93
  page.locator(".leaflet-marker-icon").click(modifiers=["Shift"])
94
94
  page.locator('input[name="name"]').fill("test marker edited")
95
- expect(page.get_by_role("heading", name="test marker edited")).to_be_visible()
95
+ expect(page.get_by_text("test marker edited")).to_be_visible()
96
96
 
97
97
 
98
98
  def test_should_follow_datalayer_style_when_changing_datalayer(
@@ -50,7 +50,7 @@ def test_can_edit_on_shift_click(live_server, openmap, page, datalayer):
50
50
  modifier = "Meta" if platform.system() == "Darwin" else "Control"
51
51
  page.goto(f"{live_server.url}{openmap.get_absolute_url()}?edit")
52
52
  page.locator(".leaflet-marker-icon").click(modifiers=[modifier, "Shift"])
53
- expect(page.get_by_role("heading", name="Layer properties")).to_be_visible()
53
+ expect(page.get_by_text("Layer properties")).to_be_visible()
54
54
 
55
55
 
56
56
  def test_marker_style_should_have_precedence(live_server, openmap, page, bootstrap):
@@ -59,7 +59,7 @@ def test_marker_style_should_have_precedence(live_server, openmap, page, bootstr
59
59
  # Change colour at layer level
60
60
  page.get_by_role("link", name="Manage layers").click()
61
61
  page.locator(".panel").get_by_title("Edit", exact=True).click()
62
- page.get_by_role("heading", name="Shape properties").click()
62
+ page.get_by_text("Shape properties").click()
63
63
  page.locator(".umap-field-color .define").click()
64
64
  expect(page.locator(".leaflet-overlay-pane path[fill='DarkBlue']")).to_have_count(1)
65
65
  page.get_by_title("DarkRed").first.click()
@@ -67,7 +67,7 @@ def test_marker_style_should_have_precedence(live_server, openmap, page, bootstr
67
67
 
68
68
  # Now change at polygon level, it should take precedence
69
69
  page.locator("path").click(modifiers=["Shift"])
70
- page.get_by_role("heading", name="Shape properties").click()
70
+ page.get_by_text("Shape properties").click()
71
71
  page.locator("#umap-feature-shape-properties").get_by_text("define").first.click()
72
72
  page.get_by_title("GoldenRod", exact=True).first.click()
73
73
  expect(page.locator(".leaflet-overlay-pane path[fill='GoldenRod']")).to_have_count(
@@ -77,7 +77,7 @@ def test_marker_style_should_have_precedence(live_server, openmap, page, bootstr
77
77
  # Now change again at layer level again, it should not change the marker color
78
78
  page.get_by_role("link", name="Manage layers").click()
79
79
  page.locator(".panel").get_by_title("Edit", exact=True).click()
80
- page.get_by_role("heading", name="Shape properties").click()
80
+ page.get_by_text("Shape properties").click()
81
81
  page.locator(".umap-field-color input").click()
82
82
  page.get_by_title("DarkViolet").first.click()
83
83
  expect(page.locator(".leaflet-overlay-pane path[fill='GoldenRod']")).to_have_count(
@@ -99,7 +99,7 @@ def test_can_remove_stroke(live_server, openmap, page, bootstrap):
99
99
  )
100
100
  page.locator("path").click()
101
101
  page.get_by_role("link", name="Toggle edit mode").click()
102
- page.get_by_role("heading", name="Shape properties").click()
102
+ page.get_by_text("Shape properties").click()
103
103
  page.locator(".umap-field-stroke .define").first.click()
104
104
  page.locator(".umap-field-stroke label").first.click()
105
105
  expect(page.locator(".leaflet-overlay-pane path[stroke='DarkBlue']")).to_have_count(
@@ -111,7 +111,7 @@ def test_can_remove_stroke(live_server, openmap, page, bootstrap):
111
111
  def test_should_reset_style_on_cancel(live_server, openmap, page, bootstrap):
112
112
  page.goto(f"{live_server.url}{openmap.get_absolute_url()}?edit")
113
113
  page.locator("path").click(modifiers=["Shift"])
114
- page.get_by_role("heading", name="Shape properties").click()
114
+ page.get_by_text("Shape properties").click()
115
115
  page.locator("#umap-feature-shape-properties").get_by_text("define").first.click()
116
116
  page.get_by_title("GoldenRod", exact=True).first.click()
117
117
  expect(page.locator(".leaflet-overlay-pane path[fill='GoldenRod']")).to_have_count(
@@ -93,7 +93,7 @@ DATALAYER_DATA3 = {
93
93
 
94
94
 
95
95
  def test_simple_facet_search(live_server, page, map):
96
- map.settings["properties"]["onLoadPanel"] = "facet"
96
+ map.settings["properties"]["onLoadPanel"] = "datafilters"
97
97
  map.settings["properties"]["facetKey"] = "mytype|My type,mynumber|My Number|number"
98
98
  map.settings["properties"]["showLabel"] = True
99
99
  map.save()
@@ -101,7 +101,7 @@ def test_simple_facet_search(live_server, page, map):
101
101
  DataLayerFactory(map=map, data=DATALAYER_DATA2)
102
102
  DataLayerFactory(map=map, data=DATALAYER_DATA3)
103
103
  page.goto(f"{live_server.url}{map.get_absolute_url()}#6/48.948/1.670")
104
- panel = page.locator(".umap-facet-search")
104
+ panel = page.locator(".umap-browser")
105
105
  # From a non browsable datalayer, should not be impacted
106
106
  paths = page.locator(".leaflet-overlay-pane path")
107
107
  expect(paths).to_be_visible()
@@ -117,17 +117,28 @@ def test_simple_facet_search(live_server, page, map):
117
117
  markers = page.locator(".leaflet-marker-icon")
118
118
  expect(markers).to_have_count(4)
119
119
  # Tooltips
120
- expect(page.get_by_text("Point 1")).to_be_visible()
121
- expect(page.get_by_text("Point 2")).to_be_visible()
122
- expect(page.get_by_text("Point 3")).to_be_visible()
123
- expect(page.get_by_text("Point 4")).to_be_visible()
120
+ expect(page.get_by_role("tooltip", name="Point 1")).to_be_visible()
121
+ expect(page.get_by_role("tooltip", name="Point 2")).to_be_visible()
122
+ expect(page.get_by_role("tooltip", name="Point 3")).to_be_visible()
123
+ expect(page.get_by_role("tooltip", name="Point 4")).to_be_visible()
124
+
125
+ # Datalist
126
+ expect(panel.get_by_text("Point 1")).to_be_visible()
127
+ expect(panel.get_by_text("Point 2")).to_be_visible()
128
+ expect(panel.get_by_text("Point 3")).to_be_visible()
129
+ expect(panel.get_by_text("Point 4")).to_be_visible()
130
+
124
131
  # Now let's filter
125
132
  odd.click()
126
133
  expect(markers).to_have_count(2)
127
- expect(page.get_by_text("Point 2")).to_be_hidden()
128
- expect(page.get_by_text("Point 4")).to_be_hidden()
129
- expect(page.get_by_text("Point 1")).to_be_visible()
130
- expect(page.get_by_text("Point 3")).to_be_visible()
134
+ expect(page.get_by_role("tooltip", name="Point 2")).to_be_hidden()
135
+ expect(page.get_by_role("tooltip", name="Point 4")).to_be_hidden()
136
+ expect(page.get_by_role("tooltip", name="Point 1")).to_be_visible()
137
+ expect(page.get_by_role("tooltip", name="Point 3")).to_be_visible()
138
+ expect(panel.get_by_text("Point 2")).to_be_hidden()
139
+ expect(panel.get_by_text("Point 4")).to_be_hidden()
140
+ expect(panel.get_by_text("Point 1")).to_be_visible()
141
+ expect(panel.get_by_text("Point 3")).to_be_visible()
131
142
  expect(paths).to_be_visible
132
143
  # Now let's filter
133
144
  odd.click()
@@ -156,7 +167,7 @@ def test_simple_facet_search(live_server, page, map):
156
167
 
157
168
 
158
169
  def test_date_facet_search(live_server, page, map):
159
- map.settings["properties"]["onLoadPanel"] = "facet"
170
+ map.settings["properties"]["onLoadPanel"] = "datafilters"
160
171
  map.settings["properties"]["facetKey"] = "mydate|Date filter|date"
161
172
  map.save()
162
173
  DataLayerFactory(map=map, data=DATALAYER_DATA1)
@@ -174,7 +185,7 @@ def test_date_facet_search(live_server, page, map):
174
185
 
175
186
 
176
187
  def test_choice_with_empty_value(live_server, page, map):
177
- map.settings["properties"]["onLoadPanel"] = "facet"
188
+ map.settings["properties"]["onLoadPanel"] = "datafilters"
178
189
  map.settings["properties"]["facetKey"] = "mytype|My type"
179
190
  map.save()
180
191
  data = copy.deepcopy(DATALAYER_DATA1)
@@ -191,7 +202,7 @@ def test_choice_with_empty_value(live_server, page, map):
191
202
 
192
203
 
193
204
  def test_number_with_zero_value(live_server, page, map):
194
- map.settings["properties"]["onLoadPanel"] = "facet"
205
+ map.settings["properties"]["onLoadPanel"] = "datafilters"
195
206
  map.settings["properties"]["facetKey"] = "mynumber|Filter|number"
196
207
  map.save()
197
208
  data = copy.deepcopy(DATALAYER_DATA1)
@@ -205,3 +216,61 @@ def test_number_with_zero_value(live_server, page, map):
205
216
  page.keyboard.press("Tab") # Move out of the input, so the "change" event is sent
206
217
  markers = page.locator(".leaflet-marker-icon")
207
218
  expect(markers).to_have_count(3)
219
+
220
+
221
+ def test_facets_search_are_persistent_when_closing_panel(live_server, page, map):
222
+ map.settings["properties"]["onLoadPanel"] = "datafilters"
223
+ map.settings["properties"]["facetKey"] = "mytype|My type,mynumber|My Number|number"
224
+ map.save()
225
+ DataLayerFactory(map=map, data=DATALAYER_DATA1)
226
+ DataLayerFactory(map=map, data=DATALAYER_DATA2)
227
+ page.goto(f"{live_server.url}{map.get_absolute_url()}#6/48.948/1.670")
228
+ panel = page.locator(".umap-browser")
229
+
230
+ # Facet values
231
+ odd = page.get_by_label("odd")
232
+ markers = page.locator(".leaflet-marker-icon")
233
+ expect(markers).to_have_count(4)
234
+
235
+ # Datalist in the browser
236
+ expect(panel.get_by_text("Point 1")).to_be_visible()
237
+ expect(panel.get_by_text("Point 2")).to_be_visible()
238
+ expect(panel.get_by_text("Point 3")).to_be_visible()
239
+ expect(panel.get_by_text("Point 4")).to_be_visible()
240
+
241
+ # Now let's filter
242
+ odd.click()
243
+ expect(page.locator("summary")).to_have_attribute("data-badge", " ")
244
+ expect(page.locator(".umap-control-browse")).to_have_attribute("data-badge", " ")
245
+ expect(markers).to_have_count(2)
246
+ expect(panel.get_by_text("Point 2")).to_be_hidden()
247
+ expect(panel.get_by_text("Point 4")).to_be_hidden()
248
+ expect(panel.get_by_text("Point 1")).to_be_visible()
249
+ expect(panel.get_by_text("Point 3")).to_be_visible()
250
+
251
+ # Let's filter using the number facet
252
+ expect(panel.get_by_label("Min")).to_have_value("10")
253
+ expect(panel.get_by_label("Max")).to_have_value("14")
254
+ page.get_by_label("Min").fill("13")
255
+ page.keyboard.press("Tab") # Move out of the input, so the "change" event is sent
256
+ expect(panel.get_by_label("Min")).to_have_attribute("data-modified", "true")
257
+ expect(markers).to_have_count(1)
258
+ expect(panel.get_by_text("Point 2")).to_be_hidden()
259
+ expect(panel.get_by_text("Point 4")).to_be_hidden()
260
+ expect(panel.get_by_text("Point 1")).to_be_hidden()
261
+ expect(panel.get_by_text("Point 3")).to_be_visible()
262
+
263
+ # Close panel
264
+ expect(panel.locator("summary")).to_have_attribute("data-badge", " ")
265
+ expect(page.locator(".umap-control-browse")).to_have_attribute("data-badge", " ")
266
+ page.get_by_role("listitem", name="Close").click()
267
+ page.get_by_role("button", name="See layers").click()
268
+ expect(panel.get_by_label("Min")).to_have_value("13")
269
+ expect(panel.get_by_label("Min")).to_have_attribute("data-modified", "true")
270
+ expect(panel.get_by_label("odd")).to_be_checked()
271
+
272
+ # Datalist in the browser should be inchanged
273
+ expect(panel.get_by_text("Point 2")).to_be_hidden()
274
+ expect(panel.get_by_text("Point 4")).to_be_hidden()
275
+ expect(panel.get_by_text("Point 1")).to_be_hidden()
276
+ expect(panel.get_by_text("Point 3")).to_be_visible()
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.3
2
2
  Name: umap-project
3
- Version: 2.2.2
3
+ Version: 2.3.0
4
4
  Summary: Create maps with OpenStreetMap layers in a minute and embed them in your site.
5
5
  Author-email: Yohan Boniface <yb@enix.org>
6
6
  Maintainer-email: David Larlet <david@larlet.fr>
@@ -19,7 +19,7 @@ Requires-Python: >=3.10
19
19
  Requires-Dist: django-agnocomplete==2.2.0
20
20
  Requires-Dist: django-environ==0.11.2
21
21
  Requires-Dist: django-probes==1.7.0
22
- Requires-Dist: django==5.0.4
22
+ Requires-Dist: django==5.0.5
23
23
  Requires-Dist: pillow==10.3.0
24
24
  Requires-Dist: psycopg==3.1.18
25
25
  Requires-Dist: rcssmin==1.1.2
@@ -29,12 +29,13 @@ Requires-Dist: social-auth-app-django==5.4.1
29
29
  Requires-Dist: social-auth-core==4.5.4
30
30
  Provides-Extra: dev
31
31
  Requires-Dist: djlint==1.34.1; extra == 'dev'
32
- Requires-Dist: hatch==1.9.7; extra == 'dev'
32
+ Requires-Dist: hatch==1.10.0; extra == 'dev'
33
33
  Requires-Dist: isort==5.13.2; extra == 'dev'
34
- Requires-Dist: mkdocs-material==9.5.18; extra == 'dev'
35
- Requires-Dist: mkdocs==1.5.3; extra == 'dev'
34
+ Requires-Dist: mkdocs-material==9.5.21; extra == 'dev'
35
+ Requires-Dist: mkdocs-static-i18n==1.2.2; extra == 'dev'
36
+ Requires-Dist: mkdocs==1.6.0; extra == 'dev'
36
37
  Requires-Dist: pymdown-extensions==10.8.1; extra == 'dev'
37
- Requires-Dist: ruff==0.4.2; extra == 'dev'
38
+ Requires-Dist: ruff==0.4.3; extra == 'dev'
38
39
  Requires-Dist: vermin==1.6.0; extra == 'dev'
39
40
  Provides-Extra: docker
40
41
  Requires-Dist: uwsgi==2.0.25.1; extra == 'docker'