mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-10-25 00:12:08 +08:00
force push to router so collection builder can be invoked consecutively
Same concept as in https://github.com/galaxyproject/galaxy/blob/9821f60d0054ff16dddcf2dfe794ebd5db83714e/client/src/components/History/Content/ContentItem.vue#L236-L246. Hopefully vue-router 4 will help us replace these workarounds with its native force push.
This commit is contained in:
+4
-1
@@ -303,7 +303,10 @@ export default {
|
||||
const { setSelectedItems } = useCollectionBuilderItemSelection();
|
||||
const selection = Array.from(this.contentSelection.values());
|
||||
setSelectedItems(selection);
|
||||
this.$router.push({ path: `/collection/new_list?advanced=${advanced}` });
|
||||
|
||||
// vue-router 4 supports a native force push with clean URLs, but we're using a __vkey__
|
||||
// bit as a workaround to allow the builder to be invoked consecutively
|
||||
this.$router.push({ path: `/collection/new_list?advanced=${advanced}` }, { force: true });
|
||||
},
|
||||
// Selected content manipulation, hide/show/delete/purge
|
||||
hideSelected() {
|
||||
|
||||
@@ -15,7 +15,16 @@ export function patchRouterPush(VueRouter) {
|
||||
// add key to location to force component refresh
|
||||
const { title, force, preventWindowManager } = options;
|
||||
if (force) {
|
||||
location = addSearchParams(location, { __vkey__: Date.now() });
|
||||
// since location can either be string or object, we need to pass the string url to addSearchParams
|
||||
if (typeof location === "string") {
|
||||
location = addSearchParams(location, { __vkey__: Date.now() });
|
||||
} else if (typeof location === "object") {
|
||||
// convert to string version addSearchParams can handle
|
||||
let url = this.resolve(location).href;
|
||||
url = addSearchParams(url, { __vkey__: Date.now() });
|
||||
// convert back to object version
|
||||
location = this.resolve(url).route;
|
||||
}
|
||||
}
|
||||
// verify if confirmation is required
|
||||
if (this.confirmation) {
|
||||
|
||||
Reference in New Issue
Block a user