umap-project 2.1.2__py3-none-any.whl → 2.2.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 (211) hide show
  1. umap/__init__.py +1 -1
  2. umap/context_processors.py +1 -0
  3. umap/locale/br/LC_MESSAGES/django.mo +0 -0
  4. umap/locale/en/LC_MESSAGES/django.po +32 -32
  5. umap/locale/hu/LC_MESSAGES/django.mo +0 -0
  6. umap/locale/it/LC_MESSAGES/django.mo +0 -0
  7. umap/locale/ms/LC_MESSAGES/django.mo +0 -0
  8. umap/migrations/0020_alter_tilelayer_url_template.py +19 -0
  9. umap/migrations/0021_remove_map_description.py +16 -0
  10. umap/models.py +10 -6
  11. umap/settings/base.py +1 -0
  12. umap/static/umap/base.css +43 -156
  13. umap/static/umap/content.css +7 -25
  14. umap/static/umap/css/icon.css +112 -0
  15. umap/static/umap/css/panel.css +140 -0
  16. umap/static/umap/img/16-white.svg +5 -1
  17. umap/static/umap/img/16.svg +7 -4
  18. umap/static/umap/img/24-white.svg +3 -1
  19. umap/static/umap/img/24.svg +3 -4
  20. umap/static/umap/img/source/16-white.svg +176 -940
  21. umap/static/umap/img/source/16.svg +8 -5
  22. umap/static/umap/img/source/24-white.svg +5 -3
  23. umap/static/umap/img/source/24.svg +6 -7
  24. umap/static/umap/js/modules/browser.js +97 -73
  25. umap/static/umap/js/modules/dompurify.js +12 -0
  26. umap/static/umap/js/modules/facets.js +149 -0
  27. umap/static/umap/js/modules/global.js +9 -1
  28. umap/static/umap/js/modules/i18n.js +7 -0
  29. umap/static/umap/js/modules/orderable.js +84 -0
  30. umap/static/umap/js/modules/panel.js +76 -0
  31. umap/static/umap/js/modules/request.js +0 -1
  32. umap/static/umap/js/modules/schema.js +324 -223
  33. umap/static/umap/js/modules/urls.js +1 -16
  34. umap/static/umap/js/modules/utils.js +340 -0
  35. umap/static/umap/js/umap.autocomplete.js +40 -25
  36. umap/static/umap/js/umap.controls.js +248 -361
  37. umap/static/umap/js/umap.core.js +77 -366
  38. umap/static/umap/js/umap.datalayer.permissions.js +1 -1
  39. umap/static/umap/js/umap.features.js +65 -43
  40. umap/static/umap/js/umap.forms.js +128 -36
  41. umap/static/umap/js/umap.icon.js +11 -4
  42. umap/static/umap/js/umap.importer.js +78 -58
  43. umap/static/umap/js/umap.js +206 -192
  44. umap/static/umap/js/umap.layer.js +86 -46
  45. umap/static/umap/js/umap.permissions.js +13 -9
  46. umap/static/umap/js/umap.popup.js +26 -30
  47. umap/static/umap/js/umap.share.js +12 -9
  48. umap/static/umap/js/umap.tableeditor.js +4 -6
  49. umap/static/umap/js/umap.ui.js +10 -60
  50. umap/static/umap/locale/am_ET.js +243 -227
  51. umap/static/umap/locale/am_ET.json +21 -9
  52. umap/static/umap/locale/ar.js +243 -227
  53. umap/static/umap/locale/ar.json +21 -9
  54. umap/static/umap/locale/ast.js +243 -227
  55. umap/static/umap/locale/ast.json +21 -9
  56. umap/static/umap/locale/bg.js +243 -227
  57. umap/static/umap/locale/bg.json +21 -9
  58. umap/static/umap/locale/br.js +253 -237
  59. umap/static/umap/locale/br.json +25 -13
  60. umap/static/umap/locale/ca.js +243 -227
  61. umap/static/umap/locale/ca.json +21 -9
  62. umap/static/umap/locale/cs_CZ.js +243 -227
  63. umap/static/umap/locale/cs_CZ.json +21 -9
  64. umap/static/umap/locale/da.js +243 -227
  65. umap/static/umap/locale/da.json +21 -9
  66. umap/static/umap/locale/de.js +243 -227
  67. umap/static/umap/locale/de.json +21 -9
  68. umap/static/umap/locale/el.js +243 -227
  69. umap/static/umap/locale/el.json +21 -9
  70. umap/static/umap/locale/en.js +243 -234
  71. umap/static/umap/locale/en.json +22 -10
  72. umap/static/umap/locale/en_US.json +21 -9
  73. umap/static/umap/locale/es.js +243 -227
  74. umap/static/umap/locale/es.json +21 -9
  75. umap/static/umap/locale/et.js +243 -227
  76. umap/static/umap/locale/et.json +21 -9
  77. umap/static/umap/locale/eu.js +227 -199
  78. umap/static/umap/locale/eu.json +1 -1
  79. umap/static/umap/locale/fa_IR.js +243 -227
  80. umap/static/umap/locale/fa_IR.json +21 -9
  81. umap/static/umap/locale/fi.js +243 -227
  82. umap/static/umap/locale/fi.json +21 -9
  83. umap/static/umap/locale/fr.js +243 -234
  84. umap/static/umap/locale/fr.json +21 -9
  85. umap/static/umap/locale/gl.js +243 -227
  86. umap/static/umap/locale/gl.json +21 -9
  87. umap/static/umap/locale/he.js +243 -227
  88. umap/static/umap/locale/he.json +21 -9
  89. umap/static/umap/locale/hr.js +243 -227
  90. umap/static/umap/locale/hr.json +21 -9
  91. umap/static/umap/locale/hu.js +243 -234
  92. umap/static/umap/locale/hu.json +21 -9
  93. umap/static/umap/locale/id.js +243 -227
  94. umap/static/umap/locale/id.json +21 -9
  95. umap/static/umap/locale/is.js +243 -227
  96. umap/static/umap/locale/is.json +21 -9
  97. umap/static/umap/locale/it.js +243 -234
  98. umap/static/umap/locale/it.json +21 -9
  99. umap/static/umap/locale/ja.js +243 -227
  100. umap/static/umap/locale/ja.json +21 -9
  101. umap/static/umap/locale/ko.js +243 -227
  102. umap/static/umap/locale/ko.json +21 -9
  103. umap/static/umap/locale/lt.js +243 -227
  104. umap/static/umap/locale/lt.json +21 -9
  105. umap/static/umap/locale/ms.js +243 -234
  106. umap/static/umap/locale/ms.json +22 -10
  107. umap/static/umap/locale/nl.js +246 -230
  108. umap/static/umap/locale/nl.json +21 -9
  109. umap/static/umap/locale/no.js +243 -227
  110. umap/static/umap/locale/no.json +21 -9
  111. umap/static/umap/locale/pl.js +243 -227
  112. umap/static/umap/locale/pl.json +21 -9
  113. umap/static/umap/locale/pl_PL.json +21 -9
  114. umap/static/umap/locale/pt.js +243 -227
  115. umap/static/umap/locale/pt.json +21 -9
  116. umap/static/umap/locale/pt_BR.js +243 -227
  117. umap/static/umap/locale/pt_BR.json +21 -9
  118. umap/static/umap/locale/pt_PT.js +243 -227
  119. umap/static/umap/locale/pt_PT.json +21 -9
  120. umap/static/umap/locale/ro.js +243 -227
  121. umap/static/umap/locale/ro.json +21 -9
  122. umap/static/umap/locale/ru.js +243 -227
  123. umap/static/umap/locale/ru.json +21 -9
  124. umap/static/umap/locale/si.js +1 -1
  125. umap/static/umap/locale/si.json +1 -1
  126. umap/static/umap/locale/sk_SK.js +243 -227
  127. umap/static/umap/locale/sk_SK.json +21 -9
  128. umap/static/umap/locale/sl.js +243 -227
  129. umap/static/umap/locale/sl.json +21 -9
  130. umap/static/umap/locale/sr.js +243 -227
  131. umap/static/umap/locale/sr.json +21 -9
  132. umap/static/umap/locale/sv.js +243 -227
  133. umap/static/umap/locale/sv.json +21 -9
  134. umap/static/umap/locale/th_TH.js +243 -227
  135. umap/static/umap/locale/th_TH.json +21 -9
  136. umap/static/umap/locale/tr.js +243 -227
  137. umap/static/umap/locale/tr.json +21 -9
  138. umap/static/umap/locale/uk_UA.js +243 -227
  139. umap/static/umap/locale/uk_UA.json +21 -9
  140. umap/static/umap/locale/vi.js +243 -227
  141. umap/static/umap/locale/vi.json +21 -9
  142. umap/static/umap/locale/vi_VN.json +21 -9
  143. umap/static/umap/locale/zh.js +243 -227
  144. umap/static/umap/locale/zh.json +21 -9
  145. umap/static/umap/locale/zh_CN.json +21 -9
  146. umap/static/umap/locale/zh_TW.Big5.json +21 -9
  147. umap/static/umap/locale/zh_TW.js +243 -234
  148. umap/static/umap/locale/zh_TW.json +21 -9
  149. umap/static/umap/map.css +124 -264
  150. umap/static/umap/test/DataLayer.js +1 -1
  151. umap/static/umap/test/Feature.js +0 -226
  152. umap/static/umap/test/Map.js +0 -304
  153. umap/static/umap/test/Polygon.js +0 -256
  154. umap/static/umap/test/Polyline.js +0 -116
  155. umap/static/umap/test/TableEditor.js +10 -10
  156. umap/static/umap/test/Util.js +0 -521
  157. umap/static/umap/test/index.html +1 -5
  158. umap/static/umap/unittests/URLs.js +1 -1
  159. umap/static/umap/unittests/utils.js +610 -0
  160. umap/static/umap/vars.css +9 -0
  161. umap/static/umap/vendors/dompurify/purify.es.mjs +1525 -0
  162. umap/static/umap/vendors/formbuilder/Leaflet.FormBuilder.js +1 -0
  163. umap/static/umap/vendors/iconlayers/iconLayers.js +1 -1
  164. umap/templates/umap/css.html +2 -0
  165. umap/templates/umap/js.html +0 -1
  166. umap/templates/umap/map_detail.html +4 -0
  167. umap/templates/umap/map_table.html +12 -10
  168. umap/templatetags/umap_tags.py +5 -0
  169. umap/tests/conftest.py +9 -0
  170. umap/tests/fixtures/test_upload_data.csv +2 -1
  171. umap/tests/fixtures/test_upload_data.umap +171 -0
  172. umap/tests/fixtures/test_upload_data_osm.json +33 -0
  173. umap/tests/integration/conftest.py +16 -0
  174. umap/tests/integration/test_anonymous_owned_map.py +30 -5
  175. umap/tests/integration/test_basics.py +21 -0
  176. umap/tests/integration/test_browser.py +16 -36
  177. umap/tests/integration/test_choropleth.py +89 -0
  178. umap/tests/integration/test_collaborative_editing.py +30 -1
  179. umap/tests/integration/test_dashboard.py +10 -0
  180. umap/tests/integration/test_datalayer.py +132 -0
  181. umap/tests/integration/test_draw_polygon.py +363 -0
  182. umap/tests/integration/test_draw_polyline.py +325 -0
  183. umap/tests/integration/test_edit_datalayer.py +145 -6
  184. umap/tests/integration/test_edit_map.py +202 -0
  185. umap/tests/integration/test_edit_marker.py +120 -0
  186. umap/tests/integration/test_edit_polygon.py +122 -0
  187. umap/tests/integration/test_facets_browser.py +132 -11
  188. umap/tests/integration/test_import.py +407 -10
  189. umap/tests/integration/test_map.py +36 -54
  190. umap/tests/integration/test_map_list.py +28 -0
  191. umap/tests/integration/test_owned_map.py +24 -6
  192. umap/tests/integration/test_picto.py +25 -38
  193. umap/tests/integration/test_querystring.py +9 -15
  194. umap/tests/integration/test_slideshow.py +0 -5
  195. umap/tests/integration/test_statics.py +3 -2
  196. umap/tests/integration/test_tableeditor.py +23 -0
  197. umap/tests/integration/test_tilelayer.py +10 -0
  198. umap/tests/integration/test_view_marker.py +64 -0
  199. umap/tests/integration/test_view_polygon.py +59 -0
  200. umap/tests/integration/test_view_polyline.py +51 -0
  201. umap/tests/test_map_views.py +13 -0
  202. {umap_project-2.1.2.dist-info → umap_project-2.2.0.dist-info}/METADATA +12 -12
  203. {umap_project-2.1.2.dist-info → umap_project-2.2.0.dist-info}/RECORD +206 -187
  204. {umap_project-2.1.2.dist-info → umap_project-2.2.0.dist-info}/WHEEL +1 -1
  205. umap/static/umap/test/Choropleth.js +0 -245
  206. umap/static/umap/test/Permissions.js +0 -74
  207. umap/static/umap/vendors/dompurify/purify.min.js +0 -3
  208. umap/static/umap/vendors/dompurify/purify.min.js.map +0 -1
  209. umap/tests/integration/test_drawing.py +0 -243
  210. {umap_project-2.1.2.dist-info → umap_project-2.2.0.dist-info}/entry_points.txt +0 -0
  211. {umap_project-2.1.2.dist-info → umap_project-2.2.0.dist-info}/licenses/LICENSE +0 -0
