umap-project 2.8.2__py3-none-any.whl → 2.9.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.
- umap/__init__.py +1 -1
- umap/admin.py +15 -2
- umap/asgi.py +12 -7
- umap/context_processors.py +1 -0
- 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 +110 -66
- umap/locale/el/LC_MESSAGES/django.mo +0 -0
- umap/locale/el/LC_MESSAGES/django.po +129 -85
- umap/locale/en/LC_MESSAGES/django.po +103 -60
- umap/locale/es/LC_MESSAGES/django.mo +0 -0
- umap/locale/es/LC_MESSAGES/django.po +114 -69
- umap/locale/fr/LC_MESSAGES/django.mo +0 -0
- umap/locale/fr/LC_MESSAGES/django.po +105 -61
- umap/locale/gl/LC_MESSAGES/django.mo +0 -0
- umap/locale/gl/LC_MESSAGES/django.po +216 -171
- umap/locale/it/LC_MESSAGES/django.mo +0 -0
- umap/locale/it/LC_MESSAGES/django.po +142 -98
- umap/locale/nl/LC_MESSAGES/django.mo +0 -0
- umap/locale/nl/LC_MESSAGES/django.po +196 -151
- umap/locale/pt/LC_MESSAGES/django.mo +0 -0
- umap/locale/pt/LC_MESSAGES/django.po +115 -71
- umap/locale/zh_TW/LC_MESSAGES/django.mo +0 -0
- umap/locale/zh_TW/LC_MESSAGES/django.po +109 -65
- umap/management/commands/empty_trash.py +12 -1
- umap/migrations/0026_datalayer_modified_at_datalayer_share_status.py +26 -0
- umap/models.py +43 -13
- umap/settings/base.py +5 -2
- umap/static/umap/base.css +5 -2
- umap/static/umap/content.css +2 -22
- umap/static/umap/css/bar.css +39 -10
- umap/static/umap/css/contextmenu.css +14 -2
- umap/static/umap/css/form.css +33 -39
- umap/static/umap/css/icon.css +47 -5
- umap/static/umap/css/panel.css +20 -2
- umap/static/umap/css/popup.css +0 -1
- umap/static/umap/css/tooltip.css +33 -31
- umap/static/umap/img/16-white.svg +5 -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/bitbucket.png +0 -0
- umap/static/umap/img/providers/github.png +0 -0
- umap/static/umap/img/providers/keycloak.png +0 -0
- umap/static/umap/img/providers/openstreetmap-oauth2.png +0 -0
- umap/static/umap/img/providers/twitter-oauth2.png +0 -0
- umap/static/umap/img/source/16-white.svg +6 -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/components/alerts/alert.js +4 -1
- umap/static/umap/js/modules/browser.js +8 -8
- umap/static/umap/js/modules/caption.js +30 -7
- umap/static/umap/js/modules/data/features.js +101 -56
- umap/static/umap/js/modules/data/layer.js +108 -83
- umap/static/umap/js/modules/form/builder.js +242 -0
- umap/static/umap/js/modules/form/fields.js +1346 -0
- umap/static/umap/js/modules/formatter.js +9 -8
- umap/static/umap/js/modules/help.js +20 -24
- umap/static/umap/js/modules/importer.js +6 -3
- umap/static/umap/js/modules/permissions.js +11 -6
- umap/static/umap/js/modules/rendering/icon.js +5 -1
- umap/static/umap/js/modules/rendering/layers/classified.js +12 -8
- umap/static/umap/js/modules/rendering/layers/cluster.js +11 -1
- umap/static/umap/js/modules/rendering/map.js +1 -23
- umap/static/umap/js/modules/rendering/ui.js +20 -38
- umap/static/umap/js/modules/rules.js +3 -2
- umap/static/umap/js/modules/saving.js +5 -0
- umap/static/umap/js/modules/schema.js +8 -6
- umap/static/umap/js/modules/share.js +3 -3
- umap/static/umap/js/modules/sync/engine.js +56 -26
- umap/static/umap/js/modules/sync/updaters.js +15 -6
- umap/static/umap/js/modules/sync/websocket.js +50 -37
- umap/static/umap/js/modules/tableeditor.js +3 -2
- umap/static/umap/js/modules/ui/bar.js +101 -9
- umap/static/umap/js/modules/ui/base.js +7 -24
- 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/ui/tooltip.js +19 -11
- umap/static/umap/js/modules/umap.js +121 -68
- umap/static/umap/js/modules/utils.js +196 -12
- umap/static/umap/js/umap.controls.js +11 -353
- 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 +33 -20
- umap/static/umap/locale/br.json +33 -20
- umap/static/umap/locale/ca.js +17 -5
- umap/static/umap/locale/ca.json +17 -5
- umap/static/umap/locale/cs_CZ.js +15 -5
- umap/static/umap/locale/cs_CZ.json +15 -5
- umap/static/umap/locale/da.js +17 -5
- umap/static/umap/locale/da.json +17 -5
- umap/static/umap/locale/de.js +17 -5
- umap/static/umap/locale/de.json +17 -5
- umap/static/umap/locale/el.js +63 -51
- umap/static/umap/locale/el.json +63 -51
- umap/static/umap/locale/en.js +15 -5
- umap/static/umap/locale/en.json +15 -5
- umap/static/umap/locale/en_US.json +17 -5
- umap/static/umap/locale/es.js +25 -13
- umap/static/umap/locale/es.json +25 -13
- umap/static/umap/locale/et.js +17 -5
- umap/static/umap/locale/et.json +17 -5
- umap/static/umap/locale/eu.js +17 -5
- umap/static/umap/locale/eu.json +17 -5
- umap/static/umap/locale/fa_IR.js +17 -5
- umap/static/umap/locale/fa_IR.json +17 -5
- umap/static/umap/locale/fi.js +17 -5
- umap/static/umap/locale/fi.json +17 -5
- umap/static/umap/locale/fr.js +16 -6
- umap/static/umap/locale/fr.json +16 -6
- umap/static/umap/locale/gl.js +357 -345
- umap/static/umap/locale/gl.json +357 -345
- 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 +14 -5
- umap/static/umap/locale/hu.json +14 -5
- 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 +125 -113
- umap/static/umap/locale/it.json +125 -113
- 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 +17 -5
- umap/static/umap/locale/ms.json +17 -5
- umap/static/umap/locale/nl.js +132 -119
- umap/static/umap/locale/nl.json +132 -119
- umap/static/umap/locale/no.js +17 -5
- umap/static/umap/locale/no.json +17 -5
- umap/static/umap/locale/pl.js +17 -5
- umap/static/umap/locale/pl.json +17 -5
- umap/static/umap/locale/pl_PL.json +17 -5
- umap/static/umap/locale/pt.js +38 -25
- umap/static/umap/locale/pt.json +38 -25
- 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 +17 -5
- umap/static/umap/locale/pt_PT.json +17 -5
- 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 +17 -5
- umap/static/umap/locale/th_TH.json +17 -5
- 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 +15 -5
- umap/static/umap/locale/zh_TW.json +15 -5
- umap/static/umap/map.css +29 -76
- umap/static/umap/nav.css +6 -3
- umap/static/umap/unittests/utils.js +14 -0
- umap/static/umap/vars.css +3 -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/__init__.py +0 -0
- umap/sync/app.py +187 -0
- umap/sync/payloads.py +56 -0
- umap/templates/auth/user_detail.html +4 -0
- umap/templates/auth/user_form.html +9 -6
- umap/templates/auth/user_stars.html +4 -0
- umap/templates/base.html +1 -1
- umap/templates/registration/login.html +2 -5
- umap/templates/umap/about.html +5 -0
- umap/templates/umap/about_summary.html +2 -2
- umap/templates/umap/components/provider.html +8 -0
- umap/templates/umap/content_footer.html +1 -1
- umap/templates/umap/css.html +0 -2
- umap/templates/umap/js.html +0 -4
- umap/templates/umap/map_detail.html +1 -1
- umap/templates/umap/password_change.html +4 -0
- umap/templates/umap/password_change_done.html +4 -0
- umap/templates/umap/search.html +4 -0
- umap/templates/umap/search_bar.html +1 -0
- umap/templates/umap/team_confirm_delete.html +4 -0
- umap/templates/umap/team_detail.html +4 -0
- umap/templates/umap/team_form.html +4 -0
- umap/templates/umap/user_dashboard.html +1 -1
- umap/templates/umap/user_teams.html +4 -0
- umap/tests/base.py +3 -1
- umap/tests/integration/conftest.py +16 -23
- umap/tests/integration/test_anonymous_owned_map.py +2 -2
- umap/tests/integration/test_basics.py +4 -7
- umap/tests/integration/test_caption.py +1 -0
- 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 +14 -22
- umap/tests/integration/test_draw_polyline.py +6 -14
- umap/tests/integration/test_edit_datalayer.py +11 -11
- umap/tests/integration/test_edit_map.py +30 -4
- umap/tests/integration/test_edit_marker.py +5 -5
- umap/tests/integration/test_edit_polygon.py +6 -6
- umap/tests/integration/test_features_id_generation.py +2 -6
- umap/tests/integration/test_import.py +115 -29
- umap/tests/integration/test_optimistic_merge.py +1 -0
- umap/tests/integration/test_owned_map.py +1 -1
- umap/tests/integration/test_picto.py +8 -8
- umap/tests/integration/test_save.py +3 -2
- umap/tests/integration/test_star.py +13 -9
- umap/tests/integration/test_tableeditor.py +8 -7
- umap/tests/integration/test_view_marker.py +10 -0
- umap/tests/integration/test_websocket_sync.py +239 -64
- umap/tests/settings.py +2 -0
- umap/tests/test_datalayer.py +2 -3
- umap/tests/test_datalayer_views.py +20 -1
- umap/tests/test_empty_trash.py +10 -3
- umap/tests/test_map_views.py +11 -0
- umap/utils.py +27 -11
- umap/views.py +37 -6
- {umap_project-2.8.2.dist-info → umap_project-2.9.0.dist-info}/METADATA +22 -22
- {umap_project-2.8.2.dist-info → umap_project-2.9.0.dist-info}/RECORD +247 -248
- {umap_project-2.8.2.dist-info → umap_project-2.9.0.dist-info}/WHEEL +1 -1
- umap/management/commands/run_websocket_server.py +0 -23
- umap/settings/local_s3.py +0 -45
- umap/static/umap/bitbucket.png +0 -0
- umap/static/umap/github.png +0 -0
- umap/static/umap/js/umap.forms.js +0 -1242
- umap/static/umap/keycloak.png +0 -0
- umap/static/umap/openstreetmap.png +0 -0
- umap/static/umap/twitter.png +0 -0
- umap/static/umap/vendors/formbuilder/Leaflet.FormBuilder.js +0 -468
- umap/static/umap/vendors/toolbar/leaflet.toolbar.css +0 -1
- umap/static/umap/vendors/toolbar/leaflet.toolbar.js +0 -1
- umap/tests/test_websocket_server.py +0 -22
- umap/websocket_server.py +0 -202
- {umap_project-2.8.2.dist-info → umap_project-2.9.0.dist-info}/entry_points.txt +0 -0
- {umap_project-2.8.2.dist-info → umap_project-2.9.0.dist-info}/licenses/LICENSE +0 -0
umap/templates/base.html
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
{% load i18n %}
|
|
4
4
|
|
|
5
5
|
{% block head_title %}
|
|
6
|
-
{% trans "Login" %}
|
|
6
|
+
{% trans "Login" %} - {{ SITE_DESCRIPTION }}
|
|
7
7
|
{% endblock head_title %}
|
|
8
8
|
{% load umap_tags i18n %}
|
|
9
9
|
|
|
@@ -55,10 +55,7 @@
|
|
|
55
55
|
<ul class="login-grid block-grid">
|
|
56
56
|
{% for name in backends.backends %}
|
|
57
57
|
<li>
|
|
58
|
-
|
|
59
|
-
href="{% url "social:begin" name %}"
|
|
60
|
-
class="umap-login-popup login-{{ name }}"
|
|
61
|
-
title="{{ name|title }}"></a>
|
|
58
|
+
{% include "umap/components/provider.html" with name=name %}
|
|
62
59
|
</li>
|
|
63
60
|
{% endfor %}
|
|
64
61
|
</ul>
|
umap/templates/umap/about.html
CHANGED
|
@@ -60,10 +60,10 @@
|
|
|
60
60
|
{% spaceless %}
|
|
61
61
|
<div class="button-bar {% if demo_map %}half{% endif %}">
|
|
62
62
|
{% if not UMAP_READONLY %}
|
|
63
|
-
<a href="{% url 'map_new' %}" class="button button-primary
|
|
63
|
+
<a href="{% url 'map_new' %}" class="button button-primary">{% trans "Create a map" %}</a>
|
|
64
64
|
{% endif %}
|
|
65
65
|
{% if demo_map %}
|
|
66
|
-
<a href="{{ demo_map.get_absolute_url }}" class="button
|
|
66
|
+
<a href="{{ demo_map.get_absolute_url }}" class="button neutral">{% trans "Play with the demo" %}</a>
|
|
67
67
|
{% endif %}
|
|
68
68
|
</div>
|
|
69
69
|
{% endspaceless %}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
{% load static %}
|
|
2
|
+
<a href="{% url "social:begin" name %}"
|
|
3
|
+
class="umap-login-popup"
|
|
4
|
+
title="{{ name|title }}">
|
|
5
|
+
{% with "umap/img/providers/"|add:name|add:".png" as path %}
|
|
6
|
+
<img src="{% static path %}" width="92px" height="92px" alt="{{ name }}" />
|
|
7
|
+
{% endwith %}
|
|
8
|
+
</a>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{% load i18n %}
|
|
2
2
|
|
|
3
3
|
<footer>
|
|
4
|
-
<a href="
|
|
4
|
+
<a href="{% url "home" %}" class="branding">uMap</a>
|
|
5
5
|
<span>{% trans "An OpenStreetMap project" %}
|
|
6
6
|
({% trans "version" %} <a href="https://docs.umap-project.org/en/stable/changelog/">{{ UMAP_VERSION }}</a>)</span>
|
|
7
7
|
{% if UMAP_HOST_INFOS.url and UMAP_HOST_INFOS.name %}<span>{% trans "Hosted by" %} <a href="{{ UMAP_HOST_INFOS.url }}">{{ UMAP_HOST_INFOS.name }}</a></span>{% endif %}
|
umap/templates/umap/css.html
CHANGED
|
@@ -12,8 +12,6 @@
|
|
|
12
12
|
href="{% static 'umap/vendors/editinosm/Leaflet.EditInOSM.css' %}" />
|
|
13
13
|
<link rel="stylesheet"
|
|
14
14
|
href="{% static 'umap/vendors/minimap/Control.MiniMap.min.css' %}" />
|
|
15
|
-
<link rel="stylesheet"
|
|
16
|
-
href="{% static 'umap/vendors/toolbar/leaflet.toolbar.css' %}" />
|
|
17
15
|
<link rel="stylesheet"
|
|
18
16
|
href="{% static 'umap/vendors/measurable/Leaflet.Measurable.css' %}" />
|
|
19
17
|
<link rel="stylesheet"
|
umap/templates/umap/js.html
CHANGED
|
@@ -29,9 +29,6 @@
|
|
|
29
29
|
<script src="{% static 'umap/vendors/photon/leaflet.photon.js' %}" defer></script>
|
|
30
30
|
<script src="{% static 'umap/vendors/fullscreen/Leaflet.fullscreen.min.js' %}"
|
|
31
31
|
defer></script>
|
|
32
|
-
<script src="{% static 'umap/vendors/toolbar/leaflet.toolbar.js' %}" defer></script>
|
|
33
|
-
<script src="{% static 'umap/vendors/formbuilder/Leaflet.FormBuilder.js' %}"
|
|
34
|
-
defer></script>
|
|
35
32
|
<script src="{% static 'umap/vendors/measurable/Leaflet.Measurable.js' %}"
|
|
36
33
|
defer></script>
|
|
37
34
|
<script src="{% static 'umap/vendors/iconlayers/iconLayers.js' %}" defer></script>
|
|
@@ -40,7 +37,6 @@
|
|
|
40
37
|
<script src="{% static 'umap/vendors/simple-statistics/simple-statistics.min.js' %}"
|
|
41
38
|
defer></script>
|
|
42
39
|
<script src="{% static 'umap/js/umap.core.js' %}" defer></script>
|
|
43
|
-
<script src="{% static 'umap/js/umap.forms.js' %}" defer></script>
|
|
44
40
|
<script src="{% static 'umap/js/umap.controls.js' %}" defer></script>
|
|
45
41
|
<script type="module" src="{% static 'umap/js/components/fragment.js' %}" defer></script>
|
|
46
42
|
{% endautoescape %}
|
umap/templates/umap/search.html
CHANGED
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
{% load i18n %}
|
|
4
4
|
|
|
5
|
+
{% block head_title %}
|
|
6
|
+
{% translate "Explore maps" %} - {{ SITE_DESCRIPTION }}
|
|
7
|
+
{% endblock head_title %}
|
|
8
|
+
|
|
5
9
|
{% block messages %}
|
|
6
10
|
{# We don't want maps from the results list to display errors in the main page. #}
|
|
7
11
|
{% endblock messages %}
|
umap/tests/base.py
CHANGED
|
@@ -127,6 +127,9 @@ class DataLayerFactory(factory.django.DjangoModelFactory):
|
|
|
127
127
|
def _adjust_kwargs(cls, **kwargs):
|
|
128
128
|
if "data" in kwargs:
|
|
129
129
|
data = copy.deepcopy(kwargs.pop("data"))
|
|
130
|
+
data.setdefault("_umap_options", {})
|
|
131
|
+
if "name" in data["_umap_options"] and kwargs["name"] == cls.name:
|
|
132
|
+
kwargs["name"] = data["_umap_options"]["name"]
|
|
130
133
|
if "settings" not in kwargs:
|
|
131
134
|
kwargs["settings"] = data.get("_umap_options", {})
|
|
132
135
|
else:
|
|
@@ -135,7 +138,6 @@ class DataLayerFactory(factory.django.DjangoModelFactory):
|
|
|
135
138
|
**DataLayerFactory.settings._defaults,
|
|
136
139
|
**kwargs["settings"],
|
|
137
140
|
}
|
|
138
|
-
data.setdefault("_umap_options", {})
|
|
139
141
|
kwargs["settings"]["name"] = kwargs["name"]
|
|
140
142
|
data["_umap_options"]["name"] = kwargs["name"]
|
|
141
143
|
data.setdefault("type", "FeatureCollection")
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import os
|
|
2
2
|
import re
|
|
3
|
-
import subprocess
|
|
4
|
-
import time
|
|
5
|
-
from pathlib import Path
|
|
6
3
|
|
|
7
4
|
import pytest
|
|
5
|
+
from daphne.testing import DaphneProcess
|
|
6
|
+
from django.contrib.staticfiles.handlers import ASGIStaticFilesHandler
|
|
8
7
|
from playwright.sync_api import expect
|
|
9
8
|
|
|
9
|
+
from umap.asgi import application
|
|
10
|
+
|
|
10
11
|
from ..base import mock_tiles
|
|
11
12
|
|
|
12
13
|
|
|
@@ -67,23 +68,15 @@ def login(new_page, settings, live_server):
|
|
|
67
68
|
return do_login
|
|
68
69
|
|
|
69
70
|
|
|
70
|
-
@pytest.fixture
|
|
71
|
-
def
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
stderr=subprocess.STDOUT,
|
|
83
|
-
)
|
|
84
|
-
time.sleep(2)
|
|
85
|
-
# Ensure it started properly before yielding
|
|
86
|
-
assert not ds_proc.poll(), ds_proc.stdout.read().decode("utf-8")
|
|
87
|
-
yield ds_proc
|
|
88
|
-
# Shut it down at the end of the pytest session
|
|
89
|
-
ds_proc.terminate()
|
|
71
|
+
@pytest.fixture(scope="function")
|
|
72
|
+
def asgi_live_server(request, live_server):
|
|
73
|
+
server = DaphneProcess("localhost", lambda: ASGIStaticFilesHandler(application))
|
|
74
|
+
server.start()
|
|
75
|
+
server.ready.wait()
|
|
76
|
+
port = server.port.value
|
|
77
|
+
server.url = f"http://localhost:{port}"
|
|
78
|
+
|
|
79
|
+
yield server
|
|
80
|
+
|
|
81
|
+
server.terminate()
|
|
82
|
+
server.join()
|
|
@@ -234,7 +234,7 @@ def test_anonymous_owner_can_delete_the_map(anonymap, live_server, owner_session
|
|
|
234
234
|
assert Map.objects.count() == 1
|
|
235
235
|
owner_session.goto(f"{live_server.url}{anonymap.get_absolute_url()}")
|
|
236
236
|
owner_session.get_by_role("button", name="Edit").click()
|
|
237
|
-
owner_session.get_by_role("
|
|
237
|
+
owner_session.get_by_role("button", name="Map advanced properties").click()
|
|
238
238
|
owner_session.get_by_text("Advanced actions").click()
|
|
239
239
|
expect(owner_session.get_by_role("button", name="Delete")).to_be_visible()
|
|
240
240
|
owner_session.get_by_role("button", name="Delete").click()
|
|
@@ -248,6 +248,6 @@ def test_non_owner_cannot_see_delete_button(anonymap, live_server, page):
|
|
|
248
248
|
anonymap.save()
|
|
249
249
|
page.goto(f"{live_server.url}{anonymap.get_absolute_url()}")
|
|
250
250
|
page.get_by_role("button", name="Edit").click()
|
|
251
|
-
page.get_by_role("
|
|
251
|
+
page.get_by_role("button", name="Map advanced properties").click()
|
|
252
252
|
page.get_by_text("Advanced actions").click()
|
|
253
253
|
expect(page.get_by_role("button", name="Delete")).to_be_hidden()
|
|
@@ -8,7 +8,7 @@ from umap.models import Map
|
|
|
8
8
|
|
|
9
9
|
def test_page_title(page, live_server):
|
|
10
10
|
page.goto(live_server.url)
|
|
11
|
-
expect(page).to_have_title("uMap")
|
|
11
|
+
expect(page).to_have_title("uMap - Online map creator")
|
|
12
12
|
|
|
13
13
|
|
|
14
14
|
@pytest.mark.parametrize(
|
|
@@ -26,10 +26,7 @@ def test_create_map_with_cursor(page, live_server, tilelayer):
|
|
|
26
26
|
page.goto(f"{live_server.url}/en/map/new/")
|
|
27
27
|
|
|
28
28
|
# Click on the Draw a marker button on a new map.
|
|
29
|
-
create_marker_link = page.locator(".
|
|
30
|
-
"Draw a marker"
|
|
31
|
-
)
|
|
32
|
-
expect(create_marker_link).to_have_attribute("href", "#")
|
|
29
|
+
create_marker_link = page.locator(".umap-edit-bar ").get_by_title("Draw a marker")
|
|
33
30
|
create_marker_link.click()
|
|
34
31
|
|
|
35
32
|
# Check no marker is present by default.
|
|
@@ -56,7 +53,7 @@ def test_cannot_put_script_tag_in_datalayer_name_or_description(
|
|
|
56
53
|
):
|
|
57
54
|
page.goto(f"{live_server.url}{openmap.get_absolute_url()}")
|
|
58
55
|
page.get_by_role("button", name="Edit").click()
|
|
59
|
-
page.get_by_role("
|
|
56
|
+
page.get_by_role("button", name="Manage layers").click()
|
|
60
57
|
page.get_by_role("button", name="Add a layer").click()
|
|
61
58
|
page.locator('input[name="name"]').click()
|
|
62
59
|
page.locator('input[name="name"]').fill('<script>alert("attack")</script>')
|
|
@@ -83,7 +80,7 @@ def test_login_from_map_page(live_server, page, tilelayer, settings, user, conte
|
|
|
83
80
|
page.get_by_role("button", name="Save").click()
|
|
84
81
|
assert Map.objects.count() == 0
|
|
85
82
|
login_page = login_page_info.value
|
|
86
|
-
expect(login_page).to_have_title("Login")
|
|
83
|
+
expect(login_page).to_have_title("Login - Online map creator")
|
|
87
84
|
login_page.get_by_placeholder("Username").fill(user.username)
|
|
88
85
|
login_page.get_by_placeholder("Password").fill("123123")
|
|
89
86
|
with page.expect_response(re.compile(r".*/map/create/")):
|
|
@@ -25,6 +25,7 @@ def test_caption(live_server, page, map):
|
|
|
25
25
|
panel.locator(".caption-item .off").get_by_text(non_loaded.name)
|
|
26
26
|
).to_be_visible()
|
|
27
27
|
expect(panel.locator(".caption-item").get_by_text(hidden.name)).to_be_hidden()
|
|
28
|
+
expect(panel.get_by_text("Created at")).to_be_visible()
|
|
28
29
|
|
|
29
30
|
|
|
30
31
|
def test_caption_should_display_owner_as_author(live_server, page, map):
|
|
@@ -51,8 +51,8 @@ def test_basic_categorized_map_with_custom_brewer(openmap, live_server, page):
|
|
|
51
51
|
expect(page.locator("path[stroke='#3288bd']")).to_have_count(7)
|
|
52
52
|
|
|
53
53
|
# Now change brewer from UI
|
|
54
|
-
page.get_by_role("button", name="Edit").click()
|
|
55
|
-
page.get_by_role("
|
|
54
|
+
page.get_by_role("button", name="Edit", exact=True).click()
|
|
55
|
+
page.get_by_role("button", name="Manage layers").click()
|
|
56
56
|
page.locator(".panel").get_by_title("Edit", exact=True).click()
|
|
57
57
|
page.get_by_text("Categorized: settings").click()
|
|
58
58
|
page.locator('select[name="brewer"]').select_option("Paired")
|
|
@@ -98,8 +98,8 @@ def test_basic_categorized_map_with_custom_categories(openmap, live_server, page
|
|
|
98
98
|
expect(page.locator("path[stroke='#f0027f']")).to_have_count(1)
|
|
99
99
|
|
|
100
100
|
# Now change categories from UI
|
|
101
|
-
page.get_by_role("button", name="Edit").click()
|
|
102
|
-
page.get_by_role("
|
|
101
|
+
page.get_by_role("button", name="Edit", exact=True).click()
|
|
102
|
+
page.get_by_role("button", name="Manage layers").click()
|
|
103
103
|
page.locator(".panel").get_by_title("Edit", exact=True).click()
|
|
104
104
|
page.get_by_text("Categorized: settings").click()
|
|
105
105
|
page.locator('input[name="categories"]').fill(
|
|
@@ -121,10 +121,6 @@ def test_basic_categorized_map_with_custom_categories(openmap, live_server, page
|
|
|
121
121
|
expect(page.locator("path[stroke='#f0027f']")).to_have_count(7)
|
|
122
122
|
|
|
123
123
|
# Now go back to automatic categories
|
|
124
|
-
page.get_by_role("button", name="Edit").click()
|
|
125
|
-
page.get_by_role("link", name="Manage layers").click()
|
|
126
|
-
page.locator(".panel").get_by_title("Edit", exact=True).click()
|
|
127
|
-
page.get_by_text("Categorized: settings").click()
|
|
128
124
|
page.get_by_text("Alphabetical").click()
|
|
129
125
|
|
|
130
126
|
# residential
|
|
@@ -48,7 +48,7 @@ def test_basic_choropleth_map_with_custom_brewer(openmap, live_server, page):
|
|
|
48
48
|
|
|
49
49
|
# Now change brewer from UI
|
|
50
50
|
page.get_by_role("button", name="Edit").click()
|
|
51
|
-
page.get_by_role("
|
|
51
|
+
page.get_by_role("button", name="Manage layers").click()
|
|
52
52
|
page.locator(".panel").get_by_title("Edit", exact=True).click()
|
|
53
53
|
page.get_by_text("Choropleth: settings").click()
|
|
54
54
|
page.locator('select[name="brewer"]').select_option("Greens")
|
|
@@ -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,17 +471,17 @@ 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("
|
|
487
|
-
expect(page.locator("
|
|
478
|
+
page.get_by_role("button", name="Toggle edit mode (⇧+Click)").click()
|
|
479
|
+
expect(page.locator(".umap-tooltip-container")).to_contain_text(
|
|
488
480
|
"Please zoom in to edit the geometry"
|
|
489
481
|
)
|
|
490
482
|
expect(page.locator(".leaflet-vertex-icon")).to_be_hidden()
|
|
491
483
|
page.get_by_label("Zoom in").click()
|
|
492
|
-
expect(page.locator("
|
|
484
|
+
expect(page.locator(".umap-tooltip-container")).to_contain_text(
|
|
493
485
|
"Please zoom in to edit the geometry"
|
|
494
486
|
)
|
|
495
487
|
page.get_by_label("Zoom in").click()
|
|
@@ -497,6 +489,6 @@ def test_vertexmarker_not_shown_if_too_many(live_server, map, page, settings):
|
|
|
497
489
|
page.get_by_label("Zoom out").click()
|
|
498
490
|
page.wait_for_timeout(500)
|
|
499
491
|
expect(page.locator(".leaflet-vertex-icon")).to_be_hidden()
|
|
500
|
-
expect(page.locator("
|
|
492
|
+
expect(page.locator(".umap-tooltip-container")).to_contain_text(
|
|
501
493
|
"Please zoom in to edit the geometry"
|
|
502
494
|
)
|
|
@@ -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"
|