umap-project 2.8.1__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.

Files changed (262) hide show
  1. umap/__init__.py +1 -1
  2. umap/admin.py +15 -2
  3. umap/asgi.py +12 -7
  4. umap/context_processors.py +1 -0
  5. umap/locale/br/LC_MESSAGES/django.mo +0 -0
  6. umap/locale/br/LC_MESSAGES/django.po +111 -67
  7. umap/locale/cs_CZ/LC_MESSAGES/django.mo +0 -0
  8. umap/locale/cs_CZ/LC_MESSAGES/django.po +110 -66
  9. umap/locale/el/LC_MESSAGES/django.mo +0 -0
  10. umap/locale/el/LC_MESSAGES/django.po +129 -85
  11. umap/locale/en/LC_MESSAGES/django.po +103 -60
  12. umap/locale/es/LC_MESSAGES/django.mo +0 -0
  13. umap/locale/es/LC_MESSAGES/django.po +114 -69
  14. umap/locale/fr/LC_MESSAGES/django.mo +0 -0
  15. umap/locale/fr/LC_MESSAGES/django.po +105 -61
  16. umap/locale/gl/LC_MESSAGES/django.mo +0 -0
  17. umap/locale/gl/LC_MESSAGES/django.po +216 -171
  18. umap/locale/hu/LC_MESSAGES/django.mo +0 -0
  19. umap/locale/hu/LC_MESSAGES/django.po +10 -10
  20. umap/locale/it/LC_MESSAGES/django.mo +0 -0
  21. umap/locale/it/LC_MESSAGES/django.po +142 -98
  22. umap/locale/nl/LC_MESSAGES/django.mo +0 -0
  23. umap/locale/nl/LC_MESSAGES/django.po +196 -151
  24. umap/locale/pt/LC_MESSAGES/django.mo +0 -0
  25. umap/locale/pt/LC_MESSAGES/django.po +115 -71
  26. umap/locale/zh_TW/LC_MESSAGES/django.mo +0 -0
  27. umap/locale/zh_TW/LC_MESSAGES/django.po +109 -65
  28. umap/management/commands/empty_trash.py +12 -1
  29. umap/migrations/0026_datalayer_modified_at_datalayer_share_status.py +26 -0
  30. umap/models.py +43 -13
  31. umap/settings/base.py +5 -2
  32. umap/static/umap/base.css +5 -2
  33. umap/static/umap/content.css +2 -22
  34. umap/static/umap/css/bar.css +39 -10
  35. umap/static/umap/css/contextmenu.css +14 -2
  36. umap/static/umap/css/form.css +33 -39
  37. umap/static/umap/css/icon.css +47 -5
  38. umap/static/umap/css/panel.css +20 -2
  39. umap/static/umap/css/popup.css +0 -1
  40. umap/static/umap/css/tooltip.css +33 -31
  41. umap/static/umap/img/16-white.svg +5 -3
  42. umap/static/umap/img/16.svg +1 -1
  43. umap/static/umap/img/24-white.svg +17 -16
  44. umap/static/umap/img/24.svg +29 -18
  45. umap/static/umap/img/providers/bitbucket.png +0 -0
  46. umap/static/umap/img/providers/github.png +0 -0
  47. umap/static/umap/img/providers/keycloak.png +0 -0
  48. umap/static/umap/img/providers/openstreetmap-oauth2.png +0 -0
  49. umap/static/umap/img/providers/twitter-oauth2.png +0 -0
  50. umap/static/umap/img/source/16-white.svg +6 -4
  51. umap/static/umap/img/source/16.svg +1 -1
  52. umap/static/umap/img/source/24-white.svg +20 -18
  53. umap/static/umap/img/source/24.svg +30 -19
  54. umap/static/umap/js/components/alerts/alert.js +4 -1
  55. umap/static/umap/js/modules/browser.js +8 -8
  56. umap/static/umap/js/modules/caption.js +30 -7
  57. umap/static/umap/js/modules/data/features.js +101 -56
  58. umap/static/umap/js/modules/data/layer.js +108 -83
  59. umap/static/umap/js/modules/form/builder.js +242 -0
  60. umap/static/umap/js/modules/form/fields.js +1346 -0
  61. umap/static/umap/js/modules/formatter.js +9 -8
  62. umap/static/umap/js/modules/help.js +20 -24
  63. umap/static/umap/js/modules/importer.js +6 -3
  64. umap/static/umap/js/modules/permissions.js +11 -6
  65. umap/static/umap/js/modules/rendering/icon.js +5 -1
  66. umap/static/umap/js/modules/rendering/layers/classified.js +12 -8
  67. umap/static/umap/js/modules/rendering/layers/cluster.js +11 -1
  68. umap/static/umap/js/modules/rendering/map.js +1 -23
  69. umap/static/umap/js/modules/rendering/ui.js +20 -38
  70. umap/static/umap/js/modules/rules.js +3 -2
  71. umap/static/umap/js/modules/saving.js +5 -0
  72. umap/static/umap/js/modules/schema.js +8 -6
  73. umap/static/umap/js/modules/share.js +3 -3
  74. umap/static/umap/js/modules/sync/engine.js +56 -26
  75. umap/static/umap/js/modules/sync/updaters.js +15 -6
  76. umap/static/umap/js/modules/sync/websocket.js +50 -37
  77. umap/static/umap/js/modules/tableeditor.js +3 -2
  78. umap/static/umap/js/modules/ui/bar.js +101 -9
  79. umap/static/umap/js/modules/ui/base.js +7 -24
  80. umap/static/umap/js/modules/ui/contextmenu.js +9 -2
  81. umap/static/umap/js/modules/ui/panel.js +5 -1
  82. umap/static/umap/js/modules/ui/tooltip.js +19 -11
  83. umap/static/umap/js/modules/umap.js +124 -71
  84. umap/static/umap/js/modules/utils.js +196 -12
  85. umap/static/umap/js/umap.controls.js +12 -354
  86. umap/static/umap/locale/am_ET.js +17 -5
  87. umap/static/umap/locale/am_ET.json +17 -5
  88. umap/static/umap/locale/ar.js +17 -5
  89. umap/static/umap/locale/ar.json +17 -5
  90. umap/static/umap/locale/ast.js +17 -5
  91. umap/static/umap/locale/ast.json +17 -5
  92. umap/static/umap/locale/bg.js +17 -5
  93. umap/static/umap/locale/bg.json +17 -5
  94. umap/static/umap/locale/br.js +33 -20
  95. umap/static/umap/locale/br.json +33 -20
  96. umap/static/umap/locale/ca.js +17 -5
  97. umap/static/umap/locale/ca.json +17 -5
  98. umap/static/umap/locale/cs_CZ.js +15 -5
  99. umap/static/umap/locale/cs_CZ.json +15 -5
  100. umap/static/umap/locale/da.js +17 -5
  101. umap/static/umap/locale/da.json +17 -5
  102. umap/static/umap/locale/de.js +17 -5
  103. umap/static/umap/locale/de.json +17 -5
  104. umap/static/umap/locale/el.js +63 -51
  105. umap/static/umap/locale/el.json +63 -51
  106. umap/static/umap/locale/en.js +15 -5
  107. umap/static/umap/locale/en.json +15 -5
  108. umap/static/umap/locale/en_US.json +17 -5
  109. umap/static/umap/locale/es.js +25 -13
  110. umap/static/umap/locale/es.json +25 -13
  111. umap/static/umap/locale/et.js +17 -5
  112. umap/static/umap/locale/et.json +17 -5
  113. umap/static/umap/locale/eu.js +17 -5
  114. umap/static/umap/locale/eu.json +17 -5
  115. umap/static/umap/locale/fa_IR.js +17 -5
  116. umap/static/umap/locale/fa_IR.json +17 -5
  117. umap/static/umap/locale/fi.js +17 -5
  118. umap/static/umap/locale/fi.json +17 -5
  119. umap/static/umap/locale/fr.js +16 -6
  120. umap/static/umap/locale/fr.json +16 -6
  121. umap/static/umap/locale/gl.js +357 -345
  122. umap/static/umap/locale/gl.json +357 -345
  123. umap/static/umap/locale/he.js +17 -5
  124. umap/static/umap/locale/he.json +17 -5
  125. umap/static/umap/locale/hr.js +17 -5
  126. umap/static/umap/locale/hr.json +17 -5
  127. umap/static/umap/locale/hu.js +39 -27
  128. umap/static/umap/locale/hu.json +39 -27
  129. umap/static/umap/locale/id.js +17 -5
  130. umap/static/umap/locale/id.json +17 -5
  131. umap/static/umap/locale/is.js +17 -5
  132. umap/static/umap/locale/is.json +17 -5
  133. umap/static/umap/locale/it.js +125 -113
  134. umap/static/umap/locale/it.json +125 -113
  135. umap/static/umap/locale/ja.js +17 -5
  136. umap/static/umap/locale/ja.json +17 -5
  137. umap/static/umap/locale/ko.js +17 -5
  138. umap/static/umap/locale/ko.json +17 -5
  139. umap/static/umap/locale/lt.js +17 -5
  140. umap/static/umap/locale/lt.json +17 -5
  141. umap/static/umap/locale/ms.js +17 -5
  142. umap/static/umap/locale/ms.json +17 -5
  143. umap/static/umap/locale/nl.js +132 -119
  144. umap/static/umap/locale/nl.json +132 -119
  145. umap/static/umap/locale/no.js +17 -5
  146. umap/static/umap/locale/no.json +17 -5
  147. umap/static/umap/locale/pl.js +17 -5
  148. umap/static/umap/locale/pl.json +17 -5
  149. umap/static/umap/locale/pl_PL.json +17 -5
  150. umap/static/umap/locale/pt.js +38 -25
  151. umap/static/umap/locale/pt.json +38 -25
  152. umap/static/umap/locale/pt_BR.js +17 -5
  153. umap/static/umap/locale/pt_BR.json +17 -5
  154. umap/static/umap/locale/pt_PT.js +17 -5
  155. umap/static/umap/locale/pt_PT.json +17 -5
  156. umap/static/umap/locale/ro.js +17 -5
  157. umap/static/umap/locale/ro.json +17 -5
  158. umap/static/umap/locale/ru.js +17 -5
  159. umap/static/umap/locale/ru.json +17 -5
  160. umap/static/umap/locale/sk_SK.js +17 -5
  161. umap/static/umap/locale/sk_SK.json +17 -5
  162. umap/static/umap/locale/sl.js +17 -5
  163. umap/static/umap/locale/sl.json +17 -5
  164. umap/static/umap/locale/sr.js +17 -5
  165. umap/static/umap/locale/sr.json +17 -5
  166. umap/static/umap/locale/sv.js +17 -5
  167. umap/static/umap/locale/sv.json +17 -5
  168. umap/static/umap/locale/th_TH.js +17 -5
  169. umap/static/umap/locale/th_TH.json +17 -5
  170. umap/static/umap/locale/tr.js +17 -5
  171. umap/static/umap/locale/tr.json +17 -5
  172. umap/static/umap/locale/uk_UA.js +17 -5
  173. umap/static/umap/locale/uk_UA.json +17 -5
  174. umap/static/umap/locale/vi.js +17 -5
  175. umap/static/umap/locale/vi.json +17 -5
  176. umap/static/umap/locale/vi_VN.json +17 -5
  177. umap/static/umap/locale/zh.js +17 -5
  178. umap/static/umap/locale/zh.json +17 -5
  179. umap/static/umap/locale/zh_CN.json +17 -5
  180. umap/static/umap/locale/zh_TW.Big5.json +17 -5
  181. umap/static/umap/locale/zh_TW.js +15 -5
  182. umap/static/umap/locale/zh_TW.json +15 -5
  183. umap/static/umap/map.css +29 -76
  184. umap/static/umap/nav.css +6 -3
  185. umap/static/umap/unittests/utils.js +14 -0
  186. umap/static/umap/vars.css +3 -0
  187. umap/static/umap/vendors/dompurify/purify.es.js +138 -354
  188. umap/static/umap/vendors/dompurify/purify.es.mjs.map +1 -1
  189. umap/static/umap/vendors/editable/Leaflet.Editable.js +1 -0
  190. umap/sync/__init__.py +0 -0
  191. umap/sync/app.py +187 -0
  192. umap/sync/payloads.py +56 -0
  193. umap/templates/auth/user_detail.html +4 -0
  194. umap/templates/auth/user_form.html +9 -6
  195. umap/templates/auth/user_stars.html +4 -0
  196. umap/templates/base.html +1 -1
  197. umap/templates/registration/login.html +2 -5
  198. umap/templates/umap/about.html +5 -0
  199. umap/templates/umap/about_summary.html +2 -2
  200. umap/templates/umap/components/provider.html +8 -0
  201. umap/templates/umap/content_footer.html +1 -1
  202. umap/templates/umap/css.html +0 -2
  203. umap/templates/umap/js.html +0 -4
  204. umap/templates/umap/map_detail.html +1 -1
  205. umap/templates/umap/password_change.html +4 -0
  206. umap/templates/umap/password_change_done.html +4 -0
  207. umap/templates/umap/search.html +4 -0
  208. umap/templates/umap/search_bar.html +1 -0
  209. umap/templates/umap/team_confirm_delete.html +4 -0
  210. umap/templates/umap/team_detail.html +4 -0
  211. umap/templates/umap/team_form.html +4 -0
  212. umap/templates/umap/user_dashboard.html +1 -1
  213. umap/templates/umap/user_teams.html +4 -0
  214. umap/tests/base.py +3 -1
  215. umap/tests/integration/conftest.py +16 -23
  216. umap/tests/integration/test_anonymous_owned_map.py +2 -2
  217. umap/tests/integration/test_basics.py +4 -7
  218. umap/tests/integration/test_caption.py +1 -0
  219. umap/tests/integration/test_categorized_layer.py +4 -8
  220. umap/tests/integration/test_choropleth.py +1 -1
  221. umap/tests/integration/test_conditional_rules.py +3 -3
  222. umap/tests/integration/test_draw_polygon.py +14 -22
  223. umap/tests/integration/test_draw_polyline.py +6 -14
  224. umap/tests/integration/test_edit_datalayer.py +11 -11
  225. umap/tests/integration/test_edit_map.py +30 -4
  226. umap/tests/integration/test_edit_marker.py +5 -5
  227. umap/tests/integration/test_edit_polygon.py +6 -6
  228. umap/tests/integration/test_features_id_generation.py +2 -6
  229. umap/tests/integration/test_import.py +115 -29
  230. umap/tests/integration/test_optimistic_merge.py +1 -0
  231. umap/tests/integration/test_owned_map.py +1 -1
  232. umap/tests/integration/test_picto.py +8 -8
  233. umap/tests/integration/test_save.py +3 -2
  234. umap/tests/integration/test_star.py +13 -9
  235. umap/tests/integration/test_tableeditor.py +8 -7
  236. umap/tests/integration/test_view_marker.py +10 -0
  237. umap/tests/integration/test_websocket_sync.py +239 -64
  238. umap/tests/settings.py +2 -0
  239. umap/tests/test_datalayer.py +2 -3
  240. umap/tests/test_datalayer_views.py +20 -1
  241. umap/tests/test_empty_trash.py +10 -3
  242. umap/tests/test_map_views.py +11 -0
  243. umap/utils.py +27 -11
  244. umap/views.py +37 -6
  245. {umap_project-2.8.1.dist-info → umap_project-2.9.0.dist-info}/METADATA +22 -22
  246. {umap_project-2.8.1.dist-info → umap_project-2.9.0.dist-info}/RECORD +249 -250
  247. {umap_project-2.8.1.dist-info → umap_project-2.9.0.dist-info}/WHEEL +1 -1
  248. umap/management/commands/run_websocket_server.py +0 -23
  249. umap/settings/local_s3.py +0 -45
  250. umap/static/umap/bitbucket.png +0 -0
  251. umap/static/umap/github.png +0 -0
  252. umap/static/umap/js/umap.forms.js +0 -1242
  253. umap/static/umap/keycloak.png +0 -0
  254. umap/static/umap/openstreetmap.png +0 -0
  255. umap/static/umap/twitter.png +0 -0
  256. umap/static/umap/vendors/formbuilder/Leaflet.FormBuilder.js +0 -468
  257. umap/static/umap/vendors/toolbar/leaflet.toolbar.css +0 -1
  258. umap/static/umap/vendors/toolbar/leaflet.toolbar.js +0 -1
  259. umap/tests/test_websocket_server.py +0 -22
  260. umap/websocket_server.py +0 -202
  261. {umap_project-2.8.1.dist-info → umap_project-2.9.0.dist-info}/entry_points.txt +0 -0
  262. {umap_project-2.8.1.dist-info → umap_project-2.9.0.dist-info}/licenses/LICENSE +0 -0
