Remove legacy iframe add helper

This commit is contained in:
guerler
2022-09-21 19:40:47 -04:00
parent 568a3769f8
commit 18308720a6
4 changed files with 5 additions and 21 deletions
@@ -96,7 +96,6 @@
</template>
<script>
import { iframeAdd } from "components/plugins/legacyNavigation";
import { StatelessTags } from "components/Tags";
import { STATES, HIERARCHICAL_COLLECTION_JOB_STATES } from "./model/states";
import CollectionDescription from "./Collection/CollectionDescription";
@@ -204,7 +203,7 @@ export default {
}
},
onDisplay() {
iframeAdd({ path: this.itemUrls.display, title: this.name, $router: this.$router });
this.$router.push(this.itemUrls.display, this.name);
},
onDragStart(evt) {
evt.dataTransfer.dropEffect = "move";
@@ -74,7 +74,6 @@ import { copy as sendToClipboard } from "utils/clipboard";
import { absPath, prependPath } from "utils/redirect.js";
import { downloadUrlMixin } from "./mixins.js";
import DatasetDownload from "./DatasetDownload";
import { iframeAdd } from "components/plugins/legacyNavigation";
export default {
components: {
@@ -140,11 +139,8 @@ export default {
this.$router.push(`/root?job_id=${this.item.creating_job}`);
},
onVisualize() {
iframeAdd({
path: this.itemUrls.visualize,
title: `Visualization of ${this.item.name || ""}`,
$router: this.$router,
});
const title = `Visualization of ${this.item.name || ""}`;
this.$router.push(this.itemUrls.visualize, title);
},
onHighlight() {
this.$emit("toggleHighlights");
@@ -2,15 +2,7 @@
* Navigation mixin for legacy code. Supplies functions to components
* to navigation to locations not controlled by Vue.
*/
import { getGalaxyInstance } from "app";
import { redirectToUrl, prependPath } from "utils/redirect";
import _l from "utils/localization";
// wrapper for window manager
export function iframeAdd({ path, title = "Galaxy", $router = null }) {
$router.push(path);
}
// straight ifrme redirect
export function iframeRedirect(path, target = "galaxy_main") {
@@ -37,7 +29,6 @@ export function redirect(path) {
export const legacyNavigationMixin = {
methods: {
redirect,
iframeAdd,
iframeRedirect,
prependPath,
},
+2 -4
View File
@@ -60,7 +60,7 @@ Vue.use(VueRouter);
// patches $router.push() to trigger an event and hide duplication warnings
const originalPush = VueRouter.prototype.push;
VueRouter.prototype.push = function push(location) {
VueRouter.prototype.push = function push(location, windowManagerTitle = null) {
// verify if confirmation is required
console.debug("VueRouter - push: ", location);
if (this.confirmation) {
@@ -70,17 +70,15 @@ VueRouter.prototype.push = function push(location) {
return;
}
}
// show location in window manager
const Galaxy = getGalaxyInstance();
if (Galaxy.frame && Galaxy.frame.active) {
if (windowManagerTitle && Galaxy.frame && Galaxy.frame.active) {
Galaxy.frame.add({
title: "Data",
url: location,
});
return true;
}
// always emit event when a route is pushed
this.app.$emit("router-push");
// avoid console warning when user clicks to revisit same route