@@ -1,243 +0,0 @@
1
- from playwright.sync_api import expect
2
-
3
-
4
- def test_draw_polyline(page, live_server, tilelayer):
5
- page.goto(f"{live_server.url}/en/map/new/")
6
-
7
- # Click on the Draw a line button on a new map.
8
- create_line = page.locator(".leaflet-control-toolbar ").get_by_title(
9
- "Draw a polyline"
10
- )
11
- create_line.click()
12
-
13
- # Check no line is present by default.
14
- # We target with the color, because there is also the drawing line guide (dash-array)
15
- # around
16
- lines = page.locator(".leaflet-overlay-pane path[stroke='DarkBlue']")
17
- guide = page.locator(".leaflet-overlay-pane > svg > g > path")
18
- expect(lines).to_have_count(0)
19
- expect(guide).to_have_count(0)
20
-
21
- # Click on the map, it will create a line.
22
- map = page.locator("#map")
23
- map.click(position={"x": 200, "y": 200})
24
- expect(lines).to_have_count(1)
25
- expect(guide).to_have_count(1)
26
- map.click(position={"x": 100, "y": 200})
27
- expect(lines).to_have_count(1)
28
- expect(guide).to_have_count(1)
29
- map.click(position={"x": 100, "y": 100})
30
- expect(lines).to_have_count(1)
31
- expect(guide).to_have_count(1)
32
- # Click again to finish
33
- map.click(position={"x": 100, "y": 100})
34
- expect(lines).to_have_count(1)
35
- expect(guide).to_have_count(0)
36
-
37
-
38
- def test_clicking_esc_should_finish_line(page, live_server, tilelayer):
39
- page.goto(f"{live_server.url}/en/map/new/")
40
-
41
- # Click on the Draw a line button on a new map.
42
- create_line = page.locator(".leaflet-control-toolbar ").get_by_title(
43
- "Draw a polyline"
44
- )
45
- create_line.click()
46
-
47
- # Check no line is present by default.
48
- # We target with the color, because there is also the drawing line guide (dash-array)
49
- # around
50
- lines = page.locator(".leaflet-overlay-pane path[stroke='DarkBlue']")
51
- guide = page.locator(".leaflet-overlay-pane > svg > g > path")
52
- expect(lines).to_have_count(0)
53
- expect(guide).to_have_count(0)
54
-
55
- # Click on the map, it will create a line.
56
- map = page.locator("#map")
57
- map.click(position={"x": 200, "y": 200})
58
- expect(lines).to_have_count(1)
59
- expect(guide).to_have_count(1)
60
- map.click(position={"x": 100, "y": 200})
61
- expect(lines).to_have_count(1)
62
- expect(guide).to_have_count(1)
63
- map.click(position={"x": 100, "y": 100})
64
- expect(lines).to_have_count(1)
65
- expect(guide).to_have_count(1)
66
- # Click ESC to finish
67
- page.keyboard.press("Escape")
68
- expect(lines).to_have_count(1)
69
- expect(guide).to_have_count(0)
70
-
71
-
72
- def test_clicking_esc_should_delete_line_if_empty(page, live_server, tilelayer):
73
- page.goto(f"{live_server.url}/en/map/new/")
74
-
75
- # Click on the Draw a line button on a new map.
76
- create_line = page.locator(".leaflet-control-toolbar ").get_by_title(
77
- "Draw a polyline"
78
- )
79
- create_line.click()
80
-
81
- # Check no line is present by default.
82
- # We target with the color, because there is also the drawing line guide (dash-array)
83
- # around
84
- lines = page.locator(".leaflet-overlay-pane path[stroke='DarkBlue']")
85
- guide = page.locator(".leaflet-overlay-pane > svg > g > path")
86
- expect(lines).to_have_count(0)
87
- expect(guide).to_have_count(0)
88
-
89
- map = page.locator("#map")
90
- map.click(position={"x": 200, "y": 200})
91
- # At this stage, the line as one element, it should not be created
92
- # on pressing esc, as invalid
93
- # Click ESC to finish
94
- page.keyboard.press("Escape")
95
- expect(lines).to_have_count(0)
96
- expect(guide).to_have_count(0)
97
-
98
-
99
- def test_clicking_esc_should_delete_line_if_invalid(page, live_server, tilelayer):
100
- page.goto(f"{live_server.url}/en/map/new/")
101
-
102
- # Click on the Draw a line button on a new map.
103
- create_line = page.locator(".leaflet-control-toolbar ").get_by_title(
104
- "Draw a polyline"
105
- )
106
- create_line.click()
107
-
108
- # Check no line is present by default.
109
- # We target with the color, because there is also the drawing line guide (dash-array)
110
- # around
111
- lines = page.locator(".leaflet-overlay-pane path[stroke='DarkBlue']")
112
- guide = page.locator(".leaflet-overlay-pane > svg > g > path")
113
- expect(lines).to_have_count(0)
114
- expect(guide).to_have_count(0)
115
-
116
- # At this stage, the line as no element, it should not be created
117
- # on pressing esc
118
- # Click ESC to finish
119
- page.keyboard.press("Escape")
120
- expect(lines).to_have_count(0)
121
- expect(guide).to_have_count(0)
122
-
123
-
124
- def test_draw_polygon(page, live_server, tilelayer):
125
- page.goto(f"{live_server.url}/en/map/new/")
126
-
127
- # Click on the Draw a polygon button on a new map.
128
- create_line = page.locator(".leaflet-control-toolbar ").get_by_title(
129
- "Draw a polygon"
130
- )
131
- create_line.click()
132
-
133
- # Check no polygon is present by default.
134
- # We target with the color, because there is also the drawing line guide (dash-array)
135
- # around
136
- lines = page.locator(".leaflet-overlay-pane path[stroke='DarkBlue']")
137
- guide = page.locator(".leaflet-overlay-pane > svg > g > path")
138
- expect(lines).to_have_count(0)
139
- expect(guide).to_have_count(0)
140
-
141
- # Click on the map, it will create a polygon.
142
- map = page.locator("#map")
143
- map.click(position={"x": 200, "y": 200})
144
- expect(lines).to_have_count(1)
145
- expect(guide).to_have_count(1)
146
- map.click(position={"x": 100, "y": 200})
147
- expect(lines).to_have_count(1)
148
- expect(guide).to_have_count(2)
149
- map.click(position={"x": 100, "y": 100})
150
- expect(lines).to_have_count(1)
151
- expect(guide).to_have_count(2)
152
- # Click again to finish
153
- map.click(position={"x": 100, "y": 100})
154
- expect(lines).to_have_count(1)
155
- expect(guide).to_have_count(0)
156
-
157
-
158
- def test_clicking_esc_should_finish_polygon(page, live_server, tilelayer):
159
- page.goto(f"{live_server.url}/en/map/new/")
160
-
161
- # Click on the Draw a polygon button on a new map.
162
- create_line = page.locator(".leaflet-control-toolbar ").get_by_title(
163
- "Draw a polygon"
164
- )
165
- create_line.click()
166
-
167
- # Check no polygon is present by default.
168
- # We target with the color, because there is also the drawing line guide (dash-array)
169
- # around
170
- lines = page.locator(".leaflet-overlay-pane path[stroke='DarkBlue']")
171
- guide = page.locator(".leaflet-overlay-pane > svg > g > path")
172
- expect(lines).to_have_count(0)
173
- expect(guide).to_have_count(0)
174
-
175
- # Click on the map, it will create a polygon.
176
- map = page.locator("#map")
177
- map.click(position={"x": 200, "y": 200})
178
- expect(lines).to_have_count(1)
179
- expect(guide).to_have_count(1)
180
- map.click(position={"x": 100, "y": 200})
181
- expect(lines).to_have_count(1)
182
- expect(guide).to_have_count(2)
183
- map.click(position={"x": 100, "y": 100})
184
- expect(lines).to_have_count(1)
185
- expect(guide).to_have_count(2)
186
- # Click ESC to finish
187
- page.keyboard.press("Escape")
188
- expect(lines).to_have_count(1)
189
- expect(guide).to_have_count(0)
190
-
191
-
192
- def test_clicking_esc_should_delete_polygon_if_empty(page, live_server, tilelayer):
193
- page.goto(f"{live_server.url}/en/map/new/")
194
-
195
- # Click on the Draw a polygon button on a new map.
196
- create_line = page.locator(".leaflet-control-toolbar ").get_by_title(
197
- "Draw a polygon"
198
- )
199
- create_line.click()
200
-
201
- # Check no polygon is present by default.
202
- # We target with the color, because there is also the drawing line guide (dash-array)
203
- # around
204
- lines = page.locator(".leaflet-overlay-pane path[stroke='DarkBlue']")
205
- guide = page.locator(".leaflet-overlay-pane > svg > g > path")
206
- expect(lines).to_have_count(0)
207
- expect(guide).to_have_count(0)
208
-
209
- # Click ESC to finish, no polygon should have been created
210
- page.keyboard.press("Escape")
211
- expect(lines).to_have_count(0)
212
- expect(guide).to_have_count(0)
213
-
214
-
215
- def test_clicking_esc_should_delete_polygon_if_invalid(page, live_server, tilelayer):
216
- page.goto(f"{live_server.url}/en/map/new/")
217
-
218
- # Click on the Draw a polygon button on a new map.
219
- create_line = page.locator(".leaflet-control-toolbar ").get_by_title(
220
- "Draw a polygon"
221
- )
222
- create_line.click()
223
-
224
- # Check no polygon is present by default.
225
- # We target with the color, because there is also the drawing line guide (dash-array)
226
- # around
227
- lines = page.locator(".leaflet-overlay-pane path[stroke='DarkBlue']")
228
- guide = page.locator(".leaflet-overlay-pane > svg > g > path")
229
- expect(lines).to_have_count(0)
230
- expect(guide).to_have_count(0)
231
-
232
- # Click on the map twice, it will start a polygon.
233
- map = page.locator("#map")
234
- map.click(position={"x": 200, "y": 200})
235
- expect(lines).to_have_count(1)
236
- expect(guide).to_have_count(1)
237
- map.click(position={"x": 100, "y": 200})
238
- expect(lines).to_have_count(1)
239
- expect(guide).to_have_count(2)
240
- # Click ESC to finish, the polygon is invalid, it should not be persisted
241
- page.keyboard.press("Escape")
242
- expect(lines).to_have_count(0)
243
- expect(guide).to_have_count(0)