@@ -2,6 +2,10 @@
2
2
 
3
3
  {% load i18n %}
4
4
 
5
+ {% block head_title %}
6
+ {% blocktranslate %}{{ current_user }}’s starred maps{% endblocktranslate %} - {{ SITE_DESCRIPTION }}
7
+ {% endblock head_title %}
8
+
5
9
  {% block maincontent %}
6
10
  <div class="col wide">
7
11
  <h2 class="section">
umap/templates/base.html CHANGED
@@ -5,7 +5,7 @@
5
5
  <head>
6
6
  <title>
7
7
  {% block head_title %}
8
- {{ SITE_NAME }}
8
+ {{ SITE_NAME }} - {{ SITE_DESCRIPTION }}
9
9
  {% endblock head_title %}
10
10
  </title>
11
11
  <meta charset="utf-8">
@@ -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
- <a rel="nofollow"
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>
@@ -1,4 +1,9 @@
1
1
  {% extends "umap/content.html" %}
2
+ {% load i18n %}
3
+
4
+ {% block head_title %}
5
+ {% translate "About" %} - {{ SITE_DESCRIPTION }}
6
+ {% endblock head_title %}
2
7
 
3
8
  {% block maincontent %}
4
9
  {% include "umap/about_summary.html" %}
@@ -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 half">{% trans "Create a map" %}</a>
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 half neutral">{% trans "Play with the demo" %}</a>
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="https://wiki.openstreetmap.org/wiki/UMap" class="branding">uMap</a>
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 %}
@@ -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"
@@ -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 %}
@@ -3,7 +3,7 @@
3
3
  {% load umap_tags i18n %}
