umap-project 3.0.6__py3-none-any.whl → 3.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 (142) hide show
  1. umap/__init__.py +1 -1
  2. umap/forms.py +1 -1
  3. umap/locale/br/LC_MESSAGES/django.mo +0 -0
  4. umap/locale/br/LC_MESSAGES/django.po +219 -72
  5. umap/locale/ca/LC_MESSAGES/django.mo +0 -0
  6. umap/locale/ca/LC_MESSAGES/django.po +286 -95
  7. umap/locale/cs_CZ/LC_MESSAGES/django.mo +0 -0
  8. umap/locale/cs_CZ/LC_MESSAGES/django.po +211 -65
  9. umap/locale/da/LC_MESSAGES/django.mo +0 -0
  10. umap/locale/da/LC_MESSAGES/django.po +394 -202
  11. umap/locale/de/LC_MESSAGES/django.mo +0 -0
  12. umap/locale/de/LC_MESSAGES/django.po +146 -75
  13. umap/locale/el/LC_MESSAGES/django.mo +0 -0
  14. umap/locale/el/LC_MESSAGES/django.po +125 -59
  15. umap/locale/en/LC_MESSAGES/django.po +124 -58
  16. umap/locale/es/LC_MESSAGES/django.mo +0 -0
  17. umap/locale/es/LC_MESSAGES/django.po +125 -59
  18. umap/locale/et/LC_MESSAGES/django.mo +0 -0
  19. umap/locale/et/LC_MESSAGES/django.po +210 -64
  20. umap/locale/eu/LC_MESSAGES/django.mo +0 -0
  21. umap/locale/eu/LC_MESSAGES/django.po +212 -65
  22. umap/locale/fa_IR/LC_MESSAGES/django.mo +0 -0
  23. umap/locale/fa_IR/LC_MESSAGES/django.po +286 -95
  24. umap/locale/fr/LC_MESSAGES/django.mo +0 -0
  25. umap/locale/fr/LC_MESSAGES/django.po +125 -59
  26. umap/locale/gl/LC_MESSAGES/django.mo +0 -0
  27. umap/locale/gl/LC_MESSAGES/django.po +212 -66
  28. umap/locale/hu/LC_MESSAGES/django.mo +0 -0
  29. umap/locale/hu/LC_MESSAGES/django.po +148 -78
  30. umap/locale/is/LC_MESSAGES/django.mo +0 -0
  31. umap/locale/is/LC_MESSAGES/django.po +130 -60
  32. umap/locale/it/LC_MESSAGES/django.mo +0 -0
  33. umap/locale/it/LC_MESSAGES/django.po +125 -59
  34. umap/locale/ms/LC_MESSAGES/django.mo +0 -0
  35. umap/locale/ms/LC_MESSAGES/django.po +289 -98
  36. umap/locale/nl/LC_MESSAGES/django.mo +0 -0
  37. umap/locale/nl/LC_MESSAGES/django.po +128 -61
  38. umap/locale/pl/LC_MESSAGES/django.mo +0 -0
  39. umap/locale/pl/LC_MESSAGES/django.po +287 -96
  40. umap/locale/pt/LC_MESSAGES/django.mo +0 -0
  41. umap/locale/pt/LC_MESSAGES/django.po +211 -65
  42. umap/locale/zh_TW/LC_MESSAGES/django.mo +0 -0
  43. umap/locale/zh_TW/LC_MESSAGES/django.po +212 -66
  44. umap/management/commands/migrate_to_S3.py +42 -20
  45. umap/management/commands/purge_old_versions.py +63 -0
  46. umap/management/commands/switch_user.py +52 -0
  47. umap/managers.py +29 -2
  48. umap/middleware.py +1 -1
  49. umap/migrations/0028_map_is_template.py +21 -0
  50. umap/models.py +14 -4
  51. umap/settings/base.py +22 -0
  52. umap/static/umap/base.css +4 -2
  53. umap/static/umap/content.css +1 -1
  54. umap/static/umap/css/dialog.css +5 -2
  55. umap/static/umap/css/form.css +19 -12
  56. umap/static/umap/css/icon.css +6 -0
  57. umap/static/umap/css/importers.css +4 -0
  58. umap/static/umap/css/panel.css +2 -0
  59. umap/static/umap/img/16-white.svg +5 -1
  60. umap/static/umap/img/16.svg +1 -1
  61. umap/static/umap/img/24-white.svg +3 -2
  62. umap/static/umap/img/24.svg +3 -4
  63. umap/static/umap/img/importers/opendata.svg +1 -0
  64. umap/static/umap/img/source/16-white.svg +8 -4
  65. umap/static/umap/img/source/16.svg +1 -1
  66. umap/static/umap/img/source/24-white.svg +5 -4
  67. umap/static/umap/img/source/24.svg +5 -6
  68. umap/static/umap/js/components/modal.js +27 -0
  69. umap/static/umap/js/modules/caption.js +4 -4
  70. umap/static/umap/js/modules/data/features.js +40 -4
  71. umap/static/umap/js/modules/data/layer.js +208 -138
  72. umap/static/umap/js/modules/form/builder.js +6 -14
  73. umap/static/umap/js/modules/form/fields.js +2 -2
  74. umap/static/umap/js/modules/help.js +11 -3
  75. umap/static/umap/js/modules/importer.js +7 -4
  76. umap/static/umap/js/modules/importers/opendata.js +142 -0
  77. umap/static/umap/js/modules/permissions.js +3 -3
  78. umap/static/umap/js/modules/rendering/controls.js +34 -2
  79. umap/static/umap/js/modules/rendering/icon.js +2 -2
  80. umap/static/umap/js/modules/rendering/layers/base.js +1 -1
  81. umap/static/umap/js/modules/rendering/layers/classified.js +55 -49
  82. umap/static/umap/js/modules/rendering/layers/cluster.js +16 -9
  83. umap/static/umap/js/modules/rendering/layers/heat.js +13 -11
  84. umap/static/umap/js/modules/rendering/map.js +5 -0
  85. umap/static/umap/js/modules/rendering/ui.js +23 -0
  86. umap/static/umap/js/modules/rules.js +24 -23
  87. umap/static/umap/js/modules/schema.js +60 -4
  88. umap/static/umap/js/modules/sync/updaters.js +7 -3
  89. umap/static/umap/js/modules/tableeditor.js +7 -30
  90. umap/static/umap/js/modules/templates.js +122 -0
  91. umap/static/umap/js/modules/ui/bar.js +13 -3
  92. umap/static/umap/js/modules/ui/panel.js +1 -1
  93. umap/static/umap/js/modules/umap.js +28 -13
  94. umap/static/umap/js/umap.controls.js +11 -4
  95. umap/static/umap/locale/br.js +51 -18
  96. umap/static/umap/locale/br.json +51 -18
  97. umap/static/umap/locale/da.js +343 -310
  98. umap/static/umap/locale/da.json +343 -310
  99. umap/static/umap/locale/de.js +40 -7
  100. umap/static/umap/locale/de.json +40 -7
  101. umap/static/umap/locale/el.js +31 -4
  102. umap/static/umap/locale/el.json +31 -4
  103. umap/static/umap/locale/en.js +33 -1
  104. umap/static/umap/locale/en.json +33 -1
  105. umap/static/umap/locale/es.js +37 -4
  106. umap/static/umap/locale/es.json +37 -4
  107. umap/static/umap/locale/fr.js +34 -1
  108. umap/static/umap/locale/fr.json +34 -1
  109. umap/static/umap/locale/hu.js +44 -17
  110. umap/static/umap/locale/hu.json +44 -17
  111. umap/static/umap/locale/it.js +74 -41
  112. umap/static/umap/locale/it.json +74 -41
  113. umap/static/umap/locale/nl.js +42 -9
  114. umap/static/umap/locale/nl.json +42 -9
  115. umap/static/umap/map.css +3 -23
  116. umap/static/umap/vendors/textpath/leaflet.textpath.js +184 -0
  117. umap/storage/fs.py +19 -9
  118. umap/templates/umap/dashboard_menu.html +5 -0
  119. umap/templates/umap/design_system.html +9 -0
  120. umap/templates/umap/js.html +3 -0
  121. umap/templates/umap/map_list.html +2 -2
  122. umap/templates/umap/map_table.html +18 -18
  123. umap/templates/umap/user_dashboard.html +9 -58
  124. umap/templates/umap/user_map_table.html +36 -0
  125. umap/templates/umap/user_templates.html +19 -0
  126. umap/templatetags/umap_tags.py +5 -0
  127. umap/tests/integration/test_conditional_rules.py +57 -0
  128. umap/tests/integration/test_datalayer.py +16 -9
  129. umap/tests/integration/test_edit_marker.py +11 -0
  130. umap/tests/integration/test_tableeditor.py +42 -7
  131. umap/tests/integration/test_templates.py +44 -0
  132. umap/tests/test_dashboard.py +19 -0
  133. umap/tests/test_purge_old_versions.py +91 -0
  134. umap/tests/test_switch_user.py +31 -0
  135. umap/tests/test_views.py +67 -0
  136. umap/urls.py +7 -1
  137. umap/views.py +64 -18
  138. {umap_project-3.0.6.dist-info → umap_project-3.1.0.dist-info}/METADATA +14 -14
  139. {umap_project-3.0.6.dist-info → umap_project-3.1.0.dist-info}/RECORD +142 -129
  140. {umap_project-3.0.6.dist-info → umap_project-3.1.0.dist-info}/WHEEL +0 -0
  141. {umap_project-3.0.6.dist-info → umap_project-3.1.0.dist-info}/entry_points.txt +0 -0
  142. {umap_project-3.0.6.dist-info → umap_project-3.1.0.dist-info}/licenses/LICENSE +0 -0
