umap-project 3.4.0b0__py3-none-any.whl → 3.4.0b2__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 CHANGED
@@ -1 +1 @@
1
- VERSION = "3.4.0b0"
1
+ VERSION = "3.4.0b2"
@@ -1,6 +1,7 @@
1
1
  from django.conf import settings as djsettings
2
2
 
3
3
  from . import VERSION
4
+ from .utils import normalize_string
4
5
 
5
6
 
6
7
  def settings(request):
@@ -14,7 +15,9 @@ def settings(request):
14
15
  "UMAP_DEMO_SITE": djsettings.UMAP_DEMO_SITE,
15
16
  "UMAP_HOST_INFOS": djsettings.UMAP_HOST_INFOS,
16
17
  "UMAP_ALLOW_EDIT_PROFILE": djsettings.UMAP_ALLOW_EDIT_PROFILE,
17
- "UMAP_TAGS": djsettings.UMAP_TAGS,
18
+ "UMAP_TAGS": sorted(
19
+ djsettings.UMAP_TAGS, key=lambda item: normalize_string(item[1])
20
+ ),
18
21
  }
19
22
 
20
23
 
umap/models.py CHANGED
@@ -13,7 +13,7 @@ from django.utils.functional import classproperty
13
13
  from django.utils.translation import gettext_lazy as _
14
14
 
15
15
  from .managers import PrivateManager, PublicManager
16
- from .utils import _urls_for_js
16
+ from .utils import _urls_for_js, normalize_string
17
17
 
18
18
 
19
19
  # Did not find a clean way to do this in Django
@@ -438,7 +438,11 @@ class Map(NamedModel):
438
438
  "iconUrl": {
439
439
  "default": "%sumap/img/marker.svg" % settings.STATIC_URL,
440
440
  },
441
- "tags": {"choices": sorted(settings.UMAP_TAGS, key=lambda i: i[0])},
441
+ "tags": {
442
+ "choices": sorted(
443
+ settings.UMAP_TAGS, key=lambda i: normalize_string(i[1])
444
+ )
445
+ },
442
446
  }
443
447
 
444
448
 
