umap-project 2.9.2__py3-none-any.whl → 3.0.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 (222) hide show
  1. umap/__init__.py +1 -1
  2. umap/context_processors.py +1 -0
  3. umap/forms.py +1 -2
  4. umap/locale/de/LC_MESSAGES/django.mo +0 -0
  5. umap/locale/de/LC_MESSAGES/django.po +218 -96
  6. umap/locale/en/LC_MESSAGES/django.po +131 -55
  7. umap/locale/et/LC_MESSAGES/django.mo +0 -0
  8. umap/locale/et/LC_MESSAGES/django.po +175 -130
  9. umap/locale/eu/LC_MESSAGES/django.mo +0 -0
  10. umap/locale/eu/LC_MESSAGES/django.po +117 -72
  11. umap/locale/fr/LC_MESSAGES/django.mo +0 -0
  12. umap/locale/fr/LC_MESSAGES/django.po +132 -56
  13. umap/locale/hu/LC_MESSAGES/django.mo +0 -0
  14. umap/locale/hu/LC_MESSAGES/django.po +209 -88
  15. umap/locale/is/LC_MESSAGES/django.mo +0 -0
  16. umap/locale/is/LC_MESSAGES/django.po +296 -175
  17. umap/middleware.py +2 -1
  18. umap/migrations/0027_map_tags.py +23 -0
  19. umap/models.py +13 -2
  20. umap/settings/base.py +23 -5
  21. umap/static/umap/base.css +41 -8
  22. umap/static/umap/content.css +72 -37
  23. umap/static/umap/css/bar.css +43 -21
  24. umap/static/umap/css/dialog.css +4 -1
  25. umap/static/umap/css/form.css +40 -27
  26. umap/static/umap/css/icon.css +11 -1
  27. umap/static/umap/css/importers.css +7 -0
  28. umap/static/umap/img/16-white.svg +23 -2
  29. umap/static/umap/img/16.svg +1 -1
  30. umap/static/umap/img/24.svg +4 -4
  31. umap/static/umap/img/home.svg +7 -0
  32. umap/static/umap/img/importers/banfr.svg +1 -0
  33. umap/static/umap/img/marker.svg +2 -5
  34. umap/static/umap/img/source/16-white.svg +24 -3
  35. umap/static/umap/img/source/16.svg +1 -1
  36. umap/static/umap/img/source/24.svg +5 -5
  37. umap/static/umap/img/target.svg +1 -0
  38. umap/static/umap/js/components/alerts/alert.js +0 -1
  39. umap/static/umap/js/modules/browser.js +4 -4
  40. umap/static/umap/js/modules/caption.js +1 -1
  41. umap/static/umap/js/modules/data/features.js +25 -25
  42. umap/static/umap/js/modules/data/layer.js +91 -97
  43. umap/static/umap/js/modules/facets.js +9 -5
  44. umap/static/umap/js/modules/form/builder.js +21 -29
  45. umap/static/umap/js/modules/form/fields.js +40 -14
  46. umap/static/umap/js/modules/formatter.js +1 -1
  47. umap/static/umap/js/modules/global.js +9 -5
  48. umap/static/umap/js/modules/help.js +18 -5
  49. umap/static/umap/js/modules/importer.js +5 -2
  50. umap/static/umap/js/modules/importers/banfr.js +93 -0
  51. umap/static/umap/js/modules/importers/cadastrefr.js +2 -2
  52. umap/static/umap/js/modules/importers/communesfr.js +1 -1
  53. umap/static/umap/js/modules/permissions.js +20 -10
  54. umap/static/umap/js/modules/rendering/icon.js +15 -2
  55. umap/static/umap/js/modules/rendering/layers/classified.js +7 -7
  56. umap/static/umap/js/modules/rendering/layers/cluster.js +2 -2
  57. umap/static/umap/js/modules/rendering/layers/heat.js +4 -4
  58. umap/static/umap/js/modules/rendering/map.js +14 -6
  59. umap/static/umap/js/modules/rendering/popup.js +2 -2
  60. umap/static/umap/js/modules/rendering/template.js +3 -3
  61. umap/static/umap/js/modules/rendering/ui.js +17 -11
  62. umap/static/umap/js/modules/rules.js +13 -16
  63. umap/static/umap/js/modules/schema.js +23 -1
  64. umap/static/umap/js/modules/share.js +1 -1
  65. umap/static/umap/js/modules/slideshow.js +1 -0
  66. umap/static/umap/js/modules/sync/engine.js +141 -19
  67. umap/static/umap/js/modules/sync/undo.js +101 -0
  68. umap/static/umap/js/modules/sync/updaters.js +51 -28
  69. umap/static/umap/js/modules/tableeditor.js +1 -1
  70. umap/static/umap/js/modules/ui/bar.js +61 -21
  71. umap/static/umap/js/modules/ui/tooltip.js +1 -1
  72. umap/static/umap/js/modules/umap.js +190 -176
  73. umap/static/umap/js/modules/utils.js +30 -4
  74. umap/static/umap/js/umap.controls.js +82 -38
  75. umap/static/umap/locale/am_ET.js +13 -7
  76. umap/static/umap/locale/am_ET.json +13 -7
  77. umap/static/umap/locale/ar.js +13 -7
  78. umap/static/umap/locale/ar.json +13 -7
  79. umap/static/umap/locale/ast.js +13 -7
  80. umap/static/umap/locale/ast.json +13 -7
  81. umap/static/umap/locale/bg.js +13 -7
  82. umap/static/umap/locale/bg.json +13 -7
  83. umap/static/umap/locale/br.js +13 -8
  84. umap/static/umap/locale/br.json +13 -8
  85. umap/static/umap/locale/ca.js +13 -7
  86. umap/static/umap/locale/ca.json +13 -7
  87. umap/static/umap/locale/cs_CZ.js +26 -20
  88. umap/static/umap/locale/cs_CZ.json +26 -20
  89. umap/static/umap/locale/da.js +13 -7
  90. umap/static/umap/locale/da.json +13 -7
  91. umap/static/umap/locale/de.js +47 -41
  92. umap/static/umap/locale/de.json +47 -41
  93. umap/static/umap/locale/el.js +13 -7
  94. umap/static/umap/locale/el.json +13 -7
  95. umap/static/umap/locale/en.js +12 -7
  96. umap/static/umap/locale/en.json +12 -7
  97. umap/static/umap/locale/en_US.json +13 -7
  98. umap/static/umap/locale/es.js +19 -13
  99. umap/static/umap/locale/es.json +19 -13
  100. umap/static/umap/locale/et.js +13 -7
  101. umap/static/umap/locale/et.json +13 -7
  102. umap/static/umap/locale/eu.js +43 -37
  103. umap/static/umap/locale/eu.json +43 -37
  104. umap/static/umap/locale/fa_IR.js +13 -7
  105. umap/static/umap/locale/fa_IR.json +13 -7
  106. umap/static/umap/locale/fi.js +13 -7
  107. umap/static/umap/locale/fi.json +13 -7
  108. umap/static/umap/locale/fr.js +12 -7
  109. umap/static/umap/locale/fr.json +12 -7
  110. umap/static/umap/locale/gl.js +19 -13
  111. umap/static/umap/locale/gl.json +19 -13
  112. umap/static/umap/locale/he.js +13 -7
  113. umap/static/umap/locale/he.json +13 -7
  114. umap/static/umap/locale/hr.js +13 -7
  115. umap/static/umap/locale/hr.json +13 -7
  116. umap/static/umap/locale/hu.js +25 -19
  117. umap/static/umap/locale/hu.json +25 -19
  118. umap/static/umap/locale/id.js +13 -7
  119. umap/static/umap/locale/id.json +13 -7
  120. umap/static/umap/locale/is.js +151 -145
  121. umap/static/umap/locale/is.json +151 -145
  122. umap/static/umap/locale/it.js +13 -7
  123. umap/static/umap/locale/it.json +13 -7
  124. umap/static/umap/locale/ja.js +13 -7
  125. umap/static/umap/locale/ja.json +13 -7
  126. umap/static/umap/locale/ko.js +13 -7
  127. umap/static/umap/locale/ko.json +13 -7
  128. umap/static/umap/locale/lt.js +13 -7
  129. umap/static/umap/locale/lt.json +13 -7
  130. umap/static/umap/locale/ms.js +13 -7
  131. umap/static/umap/locale/ms.json +13 -7
  132. umap/static/umap/locale/nl.js +12 -7
  133. umap/static/umap/locale/nl.json +12 -7
  134. umap/static/umap/locale/no.js +13 -7
  135. umap/static/umap/locale/no.json +13 -7
  136. umap/static/umap/locale/pl.js +13 -7
  137. umap/static/umap/locale/pl.json +13 -7
  138. umap/static/umap/locale/pl_PL.json +13 -7
  139. umap/static/umap/locale/pt.js +12 -7
  140. umap/static/umap/locale/pt.json +12 -7
  141. umap/static/umap/locale/pt_BR.js +13 -7
  142. umap/static/umap/locale/pt_BR.json +13 -7
  143. umap/static/umap/locale/pt_PT.js +13 -7
  144. umap/static/umap/locale/pt_PT.json +13 -7
  145. umap/static/umap/locale/ro.js +13 -7
  146. umap/static/umap/locale/ro.json +13 -7
  147. umap/static/umap/locale/ru.js +13 -7
  148. umap/static/umap/locale/ru.json +13 -7
  149. umap/static/umap/locale/sk_SK.js +13 -7
  150. umap/static/umap/locale/sk_SK.json +13 -7
  151. umap/static/umap/locale/sl.js +13 -7
  152. umap/static/umap/locale/sl.json +13 -7
  153. umap/static/umap/locale/sr.js +13 -7
  154. umap/static/umap/locale/sr.json +13 -7
  155. umap/static/umap/locale/sv.js +13 -7
  156. umap/static/umap/locale/sv.json +13 -7
  157. umap/static/umap/locale/th_TH.js +13 -7
  158. umap/static/umap/locale/th_TH.json +13 -7
  159. umap/static/umap/locale/tr.js +13 -7
  160. umap/static/umap/locale/tr.json +13 -7
  161. umap/static/umap/locale/uk_UA.js +13 -7
  162. umap/static/umap/locale/uk_UA.json +13 -7
  163. umap/static/umap/locale/vi.js +13 -7
  164. umap/static/umap/locale/vi.json +13 -7
  165. umap/static/umap/locale/vi_VN.json +13 -7
  166. umap/static/umap/locale/zh.js +13 -7
  167. umap/static/umap/locale/zh.json +13 -7
  168. umap/static/umap/locale/zh_CN.json +13 -7
  169. umap/static/umap/locale/zh_TW.Big5.json +13 -7
  170. umap/static/umap/locale/zh_TW.js +19 -13
  171. umap/static/umap/locale/zh_TW.json +19 -13
  172. umap/static/umap/map.css +58 -28
  173. umap/static/umap/unittests/sync.js +0 -57
  174. umap/static/umap/unittests/utils.js +47 -0
  175. umap/static/umap/vars.css +5 -2
  176. umap/static/umap/vendors/photon/leaflet.photon.js +3 -0
  177. umap/sync/payloads.py +3 -2
  178. umap/templates/auth/user_detail.html +1 -1
  179. umap/templates/auth/user_stars.html +1 -1
  180. umap/templates/umap/content.html +17 -12
  181. umap/templates/umap/home.html +7 -5
  182. umap/templates/umap/map_fragment.html +1 -1
  183. umap/templates/umap/map_list.html +20 -13
  184. umap/templates/umap/search.html +7 -3
  185. umap/templates/umap/search_bar.html +13 -11
  186. umap/templates/umap/team_detail.html +1 -1
  187. umap/tests/base.py +2 -1
  188. umap/tests/fixtures/remote_data.umap +55 -0
  189. umap/tests/fixtures/test_upload_data_with_iconurl.umap +122 -0
  190. umap/tests/integration/test_browser.py +1 -3
  191. umap/tests/integration/test_conditional_rules.py +3 -0
  192. umap/tests/integration/test_edit_datalayer.py +2 -7
  193. umap/tests/integration/test_edit_map.py +15 -0
  194. umap/tests/integration/test_edit_polygon.py +1 -2
  195. umap/tests/integration/test_import.py +59 -2
  196. umap/tests/integration/test_optimistic_merge.py +4 -3
  197. umap/tests/integration/test_owned_map.py +0 -1
  198. umap/tests/integration/test_save.py +2 -4
  199. umap/tests/integration/test_undo_redo.py +267 -0
  200. umap/tests/integration/test_websocket_sync.py +78 -11
  201. umap/tests/settings.py +1 -3
  202. umap/tests/test_datalayer_s3.py +1 -0
  203. umap/tests/test_map_views.py +1 -0
  204. umap/tests/test_views.py +34 -0
  205. umap/utils.py +1 -1
  206. umap/views.py +23 -2
  207. {umap_project-2.9.2.dist-info → umap_project-3.0.0.dist-info}/METADATA +13 -12
  208. {umap_project-2.9.2.dist-info → umap_project-3.0.0.dist-info}/RECORD +211 -213
  209. umap/static/umap/js/modules/saving.js +0 -52
  210. umap/static/umap/test/.eslintrc +0 -21
  211. umap/static/umap/test/DataLayer.js +0 -463
  212. umap/static/umap/test/Feature.js +0 -131
  213. umap/static/umap/test/Map.js +0 -37
  214. umap/static/umap/test/Marker.js +0 -126
  215. umap/static/umap/test/Polygon.js +0 -111
  216. umap/static/umap/test/Polyline.js +0 -286
  217. umap/static/umap/test/Util.js +0 -28
  218. umap/static/umap/test/_pre.js +0 -455
  219. umap/static/umap/test/index.html +0 -139
  220. {umap_project-2.9.2.dist-info → umap_project-3.0.0.dist-info}/WHEEL +0 -0
  221. {umap_project-2.9.2.dist-info → umap_project-3.0.0.dist-info}/entry_points.txt +0 -0
  222. {umap_project-2.9.2.dist-info → umap_project-3.0.0.dist-info}/licenses/LICENSE +0 -0
