umap-project 2.8.0__py3-none-any.whl → 2.8.0a1__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 +1 -1
- umap/locale/en/LC_MESSAGES/django.po +13 -13
- umap/management/commands/empty_trash.py +2 -5
- umap/static/umap/css/form.css +0 -3
- umap/static/umap/js/modules/data/features.js +4 -19
- umap/static/umap/js/modules/data/layer.js +19 -41
- umap/static/umap/js/modules/importer.js +20 -65
- umap/static/umap/js/modules/rendering/icon.js +1 -2
- umap/static/umap/js/modules/rendering/map.js +7 -7
- umap/static/umap/js/modules/rendering/popup.js +10 -9
- umap/static/umap/js/modules/rendering/template.js +9 -53
- umap/static/umap/js/modules/rendering/ui.js +2 -6
- umap/static/umap/js/modules/request.js +2 -2
- umap/static/umap/js/modules/schema.js +0 -1
- umap/static/umap/js/modules/ui/dialog.js +0 -5
- umap/static/umap/js/modules/umap.js +10 -33
- umap/static/umap/js/modules/utils.js +0 -2
- umap/static/umap/js/umap.controls.js +4 -7
- umap/static/umap/js/umap.forms.js +0 -44
- umap/static/umap/locale/en.js +1 -3
- umap/static/umap/locale/en.json +1 -3
- umap/static/umap/locale/fr.js +1 -3
- umap/static/umap/locale/fr.json +1 -3
- umap/static/umap/map.css +166 -34
- umap/static/umap/vars.css +1 -0
- umap/templates/base.html +0 -2
- umap/templates/umap/components/alerts/alert.html +0 -4
- umap/templates/umap/css.html +0 -3
- umap/templates/umap/js.html +0 -2
- umap/templates/umap/map_init.html +0 -2
- umap/templates/umap/user_dashboard.html +0 -2
- umap/tests/integration/test_edit_datalayer.py +0 -11
- umap/tests/integration/test_import.py +1 -20
- umap/tests/test_team_views.py +1 -35
- umap/tests/test_views.py +74 -0
- umap/views.py +15 -20
- {umap_project-2.8.0.dist-info → umap_project-2.8.0a1.dist-info}/METADATA +1 -1
- {umap_project-2.8.0.dist-info → umap_project-2.8.0a1.dist-info}/RECORD +41 -44
- umap/settings/local_s3.py +0 -45
- umap/tests/fixtures/test_upload_simple_marker.json +0 -19
- umap/tests/test_dashboard.py +0 -82
- {umap_project-2.8.0.dist-info → umap_project-2.8.0a1.dist-info}/WHEEL +0 -0
- {umap_project-2.8.0.dist-info → umap_project-2.8.0a1.dist-info}/entry_points.txt +0 -0
- {umap_project-2.8.0.dist-info → umap_project-2.8.0a1.dist-info}/licenses/LICENSE +0 -0
|
@@ -6,7 +6,6 @@ const TEMPLATE = `
|
|
|
6
6
|
<form method="dialog" data-ref="form">
|
|
7
7
|
<ul class="buttons">
|
|
8
8
|
<li><i class="icon icon-16 icon-close" data-close></i></li>
|
|
9
|
-
<li hidden data-ref="back"><i class="icon icon-16 icon-back"></i></li>
|
|
10
9
|
</ul>
|
|
11
10
|
<h3 data-ref="message" id="${Math.round(Date.now()).toString(36)}"></h3>
|
|
12
11
|
<fieldset data-ref="fieldset" role="document">
|
|
@@ -124,10 +123,6 @@ export default class Dialog extends WithTemplate {
|
|
|
124
123
|
} else {
|
|
125
124
|
this.elements.template.innerHTML = dialog.template || ''
|
|
126
125
|
}
|
|
127
|
-
this.elements.back.hidden = !dialog.back
|
|
128
|
-
if (dialog.back) {
|
|
129
|
-
this.elements.back.addEventListener('click', dialog.back)
|
|
130
|
-
}
|
|
131
126
|
|
|
132
127
|
this.focusable = this.getFocusable()
|
|
133
128
|
this.hasFormData = this.elements.fieldset.elements.length > 0
|
|
@@ -218,14 +218,6 @@ export default class Umap extends ServerStored {
|
|
|
218
218
|
this.fire('seteditedfeature')
|
|
219
219
|
}
|
|
220
220
|
|
|
221
|
-
get activeFeature() {
|
|
222
|
-
return this._activeFeature
|
|
223
|
-
}
|
|
224
|
-
|
|
225
|
-
set activeFeature(feature) {
|
|
226
|
-
this._activeFeature = feature
|
|
227
|
-
}
|
|
228
|
-
|
|
229
221
|
setPropertiesFromQueryString() {
|
|
230
222
|
const asBoolean = (key) => {
|
|
231
223
|
const value = this.searchParams.get(key)
|
|
@@ -324,14 +316,12 @@ export default class Umap extends ServerStored {
|
|
|
324
316
|
dataUrl = this.renderUrl(dataUrl)
|
|
325
317
|
dataUrl = this.proxyUrl(dataUrl)
|
|
326
318
|
const datalayer = this.createDataLayer()
|
|
327
|
-
await datalayer
|
|
328
|
-
.importFromUrl(dataUrl, dataFormat)
|
|
329
|
-
.then(() => datalayer.zoomTo())
|
|
319
|
+
await datalayer.importFromUrl(dataUrl, dataFormat)
|
|
330
320
|
}
|
|
331
321
|
} else if (data) {
|
|
332
322
|
data = decodeURIComponent(data)
|
|
333
323
|
const datalayer = this.createDataLayer()
|
|
334
|
-
await datalayer.importRaw(data, dataFormat)
|
|
324
|
+
await datalayer.importRaw(data, dataFormat)
|
|
335
325
|
}
|
|
336
326
|
}
|
|
337
327
|
|
|
@@ -578,11 +568,9 @@ export default class Umap extends ServerStored {
|
|
|
578
568
|
}
|
|
579
569
|
this.datalayersLoaded = true
|
|
580
570
|
this.fire('datalayersloaded')
|
|
581
|
-
const toLoad = []
|
|
582
571
|
for (const datalayer of this.datalayersIndex) {
|
|
583
|
-
if (datalayer.showAtLoad())
|
|
572
|
+
if (datalayer.showAtLoad()) await datalayer.show()
|
|
584
573
|
}
|
|
585
|
-
await Promise.all(toLoad)
|
|
586
574
|
this.dataloaded = true
|
|
587
575
|
this.fire('dataloaded')
|
|
588
576
|
}
|
|
@@ -653,12 +641,6 @@ export default class Umap extends ServerStored {
|
|
|
653
641
|
// have changed, we'll be more subtil when we'll remove the
|
|
654
642
|
// save action
|
|
655
643
|
this.render(['name', 'user', 'permissions'])
|
|
656
|
-
if (!this._leafletMap.listens('saved')) {
|
|
657
|
-
// When we save only layers, we don't have the map feedback message
|
|
658
|
-
this._leafletMap.on('saved', () => {
|
|
659
|
-
Alert.success(translate('Map has been saved!'))
|
|
660
|
-
})
|
|
661
|
-
}
|
|
662
644
|
this.fire('saved')
|
|
663
645
|
}
|
|
664
646
|
|
|
@@ -1117,8 +1099,8 @@ export default class Umap extends ServerStored {
|
|
|
1117
1099
|
}
|
|
1118
1100
|
this.ensurePanesOrder()
|
|
1119
1101
|
this._leafletMap.initTileLayers()
|
|
1102
|
+
this.isDirty = false
|
|
1120
1103
|
this.onDataLayersChanged()
|
|
1121
|
-
this.isDirty = !this.id
|
|
1122
1104
|
}
|
|
1123
1105
|
|
|
1124
1106
|
async save() {
|
|
@@ -1200,7 +1182,7 @@ export default class Umap extends ServerStored {
|
|
|
1200
1182
|
geometry() {
|
|
1201
1183
|
/* Return a GeoJSON geometry Object */
|
|
1202
1184
|
const latlng = this._leafletMap.latLng(
|
|
1203
|
-
this.
|
|
1185
|
+
this._leafletMap.options.center || this._leafletMap.getCenter()
|
|
1204
1186
|
)
|
|
1205
1187
|
return {
|
|
1206
1188
|
type: 'Point',
|
|
@@ -1442,14 +1424,9 @@ export default class Umap extends ServerStored {
|
|
|
1442
1424
|
const row = DomUtil.create('li', 'orderable', ul)
|
|
1443
1425
|
DomUtil.createIcon(row, 'icon-drag', translate('Drag to reorder'))
|
|
1444
1426
|
datalayer.renderToolbox(row)
|
|
1445
|
-
const
|
|
1446
|
-
datalayer,
|
|
1447
|
-
[['options.name', { handler: 'EditableText' }]],
|
|
1448
|
-
{ className: 'umap-form-inline' }
|
|
1449
|
-
)
|
|
1450
|
-
const form = builder.build()
|
|
1451
|
-
row.appendChild(form)
|
|
1427
|
+
const title = DomUtil.add('span', '', row, datalayer.options.name)
|
|
1452
1428
|
row.classList.toggle('off', !datalayer.isVisible())
|
|
1429
|
+
title.textContent = datalayer.options.name
|
|
1453
1430
|
row.dataset.id = stamp(datalayer)
|
|
1454
1431
|
})
|
|
1455
1432
|
const onReorder = (src, dst, initialIndex, finalIndex) => {
|
|
@@ -1537,7 +1514,7 @@ export default class Umap extends ServerStored {
|
|
|
1537
1514
|
processFileToImport(file, layer, type) {
|
|
1538
1515
|
type = type || Utils.detectFileType(file)
|
|
1539
1516
|
if (!type) {
|
|
1540
|
-
Alert.error(
|
|
1517
|
+
U.Alert.error(
|
|
1541
1518
|
translate('Unable to detect format of file {filename}', {
|
|
1542
1519
|
filename: file.name,
|
|
1543
1520
|
})
|
|
@@ -1683,8 +1660,8 @@ export default class Umap extends ServerStored {
|
|
|
1683
1660
|
}
|
|
1684
1661
|
|
|
1685
1662
|
_setCenterAndZoom() {
|
|
1686
|
-
this.
|
|
1687
|
-
this.
|
|
1663
|
+
this._leafletMap.options.center = this._leafletMap.getCenter()
|
|
1664
|
+
this._leafletMap.options.zoom = this._leafletMap.getZoom()
|
|
1688
1665
|
this.isDirty = true
|
|
1689
1666
|
this._defaultExtent = false
|
|
1690
1667
|
}
|
|
@@ -683,13 +683,10 @@ U.TileLayerChooser = L.Control.extend({
|
|
|
683
683
|
L.DomEvent.on(
|
|
684
684
|
el,
|
|
685
685
|
'click',
|
|
686
|
-
()
|
|
686
|
+
function () {
|
|
687
687
|
this.map.selectTileLayer(tilelayer)
|
|
688
688
|
this.map._controls.tilelayers.setLayers()
|
|
689
|
-
if (options?.
|
|
690
|
-
this.map._umap.properties.tilelayer = tilelayer.toJSON()
|
|
691
|
-
this.map._umap.isDirty = true
|
|
692
|
-
}
|
|
689
|
+
if (options?.callback) options.callback(tilelayer)
|
|
693
690
|
},
|
|
694
691
|
this
|
|
695
692
|
)
|
|
@@ -945,11 +942,11 @@ L.Control.Loading.include({
|
|
|
945
942
|
},
|
|
946
943
|
|
|
947
944
|
_showIndicator: function () {
|
|
948
|
-
this._map._container
|
|
945
|
+
L.DomUtil.addClass(this._map._container, 'umap-loading')
|
|
949
946
|
},
|
|
950
947
|
|
|
951
948
|
_hideIndicator: function () {
|
|
952
|
-
this._map._container
|
|
949
|
+
L.DomUtil.removeClass(this._map._container, 'umap-loading')
|
|
953
950
|
},
|
|
954
951
|
})
|
|
955
952
|
|
|
@@ -259,35 +259,6 @@ L.FormBuilder.CheckBox.include({
|
|
|
259
259
|
},
|
|
260
260
|
})
|
|
261
261
|
|
|
262
|
-
L.FormBuilder.EditableText = L.FormBuilder.Element.extend({
|
|
263
|
-
build: function () {
|
|
264
|
-
this.input = L.DomUtil.create('span', this.options.className || '', this.parentNode)
|
|
265
|
-
this.input.contentEditable = true
|
|
266
|
-
this.fetch()
|
|
267
|
-
L.DomEvent.on(this.input, 'input', this.sync, this)
|
|
268
|
-
L.DomEvent.on(this.input, 'keypress', this.onKeyPress, this)
|
|
269
|
-
},
|
|
270
|
-
|
|
271
|
-
getParentNode: function () {
|
|
272
|
-
return this.form
|
|
273
|
-
},
|
|
274
|
-
|
|
275
|
-
value: function () {
|
|
276
|
-
return this.input.textContent
|
|
277
|
-
},
|
|
278
|
-
|
|
279
|
-
fetch: function () {
|
|
280
|
-
this.input.textContent = this.toHTML()
|
|
281
|
-
},
|
|
282
|
-
|
|
283
|
-
onKeyPress: function (event) {
|
|
284
|
-
if (event.keyCode === 13) {
|
|
285
|
-
event.preventDefault()
|
|
286
|
-
this.input.blur()
|
|
287
|
-
}
|
|
288
|
-
},
|
|
289
|
-
})
|
|
290
|
-
|
|
291
262
|
L.FormBuilder.ColorPicker = L.FormBuilder.Input.extend({
|
|
292
263
|
colors: U.COLORS,
|
|
293
264
|
getParentNode: function () {
|
|
@@ -1221,21 +1192,6 @@ U.FormBuilder = L.FormBuilder.extend({
|
|
|
1221
1192
|
}
|
|
1222
1193
|
},
|
|
1223
1194
|
|
|
1224
|
-
getter: function (field) {
|
|
1225
|
-
const path = field.split('.')
|
|
1226
|
-
let value = this.obj
|
|
1227
|
-
let sub
|
|
1228
|
-
for (sub of path) {
|
|
1229
|
-
try {
|
|
1230
|
-
value = value[sub]
|
|
1231
|
-
} catch {
|
|
1232
|
-
console.log(field)
|
|
1233
|
-
}
|
|
1234
|
-
}
|
|
1235
|
-
if (value === undefined) values = U.SCHEMA[sub]?.default
|
|
1236
|
-
return value
|
|
1237
|
-
},
|
|
1238
|
-
|
|
1239
1195
|
finish: (event) => {
|
|
1240
1196
|
event.helper?.input?.blur()
|
|
1241
1197
|
},
|
umap/static/umap/locale/en.js
CHANGED
|
@@ -520,9 +520,7 @@ const locale = {
|
|
|
520
520
|
"Import helpers": "Import helpers",
|
|
521
521
|
"Import helpers will fill the URL field for you.": "Import helpers will fill the URL field for you.",
|
|
522
522
|
"Wikipedia": "Wikipedia",
|
|
523
|
-
"Save draft": "Save draft"
|
|
524
|
-
"No data has been found for import": "No data has been found for import",
|
|
525
|
-
"Successfully imported {count} feature(s)": "Successfully imported {count} feature(s)"
|
|
523
|
+
"Save draft": "Save draft"
|
|
526
524
|
}
|
|
527
525
|
L.registerLocale("en", locale)
|
|
528
526
|
L.setLocale("en")
|
umap/static/umap/locale/en.json
CHANGED
|
@@ -520,7 +520,5 @@
|
|
|
520
520
|
"Import helpers": "Import helpers",
|
|
521
521
|
"Import helpers will fill the URL field for you.": "Import helpers will fill the URL field for you.",
|
|
522
522
|
"Wikipedia": "Wikipedia",
|
|
523
|
-
"Save draft": "Save draft"
|
|
524
|
-
"No data has been found for import": "No data has been found for import",
|
|
525
|
-
"Successfully imported {count} feature(s)": "Successfully imported {count} feature(s)"
|
|
523
|
+
"Save draft": "Save draft"
|
|
526
524
|
}
|
umap/static/umap/locale/fr.js
CHANGED
|
@@ -520,9 +520,7 @@ const locale = {
|
|
|
520
520
|
"Import helpers": "Assistants d'import",
|
|
521
521
|
"Import helpers will fill the URL field for you.": "Les assistants d'import vont renseigner le champ URL pour vous.",
|
|
522
522
|
"Wikipedia": "Wikipedia",
|
|
523
|
-
"Save draft": "Enregistrer le brouillon"
|
|
524
|
-
"No data has been found for import": "Aucunes données à importer",
|
|
525
|
-
"Successfully imported {count} feature(s)": "{count} élément(s) ajouté(s) à la carte"
|
|
523
|
+
"Save draft": "Enregistrer le brouillon"
|
|
526
524
|
}
|
|
527
525
|
L.registerLocale("fr", locale)
|
|
528
526
|
L.setLocale("fr")
|
umap/static/umap/locale/fr.json
CHANGED
|
@@ -520,7 +520,5 @@
|
|
|
520
520
|
"Import helpers": "Assistants d'import",
|
|
521
521
|
"Import helpers will fill the URL field for you.": "Les assistants d'import vont renseigner le champ URL pour vous.",
|
|
522
522
|
"Wikipedia": "Wikipedia",
|
|
523
|
-
"Save draft": "Enregistrer le brouillon"
|
|
524
|
-
"No data has been found for import": "Aucunes données à importer",
|
|
525
|
-
"Successfully imported {count} feature(s)": "{count} élément(s) ajouté(s) à la carte"
|
|
523
|
+
"Save draft": "Enregistrer le brouillon"
|
|
526
524
|
}
|
umap/static/umap/map.css
CHANGED
|
@@ -924,6 +924,7 @@ a.umap-control-caption,
|
|
|
924
924
|
width: 2px;
|
|
925
925
|
}
|
|
926
926
|
.umap-icon-active {
|
|
927
|
+
z-index: var(--zindex-icon-active)!important;
|
|
927
928
|
opacity: 1.0!important;
|
|
928
929
|
}
|
|
929
930
|
.umap-edit-enabled .readonly {
|
|
@@ -934,42 +935,173 @@ a.umap-control-caption,
|
|
|
934
935
|
/* ********************************* */
|
|
935
936
|
/* Ajax loader */
|
|
936
937
|
/* ********************************* */
|
|
938
|
+
.umap-loading .umap-loader
|
|
939
|
+
{
|
|
940
|
+
display: block;
|
|
941
|
+
-webkit-animation: shift-rightwards 3s ease-in-out infinite;
|
|
942
|
+
-moz-animation: shift-rightwards 3s ease-in-out infinite;
|
|
943
|
+
-ms-animation: shift-rightwards 3s ease-in-out infinite;
|
|
944
|
+
-o-animation: shift-rightwards 3s ease-in-out infinite;
|
|
945
|
+
animation: shift-rightwards 3s ease-in-out infinite;
|
|
946
|
+
-webkit-animation-delay: .2s;
|
|
947
|
+
-moz-animation-delay: .2s;
|
|
948
|
+
-o-animation-delay: .2s;
|
|
949
|
+
animation-delay: .2s;
|
|
950
|
+
}
|
|
937
951
|
.umap-loader {
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
}
|
|
951
|
-
.umap-loader::after {
|
|
952
|
-
content: '';
|
|
953
|
-
box-sizing: border-box;
|
|
954
|
-
width: 0;
|
|
955
|
-
height: 4.8px;
|
|
956
|
-
background: var(--color-darkerGray);
|
|
957
|
-
position: absolute;
|
|
958
|
-
top: 0;
|
|
959
|
-
left: 0;
|
|
960
|
-
animation: animFw 10s linear infinite;
|
|
961
|
-
}
|
|
962
|
-
|
|
963
|
-
@keyframes animFw {
|
|
964
|
-
0% {
|
|
965
|
-
width: 0;
|
|
966
|
-
}
|
|
967
|
-
100% {
|
|
968
|
-
width: 100%;
|
|
969
|
-
}
|
|
952
|
+
position: absolute;
|
|
953
|
+
display: none;
|
|
954
|
+
top: 0;
|
|
955
|
+
left: 0;
|
|
956
|
+
right: 0;
|
|
957
|
+
height: 4px;
|
|
958
|
+
z-index: var(--zindex-loader);
|
|
959
|
+
background-color: #79c1c0 !important;
|
|
960
|
+
-webkit-transform: translateX(100%);
|
|
961
|
+
-moz-transform: translateX(100%);
|
|
962
|
+
-o-transform: translateX(100%);
|
|
963
|
+
transform: translateX(100%);
|
|
970
964
|
}
|
|
971
|
-
|
|
972
|
-
|
|
965
|
+
|
|
966
|
+
|
|
967
|
+
@-webkit-keyframes shift-rightwards
|
|
968
|
+
{
|
|
969
|
+
0%
|
|
970
|
+
{
|
|
971
|
+
-webkit-transform:translateX(-100%);
|
|
972
|
+
-moz-transform:translateX(-100%);
|
|
973
|
+
-o-transform:translateX(-100%);
|
|
974
|
+
transform:translateX(-100%);
|
|
975
|
+
}
|
|
976
|
+
|
|
977
|
+
40%
|
|
978
|
+
{
|
|
979
|
+
-webkit-transform:translateX(0%);
|
|
980
|
+
-moz-transform:translateX(0%);
|
|
981
|
+
-o-transform:translateX(0%);
|
|
982
|
+
transform:translateX(0%);
|
|
983
|
+
}
|
|
984
|
+
|
|
985
|
+
60%
|
|
986
|
+
{
|
|
987
|
+
-webkit-transform:translateX(0%);
|
|
988
|
+
-moz-transform:translateX(0%);
|
|
989
|
+
-o-transform:translateX(0%);
|
|
990
|
+
transform:translateX(0%);
|
|
991
|
+
}
|
|
992
|
+
|
|
993
|
+
100%
|
|
994
|
+
{
|
|
995
|
+
-webkit-transform:translateX(100%);
|
|
996
|
+
-moz-transform:translateX(100%);
|
|
997
|
+
-o-transform:translateX(100%);
|
|
998
|
+
transform:translateX(100%);
|
|
999
|
+
}
|
|
1000
|
+
|
|
1001
|
+
}
|
|
1002
|
+
@-moz-keyframes shift-rightwards
|
|
1003
|
+
{
|
|
1004
|
+
0%
|
|
1005
|
+
{
|
|
1006
|
+
-webkit-transform:translateX(-100%);
|
|
1007
|
+
-moz-transform:translateX(-100%);
|
|
1008
|
+
-o-transform:translateX(-100%);
|
|
1009
|
+
transform:translateX(-100%);
|
|
1010
|
+
}
|
|
1011
|
+
|
|
1012
|
+
40%
|
|
1013
|
+
{
|
|
1014
|
+
-webkit-transform:translateX(0%);
|
|
1015
|
+
-moz-transform:translateX(0%);
|
|
1016
|
+
-o-transform:translateX(0%);
|
|
1017
|
+
transform:translateX(0%);
|
|
1018
|
+
}
|
|
1019
|
+
|
|
1020
|
+
60%
|
|
1021
|
+
{
|
|
1022
|
+
-webkit-transform:translateX(0%);
|
|
1023
|
+
-moz-transform:translateX(0%);
|
|
1024
|
+
-o-transform:translateX(0%);
|
|
1025
|
+
transform:translateX(0%);
|
|
1026
|
+
}
|
|
1027
|
+
|
|
1028
|
+
100%
|
|
1029
|
+
{
|
|
1030
|
+
-webkit-transform:translateX(100%);
|
|
1031
|
+
-moz-transform:translateX(100%);
|
|
1032
|
+
-o-transform:translateX(100%);
|
|
1033
|
+
transform:translateX(100%);
|
|
1034
|
+
}
|
|
1035
|
+
|
|
1036
|
+
}
|
|
1037
|
+
@-o-keyframes shift-rightwards
|
|
1038
|
+
{
|
|
1039
|
+
0%
|
|
1040
|
+
{
|
|
1041
|
+
-webkit-transform:translateX(-100%);
|
|
1042
|
+
-moz-transform:translateX(-100%);
|
|
1043
|
+
-o-transform:translateX(-100%);
|
|
1044
|
+
transform:translateX(-100%);
|
|
1045
|
+
}
|
|
1046
|
+
|
|
1047
|
+
40%
|
|
1048
|
+
{
|
|
1049
|
+
-webkit-transform:translateX(0%);
|
|
1050
|
+
-moz-transform:translateX(0%);
|
|
1051
|
+
-o-transform:translateX(0%);
|
|
1052
|
+
transform:translateX(0%);
|
|
1053
|
+
}
|
|
1054
|
+
|
|
1055
|
+
60%
|
|
1056
|
+
{
|
|
1057
|
+
-webkit-transform:translateX(0%);
|
|
1058
|
+
-moz-transform:translateX(0%);
|
|
1059
|
+
-o-transform:translateX(0%);
|
|
1060
|
+
transform:translateX(0%);
|
|
1061
|
+
}
|
|
1062
|
+
|
|
1063
|
+
100%
|
|
1064
|
+
{
|
|
1065
|
+
-webkit-transform:translateX(100%);
|
|
1066
|
+
-moz-transform:translateX(100%);
|
|
1067
|
+
-o-transform:translateX(100%);
|
|
1068
|
+
transform:translateX(100%);
|
|
1069
|
+
}
|
|
1070
|
+
|
|
1071
|
+
}
|
|
1072
|
+
@keyframes shift-rightwards
|
|
1073
|
+
{
|
|
1074
|
+
0%
|
|
1075
|
+
{
|
|
1076
|
+
-webkit-transform:translateX(-100%);
|
|
1077
|
+
-moz-transform:translateX(-100%);
|
|
1078
|
+
-o-transform:translateX(-100%);
|
|
1079
|
+
transform:translateX(-100%);
|
|
1080
|
+
}
|
|
1081
|
+
|
|
1082
|
+
40%
|
|
1083
|
+
{
|
|
1084
|
+
-webkit-transform:translateX(0%);
|
|
1085
|
+
-moz-transform:translateX(0%);
|
|
1086
|
+
-o-transform:translateX(0%);
|
|
1087
|
+
transform:translateX(0%);
|
|
1088
|
+
}
|
|
1089
|
+
|
|
1090
|
+
60%
|
|
1091
|
+
{
|
|
1092
|
+
-webkit-transform:translateX(0%);
|
|
1093
|
+
-moz-transform:translateX(0%);
|
|
1094
|
+
-o-transform:translateX(0%);
|
|
1095
|
+
transform:translateX(0%);
|
|
1096
|
+
}
|
|
1097
|
+
|
|
1098
|
+
100%
|
|
1099
|
+
{
|
|
1100
|
+
-webkit-transform:translateX(100%);
|
|
1101
|
+
-moz-transform:translateX(100%);
|
|
1102
|
+
-o-transform:translateX(100%);
|
|
1103
|
+
transform:translateX(100%);
|
|
1104
|
+
}
|
|
973
1105
|
}
|
|
974
1106
|
|
|
975
1107
|
/* *************************** */
|
umap/static/umap/vars.css
CHANGED
umap/templates/base.html
CHANGED
|
@@ -18,7 +18,6 @@
|
|
|
18
18
|
<meta name="viewport"
|
|
19
19
|
content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
|
|
20
20
|
{# See https://evilmartians.com/chronicles/how-to-favicon-in-2021-six-files-that-fit-most-needs #}
|
|
21
|
-
{% autoescape off %}
|
|
22
21
|
<link rel="icon"
|
|
23
22
|
href="{% static 'umap/favicons/favicon.ico' %}"
|
|
24
23
|
sizes="32x32">
|
|
@@ -29,7 +28,6 @@
|
|
|
29
28
|
href="{% static 'umap/favicons/apple-touch-icon.png' %}">
|
|
30
29
|
<!-- 180×180 -->
|
|
31
30
|
<link rel="manifest" href="/manifest.webmanifest">
|
|
32
|
-
{% endautoescape %}
|
|
33
31
|
</head>
|
|
34
32
|
<body class="{% block body_class %}{% endblock body_class %}">
|
|
35
33
|
{% block header %}
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
{% load i18n static %}
|
|
2
2
|
|
|
3
|
-
{% autoescape off %}
|
|
4
3
|
<style type="text/css">
|
|
5
4
|
@import "{% static 'umap/js/components/alerts/alert.css' %}";
|
|
6
5
|
</style>
|
|
7
|
-
{% endautoescape %}
|
|
8
6
|
<template id="umap-alert-template">
|
|
9
7
|
<div role="dialog" class="dark window umap-alert">
|
|
10
8
|
<div>
|
|
@@ -99,7 +97,6 @@
|
|
|
99
97
|
</div>
|
|
100
98
|
</template>
|
|
101
99
|
<umap-alert-conflict></umap-alert-conflict>
|
|
102
|
-
{% autoescape off %}
|
|
103
100
|
<script type="module">
|
|
104
101
|
import { register } from '{% static 'umap/js/components/base.js' %}'
|
|
105
102
|
import {
|
|
@@ -111,4 +108,3 @@
|
|
|
111
108
|
register(uMapAlertCreation, 'umap-alert-creation')
|
|
112
109
|
register(uMapAlertConflict, 'umap-alert-conflict')
|
|
113
110
|
</script>
|
|
114
|
-
{% endautoescape %}
|
umap/templates/umap/css.html
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
{% load static %}
|
|
2
2
|
|
|
3
|
-
{% autoescape off %}
|
|
4
|
-
|
|
5
3
|
<link rel="stylesheet"
|
|
6
4
|
href="{% static 'umap/vendors/leaflet/leaflet.css' %}" />
|
|
7
5
|
<link rel="stylesheet"
|
|
@@ -41,4 +39,3 @@
|
|
|
41
39
|
<link rel="stylesheet" href="{% static 'umap/css/tableeditor.css' %}" />
|
|
42
40
|
<link rel="stylesheet" href="{% static 'umap/css/bar.css' %}" />
|
|
43
41
|
<link rel="stylesheet" href="{% static 'umap/theme.css' %}" />
|
|
44
|
-
{% endautoescape %}
|
umap/templates/umap/js.html
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
{% load static %}
|
|
2
2
|
|
|
3
|
-
{% autoescape off %}
|
|
4
3
|
<script type="module"
|
|
5
4
|
src="{% static 'umap/vendors/leaflet/leaflet-src.esm.js' %}"
|
|
6
5
|
defer></script>
|
|
@@ -43,4 +42,3 @@
|
|
|
43
42
|
<script src="{% static 'umap/js/umap.forms.js' %}" defer></script>
|
|
44
43
|
<script src="{% static 'umap/js/umap.controls.js' %}" defer></script>
|
|
45
44
|
<script type="module" src="{% static 'umap/js/components/fragment.js' %}" defer></script>
|
|
46
|
-
{% endautoescape %}
|
|
@@ -46,9 +46,7 @@
|
|
|
46
46
|
{% block bottom_js %}
|
|
47
47
|
{{ block.super }}
|
|
48
48
|
<script type="module">
|
|
49
|
-
{% autoescape off %}
|
|
50
49
|
import Umap from '{% static "umap/js/modules/umap.js" %}'
|
|
51
|
-
{% endautoescape %}
|
|
52
50
|
const CACHE = {}
|
|
53
51
|
for (const mapOpener of document.querySelectorAll("button.map-opener")) {
|
|
54
52
|
mapOpener.addEventListener('click', (event) => {
|
|
@@ -221,14 +221,3 @@ def test_deleting_datalayer_should_remove_from_caption(
|
|
|
221
221
|
page.locator(".panel.right").get_by_title("Delete layer").click()
|
|
222
222
|
page.get_by_role("button", name="OK").click()
|
|
223
223
|
expect(panel.get_by_text("test datalayer")).to_be_hidden()
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
def test_can_edit_datalayer_name_in_list(live_server, openmap, datalayer, page):
|
|
227
|
-
page.goto(f"{live_server.url}{openmap.get_absolute_url()}?edit")
|
|
228
|
-
page.get_by_role("link", name="Manage layers").click()
|
|
229
|
-
page.get_by_text("test datalayer").click()
|
|
230
|
-
page.get_by_text("test datalayer").fill("test datalayer foobar")
|
|
231
|
-
page.get_by_role("button", name="Open browser").click()
|
|
232
|
-
expect(
|
|
233
|
-
page.locator(".panel.left").get_by_text("test datalayer foobar")
|
|
234
|
-
).to_be_visible()
|
|
@@ -9,6 +9,7 @@ from playwright.sync_api import expect
|
|
|
9
9
|
|
|
10
10
|
from umap.models import DataLayer
|
|
11
11
|
|
|
12
|
+
from ..base import mock_tiles
|
|
12
13
|
from .helpers import save_and_get_json
|
|
13
14
|
|
|
14
15
|
pytestmark = pytest.mark.django_db
|
|
@@ -764,23 +765,3 @@ def test_import_georss_from_textarea(tilelayer, live_server, page):
|
|
|
764
765
|
# A layer has been created
|
|
765
766
|
expect(layers).to_have_count(1)
|
|
766
767
|
expect(markers).to_have_count(1)
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
def test_import_from_multiple_files(live_server, page, tilelayer):
|
|
770
|
-
page.goto(f"{live_server.url}/map/new/")
|
|
771
|
-
page.get_by_title("Import data").click()
|
|
772
|
-
file_input = page.locator("input[type='file']")
|
|
773
|
-
with page.expect_file_chooser() as fc_info:
|
|
774
|
-
file_input.click()
|
|
775
|
-
file_chooser = fc_info.value
|
|
776
|
-
FIXTURES = Path(__file__).parent.parent / "fixtures"
|
|
777
|
-
paths = [
|
|
778
|
-
FIXTURES / "test_upload_data.json",
|
|
779
|
-
FIXTURES / "test_upload_simple_marker.json",
|
|
780
|
-
]
|
|
781
|
-
file_chooser.set_files(paths)
|
|
782
|
-
markers = page.locator(".leaflet-marker-icon")
|
|
783
|
-
expect(markers).to_have_count(0)
|
|
784
|
-
page.get_by_role("button", name="Import data", exact=True).click()
|
|
785
|
-
# Two in one file, one in the other
|
|
786
|
-
expect(markers).to_have_count(3)
|
umap/tests/test_team_views.py
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import pytest
|
|
2
2
|
from django.urls import reverse
|
|
3
3
|
|
|
4
|
-
from umap.models import
|
|
4
|
+
from umap.models import Team
|
|
5
5
|
|
|
6
6
|
pytestmark = pytest.mark.django_db
|
|
7
7
|
|
|
@@ -15,40 +15,6 @@ def test_can_see_team_maps(client, map, team):
|
|
|
15
15
|
assert map.name in response.content.decode()
|
|
16
16
|
|
|
17
17
|
|
|
18
|
-
@pytest.mark.parametrize("share_status", [Map.PRIVATE, Map.DRAFT])
|
|
19
|
-
def test_others_cannot_see_team_private_maps_in_team_page(
|
|
20
|
-
client, map, team, user, share_status
|
|
21
|
-
):
|
|
22
|
-
map.team = team
|
|
23
|
-
map.share_status = share_status
|
|
24
|
-
map.save()
|
|
25
|
-
url = reverse("team_maps", args=(team.pk,))
|
|
26
|
-
response = client.get(url)
|
|
27
|
-
assert response.status_code == 200
|
|
28
|
-
assert map.name not in response.content.decode()
|
|
29
|
-
# User is not in team
|
|
30
|
-
client.login(username=user.username, password="123123")
|
|
31
|
-
response = client.get(url)
|
|
32
|
-
assert response.status_code == 200
|
|
33
|
-
assert map.name not in response.content.decode()
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
@pytest.mark.parametrize("share_status", [Map.PRIVATE, Map.DRAFT])
|
|
37
|
-
def test_members_can_see_private_maps_in_team_page(
|
|
38
|
-
client, map, team, user, share_status
|
|
39
|
-
):
|
|
40
|
-
map.team = team
|
|
41
|
-
map.share_status = share_status
|
|
42
|
-
map.save()
|
|
43
|
-
user.teams.add(team)
|
|
44
|
-
user.save()
|
|
45
|
-
url = reverse("team_maps", args=(team.pk,))
|
|
46
|
-
client.login(username=user.username, password="123123")
|
|
47
|
-
response = client.get(url)
|
|
48
|
-
assert response.status_code == 200
|
|
49
|
-
assert map.name in response.content.decode()
|
|
50
|
-
|
|
51
|
-
|
|
52
18
|
def test_user_can_see_their_teams(client, team, user):
|
|
53
19
|
user.teams.add(team)
|
|
54
20
|
user.save()
|