From c3a70ede99e2df64dbf262073c4f88349f983f94 Mon Sep 17 00:00:00 2001 From: Dannon Baker Date: Thu, 23 Feb 2023 10:37:43 -0500 Subject: [PATCH] Sketch out initial dataset view component --- client/src/components/Dataset/DatasetView.vue | 82 +++++++++++++++++++ .../History/Content/ContentItem.vue | 5 ++ .../History/Content/ContentOptions.vue | 4 +- client/src/entry/analysis/router.js | 6 ++ lib/galaxy/webapps/galaxy/buildapp.py | 1 + 5 files changed, 97 insertions(+), 1 deletion(-) create mode 100644 client/src/components/Dataset/DatasetView.vue diff --git a/client/src/components/Dataset/DatasetView.vue b/client/src/components/Dataset/DatasetView.vue new file mode 100644 index 000000000000..14a434cfa8d9 --- /dev/null +++ b/client/src/components/Dataset/DatasetView.vue @@ -0,0 +1,82 @@ + + + + diff --git a/client/src/components/History/Content/ContentItem.vue b/client/src/components/History/Content/ContentItem.vue index 1e56b0a0d451..24bc5d6da404 100644 --- a/client/src/components/History/Content/ContentItem.vue +++ b/client/src/components/History/Content/ContentItem.vue @@ -69,6 +69,7 @@ :keyboard-selectable="isCollection || expandDataset" @delete="onDelete" @display="onDisplay" + @view="onView" @showCollectionInfo="onShowCollectionInfo" @edit="onEdit" @undelete="$emit('undelete')" @@ -223,6 +224,7 @@ export default { reportError: `/datasets/${id}/error`, rerun: `/tool_runner/rerun?id=${id}`, visualize: `/visualizations?dataset_id=${id}`, + view: `/datasets/${id}`, }; }, isBeingUsed() { @@ -292,6 +294,9 @@ export default { onDragEnd() { clearDrag(); }, + onView() { + this.$router.push(this.itemUrls.view); + }, onEdit() { this.$router.push(this.itemUrls.edit); }, diff --git a/client/src/components/History/Content/ContentOptions.vue b/client/src/components/History/Content/ContentOptions.vue index 4cc1fe03fdea..7fd4af4ac582 100644 --- a/client/src/components/History/Content/ContentOptions.vue +++ b/client/src/components/History/Content/ContentOptions.vue @@ -38,6 +38,8 @@ const editDisabled = computed(() => const displayUrl = computed(() => prependPath(props.itemUrls.display)); +const viewUrl = computed(() => prependPath(props.itemUrls.view)); + const editUrl = computed(() => prependPath(props.itemUrls.edit)); const isCollection = computed(() => !props.isDataset); @@ -98,7 +100,7 @@ function onDisplay($event: MouseEvent) { class="display-btn px-1" size="sm" variant="link" - :href="displayUrl" + :href="viewUrl" @click.prevent.stop="onDisplay($event)"> diff --git a/client/src/entry/analysis/router.js b/client/src/entry/analysis/router.js index 26268196303b..2c79475d0627 100644 --- a/client/src/entry/analysis/router.js +++ b/client/src/entry/analysis/router.js @@ -5,6 +5,7 @@ import CollectionEditView from "components/Collections/common/CollectionEditView import DatasetList from "components/Dataset/DatasetList"; import DatasetAttributes from "components/DatasetInformation/DatasetAttributes"; import DatasetDetails from "components/DatasetInformation/DatasetDetails"; +import DatasetView from "components/Dataset/DatasetView"; import DatasetError from "components/DatasetInformation/DatasetError"; import FormGeneric from "components/Form/FormGeneric"; import HistoryExportTasks from "components/History/Export/HistoryExport"; @@ -225,6 +226,11 @@ export function getRouter(Galaxy) { component: DatasetError, props: true, }, + { + path: "datasets/:datasetId", + component: DatasetView, + props: true, + }, { path: "datatypes", component: AvailableDatatypes, diff --git a/lib/galaxy/webapps/galaxy/buildapp.py b/lib/galaxy/webapps/galaxy/buildapp.py index 47e8d47ca971..a9efded9736d 100644 --- a/lib/galaxy/webapps/galaxy/buildapp.py +++ b/lib/galaxy/webapps/galaxy/buildapp.py @@ -258,6 +258,7 @@ def app_pair(global_conf, load_app_kwds=None, wsgi_preflight=True, **kwargs): webapp.add_client_route("/datasets/{dataset_id}/details") webapp.add_client_route("/datasets/{dataset_id}/preview") webapp.add_client_route("/datasets/{dataset_id}/show_params") + webapp.add_client_route("/datasets/{dataset_id}") webapp.add_client_route("/collection/{collection_id}/edit") webapp.add_client_route("/jobs/submission/success") webapp.add_client_route("/jobs/{job_id}/view")