@@ -1,16 +1,22 @@
1
1
  import { DomEvent } from '../../../vendors/leaflet/leaflet-src.esm.js'
2
+ import { LineString, Point, Polygon } from '../data/features.js'
2
3
  import { translate } from '../i18n.js'
3
4
  import { WithTemplate } from '../utils.js'
4
- import ContextMenu from './contextmenu.js'
5
5
  import * as Utils from '../utils.js'
6
- import { Point, LineString, Polygon } from '../data/features.js'
6
+ import ContextMenu from './contextmenu.js'
7
7
 
8
8
  const TOP_BAR_TEMPLATE = `
9
9
  <div class="umap-main-edit-toolbox with-transition dark">
10
10
  <div class="umap-left-edit-toolbox" data-ref="left">
11
11
  <div class="logo"><a class="" href="/" title="${translate('Go to the homepage')}">uMap</a></div>
12
- <button class="map-name flat" type="button" data-ref="name"></button>
13
- <button class="share-status flat" type="button" data-ref="share"></button>
12
+ <button class="map-name flat truncate" type="button" data-ref="name"></button>
13
+ <button class="share-status flat truncate" type="button" data-ref="share"></button>
14
+ <button class="edit-undo round flat" type="button" data-ref="undo" disabled>
15
+ <i class="icon icon-16 icon-undo"></i>
16
+ </button>
17
+ <button class="edit-redo round flat" type="button" data-ref="redo" disabled>
18
+ <i class="icon icon-16 icon-redo"></i>
19
+ </button>
14
20
  </div>
15
21
  <div class="umap-right-edit-toolbox" data-ref="right">
16
22
  <button class="connected-peers round" type="button" data-ref="peers">
@@ -19,18 +25,14 @@ const TOP_BAR_TEMPLATE = `
19
25
  </button>
