diff --git a/umap/static/umap/css/bar.css b/umap/static/umap/css/bar.css index fe0410b6..348fb263 100644 --- a/umap/static/umap/css/bar.css +++ b/umap/static/umap/css/bar.css @@ -13,9 +13,14 @@ padding: 0 var(--text-margin); background-color: inherit; } +.leaflet-container .edit-undo { + margin-left: var(--box-margin); +} +.leaflet-container .edit-undo[disabled], +.leaflet-container .edit-redo[disabled] { + filter: invert(.5); +} .leaflet-container .edit-save, -.leaflet-container .edit-undo, -.leaflet-container .edit-redo, .leaflet-container .edit-disable, .leaflet-container .connected-peers { @@ -40,8 +45,6 @@ color: var(--color-darkGray); } -.leaflet-container .edit-undo:hover, -.leaflet-container .edit-redo:hover, .leaflet-container .edit-disable:hover { border: 0.5px solid rgba(153, 153, 153, 0.80); text-decoration: none; diff --git a/umap/static/umap/js/modules/ui/bar.js b/umap/static/umap/js/modules/ui/bar.js index d8f49102..d6055b17 100644 --- a/umap/static/umap/js/modules/ui/bar.js +++ b/umap/static/umap/js/modules/ui/bar.js @@ -11,13 +11,11 @@ const TOP_BAR_TEMPLATE = ` - -
diff --git a/umap/tests/integration/test_browser.py b/umap/tests/integration/test_browser.py index cee5b27e..3a0c30f5 100644 --- a/umap/tests/integration/test_browser.py +++ b/umap/tests/integration/test_browser.py @@ -350,7 +350,7 @@ def test_should_redraw_list_on_feature_delete(live_server, openmap, page, bootst buttons.first.click() page.locator("dialog").get_by_role("button", name="OK").click() expect(buttons).to_have_count(2) - page.get_by_role("button", name="Undo").click() + page.locator(".edit-undo").click() expect(buttons).to_have_count(3) diff --git a/umap/tests/integration/test_conditional_rules.py b/umap/tests/integration/test_conditional_rules.py index 37dabaff..d72d36bd 100644 --- a/umap/tests/integration/test_conditional_rules.py +++ b/umap/tests/integration/test_conditional_rules.py @@ -261,7 +261,7 @@ def test_can_create_new_rule(live_server, page, openmap): page.get_by_title("AliceBlue").first.click() colors = getColors(markers) assert colors.count("rgb(240, 248, 255)") == 3 - page.get_by_role("button", name="Undo").click() + page.locator(".edit-undo").click() colors = getColors(markers) assert colors.count("rgb(240, 248, 255)") == 0 diff --git a/umap/tests/integration/test_edit_datalayer.py b/umap/tests/integration/test_edit_datalayer.py index bd06ca87..18b9dffd 100644 --- a/umap/tests/integration/test_edit_datalayer.py +++ b/umap/tests/integration/test_edit_datalayer.py @@ -64,7 +64,7 @@ def test_cancel_deleting_datalayer_should_restore( page.get_by_role("button", name="OK").click() expect(markers).to_have_count(0) expect(page.get_by_text("test datalayer")).to_be_hidden() - page.get_by_role("button", name="Undo").click() + page.locator(".edit-undo").click() expect(markers).to_have_count(1) expect(page.locator(".umap-browser").get_by_text("test datalayer")).to_be_visible() diff --git a/umap/tests/integration/test_edit_polygon.py b/umap/tests/integration/test_edit_polygon.py index 4a8ddac8..e3c2f0cd 100644 --- a/umap/tests/integration/test_edit_polygon.py +++ b/umap/tests/integration/test_edit_polygon.py @@ -117,7 +117,7 @@ def test_should_reset_style_on_cancel(live_server, openmap, page, bootstrap): expect(page.locator(".leaflet-overlay-pane path[fill='GoldenRod']")).to_have_count( 1 ) - page.get_by_role("button", name="Undo").click() + page.locator(".edit-undo").click() expect(page.locator(".leaflet-overlay-pane path[fill='DarkBlue']")).to_have_count(1) diff --git a/umap/tests/integration/test_save.py b/umap/tests/integration/test_save.py index c885d094..a32c97ca 100644 --- a/umap/tests/integration/test_save.py +++ b/umap/tests/integration/test_save.py @@ -16,7 +16,7 @@ def test_reseting_map_would_remove_from_save_queue( page.on("request", register_request) page.locator('input[name="name"]').click() page.locator('input[name="name"]').fill("new name") - page.get_by_role("button", name="Undo").click() + page.locator(".edit-undo").click() page.wait_for_timeout(500) page.get_by_role("button", name="Manage layers").click() page.get_by_role("button", name="Edit", exact=True).click() diff --git a/umap/tests/integration/test_websocket_sync.py b/umap/tests/integration/test_websocket_sync.py index bae3c167..0bfaa771 100644 --- a/umap/tests/integration/test_websocket_sync.py +++ b/umap/tests/integration/test_websocket_sync.py @@ -686,7 +686,7 @@ def test_should_sync_datalayer_clear( expect(peerB.locator(".leaflet-marker-icon")).to_have_count(0) # Undo in peer A - peerA.get_by_role("button", name="Undo").click() + peerA.locator(".edit-undo").click() expect(peerA.locator(".leaflet-marker-icon")).to_have_count(1) expect(peerB.locator(".leaflet-marker-icon")).to_have_count(1)