@@ -491,7 +491,7 @@ export class DataLayer {
491
491
 
492
492
  inferFields(feature) {
493
493
  for (const key in feature.properties) {
494
- if (typeof feature.properties[key] !== 'object') {
494
+ if (key && typeof feature.properties[key] !== 'object') {
495
495
  if (key.indexOf('_') === 0) continue
496
496
  if (this.fields.has(key)) continue
497
497
  if (this._umap.fields.has(key)) continue
@@ -246,6 +246,10 @@ export class MapPermissions {
246
246
  )
247
247
  }
248
248
 
249
+ pull() {
250
+ this.setProperties(this._umap.properties.permissions)
251
+ }
252
+
249
253
  getShareStatusDisplay() {
250
254
  if (this._umap.properties.share_statuses) {
251
255
  return Object.fromEntries(this._umap.properties.share_statuses)[
@@ -281,6 +281,8 @@ export const Cluster = FeatureGroup.extend({
281
281
  ],
282
282
 
283
283
  onEdit: function (field, builder) {
284
- if (field === 'properties.cluster.radius') this.redraw()
284
+ if (field === 'properties.cluster.radius' || field === 'properties.color') {
285
+ this.redraw()
286
+ }
285
287
  },
286
288
  })
@@ -1271,6 +1271,7 @@ export default class Umap {
1271
1271
  if (!this.id) {
1272
1272
  this.properties.permissions.owner = { ...data.user }
1273
1273
  }
1274
+ this.permissions.pull()
1274
1275
  this.render(['user', 'properties.permissions'])
1275
1276
  resolve()
1276
1277
  })
umap/static/umap/map.css CHANGED
@@ -369,7 +369,7 @@ ul.photon-autocomplete {
369
369
  margin: 0;
370
370
  }
371
371
 
372
- .photon-autocomplete button:hover {
372
+ .photon-autocomplete button[type="button"]:hover {
373
373
  background-color: var(--color-darkCyan);
374
374
  }
375
375
 
@@ -405,8 +405,8 @@ ul.photon-autocomplete {
405
405
  display: none;
406
406
  }
407
407
 
408
- .search-result-tools button {
409
- padding: 8px;
408
+ .search-result-tools button[type="button"] {
409
+ padding: var(--text-margin);
410
410
  background-color: var(--background-color);
411
411
  }
412
412
 
umap/tests/test_utils.py CHANGED
@@ -1,6 +1,8 @@
1
1
  from pathlib import Path
2
2
 
3
- from umap.utils import gzip_file
3
+ import pytest
4
+
5
+ from umap.utils import gzip_file, normalize_string
4
6
 
5
7
 
6
8
  def test_gzip_file():
@@ -12,3 +14,15 @@ def test_gzip_file():
12
14
  dest_stat = dest.stat()
13
15
  dest.unlink()
14
16
  assert src_stat.st_mtime == dest_stat.st_mtime
17
+
18
+
19
+ @pytest.mark.parametrize(
20
+ "input,output",
21
+ (
22
+ ("Vélo", "velo"),
23
+ ("Éducation", "education"),
24
+ ("stävänger", "stavanger"),
25
+ ),
26
+ )
27
+ def test_normalize_string(input, output):
28
+ assert normalize_string(input) == output
umap/utils.py CHANGED
@@ -1,6 +1,7 @@
1
1
  import gzip
2
2
  import json
3
3
  import os
4
+ import unicodedata
4
5
  from pathlib import Path
5
6
 
6
7
  from django.conf import settings
@@ -222,3 +223,8 @@ def collect_pictograms():
222
223
  }
223
224
 
224
225
  return pictograms
226
+
227
+
228
+ def normalize_string(s):
229
+ n = unicodedata.normalize("NFKD", str(s))
230
+ return "".join([c for c in n if not unicodedata.combining(c)]).lower()
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: umap-project
3
- Version: 3.4.0b0
3
+ Version: 3.4.0b2
4
4
  Summary: Create maps with OpenStreetMap layers in a minute and embed them in your site.
5
5
  Author-email: Yohan Boniface <yb@enix.org>
6
6
  Maintainer-email: David Larlet <david@larlet.fr>
@@ -1,17 +1,17 @@
1
- umap/__init__.py,sha256=Ljc5HYqr_2XjFCS7LvSKLk0QIG5RJru6J6Kdn2PxkCQ,20
1
+ umap/__init__.py,sha256=KcKEmc7wFzGijZ5CyMAKf_gEGKXIjZgOb3-HUFHQgUc,20
2
2
  umap/admin.py,sha256=YlK4CgEWb2eFYRKiklsKouxeiQ8z_b-H2Fv2XCaiGFQ,3014
3
3
  umap/apps.py,sha256=5ssKqPUuNJlapaBmr4LY_HDb7J1NFCT3wzythxQOOfs,109
4
4
  umap/asgi.py,sha256=sJkGqDLgMoPkq2nMRyRE_Hz3ZLJm1X5lgXiQJu6rYt0,660
5
5
  umap/autocomplete.py,sha256=wHxlOTHQozSQcUAYVfBIGMsgVCKT1ox9bZ0uqUk63YY,803
6
- umap/context_processors.py,sha256=QIulvu2vevmyBk4CKPPSJK457FJmdoD3JdrvMnHnMHY,705
6
+ umap/context_processors.py,sha256=gqyrizFe0O6aspMJxARlBj98rICieYKA9KufP9JIFgw,815
7
7
  umap/decorators.py,sha256=EEICH54p9swHIs_tuqt4FL-l749vk6P8AevlWFKn5zk,2477
8
8
  umap/fields.py,sha256=c32tKWKF8aThrCXDJblwo0n9n2ET6hxBYzEupfr0B4o,900
9
9
  umap/forms.py,sha256=i_SQ6OykKc6XFZJ5tg3rrA6r5SryOvj1WiKbIcWtD4A,3771
10
10
  umap/managers.py,sha256=A5Ih92f9E3egPVCToQHYJ4wQMFSqTS6dtqzx56Fs2JU,1051
11
11
  umap/middleware.py,sha256=GsIFl0St_Rk5zjpE8dpGBlD0JL2AyMrNHu8SHylqwEg,1564
12
- umap/models.py,sha256=xANPE5gw3jjLartllGrc3GtEZ4en1NsG1WLS05blmRc,19914
12
+ umap/models.py,sha256=BxanTAWXXxUvX3opvdHLssSDewWYSpyETrb09DouewM,20018
13
13
  umap/urls.py,sha256=evKfLGEIoc8TPfCalLeHxeQ-zD0HvUJo0Rln8n3kBps,7896
14
- umap/utils.py,sha256=rSzK0GjsAZtPCeJ9Wkk4J3xhIrduOU3wQjxzpPWCA5s,7720
14
+ umap/utils.py,sha256=GblhfPWvrMI756OqNSJ5SF5pEeJs-cEHZ7xJxQv4z5c,7887
15
15
  umap/views.py,sha256=vqef2yvth3Zea_074vyIBlf5hHoFrHlfbGKxdTBLAhI,50821
16
16
  umap/wsgi.py,sha256=IopIgnDZbCus3XpSetTHnra9VyzWi0Y2tJo-CmfTWCY,1132
17
17
  umap/bin/__init__.py,sha256=iA3ON4A6NCpenrn3q2OgefUKF5QRFIQS-FtS0pxruI8,234
@@ -157,7 +157,7 @@ umap/static/.gitignore,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
157
157
  umap/static/umap/base.css,sha256=G6TyKKFTu-A7QOrq5ZAt8KEIJ5CFbe4K-JEURDDRkmw,5120
158
158
  umap/static/umap/content.css,sha256=gOvOzuvw-AzhVnalcoU0Kyj25uYp6g2nLo0gOWZ_1i4,12287
159
159
  umap/static/umap/font.css,sha256=fYmTKNd_Ts6TrmBbnLRgyeUS4vpfxkEqhLR-pkd3KrA,904
160
- umap/static/umap/map.css,sha256=zP2RV7OGcLvvplCCrflrBUqDXV0L1NqVGRgLkSk6igI,22109
160
+ umap/static/umap/map.css,sha256=DujW9eyl-ObrqygcvSrelWtYIGIC-WUQPQN1YkOt5xg,22154
161
161
  umap/static/umap/nav.css,sha256=MsckfSfuMgADt71FIVpW351ZC2ATlr50iGW-47hziwk,1956
162
162
  umap/static/umap/theme.css,sha256=gkbyghlT5kNfz0Qyg1JL7xalqvHVx321eO9qlnvcaAU,49
163
163
  umap/static/umap/vars.css,sha256=bZVi0ACdtGDupargPUT2yQLFYEzaEo6czW9yo5znm3Y,2636
@@ -253,7 +253,7 @@ umap/static/umap/js/modules/importer.js,sha256=UEEUodCoWmrhq1ActNusz4jU6n6R3DRuh
253
253
  umap/static/umap/js/modules/leaflet-configure.js,sha256=P3aD8iNGxuVNv-xW4Di4txAjNmnlpKtCCzDvPaKEdQ8,243
254
254
  umap/static/umap/js/modules/managers.js,sha256=d44NX7SXabpGnnlRH1Oh968VNMlhbvnqASt7VcbiUdc,10459
255
255
  umap/static/umap/js/modules/orderable.js,sha256=zDtcElZ_MVPoGba8Iv9bxOzk4vuN7C-5XVl4UomDYHE,2521
256
- umap/static/umap/js/modules/permissions.js,sha256=kZ2RHM1R3maA3Yqwe8LSkdI7Ex0jQOb3o3MYMe_XxI0,9081
256
+ umap/static/umap/js/modules/permissions.js,sha256=ewyrOGXrvFBJH6rYRZaciZwd8I6O9xmuxnZWibKXQGg,9155
257
257
  umap/static/umap/js/modules/printer.js,sha256=fvb44tLBiYR7TyBdXJdroYsjQOrnbzw7-6F0dBCUEGg,3607
258
258
  umap/static/umap/js/modules/request.js,sha256=9GRJoOPbdkHL9OFP6Joaf5wzsJckPyiG2O7AxQciTik,3885
259
259
  umap/static/umap/js/modules/rules.js,sha256=Ff20yyrQ0OfcS_UtfPbaSs9lV3f5x4ZXUFEvSBw88fk,10034
@@ -262,11 +262,11 @@ umap/static/umap/js/modules/share.js,sha256=obyh6uYy9CR7Xry3uoAJkhgGlg7-io3SHjaZ
262
262
  umap/static/umap/js/modules/slideshow.js,sha256=7tmW32iuEwLXTY_4A_DmiRMjdDr5luhpJSdmbz2SXPc,3608
263
263
  umap/static/umap/js/modules/tableeditor.js,sha256=8ZQcy_b0urXMoUUKcYW1fi1nul38jTaq95GfDyykGTI,8800
264
264
  umap/static/umap/js/modules/templates.js,sha256=mm-3OnVcCKmPyPfNkar0HX2ynT8E4CgqU4Q3m9bDP10,4401
265
- umap/static/umap/js/modules/umap.js,sha256=beEtnWoOJe797Pjgy_VW7ZHJV2a5iOTYZaPC5xT_BCs,57359
265
+ umap/static/umap/js/modules/umap.js,sha256=GH779DT_AfTpXrefTgHjGOH-gPFs84Ab_TtDYUzpG5s,57395
266
266
  umap/static/umap/js/modules/urls.js,sha256=76cFqycj2O8huuoYYBvxnVt2Fc2UDbgrRsiv6lQmcSY,890
267
267
  umap/static/umap/js/modules/utils.js,sha256=yZhvc6kMsgnBTxeflcJ0eigNd0S1uOsZCzotXqqVpMA,16702
268
268
  umap/static/umap/js/modules/data/features.js,sha256=a5hbjoJQEaKpKkT_JELmAZVcNBcfEgP7dnpY7-5XGhA,39287
269
- umap/static/umap/js/modules/data/layer.js,sha256=e56iu8nr1fMYBYu5gOXvVvYv8mSTBxMT_KwuC1Jgl90,40933
269
+ umap/static/umap/js/modules/data/layer.js,sha256=SpfYIZ0SXKkDDmu8UvrJ5vWDFzLaQ4hCZ7umO57b1Tg,40940
270
270
  umap/static/umap/js/modules/form/builder.js,sha256=Xq1oNE3t_6JFWm_i2MAaCrfYMkollWHW9nVmL-8Bu7o,6518
271
271
  umap/static/umap/js/modules/form/fields.js,sha256=n7zezzllOKNu1o_AD8dCI-WiLJ9rqWnF1P9gTb90TT4,32938
272
272
  umap/static/umap/js/modules/importers/banfr.js,sha256=TBwL3GQJdzYtaDtxeHxyPQ7Ycy5zTaQyvzXa55X7n2I,2932
@@ -285,7 +285,7 @@ umap/static/umap/js/modules/rendering/template.js,sha256=D-x6gNP5NbpZRitqfGL28VW
285
285
  umap/static/umap/js/modules/rendering/ui.js,sha256=LgaDuTHm9EbdL35OOCSiMnufeOVGS8Ecu6tGW_oFHkw,17700
286
286
  umap/static/umap/js/modules/rendering/layers/base.js,sha256=k_TlwHiGc16CFvE41-OmgjTFa99LbkG0IUKCUoZaruk,2483
287
287
  umap/static/umap/js/modules/rendering/layers/classified.js,sha256=gYvPWJMHKWuIC2xtUI9gzuUJcVExaoYd86fxgZY2WtE,15294
288
- umap/static/umap/js/modules/rendering/layers/cluster.js,sha256=K38WgRk7VI80cpJc1wFjqaZsNQCQqpM5CWMmy1LOYnk,8090
288
+ umap/static/umap/js/modules/rendering/layers/cluster.js,sha256=mn1-m2KGmmQv8IohoZ3zLfClwvl38Xv8zwGFyYwmQ5o,8136
289
289
  umap/static/umap/js/modules/rendering/layers/heat.js,sha256=K_LsxnfpGImy2HlneV5nK0cBu1FxDmPNxR5VmsV4LaM,4975
290
290
  umap/static/umap/js/modules/sync/engine.js,sha256=LDB7HHCmfVb0Cz30yVXBSV0f-1CGG5bkzrPtaT5RePM,18390
291
291
  umap/static/umap/js/modules/sync/hlc.js,sha256=XeJz3x7qiDz7v-mcgGIynj5ks34FpWx_oSPUPFd_ZGA,2991
@@ -531,7 +531,7 @@ umap/tests/test_statics.py,sha256=xKuxT8Xj5Ii7gKISuiSfDj7dpjmJ2Ierby3Lg-haZCg,12
531
531
  umap/tests/test_switch_user.py,sha256=MzTBxcPVm8X0R4gBkBL_wntznOyEn0ixJSEiQMvaxGo,1255
532
532
  umap/tests/test_team_views.py,sha256=edmqn_tx4XQ1sEQtB7CpuJT6WwQQiUyUYu8-ESZxFcw,5615
533
533
  umap/tests/test_tilelayer.py,sha256=toVpVutEvMLWKx5uH7ZbGNPGzqICZx1_S2OOpIfYPfQ,603
534
- umap/tests/test_utils.py,sha256=noh-AFL3qV-dNZYr8L1acsYC02SI710Bq2ZXV-jBEzk,407
534
+ umap/tests/test_utils.py,sha256=BWtrNhkei7LacUqVGVP9fMX4Ys_wYu4AAOLwNZfFfLo,692
535
535
  umap/tests/test_views.py,sha256=5-XT4tiT9FIJY6BWWY6yJCj5BFAwON5RfF6HPzz4E8s,19503
536
536
  umap/tests/fixtures/categorized_highway.geojson,sha256=p7QHOd8nXi7yVq37gY6Ca8BXkjaLnDxW9Fq0Zcm3Fk4,15830
537
537
  umap/tests/fixtures/choropleth_region_chomage.geojson,sha256=mVVbYlf92Sr3wWH9ETm43FdHz1U3zjsn91HuU5H5r4Y,21325
@@ -605,8 +605,8 @@ umap/tests/integration/test_view_marker.py,sha256=NFCwNez__E_WsE1DuW5RuB0HVKDP4C
605
605
  umap/tests/integration/test_view_polygon.py,sha256=NMJC6Nt9VpQ8FIU9Pqq2OspHv49xsWlsoXCr8iBa0VA,2060
606
606
  umap/tests/integration/test_view_polyline.py,sha256=aJoXKmLhJaN0yhPdDCVskZNGx3q3mLDkjVPhZ30cadA,13959
607
607
  umap/tests/integration/test_websocket_sync.py,sha256=CeigDGSDSa6LeM_ZxPoDDfQ20GPHEgPPSDVLEMd4ToI,28367
608
- umap_project-3.4.0b0.dist-info/METADATA,sha256=_IA4BT3WtcScs9blPrzUaKwTqpMdYMSGH-MvJCvRhZg,5751
609
- umap_project-3.4.0b0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
610
- umap_project-3.4.0b0.dist-info/entry_points.txt,sha256=gz-KDQfEsMLBae8ABOD3foJsCYGPW1tA4Y394R_1RW8,39
611
- umap_project-3.4.0b0.dist-info/licenses/LICENSE,sha256=kQtrtRKgiPhcl7aO0-lmvbrNAXu7WHyiXvPrUk-TD2Q,820
612
- umap_project-3.4.0b0.dist-info/RECORD,,
608
+ umap_project-3.4.0b2.dist-info/METADATA,sha256=2qWLswAIbSpvDkEwgP5J_ZPzWaYIQ_DqFm1uhHVe32o,5751
609
+ umap_project-3.4.0b2.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
610
+ umap_project-3.4.0b2.dist-info/entry_points.txt,sha256=gz-KDQfEsMLBae8ABOD3foJsCYGPW1tA4Y394R_1RW8,39
611
+ umap_project-3.4.0b2.dist-info/licenses/LICENSE,sha256=kQtrtRKgiPhcl7aO0-lmvbrNAXu7WHyiXvPrUk-TD2Q,820
612
+ umap_project-3.4.0b2.dist-info/RECORD,,