Skip to content

Commit dbf0179

Browse files
committed
cleanup sharebox changes
* "data" moved to helptext * drop css introduced in previous draft * prettier.js
1 parent 3f6c705 commit dbf0179

File tree

4 files changed

+17
-10
lines changed

4 files changed

+17
-10
lines changed

umap/static/umap/base.css

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -227,8 +227,7 @@ button.flat,
227227
font-size: 10px;
228228
border-radius: 0 2px;
229229
}
230-
.content .helptext,
231-
#umap-ui-container .help-text {
230+
.content .helptext {
232231
background-color: #eee;
233232
color: #000;
234233
}
@@ -410,7 +409,6 @@ input.switch:checked ~ label:after {
410409
.umap-multiplechoice.by5 {
411410
grid-template-columns: 1fr 1fr 1fr;
412411
}
413-
.button-bar.by4,
414412
.umap-multiplechoice.by4 {
415413
grid-template-columns: 1fr 1fr 1fr 1fr;
416414
}

umap/static/umap/js/umap.controls.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1069,7 +1069,6 @@ L.U.TileLayerControl = L.Control.IconLayers.extend({
10691069
L.Control.IconLayers.prototype.setLayers.call(this, layers.slice(0, maxShown))
10701070
if (this.map.selected_tilelayer) this.setActiveLayer(this.map.selected_tilelayer)
10711071
},
1072-
10731072
})
10741073

10751074
/* Used in edit mode to define the default tilelayer */

umap/static/umap/js/umap.share.js

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,12 @@ L.U.Share = L.Class.extend({
5555
() => navigator.clipboard.writeText(this.mapUrl.value),
5656
this
5757
)
58-
const mapUrlLabel = L.DomUtil.add('label', '', this.container, L._('Link to view the map'))
58+
const mapUrlLabel = L.DomUtil.add(
59+
'label',
60+
'',
61+
this.container,
62+
L._('Link to view the map')
63+
)
5964
this.mapUrl = L.DomUtil.create('input', 'umap-share-url', mapUrlLabel)
6065
this.mapUrl.type = 'text'
6166
this.mapUrl.readOnly = true
@@ -80,27 +85,32 @@ L.U.Share = L.Class.extend({
8085
L.DomUtil.create('hr', '', this.container)
8186

8287
L.DomUtil.add('h4', '', this.container, L._('Download'))
83-
L.DomUtil.add('small', 'label', this.container, L._('Only visible layers'))
88+
L.DomUtil.add('small', 'label', this.container, L._("Only visible layers' data"))
8489
for (const key in this.EXPORT_TYPES) {
8590
if (this.EXPORT_TYPES.hasOwnProperty(key)) {
8691
L.DomUtil.createButton(
8792
'download-file',
8893
this.container,
89-
this.EXPORT_TYPES[key].name || key + ' data',
94+
this.EXPORT_TYPES[key].name || key,
9095
() => this.download(key),
9196
this
9297
)
9398
}
9499
}
95100
L.DomUtil.create('div', 'vspace', this.container)
96-
L.DomUtil.add('small', 'label', this.container, L._('All data and settings of the map'))
101+
L.DomUtil.add(
102+
'small',
103+
'label',
104+
this.container,
105+
L._('All data and settings of the map')
106+
)
97107
const downloadUrl = L.Util.template(this.map.options.urls.map_download, {
98108
map_id: this.map.options.umap_id,
99109
})
100110
const link = L.DomUtil.createLink(
101111
'download-backup',
102112
this.container,
103-
L._('Download full backup'),
113+
L._('full backup'),
104114
downloadUrl
105115
)
106116
let name = this.map.options.name || 'data'

umap/tests/integration/test_export_map.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
def test_umap_export(map, live_server, datalayer, page):
1111
page.goto(f"{live_server.url}{map.get_absolute_url()}?share")
12-
link = page.get_by_role("link", name="Download full backup")
12+
link = page.get_by_role("link", name="full backup")
1313
expect(link).to_be_visible()
1414
with page.expect_download() as download_info:
1515
link.click()

0 commit comments

Comments
 (0)