@@ -205,7 +205,7 @@ class Feature {
205
205
 
206
206
  edit(event) {
207
207
  if (!this._umap.editEnabled || this.isReadOnly()) return
208
- if (this._umap.editedFeature === this) return
208
+ if (this._umap.editedFeature === this && !event.force) return
209
209
  const container = DomUtil.create('div', 'umap-feature-container')
210
210
  DomUtil.createTitle(
211
211
  container,
@@ -241,7 +241,15 @@ class Feature {
241
241
  builder = new MutatingForm(this, properties, {
242
242
  id: 'umap-feature-properties',
243
243
  })
244
- container.appendChild(builder.build())
244
+ const form = builder.build()
245
+ container.appendChild(form)
246
+ const button = Utils.loadTemplate(
247
+ `<button type="button"><i class="icon icon-16 icon-add"></i>${translate('Add a new property')}</button>`
248
+ )
249
+ button.addEventListener('click', () => {
250
+ this.datalayer.addProperty().then(() => this.edit({ force: true }))
251
+ })
252
+ form.appendChild(button)
245
253
  this.appendEditFieldsets(container)
246
254
  const advancedActions = DomUtil.createFieldset(
247
255
  container,
@@ -272,6 +280,8 @@ class Feature {
272
280
  container.appendChild(button)
273
281
  }
274
282
 
283
+ addExtraEditFieldset() {}
284
+
275
285
  appendEditFieldsets(container) {
276
286
  const optionsFields = this.getShapeOptions()
277
287
  let builder = new MutatingForm(this, optionsFields, {
@@ -283,6 +293,8 @@ class Feature {
283
293
  )
284
294
  shapeProperties.appendChild(builder.build())
285
295
 
296
+ this.addExtraEditFieldset(container)
297
+
286
298
  const advancedOptions = this.getAdvancedOptions()
287
299
  builder = new MutatingForm(this, advancedOptions, {
288
300
  id: 'umap-feature-advanced-properties',
@@ -336,7 +348,10 @@ class Feature {
336
348
  }
337
349
 
338
350
  hasPopupFooter() {
339
- if (this.datalayer.isRemoteLayer() && this.datalayer.options.remoteData.dynamic) {
351
+ if (
352
+ this.datalayer.isRemoteLayer() &&
353
+ this.datalayer.properties.remoteData.dynamic
354
+ ) {
340
355
  return false
341
356
  }
342
357
  return this._umap.getProperty('displayPopupFooter')
@@ -414,7 +429,7 @@ class Feature {
414
429
  } else if (Utils.usableOption(this.properties._umap_options, option)) {
415
430
  value = this.properties._umap_options[option]
416
431
  } else if (this.datalayer) {
417
- value = this.datalayer.getOption(option, this)
432
+ value = this.datalayer.getProperty(option, this)
418
433
  } else {
419
434
  value = this._umap.getProperty(option)
420
435
  }
@@ -469,12 +484,16 @@ class Feature {
469
484
  }
470
485
 
471
486
  deleteProperty(property) {
487
+ const oldValue = this.properties[property]
472
488
  delete this.properties[property]
489
+ this.sync.update(`properties.${property}`, undefined, oldValue)
473
490
  }
474
491
 
475
492
  renameProperty(from, to) {
493
+ const oldValue = this.properties[from]
476
494
  this.properties[to] = this.properties[from]
477
495
  this.deleteProperty(from)
496
+ this.sync.update(`properties.${to}`, oldValue, undefined)
478
497
  }
479
498
 
480
499
  toGeoJSON() {
@@ -1100,6 +1119,23 @@ export class LineString extends Path {
1100
1119
  }
1101
1120
  return items
1102
1121
  }
1122
+
1123
+ addExtraEditFieldset(container) {
1124
+ const options = [
1125
+ 'properties._umap_options.textPath',
1126
+ 'properties._umap_options.textPathColor',
1127
+ 'properties._umap_options.textPathRepeat',
1128
+ 'properties._umap_options.textPathRotate',
1129
+ 'properties._umap_options.textPathSize',
1130
+ 'properties._umap_options.textPathOffset',
1131
+ 'properties._umap_options.textPathPosition',
1132
+ ]
1133
+ const builder = new MutatingForm(this, options, {
1134
+ id: 'umap-feature-line-decoration',
1135
+ })
1136
+ const fieldset = DomUtil.createFieldset(container, translate('Line decoration'))
1137
+ fieldset.appendChild(builder.build())
1138
+ }
1103
1139
  }
1104
1140
 
1105
1141
  export class Polygon extends Path {