[go: nahoru, domu]

Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor display application handling #15076

Draft
wants to merge 10 commits into
base: dev
Choose a base branch
from
Prev Previous commit
Next Next commit
Build client url from attributes
  • Loading branch information
guerler committed Nov 18, 2022
commit 984e21390f035ea0058471debd56d04f95b7a518
29 changes: 29 additions & 0 deletions client/src/components/Visualizations/DisplayApplication.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<template>
<div>
{{ appName }}
{{ datasetId }}
{{ linkName }}
</div>
</template>
<script>
import { DatasetProvider } from "components/providers";
export default {
components: {
DatasetProvider,
},
props: {
appName: {
type: String,
required: true,
},
datasetId: {
type: String,
required: true,
},
linkName: {
type: String,
required: true,
},
},
};
</script>
8 changes: 7 additions & 1 deletion client/src/components/Visualizations/DisplayApplications.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<span class="font-weight-bold">{{ displayApp.label }}</span>
<span v-for="(link, linkKey) in displayApp.links" :key="linkKey">
<span v-if="linkKey == 0">(</span>
<b-link :href="link.href" :target="link.target">{{ link.text }}</b-link>
<b-link :href="getUrl(link)" :target="link.target">{{ link.text }}</b-link>
<span v-if="linkKey != displayApp.links.length - 1">, </span>
<span v-else>)</span>
</span>
Expand All @@ -37,6 +37,7 @@
</div>
</template>
<script>
import { safePath } from "utils/redirect";
import { DatasetProvider } from "components/providers";
export default {
components: {
Expand All @@ -48,5 +49,10 @@ export default {
required: true,
},
},
methods: {
getUrl(link) {
return safePath(`/display_applications/${ this.datasetId }/${ link.app_name }/${ link.link_name }`);
},
},
};
</script>
2 changes: 1 addition & 1 deletion client/src/entry/analysis/router.js
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ export function getRouter(Galaxy) {
component: AvailableDatatypes,
},
{
path: "display_applications/:datasetId/:appName/:linkName/:userId/:appAction/:actionParam",
path: "display_applications/:datasetId/:appName/:linkName",
component: DisplayApplication,
props: true,
redirect: redirectAnon(),
Expand Down
4 changes: 4 additions & 0 deletions lib/galaxy/managers/hdas.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@

from sqlalchemy.orm.session import object_session

from urllib.parse import quote_plus

from galaxy import (
datatypes,
exceptions,
Expand Down Expand Up @@ -488,6 +490,8 @@ def serialize_display_apps(self, item, key, trans=None, **context):
"target": link_app.url.get("target_frame", "_blank"),
"href": link_app.get_display_url(hda, trans),
"text": gettext.gettext(link_app.name),
"app_name": quote_plus(link_app.display_application.id),
"link_name": quote_plus(link_app.id),
}
)
if app_links:
Expand Down