umap-project 2.9.0b0__py3-none-any.whl → 2.9.2__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.
- umap/__init__.py +1 -1
- umap/admin.py +15 -2
- umap/locale/br/LC_MESSAGES/django.mo +0 -0
- umap/locale/br/LC_MESSAGES/django.po +111 -67
- umap/locale/cs_CZ/LC_MESSAGES/django.mo +0 -0
- umap/locale/cs_CZ/LC_MESSAGES/django.po +112 -67
- umap/locale/el/LC_MESSAGES/django.mo +0 -0
- umap/locale/el/LC_MESSAGES/django.po +132 -87
- umap/locale/en/LC_MESSAGES/django.po +11 -10
- umap/locale/es/LC_MESSAGES/django.mo +0 -0
- umap/locale/es/LC_MESSAGES/django.po +117 -71
- umap/locale/fr/LC_MESSAGES/django.mo +0 -0
- umap/locale/fr/LC_MESSAGES/django.po +11 -10
- umap/locale/gl/LC_MESSAGES/django.mo +0 -0
- umap/locale/gl/LC_MESSAGES/django.po +219 -173
- umap/locale/it/LC_MESSAGES/django.mo +0 -0
- umap/locale/it/LC_MESSAGES/django.po +145 -100
- umap/locale/nl/LC_MESSAGES/django.mo +0 -0
- umap/locale/nl/LC_MESSAGES/django.po +198 -152
- umap/locale/pt/LC_MESSAGES/django.mo +0 -0
- umap/locale/pt/LC_MESSAGES/django.po +118 -73
- umap/locale/zh_TW/LC_MESSAGES/django.mo +0 -0
- umap/locale/zh_TW/LC_MESSAGES/django.po +112 -67
- umap/middleware.py +30 -1
- umap/models.py +20 -10
- umap/settings/base.py +2 -1
- umap/static/umap/base.css +4 -1
- umap/static/umap/css/bar.css +32 -0
- umap/static/umap/css/contextmenu.css +14 -2
- umap/static/umap/css/form.css +5 -10
- umap/static/umap/css/icon.css +39 -3
- umap/static/umap/css/panel.css +18 -1
- umap/static/umap/css/popup.css +0 -1
- umap/static/umap/img/16-white.svg +3 -3
- umap/static/umap/img/16.svg +1 -1
- umap/static/umap/img/24-white.svg +17 -16
- umap/static/umap/img/24.svg +29 -18
- umap/static/umap/img/providers/twitter-oauth2.png +0 -0
- umap/static/umap/img/source/16-white.svg +4 -4
- umap/static/umap/img/source/16.svg +1 -1
- umap/static/umap/img/source/24-white.svg +20 -18
- umap/static/umap/img/source/24.svg +30 -19
- umap/static/umap/js/modules/browser.js +2 -2
- umap/static/umap/js/modules/caption.js +4 -4
- umap/static/umap/js/modules/data/features.js +80 -32
- umap/static/umap/js/modules/data/layer.js +37 -50
- umap/static/umap/js/modules/form/builder.js +23 -22
- umap/static/umap/js/modules/form/fields.js +13 -5
- umap/static/umap/js/modules/formatter.js +6 -2
- umap/static/umap/js/modules/help.js +17 -23
- umap/static/umap/js/modules/importer.js +5 -2
- umap/static/umap/js/modules/permissions.js +6 -2
- umap/static/umap/js/modules/rendering/layers/classified.js +1 -1
- umap/static/umap/js/modules/rendering/map.js +1 -21
- umap/static/umap/js/modules/rendering/ui.js +20 -38
- umap/static/umap/js/modules/rules.js +1 -1
- umap/static/umap/js/modules/saving.js +5 -0
- umap/static/umap/js/modules/schema.js +4 -1
- umap/static/umap/js/modules/sync/engine.js +39 -14
- umap/static/umap/js/modules/sync/updaters.js +7 -6
- umap/static/umap/js/modules/sync/websocket.js +48 -40
- umap/static/umap/js/modules/ui/bar.js +84 -0
- umap/static/umap/js/modules/ui/base.js +11 -0
- umap/static/umap/js/modules/ui/contextmenu.js +9 -2
- umap/static/umap/js/modules/ui/panel.js +5 -1
- umap/static/umap/js/modules/umap.js +85 -44
- umap/static/umap/js/umap.controls.js +11 -341
- umap/static/umap/locale/am_ET.js +17 -5
- umap/static/umap/locale/am_ET.json +17 -5
- umap/static/umap/locale/ar.js +17 -5
- umap/static/umap/locale/ar.json +17 -5
- umap/static/umap/locale/ast.js +17 -5
- umap/static/umap/locale/ast.json +17 -5
- umap/static/umap/locale/bg.js +17 -5
- umap/static/umap/locale/bg.json +17 -5
- umap/static/umap/locale/br.js +20 -15
- umap/static/umap/locale/br.json +20 -15
- umap/static/umap/locale/ca.js +8 -4
- umap/static/umap/locale/ca.json +8 -4
- umap/static/umap/locale/cs_CZ.js +8 -4
- umap/static/umap/locale/cs_CZ.json +8 -4
- umap/static/umap/locale/da.js +17 -5
- umap/static/umap/locale/da.json +17 -5
- umap/static/umap/locale/de.js +8 -4
- umap/static/umap/locale/de.json +8 -4
- umap/static/umap/locale/el.js +54 -50
- umap/static/umap/locale/el.json +54 -50
- umap/static/umap/locale/en.js +9 -4
- umap/static/umap/locale/en.json +9 -4
- umap/static/umap/locale/en_US.json +17 -5
- umap/static/umap/locale/es.js +13 -9
- umap/static/umap/locale/es.json +13 -9
- umap/static/umap/locale/et.js +17 -5
- umap/static/umap/locale/et.json +17 -5
- umap/static/umap/locale/eu.js +8 -4
- umap/static/umap/locale/eu.json +8 -4
- umap/static/umap/locale/fa_IR.js +8 -4
- umap/static/umap/locale/fa_IR.json +8 -4
- umap/static/umap/locale/fi.js +17 -5
- umap/static/umap/locale/fi.json +17 -5
- umap/static/umap/locale/fr.js +9 -4
- umap/static/umap/locale/fr.json +9 -4
- umap/static/umap/locale/gl.js +13 -9
- umap/static/umap/locale/gl.json +13 -9
- umap/static/umap/locale/he.js +17 -5
- umap/static/umap/locale/he.json +17 -5
- umap/static/umap/locale/hr.js +17 -5
- umap/static/umap/locale/hr.json +17 -5
- umap/static/umap/locale/hu.js +8 -4
- umap/static/umap/locale/hu.json +8 -4
- umap/static/umap/locale/id.js +17 -5
- umap/static/umap/locale/id.json +17 -5
- umap/static/umap/locale/is.js +17 -5
- umap/static/umap/locale/is.json +17 -5
- umap/static/umap/locale/it.js +31 -27
- umap/static/umap/locale/it.json +31 -27
- umap/static/umap/locale/ja.js +17 -5
- umap/static/umap/locale/ja.json +17 -5
- umap/static/umap/locale/ko.js +17 -5
- umap/static/umap/locale/ko.json +17 -5
- umap/static/umap/locale/lt.js +17 -5
- umap/static/umap/locale/lt.json +17 -5
- umap/static/umap/locale/ms.js +8 -4
- umap/static/umap/locale/ms.json +8 -4
- umap/static/umap/locale/nl.js +132 -127
- umap/static/umap/locale/nl.json +132 -127
- umap/static/umap/locale/no.js +17 -5
- umap/static/umap/locale/no.json +17 -5
- umap/static/umap/locale/pl.js +8 -4
- umap/static/umap/locale/pl.json +8 -4
- umap/static/umap/locale/pl_PL.json +17 -5
- umap/static/umap/locale/pt.js +38 -33
- umap/static/umap/locale/pt.json +38 -33
- umap/static/umap/locale/pt_BR.js +17 -5
- umap/static/umap/locale/pt_BR.json +17 -5
- umap/static/umap/locale/pt_PT.js +8 -4
- umap/static/umap/locale/pt_PT.json +8 -4
- umap/static/umap/locale/ro.js +17 -5
- umap/static/umap/locale/ro.json +17 -5
- umap/static/umap/locale/ru.js +17 -5
- umap/static/umap/locale/ru.json +17 -5
- umap/static/umap/locale/sk_SK.js +17 -5
- umap/static/umap/locale/sk_SK.json +17 -5
- umap/static/umap/locale/sl.js +17 -5
- umap/static/umap/locale/sl.json +17 -5
- umap/static/umap/locale/sr.js +17 -5
- umap/static/umap/locale/sr.json +17 -5
- umap/static/umap/locale/sv.js +17 -5
- umap/static/umap/locale/sv.json +17 -5
- umap/static/umap/locale/th_TH.js +8 -4
- umap/static/umap/locale/th_TH.json +8 -4
- umap/static/umap/locale/tr.js +17 -5
- umap/static/umap/locale/tr.json +17 -5
- umap/static/umap/locale/uk_UA.js +17 -5
- umap/static/umap/locale/uk_UA.json +17 -5
- umap/static/umap/locale/vi.js +17 -5
- umap/static/umap/locale/vi.json +17 -5
- umap/static/umap/locale/vi_VN.json +17 -5
- umap/static/umap/locale/zh.js +17 -5
- umap/static/umap/locale/zh.json +17 -5
- umap/static/umap/locale/zh_CN.json +17 -5
- umap/static/umap/locale/zh_TW.Big5.json +17 -5
- umap/static/umap/locale/zh_TW.js +14 -10
- umap/static/umap/locale/zh_TW.json +14 -10
- umap/static/umap/map.css +17 -68
- umap/static/umap/nav.css +4 -0
- umap/static/umap/vars.css +1 -0
- umap/static/umap/vendors/dompurify/purify.es.js +138 -354
- umap/static/umap/vendors/dompurify/purify.es.mjs.map +1 -1
- umap/static/umap/vendors/editable/Leaflet.Editable.js +1 -0
- umap/sync/app.py +19 -13
- umap/sync/payloads.py +8 -1
- umap/templates/auth/user_form.html +2 -2
- umap/templates/umap/content_footer.html +1 -1
- umap/templates/umap/css.html +0 -2
- umap/templates/umap/js.html +0 -1
- umap/templates/umap/messages.html +5 -1
- umap/templates/umap/search_bar.html +1 -0
- umap/tests/integration/test_anonymous_owned_map.py +2 -2
- umap/tests/integration/test_basics.py +2 -5
- umap/tests/integration/test_categorized_layer.py +4 -8
- umap/tests/integration/test_choropleth.py +1 -1
- umap/tests/integration/test_conditional_rules.py +3 -3
- umap/tests/integration/test_draw_polygon.py +11 -19
- umap/tests/integration/test_draw_polyline.py +6 -14
- umap/tests/integration/test_edit_datalayer.py +10 -10
- umap/tests/integration/test_edit_map.py +27 -1
- umap/tests/integration/test_edit_marker.py +5 -5
- umap/tests/integration/test_edit_polygon.py +5 -5
- umap/tests/integration/test_features_id_generation.py +2 -6
- umap/tests/integration/test_import.py +93 -29
- umap/tests/integration/test_owned_map.py +1 -1
- umap/tests/integration/test_save.py +2 -2
- umap/tests/integration/test_tableeditor.py +7 -7
- umap/tests/integration/test_view_marker.py +10 -0
- umap/tests/integration/test_websocket_sync.py +128 -32
- umap/utils.py +4 -1
- umap/views.py +1 -10
- {umap_project-2.9.0b0.dist-info → umap_project-2.9.2.dist-info}/METADATA +13 -13
- {umap_project-2.9.0b0.dist-info → umap_project-2.9.2.dist-info}/RECORD +203 -205
- umap/static/umap/vendors/toolbar/leaflet.toolbar.css +0 -1
- umap/static/umap/vendors/toolbar/leaflet.toolbar.js +0 -1
- {umap_project-2.9.0b0.dist-info → umap_project-2.9.2.dist-info}/WHEEL +0 -0
- {umap_project-2.9.0b0.dist-info → umap_project-2.9.2.dist-info}/entry_points.txt +0 -0
- {umap_project-2.9.0b0.dist-info → umap_project-2.9.2.dist-info}/licenses/LICENSE +0 -0
|
@@ -252,7 +252,7 @@ def test_can_create_new_rule(live_server, page, openmap):
|
|
|
252
252
|
markers = page.locator(".leaflet-marker-icon .icon_container")
|
|
253
253
|
expect(markers).to_have_count(5)
|
|
254
254
|
page.get_by_role("button", name="Edit").click()
|
|
255
|
-
page.get_by_role("
|
|
255
|
+
page.get_by_role("button", name="Map advanced properties").click()
|
|
256
256
|
page.get_by_text("Conditional style rules").click()
|
|
257
257
|
page.get_by_role("button", name="Add rule").click()
|
|
258
258
|
page.locator("input[name=condition]").click()
|
|
@@ -276,7 +276,7 @@ def test_can_deactive_rule_from_list(live_server, page, openmap):
|
|
|
276
276
|
colors = getColors(markers)
|
|
277
277
|
assert colors.count("rgb(240, 248, 255)") == 3
|
|
278
278
|
page.get_by_role("button", name="Edit").click()
|
|
279
|
-
page.get_by_role("
|
|
279
|
+
page.get_by_role("button", name="Map advanced properties").click()
|
|
280
280
|
page.get_by_text("Conditional style rules").click()
|
|
281
281
|
page.get_by_role("button", name="Show/hide layer").click()
|
|
282
282
|
colors = getColors(markers)
|
|
@@ -289,7 +289,7 @@ def test_can_deactive_rule_from_list(live_server, page, openmap):
|
|
|
289
289
|
def test_autocomplete_datalist(live_server, page, openmap):
|
|
290
290
|
DataLayerFactory(map=openmap, data=DATALAYER_DATA1)
|
|
291
291
|
page.goto(f"{live_server.url}{openmap.get_absolute_url()}?edit#6/48.948/1.670")
|
|
292
|
-
page.get_by_role("
|
|
292
|
+
page.get_by_role("button", name="Map advanced properties").click()
|
|
293
293
|
page.locator("summary").filter(has_text="Conditional style rules").click()
|
|
294
294
|
page.get_by_role("button", name="Add rule").click()
|
|
295
295
|
panel = page.locator(".panel.right.on")
|
|
@@ -10,10 +10,8 @@ def test_draw_polygon(page, live_server, tilelayer):
|
|
|
10
10
|
page.goto(f"{live_server.url}/en/map/new/")
|
|
11
11
|
|
|
12
12
|
# Click on the Draw a polygon button on a new map.
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
)
|
|
16
|
-
create_line.click()
|
|
13
|
+
create_path = page.locator(".umap-edit-bar").get_by_title("Draw a polygon")
|
|
14
|
+
create_path.click()
|
|
17
15
|
|
|
18
16
|
# Check no polygon is present by default.
|
|
19
17
|
# We target with the color, because there is also the drawing line guide (dash-array)
|
|
@@ -44,10 +42,8 @@ def test_clicking_esc_should_finish_polygon(page, live_server, tilelayer):
|
|
|
44
42
|
page.goto(f"{live_server.url}/en/map/new/")
|
|
45
43
|
|
|
46
44
|
# Click on the Draw a polygon button on a new map.
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
)
|
|
50
|
-
create_line.click()
|
|
45
|
+
create_path = page.locator(".umap-edit-bar ").get_by_title("Draw a polygon")
|
|
46
|
+
create_path.click()
|
|
51
47
|
|
|
52
48
|
# Check no polygon is present by default.
|
|
53
49
|
# We target with the color, because there is also the drawing line guide (dash-array)
|
|
@@ -80,10 +76,8 @@ def test_clicking_esc_should_delete_polygon_if_empty(page, live_server, tilelaye
|
|
|
80
76
|
page.goto(f"{live_server.url}/en/map/new/")
|
|
81
77
|
|
|
82
78
|
# Click on the Draw a polygon button on a new map.
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
)
|
|
86
|
-
create_line.click()
|
|
79
|
+
create_path = page.locator(".umap-edit-bar ").get_by_title("Draw a polygon")
|
|
80
|
+
create_path.click()
|
|
87
81
|
|
|
88
82
|
# Check no polygon is present by default.
|
|
89
83
|
# We target with the color, because there is also the drawing line guide (dash-array)
|
|
@@ -105,10 +99,8 @@ def test_clicking_esc_should_delete_polygon_if_invalid(page, live_server, tilela
|
|
|
105
99
|
page.goto(f"{live_server.url}/en/map/new/")
|
|
106
100
|
|
|
107
101
|
# Click on the Draw a polygon button on a new map.
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
)
|
|
111
|
-
create_line.click()
|
|
102
|
+
create_path = page.locator(".umap-edit-bar ").get_by_title("Draw a polygon")
|
|
103
|
+
create_path.click()
|
|
112
104
|
|
|
113
105
|
# Check no polygon is present by default.
|
|
114
106
|
# We target with the color, because there is also the drawing line guide (dash-array)
|
|
@@ -188,7 +180,7 @@ def test_can_draw_hole(page, live_server, tilelayer):
|
|
|
188
180
|
|
|
189
181
|
# First vertex of the hole will be created here
|
|
190
182
|
map.click(position={"x": 180, "y": 120})
|
|
191
|
-
page.get_by_role("
|
|
183
|
+
page.get_by_role("button", name="Start a hole here").click()
|
|
192
184
|
map.click(position={"x": 180, "y": 180})
|
|
193
185
|
map.click(position={"x": 120, "y": 180})
|
|
194
186
|
map.click(position={"x": 120, "y": 120})
|
|
@@ -479,11 +471,11 @@ def test_vertexmarker_not_shown_if_too_many(live_server, map, page, settings):
|
|
|
479
471
|
settings.UMAP_ALLOW_ANONYMOUS = True
|
|
480
472
|
page.goto(f"{live_server.url}/en/map/new/#15/48.4395/3.3189")
|
|
481
473
|
page.get_by_title("Import data").click()
|
|
482
|
-
page.locator(".umap-
|
|
474
|
+
page.locator(".umap-import textarea").fill(geojson)
|
|
483
475
|
page.locator('select[name="format"]').select_option("geojson")
|
|
484
476
|
page.get_by_role("button", name="Import data", exact=True).click()
|
|
485
477
|
page.locator("path").click()
|
|
486
|
-
page.get_by_role("
|
|
478
|
+
page.get_by_role("button", name="Toggle edit mode (⇧+Click)").click()
|
|
487
479
|
expect(page.locator(".umap-tooltip-container")).to_contain_text(
|
|
488
480
|
"Please zoom in to edit the geometry"
|
|
489
481
|
)
|
|
@@ -10,9 +10,7 @@ def test_draw_polyline(page, live_server, tilelayer):
|
|
|
10
10
|
page.goto(f"{live_server.url}/en/map/new/")
|
|
11
11
|
|
|
12
12
|
# Click on the Draw a line button on a new map.
|
|
13
|
-
create_line = page.locator(".
|
|
14
|
-
"Draw a polyline"
|
|
15
|
-
)
|
|
13
|
+
create_line = page.locator(".umap-edit-bar ").get_by_title("Draw a polyline")
|
|
16
14
|
create_line.click()
|
|
17
15
|
|
|
18
16
|
# Check no line is present by default.
|
|
@@ -44,9 +42,7 @@ def test_clicking_esc_should_finish_line(page, live_server, tilelayer):
|
|
|
44
42
|
page.goto(f"{live_server.url}/en/map/new/")
|
|
45
43
|
|
|
46
44
|
# Click on the Draw a line button on a new map.
|
|
47
|
-
create_line = page.locator(".
|
|
48
|
-
"Draw a polyline"
|
|
49
|
-
)
|
|
45
|
+
create_line = page.locator(".umap-edit-bar ").get_by_title("Draw a polyline")
|
|
50
46
|
create_line.click()
|
|
51
47
|
|
|
52
48
|
# Check no line is present by default.
|
|
@@ -80,9 +76,7 @@ def test_clicking_esc_should_delete_line_if_empty(page, live_server, tilelayer):
|
|
|
80
76
|
page.goto(f"{live_server.url}/en/map/new/")
|
|
81
77
|
|
|
82
78
|
# Click on the Draw a line button on a new map.
|
|
83
|
-
create_line = page.locator(".
|
|
84
|
-
"Draw a polyline"
|
|
85
|
-
)
|
|
79
|
+
create_line = page.locator(".umap-edit-bar ").get_by_title("Draw a polyline")
|
|
86
80
|
create_line.click()
|
|
87
81
|
|
|
88
82
|
# Check no line is present by default.
|
|
@@ -109,9 +103,7 @@ def test_clicking_esc_should_delete_line_if_invalid(page, live_server, tilelayer
|
|
|
109
103
|
page.goto(f"{live_server.url}/en/map/new/")
|
|
110
104
|
|
|
111
105
|
# Click on the Draw a line button on a new map.
|
|
112
|
-
create_line = page.locator(".
|
|
113
|
-
"Draw a polyline"
|
|
114
|
-
)
|
|
106
|
+
create_line = page.locator(".umap-edit-bar ").get_by_title("Draw a polyline")
|
|
115
107
|
create_line.click()
|
|
116
108
|
|
|
117
109
|
# Check no line is present by default.
|
|
@@ -337,11 +329,11 @@ def test_can_delete_shape_using_toolbar(live_server, page, tilelayer, settings):
|
|
|
337
329
|
|
|
338
330
|
# Now split the line
|
|
339
331
|
map.click(position={"x": 100, "y": 100})
|
|
340
|
-
page.get_by_role("
|
|
332
|
+
page.get_by_role("button", name="Split line").click()
|
|
341
333
|
|
|
342
334
|
# Delete part of it
|
|
343
335
|
map.click(position={"x": 125, "y": 100})
|
|
344
|
-
page.get_by_role("
|
|
336
|
+
page.get_by_role("button", name="Delete this shape").click()
|
|
345
337
|
data = save_and_get_json(page)
|
|
346
338
|
assert len(data["features"]) == 1
|
|
347
339
|
assert data["features"][0]["geometry"]["type"] == "LineString"
|
|
@@ -59,7 +59,7 @@ def test_cancel_deleting_datalayer_should_restore(
|
|
|
59
59
|
markers = page.locator(".leaflet-marker-icon")
|
|
60
60
|
expect(layers).to_have_count(1)
|
|
61
61
|
expect(markers).to_have_count(1)
|
|
62
|
-
page.get_by_role("
|
|
62
|
+
page.get_by_role("button", name="Manage layers").click()
|
|
63
63
|
page.locator(".panel.right").get_by_title("Delete layer").click()
|
|
64
64
|
page.get_by_role("button", name="OK").click()
|
|
65
65
|
expect(markers).to_have_count(0)
|
|
@@ -77,7 +77,7 @@ def test_can_clone_datalayer(live_server, openmap, login, datalayer, page):
|
|
|
77
77
|
markers = page.locator(".leaflet-marker-icon")
|
|
78
78
|
expect(layers).to_have_count(1)
|
|
79
79
|
expect(markers).to_have_count(1)
|
|
80
|
-
page.get_by_role("
|
|
80
|
+
page.get_by_role("button", name="Manage layers").click()
|
|
81
81
|
page.locator(".panel.right").get_by_title("Edit", exact=True).click()
|
|
82
82
|
page.get_by_text("Advanced actions").click()
|
|
83
83
|
page.get_by_role("button", name="Clone").click()
|
|
@@ -99,7 +99,7 @@ def test_can_change_icon_class(live_server, openmap, page):
|
|
|
99
99
|
DataLayerFactory(map=openmap, data=data)
|
|
100
100
|
page.goto(f"{live_server.url}{openmap.get_absolute_url()}?edit#6/45.3/1")
|
|
101
101
|
expect(page.locator(".umap-div-icon")).to_be_visible()
|
|
102
|
-
page.get_by_role("
|
|
102
|
+
page.get_by_role("button", name="Manage layers").click()
|
|
103
103
|
expect(page.locator(".umap-circle-icon")).to_be_hidden()
|
|
104
104
|
page.locator(".panel.right").get_by_title("Edit", exact=True).click()
|
|
105
105
|
page.get_by_text("Shape properties").click()
|
|
@@ -113,7 +113,7 @@ def test_can_change_name(live_server, openmap, page, datalayer):
|
|
|
113
113
|
page.goto(
|
|
114
114
|
f"{live_server.url}{openmap.get_absolute_url()}?edit&onLoadPanel=databrowser"
|
|
115
115
|
)
|
|
116
|
-
page.get_by_role("
|
|
116
|
+
page.get_by_role("button", name="Manage layers").click()
|
|
117
117
|
page.locator(".panel.right").get_by_title("Edit", exact=True).click()
|
|
118
118
|
expect(page.locator(".umap-is-dirty")).to_be_hidden()
|
|
119
119
|
page.locator('input[name="name"]').click()
|
|
@@ -143,7 +143,7 @@ def test_can_create_new_datalayer(live_server, openmap, page, datalayer):
|
|
|
143
143
|
page.goto(
|
|
144
144
|
f"{live_server.url}{openmap.get_absolute_url()}?edit&onLoadPanel=databrowser"
|
|
145
145
|
)
|
|
146
|
-
page.get_by_role("
|
|
146
|
+
page.get_by_role("button", name="Manage layers").click()
|
|
147
147
|
page.get_by_role("button", name="Add a layer").click()
|
|
148
148
|
page.locator('input[name="name"]').click()
|
|
149
149
|
page.locator('input[name="name"]').fill("Layer A")
|
|
@@ -155,7 +155,7 @@ def test_can_create_new_datalayer(live_server, openmap, page, datalayer):
|
|
|
155
155
|
assert saved.name == "Layer A"
|
|
156
156
|
expect(page.locator(".umap-is-dirty")).to_be_hidden()
|
|
157
157
|
# Edit again, it should not create a new datalayer
|
|
158
|
-
page.get_by_role("
|
|
158
|
+
page.get_by_role("button", name="Manage layers").click()
|
|
159
159
|
page.locator(".panel.right").get_by_title("Edit", exact=True).first.click()
|
|
160
160
|
page.locator('input[name="name"]').click()
|
|
161
161
|
page.locator('input[name="name"]').fill("Layer A with a new name")
|
|
@@ -179,7 +179,7 @@ def test_can_restore_version(live_server, openmap, page, datalayer):
|
|
|
179
179
|
with page.expect_response(re.compile(".*/datalayer/update/.*")):
|
|
180
180
|
page.get_by_role("button", name="Save").click()
|
|
181
181
|
expect(marker).to_have_class(re.compile(".*umap-div-icon.*"))
|
|
182
|
-
page.get_by_role("
|
|
182
|
+
page.get_by_role("button", name="Manage layers").click()
|
|
183
183
|
page.locator(".panel.right").get_by_title("Edit", exact=True).click()
|
|
184
184
|
page.get_by_text("Versions").click()
|
|
185
185
|
page.get_by_role("button", name="Restore this version").last.click()
|
|
@@ -201,7 +201,7 @@ def test_deleting_datalayer_should_remove_from_browser_and_layers_list(
|
|
|
201
201
|
panel = page.locator(".panel.left")
|
|
202
202
|
edit_panel = page.locator(".panel.right")
|
|
203
203
|
page.get_by_title("Open browser").click()
|
|
204
|
-
page.get_by_role("
|
|
204
|
+
page.get_by_role("button", name="Manage layers").click()
|
|
205
205
|
expect(panel.get_by_text("test datalayer")).to_be_visible()
|
|
206
206
|
expect(edit_panel.get_by_text("test datalayer")).to_be_visible()
|
|
207
207
|
page.locator(".panel.right").get_by_title("Delete layer").click()
|
|
@@ -216,7 +216,7 @@ def test_deleting_datalayer_should_remove_from_caption(
|
|
|
216
216
|
page.goto(f"{live_server.url}{openmap.get_absolute_url()}?edit")
|
|
217
217
|
panel = page.locator(".panel.left")
|
|
218
218
|
page.get_by_role("button", name="About").click()
|
|
219
|
-
page.get_by_role("
|
|
219
|
+
page.get_by_role("button", name="Manage layers").click()
|
|
220
220
|
expect(panel.get_by_text("test datalayer")).to_be_visible()
|
|
221
221
|
page.locator(".panel.right").get_by_title("Delete layer").click()
|
|
222
222
|
page.get_by_role("button", name="OK").click()
|
|
@@ -225,7 +225,7 @@ def test_deleting_datalayer_should_remove_from_caption(
|
|
|
225
225
|
|
|
226
226
|
def test_can_edit_datalayer_name_in_list(live_server, openmap, datalayer, page):
|
|
227
227
|
page.goto(f"{live_server.url}{openmap.get_absolute_url()}?edit")
|
|
228
|
-
page.get_by_role("
|
|
228
|
+
page.get_by_role("button", name="Manage layers").click()
|
|
229
229
|
page.get_by_text("test datalayer").click()
|
|
230
230
|
page.get_by_text("test datalayer").fill("test datalayer foobar")
|
|
231
231
|
page.get_by_role("button", name="Open browser").click()
|
|
@@ -21,6 +21,16 @@ def test_can_edit_name(page, live_server, tilelayer):
|
|
|
21
21
|
)
|
|
22
22
|
|
|
23
23
|
|
|
24
|
+
def test_can_display_help(page, live_server, tilelayer):
|
|
25
|
+
page.goto(f"{live_server.url}/en/map/new/")
|
|
26
|
+
|
|
27
|
+
page.get_by_title("Edit map name and caption").click()
|
|
28
|
+
help_button = page.locator(".panel .umap-field-description .umap-help-button")
|
|
29
|
+
expect(help_button).to_be_visible()
|
|
30
|
+
help_button.click()
|
|
31
|
+
expect(page.locator("dialog").first).to_contain_text("Text formatting")
|
|
32
|
+
|
|
33
|
+
|
|
24
34
|
def test_can_edit_name_on_click_on_toolbar(page, live_server, tilelayer):
|
|
25
35
|
page.goto(f"{live_server.url}/en/map/new/")
|
|
26
36
|
page.locator(".umap-main-edit-toolbox .map-name").click()
|
|
@@ -182,7 +192,7 @@ def test_sortkey_impacts_datalayerindex(map, live_server, page):
|
|
|
182
192
|
|
|
183
193
|
# Change the default sortkey to be "key"
|
|
184
194
|
page.get_by_role("button", name="Edit").click()
|
|
185
|
-
page.get_by_role("
|
|
195
|
+
page.get_by_role("button", name="Map advanced properties").click()
|
|
186
196
|
page.get_by_text("Default properties").click()
|
|
187
197
|
|
|
188
198
|
# Click "define"
|
|
@@ -200,3 +210,19 @@ def test_sortkey_impacts_datalayerindex(map, live_server, page):
|
|
|
200
210
|
assert "Z First" == first_listed_feature.text_content()
|
|
201
211
|
assert "Y Second" == second_listed_feature.text_content()
|
|
202
212
|
assert "X Third" == third_listed_feature.text_content()
|
|
213
|
+
|
|
214
|
+
|
|
215
|
+
def test_hover_tooltip_setting_should_be_persistent(live_server, map, page):
|
|
216
|
+
map.settings["properties"]["showLabel"] = None
|
|
217
|
+
map.edit_status = Map.ANONYMOUS
|
|
218
|
+
map.save()
|
|
219
|
+
page.goto(f"{live_server.url}{map.get_absolute_url()}?edit")
|
|
220
|
+
page.get_by_role("button", name="Map advanced properties").click()
|
|
221
|
+
page.get_by_text("Default interaction options").click()
|
|
222
|
+
expect(page.get_by_text("on hover")).to_be_visible()
|
|
223
|
+
expect(page.locator(".umap-field-showLabel")).to_match_aria_snapshot("""
|
|
224
|
+
- text: Display label
|
|
225
|
+
- button "clear"
|
|
226
|
+
- text: always never on hover
|
|
227
|
+
""")
|
|
228
|
+
expect(page.locator(".umap-field-showLabel input[value=null]")).to_be_checked()
|
|
@@ -43,7 +43,7 @@ def test_marker_style_should_have_precedence(live_server, openmap, page, bootstr
|
|
|
43
43
|
page.goto(f"{live_server.url}{openmap.get_absolute_url()}?edit#6/48.5/19")
|
|
44
44
|
|
|
45
45
|
# Change colour at layer level
|
|
46
|
-
page.get_by_role("
|
|
46
|
+
page.get_by_role("button", name="Manage layers").click()
|
|
47
47
|
page.locator(".panel").get_by_title("Edit", exact=True).click()
|
|
48
48
|
page.get_by_text("Shape properties").click()
|
|
49
49
|
page.locator(".umap-field-color .define").click()
|
|
@@ -65,7 +65,7 @@ def test_marker_style_should_have_precedence(live_server, openmap, page, bootstr
|
|
|
65
65
|
)
|
|
66
66
|
|
|
67
67
|
# Now change again at layer level again, it should not change the marker color
|
|
68
|
-
page.get_by_role("
|
|
68
|
+
page.get_by_role("button", name="Manage layers").click()
|
|
69
69
|
page.locator(".panel").get_by_title("Edit", exact=True).click()
|
|
70
70
|
page.get_by_text("Shape properties").click()
|
|
71
71
|
page.locator(".umap-field-color input").click()
|
|
@@ -78,8 +78,8 @@ def test_marker_style_should_have_precedence(live_server, openmap, page, bootstr
|
|
|
78
78
|
def test_should_open_an_edit_toolbar_on_click(live_server, openmap, page, bootstrap):
|
|
79
79
|
page.goto(f"{live_server.url}{openmap.get_absolute_url()}?edit")
|
|
80
80
|
page.locator(".leaflet-marker-icon").click()
|
|
81
|
-
expect(page.get_by_role("
|
|
82
|
-
expect(page.get_by_role("
|
|
81
|
+
expect(page.get_by_role("button", name="Toggle edit mode")).to_be_visible()
|
|
82
|
+
expect(page.get_by_role("button", name="Delete this feature")).to_be_visible()
|
|
83
83
|
|
|
84
84
|
|
|
85
85
|
def test_should_update_open_popup_on_edit(live_server, openmap, page, bootstrap):
|
|
@@ -115,6 +115,6 @@ def test_should_follow_datalayer_style_when_changing_datalayer(
|
|
|
115
115
|
expect(marker).to_have_css("background-color", "rgb(0, 139, 139)")
|
|
116
116
|
# Change datalayer
|
|
117
117
|
marker.click()
|
|
118
|
-
page.get_by_role("
|
|
118
|
+
page.get_by_role("button", name="Toggle edit mode (⇧+Click)").click()
|
|
119
119
|
page.locator(".umap-field-datalayer select").select_option(label="other datalayer")
|
|
120
120
|
expect(marker).to_have_css("background-color", "rgb(148, 0, 211)")
|
|
@@ -57,7 +57,7 @@ def test_marker_style_should_have_precedence(live_server, openmap, page, bootstr
|
|
|
57
57
|
page.goto(f"{live_server.url}{openmap.get_absolute_url()}?edit")
|
|
58
58
|
|
|
59
59
|
# Change colour at layer level
|
|
60
|
-
page.get_by_role("
|
|
60
|
+
page.get_by_role("button", name="Manage layers").click()
|
|
61
61
|
page.locator(".panel").get_by_title("Edit", exact=True).click()
|
|
62
62
|
page.get_by_text("Shape properties").click()
|
|
63
63
|
page.locator(".umap-field-color .define").click()
|
|
@@ -75,7 +75,7 @@ def test_marker_style_should_have_precedence(live_server, openmap, page, bootstr
|
|
|
75
75
|
)
|
|
76
76
|
|
|
77
77
|
# Now change again at layer level again, it should not change the marker color
|
|
78
|
-
page.get_by_role("
|
|
78
|
+
page.get_by_role("button", name="Manage layers").click()
|
|
79
79
|
page.locator(".panel").get_by_title("Edit", exact=True).click()
|
|
80
80
|
page.get_by_text("Shape properties").click()
|
|
81
81
|
page.locator(".umap-field-color input").click()
|
|
@@ -88,8 +88,8 @@ def test_marker_style_should_have_precedence(live_server, openmap, page, bootstr
|
|
|
88
88
|
def test_should_open_an_edit_toolbar_on_click(live_server, openmap, page, bootstrap):
|
|
89
89
|
page.goto(f"{live_server.url}{openmap.get_absolute_url()}?edit")
|
|
90
90
|
page.locator("path").click()
|
|
91
|
-
expect(page.get_by_role("
|
|
92
|
-
expect(page.get_by_role("
|
|
91
|
+
expect(page.get_by_role("button", name="Toggle edit mode")).to_be_visible()
|
|
92
|
+
expect(page.get_by_role("button", name="Delete this feature")).to_be_visible()
|
|
93
93
|
|
|
94
94
|
|
|
95
95
|
def test_can_remove_stroke(live_server, openmap, page, bootstrap):
|
|
@@ -98,7 +98,7 @@ def test_can_remove_stroke(live_server, openmap, page, bootstrap):
|
|
|
98
98
|
1
|
|
99
99
|
)
|
|
100
100
|
page.locator("path").click()
|
|
101
|
-
page.get_by_role("
|
|
101
|
+
page.get_by_role("button", name="Toggle edit mode").click()
|
|
102
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 .show-on-defined label").first.click()
|
|
@@ -6,9 +6,7 @@ def test_ids_generation(page, live_server, tilelayer):
|
|
|
6
6
|
page.goto(f"{live_server.url}/en/map/new/")
|
|
7
7
|
|
|
8
8
|
# Click on the Draw a line button on a new map.
|
|
9
|
-
create_polyline = page.locator(".
|
|
10
|
-
"Draw a polyline"
|
|
11
|
-
)
|
|
9
|
+
create_polyline = page.locator(".umap-edit-bar ").get_by_title("Draw a polyline")
|
|
12
10
|
create_polyline.click()
|
|
13
11
|
|
|
14
12
|
map = page.locator("#map")
|
|
@@ -18,9 +16,7 @@ def test_ids_generation(page, live_server, tilelayer):
|
|
|
18
16
|
map.click(position={"x": 100, "y": 100})
|
|
19
17
|
|
|
20
18
|
# Click on the Draw a polygon button on a new map.
|
|
21
|
-
create_polygon = page.locator(".
|
|
22
|
-
"Draw a polygon"
|
|
23
|
-
)
|
|
19
|
+
create_polygon = page.locator(".umap-edit-bar ").get_by_title("Draw a polygon")
|
|
24
20
|
create_polygon.click()
|
|
25
21
|
|
|
26
22
|
map = page.locator("#map")
|