Skip to content

Commit 353263e

Browse files
committed
Fix scratchbook->window-manager selector rename in Python/tour, use addSearchParams, guard focus()
1 parent f33428a commit 353263e

4 files changed

Lines changed: 10 additions & 9 deletions

File tree

client/src/stores/windowManagerStore.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { ref } from "vue";
44

55
import _l from "@/utils/localization";
66
import { withPrefix } from "@/utils/redirect";
7+
import { addSearchParams } from "@/utils/url";
78

89
const STORAGE_KEY = "galaxy-window-manager-windows";
910

@@ -42,10 +43,7 @@ export const useWindowManagerStore = defineStore("windowManager", () => {
4243
}
4344

4445
function buildUrl(url: string): string {
45-
let fullUrl = withPrefix(url);
46-
fullUrl += fullUrl.includes("?") ? "&" : "?";
47-
fullUrl += "hide_panels=true&hide_masthead=true";
48-
return fullUrl;
46+
return addSearchParams(withPrefix(url), { hide_panels: "true", hide_masthead: "true" });
4947
}
5048

5149
function add(options: { title?: string; url: string; x?: number; y?: number; width?: number; height?: number }) {
@@ -82,6 +80,9 @@ export const useWindowManagerStore = defineStore("windowManager", () => {
8280
}
8381

8482
function focus(id: string) {
83+
if (focusedId.value === id) {
84+
return;
85+
}
8586
focusedId.value = id;
8687
const win = windows.value.find((w) => w.id === id);
8788
if (win) {

config/plugins/tours/core.windows.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ steps:
8080
intro: "Clicking the eye-icon usually displays a dataset in the center panel."
8181
postclick: true
8282

83-
- element: ".scratchbook-window"
83+
- element: ".window-manager-window"
8484
intro: "However while using the Window Manager, the dataset will be shown as resizable window."
8585

8686
- title: "Done."

lib/galaxy/selenium/navigates_galaxy.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2228,13 +2228,13 @@ def window_manager_is_active(self) -> bool:
22282228

22292229
def window_manager_window_count(self) -> int:
22302230
"""Return number of open scratchbook windows."""
2231-
return len(self.find_elements_by_selector(".scratchbook-window"))
2231+
return len(self.find_elements_by_selector(".window-manager-window"))
22322232

22332233
def window_manager_wait_for_window_count(self, expected_count: int):
22342234
"""Wait until the expected number of scratchbook windows exist."""
22352235

22362236
def check_count(driver=None):
2237-
count = len(self.find_elements_by_selector(".scratchbook-window"))
2237+
count = len(self.find_elements_by_selector(".window-manager-window"))
22382238
return count == expected_count
22392239

22402240
self._wait_on(check_count, f"window count to be {expected_count}")
@@ -2247,7 +2247,7 @@ def scratchbook_frame(self, index=0):
22472247
with self.scratchbook_frame(0):
22482248
self.wait_for_selector_visible(".dataset-view")
22492249
"""
2250-
iframes = self.find_elements_by_selector(".scratchbook-window iframe")
2250+
iframes = self.find_elements_by_selector(".window-manager-window iframe")
22512251
assert len(iframes) > index, f"Expected at least {index + 1} scratchbook iframes, found {len(iframes)}"
22522252
try:
22532253
self.switch_to_frame(iframes[index])

lib/galaxy_test/selenium/test_window_manager_persistence.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ class TestWindowManagerPersistence(SeleniumTestCase):
1313

1414
def setUp(self):
1515
super().setUp()
16-
self.execute_script("localStorage.removeItem('galaxy-scratchbook-windows');")
16+
self.execute_script("localStorage.removeItem('galaxy-window-manager-windows');")
1717

1818
@selenium_test
1919
@managed_history

0 commit comments

Comments
 (0)