fix: do not save "null" instead of null for showLabel

This commit is contained in:
Yohan Boniface 2025-02-07 21:50:36 +01:00
parent 6793a6bdc7
commit 64068af393
3 changed files with 12 additions and 2 deletions

View file

@ -1195,7 +1195,7 @@ Fields.NullableChoices = class extends Fields.TernaryChoices {
this.properties.choices || [
[true, translate('always')],
[false, translate('never')],
['null', translate('hidden')],
[null, translate('hidden')],
]
)
}

View file

@ -450,7 +450,7 @@ export const SCHEMA = {
choices: [
[true, translate('always')],
[false, translate('never')],
['null', translate('on hover')],
[null, translate('on hover')],
],
},
slideshow: {

View file

@ -181,3 +181,13 @@ def test_only_visible_markers_are_added_to_dom(live_server, map, page):
)
expect(markers).to_have_count(1)
expect(tooltips).to_have_count(1)
def test_should_display_tooltip_on_hover(live_server, map, page, bootstrap):
map.settings["properties"]["showLabel"] = None
map.settings["properties"]["labelKey"] = "Foo {name}"
map.save()
page.goto(f"{live_server.url}{map.get_absolute_url()}")
expect(page.get_by_text("Foo test marker")).to_be_hidden()
page.locator(".leaflet-marker-icon").hover()
expect(page.get_by_text("Foo test marker")).to_be_visible()