diff --git a/umap/static/umap/js/umap.layer.js b/umap/static/umap/js/umap.layer.js index 3982c4a8..faf2d5d4 100644 --- a/umap/static/umap/js/umap.layer.js +++ b/umap/static/umap/js/umap.layer.js @@ -1713,7 +1713,7 @@ U.DataLayer = L.Evented.extend({ 'This situation is tricky, you have to choose carefully which version is pertinent.' ) ) - document.addEventListener('alertConflictOverride', async (event) => { + document.addEventListener('umap:alertConflictOverride', async (event) => { await this._trySave(url, {}, formData) }) } diff --git a/umap/tests/integration/test_optimistic_merge.py b/umap/tests/integration/test_optimistic_merge.py index ee7a1e6a..6fad8653 100644 --- a/umap/tests/integration/test_optimistic_merge.py +++ b/umap/tests/integration/test_optimistic_merge.py @@ -288,9 +288,9 @@ def test_should_display_alert_on_conflict(context, live_server, datalayer, openm saved = DataLayer.objects.last() data = json.loads(Path(saved.geojson.path).read_text()) assert data["features"][0]["properties"]["name"] == "new name" - expect(page_two.get_by_text("Woops! Someone else seems to")).to_be_visible() + expect(page_two.get_by_text("Whoops! Other contributor(s) changed")).to_be_visible() with page_two.expect_response(re.compile(r".*/datalayer/update/.*")): - page_two.get_by_role("button", name="Save anyway").click() + page_two.get_by_text("Keep your changes and loose theirs").click() saved = DataLayer.objects.last() data = json.loads(Path(saved.geojson.path).read_text()) assert data["features"][0]["properties"]["name"] == "custom name"