20
26
  <button class="umap-user flat" type="button" data-ref="user">
21
27
  <i class="icon icon-16 icon-profile"></i>
22
- <span class="username" data-ref="username"></span>
28
+ <span class="username truncate" data-ref="username"></span>
23
29
  </button>
24
30
  <button class="umap-help-link flat" type="button" title="${translate('Help')}" data-ref="help">${translate('Help')}</button>
25
- <button class="edit-cancel round" type="button" data-ref="cancel">
26
- <i class="icon icon-16 icon-restore"></i>
27
- <span class="">${translate('Cancel edits')}</span>
28
- </button>
29
- <button class="edit-disable round" type="button" data-ref="view">
31
+ <button class="edit-disable round disabled-on-dirty" type="button" data-ref="view">
30
32
  <i class="icon icon-16 icon-eye"></i>
31
- <span class="">${translate('View')}</span>
33
+ <span>${translate('View')}</span>
32
34
  </button>
33
- <button class="edit-save button round" type="button" data-ref="save">
35
+ <button class="edit-save button round enabled-on-dirty" type="button" data-ref="save">
34
36
  <i class="icon icon-16 icon-save"></i>
35
37
  <i class="icon icon-16 icon-save-disabled"></i>
36
38
  <span hidden data-ref="saveLabel">${translate('Save')}</span>
