Skip to content

Commit e634402

Browse files
committed
Add ts interface for RouterPushOptions for better typing
Fixes vue-tsc issues related to DatasetDisplay improvements.
1 parent e7dc06c commit e634402

File tree

2 files changed

+22
-7
lines changed

2 files changed

+22
-7
lines changed

client/src/components/History/Content/ContentItem.vue

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@ import {
99
faSpinner,
1010
} from "@fortawesome/free-solid-svg-icons";
1111
import { FontAwesomeIcon } from "@fortawesome/vue-fontawesome";
12-
import { getGalaxyInstance } from "app";
1312
import { BBadge, BButton, BCollapse } from "bootstrap-vue";
1413
import { computed, ref } from "vue";
1514
import { useRoute, useRouter } from "vue-router/composables";
1615
16+
import { getGalaxyInstance } from "@/app";
1717
import type { ItemUrls } from "@/components/History/Content/Dataset/index";
1818
import { updateContentFields } from "@/components/History/model/queries";
1919
import { useEntryPointStore } from "@/stores/entryPointStore";
@@ -22,6 +22,7 @@ import { clearDrag } from "@/utils/setDrag";
2222
2323
import { JobStateSummary } from "./Collection/JobStateSummary";
2424
import { getContentItemState, type StateMap, STATES } from "./model/states";
25+
import type { RouterPushOptions } from "./router-push-options";
2526
2627
import CollectionDescription from "./Collection/CollectionDescription.vue";
2728
import ContentOptions from "./ContentOptions.vue";
@@ -277,18 +278,20 @@ function onDisplay() {
277278
// but we're using a __vkey__ bit as a workaround
278279
// Only conditionally force to keep urls clean most of the time.
279280
if (route.path === itemUrls.value.display) {
280-
// @ts-ignore - monkeypatched router, drop with migration.
281-
router.push(displayUrl, {
281+
const options: RouterPushOptions = {
282282
force: true,
283283
preventWindowManager: !isWindowManagerActive,
284284
title: isWindowManagerActive ? `${props.item.hid}: ${props.name}` : undefined,
285-
});
286-
} else if (displayUrl) {
285+
};
287286
// @ts-ignore - monkeypatched router, drop with migration.
288-
router.push(displayUrl, {
287+
router.push(displayUrl, options);
288+
} else if (displayUrl) {
289+
const options: RouterPushOptions = {
289290
preventWindowManager: !isWindowManagerActive,
290291
title: isWindowManagerActive ? `${props.item.hid}: ${props.name}` : undefined,
291-
});
292+
};
293+
// @ts-ignore - monkeypatched router, drop with migration.
294+
router.push(displayUrl, options);
292295
}
293296
}
294297
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
/**
2+
* Custom options for the monkeypatched router.push() method
3+
* Used to control window manager behavior and force navigation
4+
*/
5+
export interface RouterPushOptions {
6+
// Title for window manager frame
7+
title?: string;
8+
// Force reload (currently by adding timestamp to URL)
9+
force?: boolean;
10+
// Explicit WM bypass -- prevent opening in window manager even if active
11+
preventWindowManager?: boolean;
12+
}

0 commit comments

Comments
 (0)