umap-project 2.0.4__py3-none-any.whl → 2.1.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 (106) hide show
  1. umap/__init__.py +1 -1
  2. umap/fields.py +3 -1
  3. umap/locale/br/LC_MESSAGES/django.po +76 -71
  4. umap/locale/en/LC_MESSAGES/django.po +41 -41
  5. umap/locale/hu/LC_MESSAGES/django.po +42 -42
  6. umap/locale/it/LC_MESSAGES/django.po +64 -58
  7. umap/locale/ms/LC_MESSAGES/django.po +62 -57
  8. umap/migrations/0018_datalayer_uuid.py +62 -0
  9. umap/migrations/0019_migrate_internal_remote_datalayers.py +52 -0
  10. umap/models.py +20 -3
  11. umap/settings/base.py +1 -0
  12. umap/settings/dev.py +1 -0
  13. umap/static/umap/js/modules/browser.js +2 -2
  14. umap/static/umap/js/modules/global.js +14 -4
  15. umap/static/umap/js/modules/i18n.js +35 -0
  16. umap/static/umap/js/modules/leaflet-configure.js +7 -0
  17. umap/static/umap/js/modules/schema.js +388 -0
  18. umap/static/umap/js/modules/urls.js +17 -2
  19. umap/static/umap/js/modules/utils.js +24 -0
  20. umap/static/umap/js/umap.controls.js +9 -10
  21. umap/static/umap/js/umap.core.js +5 -5
  22. umap/static/umap/js/umap.features.js +23 -9
  23. umap/static/umap/js/umap.forms.js +49 -299
  24. umap/static/umap/js/umap.icon.js +2 -2
  25. umap/static/umap/js/umap.js +26 -129
  26. umap/static/umap/js/umap.layer.js +9 -9
  27. umap/static/umap/js/umap.popup.js +3 -0
  28. umap/static/umap/js/umap.share.js +1 -1
  29. umap/static/umap/locale/am_ET.json +229 -225
  30. umap/static/umap/locale/ar.json +229 -225
  31. umap/static/umap/locale/ast.json +229 -225
  32. umap/static/umap/locale/bg.json +229 -225
  33. umap/static/umap/locale/br.json +237 -233
  34. umap/static/umap/locale/ca.json +229 -225
  35. umap/static/umap/locale/cs_CZ.json +229 -225
  36. umap/static/umap/locale/da.json +229 -225
  37. umap/static/umap/locale/de.json +229 -225
  38. umap/static/umap/locale/el.json +229 -225
  39. umap/static/umap/locale/en.json +230 -233
  40. umap/static/umap/locale/en_US.json +229 -225
  41. umap/static/umap/locale/es.json +229 -225
  42. umap/static/umap/locale/et.json +229 -225
  43. umap/static/umap/locale/eu.json +226 -198
  44. umap/static/umap/locale/fa_IR.json +229 -225
  45. umap/static/umap/locale/fi.json +229 -225
  46. umap/static/umap/locale/fr.json +229 -232
  47. umap/static/umap/locale/gl.json +229 -225
  48. umap/static/umap/locale/he.json +229 -225
  49. umap/static/umap/locale/hr.json +229 -225
  50. umap/static/umap/locale/hu.json +229 -232
  51. umap/static/umap/locale/id.json +229 -225
  52. umap/static/umap/locale/is.json +229 -225
  53. umap/static/umap/locale/it.json +229 -232
  54. umap/static/umap/locale/ja.json +229 -225
  55. umap/static/umap/locale/ko.json +229 -225
  56. umap/static/umap/locale/lt.json +229 -225
  57. umap/static/umap/locale/ms.json +229 -232
  58. umap/static/umap/locale/nl.json +232 -228
  59. umap/static/umap/locale/no.json +229 -225
  60. umap/static/umap/locale/pl.json +229 -225
  61. umap/static/umap/locale/pl_PL.json +229 -225
  62. umap/static/umap/locale/pt.json +229 -225
  63. umap/static/umap/locale/pt_BR.json +229 -225
  64. umap/static/umap/locale/pt_PT.json +229 -225
  65. umap/static/umap/locale/ro.json +229 -225
  66. umap/static/umap/locale/ru.json +229 -225
  67. umap/static/umap/locale/sk_SK.json +229 -225
  68. umap/static/umap/locale/sl.json +229 -225
  69. umap/static/umap/locale/sr.json +229 -225
  70. umap/static/umap/locale/sv.json +229 -225
  71. umap/static/umap/locale/th_TH.json +229 -225
  72. umap/static/umap/locale/tr.json +229 -225
  73. umap/static/umap/locale/uk_UA.json +229 -225
  74. umap/static/umap/locale/vi.json +229 -225
  75. umap/static/umap/locale/vi_VN.json +229 -225
  76. umap/static/umap/locale/zh.json +229 -225
  77. umap/static/umap/locale/zh_CN.json +229 -225
  78. umap/static/umap/locale/zh_TW.Big5.json +229 -225
  79. umap/static/umap/locale/zh_TW.json +229 -232
  80. umap/static/umap/test/index.html +0 -2
  81. umap/static/umap/{test → unittests}/URLs.js +5 -0
  82. umap/static/umap/vendors/leaflet/leaflet-src.esm.js +7064 -7064
  83. umap/static/umap/vendors/photon/leaflet.photon.js +3 -0
  84. umap/templates/umap/js.html +8 -6
  85. umap/templatetags/umap_tags.py +3 -2
  86. umap/tests/integration/test_browser.py +40 -0
  87. umap/tests/integration/test_collaborative_editing.py +72 -3
  88. umap/tests/integration/test_export_map.py +226 -9
  89. umap/tests/integration/test_features_id_generation.py +51 -0
  90. umap/tests/integration/test_owned_map.py +14 -1
  91. umap/tests/integration/test_statics.py +3 -3
  92. umap/tests/integration/test_tilelayer.py +3 -3
  93. umap/tests/settings.py +3 -3
  94. umap/tests/test_datalayer_views.py +67 -20
  95. umap/tests/test_map_views.py +20 -0
  96. umap/tests/test_merge_features.py +25 -5
  97. umap/urls.py +12 -12
  98. umap/utils.py +7 -0
  99. umap/views.py +56 -47
  100. umap/wsgi.py +1 -0
  101. {umap_project-2.0.4.dist-info → umap_project-2.1.0.dist-info}/METADATA +9 -9
  102. {umap_project-2.0.4.dist-info → umap_project-2.1.0.dist-info}/RECORD +105 -99
  103. umap/static/umap/test/Map.Export.js +0 -106
  104. {umap_project-2.0.4.dist-info → umap_project-2.1.0.dist-info}/WHEEL +0 -0
  105. {umap_project-2.0.4.dist-info → umap_project-2.1.0.dist-info}/entry_points.txt +0 -0
  106. {umap_project-2.0.4.dist-info → umap_project-2.1.0.dist-info}/licenses/LICENSE +0 -0