@@ -118,11 +120,21 @@ export class TopBar extends WithTemplate {
118
120
  })
119
121
 
120
122
  this.elements.help.addEventListener('click', () => this._umap.help.showGetStarted())
121
- this.elements.cancel.addEventListener('click', () => this._umap.askForReset())
122
- this.elements.cancel.addEventListener('mouseover', () => {
123
+ this.elements.redo.addEventListener('click', () => this._umap.redo())
124
+ this.elements.undo.addEventListener('click', () => this._umap.undo())
125
+ this.elements.undo.addEventListener('mouseover', () => {
126
+ this._umap.tooltip.open({
127
+ content: this._umap.help.displayLabel('UNDO'),
128
+ anchor: this.elements.undo,
129
+ position: 'bottom',
130
+ delay: 500,
131
+ duration: 5000,
132
+ })
133
+ })
134
+ this.elements.redo.addEventListener('mouseover', () => {
123
135
  this._umap.tooltip.open({
124
- content: this._umap.help.displayLabel('CANCEL'),
125
- anchor: this.elements.cancel,
136
+ content: this._umap.help.displayLabel('REDO'),
137
+ anchor: this.elements.redo,
126
138
  position: 'bottom',
127
139
  delay: 500,
128
140
  duration: 5000,
@@ -154,9 +166,10 @@ export class TopBar extends WithTemplate {
154
166
  redraw() {
155
167
  const syncEnabled = this._umap.getProperty('syncEnabled')
156
168
  this.elements.peers.hidden = !syncEnabled
157
- this.elements.cancel.hidden = syncEnabled
169
+ this.elements.view.disabled = this._umap.sync._undoManager.isDirty()
158
170
  this.elements.saveLabel.hidden = this._umap.permissions.isDraft()
159
171
  this.elements.saveDraftLabel.hidden = !this._umap.permissions.isDraft()
172
+ this._umap.sync._undoManager.toggleState()
160
173
  }
161
174
  }
162
175
 
@@ -167,6 +180,7 @@ const BOTTOM_BAR_TEMPLATE = `
167
180
  <button class="umap-about-link flat" type="button" title="${translate('Open caption')}" data-ref="caption">${translate('Open caption')}</button>
168
181
  <button class="umap-open-browser-link flat" type="button" title="${translate('Browse data')}" data-ref="browse">${translate('Browse data')}</button>
169
182
  <button class="umap-open-browser-link flat" type="button" title="${translate('Filter data')}" data-ref="filter">${translate('Filter data')}</button>
183
+ <select data-ref=layers></select>
170
184
  </div>
171
185
  `
172
186
 
@@ -189,6 +203,14 @@ export class BottomBar extends WithTemplate {
189
203
  this._umap.openBrowser('filters')
190
204
  )
191
205
  this._slideshow.renderToolbox(this.element)
206
+ this.elements.layers.addEventListener('change', () => {
207
+ const select = this.elements.layers
208
+ const selected = select.options[select.selectedIndex].value
209
+ if (!selected) return
210
+ this._umap.eachDataLayer((datalayer) => {
211
+ datalayer.toggle(datalayer.id === selected)
212
+ })
213
+ })
192
214
  this.redraw()
193
215
  }
194
216
 
@@ -201,6 +223,27 @@ export class BottomBar extends WithTemplate {
201
223
  this.elements.caption.hidden = !showMenus
202
224
  this.elements.browse.hidden = !showMenus
203
225
  this.elements.filter.hidden = !showMenus || !this._umap.properties.facetKey
226
+ this.buildDataLayerSwitcher()
227
+ }
228
+
229
+ buildDataLayerSwitcher() {
230
+ this.elements.layers.innerHTML = ''
231
+ const datalayers = this._umap.datalayersIndex.filter((d) => d.options.inCaption)
232
+ if (datalayers.length < 2) {
233
+ this.elements.layers.hidden = true
234
+ } else {
235
+ this.elements.layers.appendChild(Utils.loadTemplate(`<option value=""></option>`))
236
+ this.elements.layers.hidden = false
237
+ const visible = datalayers.filter((datalayer) => datalayer.isVisible())
238
+ for (const datalayer of datalayers) {
239
+ const selected = visible.length === 1 && datalayer.isVisible() ? 'selected' : ''
240
+ this.elements.layers.appendChild(
241
+ Utils.loadTemplate(
242
+ `<option value="${datalayer.id}" ${selected}>${datalayer.getName()}</option>`
243
+ )
244
+ )
245
+ }
246
+ }
204
247
  }
205
248
  }
206
249
 
@@ -240,10 +283,7 @@ export class EditBar extends WithTemplate {
240
283
  DomEvent.disableClickPropagation(this.element)
241
284
  this._onClick('marker', () => this._leafletMap.editTools.startMarker())
242
285
  this._onClick('polyline', () => this._leafletMap.editTools.startPolyline())
243
- this._onClick('multiline', () => {
244
- console.log('click click')
245
- this._umap.editedFeature.ui.editor.newShape()
246
- })
286
+ this._onClick('multiline', () => this._umap.editedFeature.ui.editor.newShape())
247
287
  this._onClick('polygon', () => this._leafletMap.editTools.startPolygon())
248
288
  this._onClick('multipolygon', () => this._umap.editedFeature.ui.editor.newShape())
249
289
  this._onClick('caption', () => this._umap.editCaption())
@@ -1,7 +1,7 @@
1
1
  import { DomEvent } from '../../../vendors/leaflet/leaflet-src.esm.js'
2
2
  import { translate } from '../i18n.js'
3
- import { Positioned } from './base.js'
4
3
  import * as Utils from '../utils.js'
4
+ import { Positioned } from './base.js'
5
5
 
6
6
  export default class Tooltip extends Positioned {
7
7
  constructor(parent) {