wip: make that "browse data" opens the browser in expanded mode
And also add a "See layer" action in the context menu. I'm not totally sure it's the way to go, but it's closer to the current behaviour, and as a user a way missing a way to go straight to the extanded browser version.
This commit is contained in:
parent
05fd33deb7
commit
a6ed20b120
2 changed files with 22 additions and 19 deletions
|
@ -82,7 +82,6 @@ U.Map = L.Map.extend({
|
||||||
.split(',')
|
.split(',')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
let editedFeature = null
|
let editedFeature = null
|
||||||
const self = this
|
const self = this
|
||||||
try {
|
try {
|
||||||
|
@ -207,11 +206,9 @@ U.Map = L.Map.extend({
|
||||||
if (L.Util.queryString('share')) {
|
if (L.Util.queryString('share')) {
|
||||||
this.share.open()
|
this.share.open()
|
||||||
} else if (this.options.onLoadPanel === 'databrowser') {
|
} else if (this.options.onLoadPanel === 'databrowser') {
|
||||||
this.panel.mode = 'expanded'
|
this.openBrowser('expanded')
|
||||||
this.openBrowser()
|
|
||||||
} else if (this.options.onLoadPanel === 'datalayers') {
|
} else if (this.options.onLoadPanel === 'datalayers') {
|
||||||
this.panel.mode = 'condensed'
|
this.openBrowser('condensed')
|
||||||
this.openBrowser()
|
|
||||||
} else if (this.options.onLoadPanel === 'caption') {
|
} else if (this.options.onLoadPanel === 'caption') {
|
||||||
this.panel.mode = 'condensed'
|
this.panel.mode = 'condensed'
|
||||||
this.displayCaption()
|
this.displayCaption()
|
||||||
|
@ -334,7 +331,6 @@ U.Map = L.Map.extend({
|
||||||
if (this.options.editMode === 'advanced') {
|
if (this.options.editMode === 'advanced') {
|
||||||
new U.SettingsToolbar({ actions: editActions }).addTo(this)
|
new U.SettingsToolbar({ actions: editActions }).addTo(this)
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
this._controls.zoom = new L.Control.Zoom({
|
this._controls.zoom = new L.Control.Zoom({
|
||||||
zoomInTitle: L._('Zoom in'),
|
zoomInTitle: L._('Zoom in'),
|
||||||
|
@ -905,7 +901,8 @@ U.Map = L.Map.extend({
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
openBrowser: function () {
|
openBrowser: function (mode) {
|
||||||
|
if (mode) this.panel.mode = mode
|
||||||
this.onceDatalayersLoaded(function () {
|
this.onceDatalayersLoaded(function () {
|
||||||
this.browser.open()
|
this.browser.open()
|
||||||
})
|
})
|
||||||
|
@ -1601,8 +1598,7 @@ U.Map = L.Map.extend({
|
||||||
'umap-open-browser-link flat',
|
'umap-open-browser-link flat',
|
||||||
container,
|
container,
|
||||||
L._('Browse data'),
|
L._('Browse data'),
|
||||||
this.openBrowser,
|
() => this.openBrowser('expanded')
|
||||||
this
|
|
||||||
)
|
)
|
||||||
if (this.options.facetKey) {
|
if (this.options.facetKey) {
|
||||||
L.DomUtil.createButton(
|
L.DomUtil.createButton(
|
||||||
|
@ -1743,10 +1739,17 @@ U.Map = L.Map.extend({
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
items.push('-', {
|
items.push(
|
||||||
|
'-',
|
||||||
|
{
|
||||||
|
text: L._('See layers'),
|
||||||
|
callback: () => this.openBrowser('condensed'),
|
||||||
|
},
|
||||||
|
{
|
||||||
text: L._('Browse data'),
|
text: L._('Browse data'),
|
||||||
callback: this.openBrowser,
|
callback: () => this.openBrowser('expanded'),
|
||||||
})
|
}
|
||||||
|
)
|
||||||
if (this.options.facetKey) {
|
if (this.options.facetKey) {
|
||||||
items.push({
|
items.push({
|
||||||
text: L._('Facet search'),
|
text: L._('Facet search'),
|
||||||
|
|
|
@ -40,7 +40,7 @@ def test_javascript_have_been_loaded(
|
||||||
expect(page).to_have_url(re.compile(r".*#7/48\..+/13\..+"))
|
expect(page).to_have_url(re.compile(r".*#7/48\..+/13\..+"))
|
||||||
expect(page).to_have_url(re.compile(r".*/fr/"))
|
expect(page).to_have_url(re.compile(r".*/fr/"))
|
||||||
# Should be in French, so hashed locale file has been loaded correctly
|
# Should be in French, so hashed locale file has been loaded correctly
|
||||||
button = page.get_by_text("Voir les calques")
|
button = page.get_by_role("button", name="Voir les calques")
|
||||||
expect(button).to_be_visible()
|
expect(button).to_be_visible()
|
||||||
button.click()
|
button.click()
|
||||||
layers = page.locator(".umap-browser .datalayer")
|
layers = page.locator(".umap-browser .datalayer")
|
||||||
|
|
Loading…
Reference in a new issue