4
4
 
5
5
  {% block head_title %}
6
- {{ map.name }} - {{ SITE_NAME }}
6
+ {{ map.name }} - {{ SITE_NAME }} - {{ SITE_DESCRIPTION }}
7
7
  {% endblock head_title %}
8
8
  {% block body_class %}
9
9
  map_detail
@@ -2,6 +2,10 @@
2
2
 
3
3
  {% load i18n %}
4
4
 
5
+ {% block head_title %}
6
+ {% translate "Password change" %} - {{ SITE_DESCRIPTION }}
7
+ {% endblock head_title %}
8
+
5
9
  {% block content %}
6
10
  <h2 class="section">
7
11
  {% trans "Password change" %}
@@ -2,6 +2,10 @@
2
2
 
3
3
  {% load i18n %}
4
4
 
5
+ {% block head_title %}
6
+ {% translate "Password change successful" %} - {{ SITE_DESCRIPTION }}
7
+ {% endblock head_title %}
8
+
5
9
  {% block content %}
6
10
  <h2 class="section">
7
11
  {% trans "Password change successful" %}
@@ -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 %}
@@ -9,6 +9,7 @@
9
9
  <input name="q"
10
10
  type="search"
11
11
  placeholder="{% firstof placeholder default_placeholder %}"
12
+ aria-label="{% firstof placeholder default_placeholder %}"
12
13
  value="{{ request.GET.q|default:"" }}" />