@@ -677,7 +677,7 @@ U.DataLayer = L.Evented.extend({
677
677
  this._loading = true
678
678
  const [geojson, response, error] = await this.map.server.get(this._dataUrl())
679
679
  if (!error) {
680
- this._last_modified = response.headers.get('last-modified')
680
+ this._reference_version = response.headers.get('X-Datalayer-Version')
681
681
  // FIXME: for now this property is set dynamically from backend
682
682
  // And thus it's not in the geojson file in the server
683
683
  // So do not let all options to be reset
@@ -688,7 +688,7 @@ U.DataLayer = L.Evented.extend({
688
688
  }
689
689
  // In case of maps pre 1.0 still around
690
690
  if (geojson._storage) geojson._storage.editMode = this.options.editMode
691
- this.fromUmapGeoJSON(geojson)
691
+ await this.fromUmapGeoJSON(geojson)
692
692
  this.backupOptions()
693
693
  this.fire('loaded')
694
694
  this._loading = false
@@ -703,10 +703,10 @@ U.DataLayer = L.Evented.extend({
703
703
  this.fire('datachanged')
704
704
  },
705
705
 
706
- fromUmapGeoJSON: function (geojson) {
706
+ fromUmapGeoJSON: async function (geojson) {
707
707
  if (geojson._storage) geojson._umap_options = geojson._storage // Retrocompat
708
708
  if (geojson._umap_options) this.setOptions(geojson._umap_options)
709
- if (this.isRemoteLayer()) this.fetchRemoteData()
709
+ if (this.isRemoteLayer()) await this.fetchRemoteData()
710
710
  else this.fromGeoJSON(geojson)
711
711
  this._loaded = true
712
712
  },
@@ -1459,7 +1459,7 @@ U.DataLayer = L.Evented.extend({
1459
1459
  if (!this.isVisible()) return
1460
1460
  const bounds = this.layer.getBounds()
1461
1461
  if (bounds.isValid()) {
1462
- const options = {maxZoom: this.getOption("zoomTo")}
1462
+ const options = { maxZoom: this.getOption('zoomTo') }
1463
1463
  this.map.fitBounds(bounds, options)
1464
1464
  }
1465
1465
  },
@@ -1577,8 +1577,8 @@ U.DataLayer = L.Evented.extend({
1577
1577
  map_id: this.map.options.umap_id,
1578
1578
  pk: this.umap_id,
1579
1579
  })
1580
- const headers = this._last_modified
1581
- ? { 'If-Unmodified-Since': this._last_modified }
1580
+ const headers = this._reference_version
1581
+ ? { 'X-Datalayer-Reference': this._reference_version }
1582
1582
  : {}
1583
1583
  await this._trySave(saveUrl, headers, formData)
1584
1584
  this._geojson = geojson
@@ -1596,7 +1596,7 @@ U.DataLayer = L.Evented.extend({
1596
1596
  label: L._('Save anyway'),
1597
1597
  callback: async () => {
1598
1598
  // Save again,
1599
- // but do not pass If-Unmodified-Since this time
1599
+ // but do not pass the reference version this time
1600
1600
  await this._trySave(url, {}, formData)
1601
1601
  },
1602
1602
  },
@@ -1619,7 +1619,7 @@ U.DataLayer = L.Evented.extend({
1619
1619
  this.fromGeoJSON(data.geojson)
1620
1620
  delete data.geojson
1621
1621
  }
1622
- this._last_modified = response.headers.get('last-modified')
1622
+ this._reference_version = response.headers.get('X-Datalayer-Version')
1623
1623
  this.setUmapId(data.id)
1624
1624
  this.updateOptions(data)
1625
1625
  this.backupOptions()
@@ -59,6 +59,9 @@ U.Popup.Panel = U.Popup.extend({
59
59
  L.DomUtil.create('i', 'umap-icon-16 umap-list', button)
60
60
  const label = L.DomUtil.create('span', '', button)
61
61
  label.textContent = label.title = L._('See all')
62
+ // Fixme: remove me when this is merged and released
63
+ // https://github.com/Leaflet/Leaflet/pull/9052
64
+ L.DomEvent.disableClickPropagation(button)
62
65
  L.DomEvent.on(button, 'click', this.feature.map.openBrowser, this.feature.map)
63
66
  return button
64
67
  },
@@ -215,7 +215,7 @@ U.IframeExporter = L.Evented.extend({
215
215
  this.map = map
216
216
  this.baseUrl = L.Util.getBaseUrl()
217
217
  // Use map default, not generic default
218
- this.queryString.onLoadPanel = this.map.options.onLoadPanel
218
+ this.queryString.onLoadPanel = this.map.getOption('onLoadPanel')
219
219
  },
220
220
 
221
221
  getMap: function () {