13
14
  </div>
14
15
  <div class="col third mwide">
@@ -2,6 +2,10 @@
2
2
 
3
3
  {% load i18n %}
4
4
 
5
+ {% block head_title %}
6
+ {% translate "Team deletion" %} - {{ SITE_DESCRIPTION }}
7
+ {% endblock head_title %}
8
+
5
9
  {% block maincontent %}
6
10
  {% include "umap/dashboard_menu.html" with selected="teams" %}
7
11
  <div class="wrapper">
@@ -2,6 +2,10 @@
2
2
 
3
3
  {% load i18n %}
4
4
 
5
+ {% block head_title %}
6
+ {% blocktranslate %}{{ current_team }}’s maps{% endblocktranslate %} - {{ SITE_DESCRIPTION }}
7
+ {% endblock head_title %}
8
+
5
9
  {% block maincontent %}
6
10
  <div class="wrapper">
7
11
  <div class="row">
@@ -2,6 +2,10 @@
2
2
 
3
3
  {% load i18n %}
4
4
 
5
+ {% block head_title %}
6
+ {% translate "Create or edit a team" %} - {{ SITE_DESCRIPTION }}
7
+ {% endblock head_title %}
8
+
5
9
  {% block maincontent %}
6
10
  {% include "umap/dashboard_menu.html" with selected="teams" %}
7
11
  <div class="wrapper">
@@ -3,7 +3,7 @@
3
3
  {% load i18n static %}
4
4
 
5
5
  {% block head_title %}
6
- {{ SITE_NAME }} - {% trans "My Dashboard" %}
6
+ {% translate "My Dashboard" %} - {{ SITE_DESCRIPTION }}
7
7
  {% endblock head_title %}
8
8
  {% block maincontent %}
9
9
  {% trans "Search my maps" as placeholder %}
@@ -2,6 +2,10 @@
2
2
 
3
3
  {% load i18n %}
4
4
 
5
+ {% block head_title %}
6
+ {% translate "My Teams" %} - {{ SITE_DESCRIPTION }}
7
+ {% endblock head_title %}
8
+
5
9
  {% block maincontent %}
6
10
  {% include "umap/dashboard_menu.html" with selected="teams" %}
7
11
  <div class="wrapper">
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 websocket_server():
72
- # Find the test-settings, and put them in the current environment
73
- settings_path = (Path(__file__).parent.parent / "settings.py").absolute().as_posix()
74
- os.environ["UMAP_SETTINGS"] = settings_path
75
-
76
- ds_proc = subprocess.Popen(
77
- [
78
- "umap",
79
- "run_websocket_server",
80
- ],
81
- stdout=subprocess.PIPE,
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("link", name="Map advanced properties").click()
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("link", name="Map advanced properties").click()
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(".leaflet-control-toolbar ").get_by_title(
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("link", name="Manage layers").click()
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("link", name="Manage layers").click()
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("link", name="Manage layers").click()
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("link", name="Manage layers").click()
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("link", name="Map advanced properties").click()
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("link", name="Map advanced properties").click()
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("link", name="Map advanced properties").click()
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
- create_line = page.locator(".leaflet-control-toolbar ").get_by_title(
14
- "Draw a polygon"
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
- create_line = page.locator(".leaflet-control-toolbar ").get_by_title(
48
- "Draw a polygon"
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
- create_line = page.locator(".leaflet-control-toolbar ").get_by_title(
84
- "Draw a polygon"
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
- create_line = page.locator(".leaflet-control-toolbar ").get_by_title(
109
- "Draw a polygon"
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("link", name="Start a hole here").click()
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-upload textarea").fill(geojson)
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("link", name="Toggle edit mode (⇧+Click)").click()
487
- expect(page.locator("#umap-tooltip-container")).to_contain_text(
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("#umap-tooltip-container")).to_contain_text(
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("#umap-tooltip-container")).to_contain_text(
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(".leaflet-control-toolbar ").get_by_title(
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(".leaflet-control-toolbar ").get_by_title(
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(".leaflet-control-toolbar ").get_by_title(
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(".leaflet-control-toolbar ").get_by_title(
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("link", name="Split line").click()
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("link", name="Delete this shape").click()
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"