From 7d93f386d725232ca3345f5be7ae63492596a6f5 Mon Sep 17 00:00:00 2001 From: davelopez <46503462+davelopez@users.noreply.github.com> Date: Wed, 13 Jul 2022 13:05:12 +0200 Subject: [PATCH 1/5] Add href links to some history item actions This will allow to right click and open the action in a new tab or window. --- .../History/Content/ContentItem.vue | 33 +++++++++++++++---- .../History/Content/ContentOptions.vue | 7 ++-- .../Content/Dataset/DatasetActions.vue | 25 ++++++++++---- .../Content/Dataset/DatasetDetails.vue | 7 +++- 4 files changed, 55 insertions(+), 17 deletions(-) diff --git a/client/src/components/History/Content/ContentItem.vue b/client/src/components/History/Content/ContentItem.vue index 049f11f36ca..f8b4f8bc533 100644 --- a/client/src/components/History/Content/ContentItem.vue +++ b/client/src/components/History/Content/ContentItem.vue @@ -53,6 +53,7 @@ :is-history-item="isHistoryItem" :is-visible="item.visible" :state="state" + :item-urls="itemUrls" @delete="$emit('delete')" @display="onDisplay" @edit="onEdit" @@ -81,6 +82,7 @@ v-if="expandDataset" :dataset="item" :show-highlight="isHistoryItem" + :item-urls="itemUrls" @edit="onEdit" @toggleHighlights="toggleHighlights" /> @@ -99,9 +101,12 @@ import { JobStateSummary } from "./Collection/JobStateSummary"; import { library } from "@fortawesome/fontawesome-svg-core"; import { FontAwesomeIcon } from "@fortawesome/vue-fontawesome"; import { faArrowCircleUp, faMinusCircle, faCheckCircle } from "@fortawesome/free-solid-svg-icons"; +import { getAppRoot } from "onload/loadConfig"; library.add(faArrowCircleUp, faMinusCircle, faCheckCircle); +const root = getAppRoot(); + export default { components: { CollectionDescription, @@ -165,6 +170,25 @@ export default { tagsDisabled() { return !this.expandDataset || !this.isHistoryItem; }, + isCollection() { + return "collection_type" in this.item; + }, + itemUrls() { + const id = this.item.id; + if (this.isCollection) { + return { + edit: `${root}collection/edit/${id}`, + }; + } + return { + display: `${root}datasets/${id}/display/?preview=True`, + edit: `${root}datasets/edit?dataset_id=${id}`, + showDetails: `${root}datasets/${id}/details`, + reportError: `${root}datasets/error?dataset_id=${id}`, + rerun: `${root}tool_runner/rerun?id=${id}`, + visualize: `visualizations?dataset_id=${id}`, + }; + }, }, methods: { onClick() { @@ -175,8 +199,7 @@ export default { } }, onDisplay() { - const url = `datasets/${this.item.id}/display/?preview=True`; - iframeAdd({ path: url, title: this.name }); + iframeAdd({ path: this.itemUrls.display, title: this.name }); }, onDragStart(evt) { evt.dataTransfer.dropEffect = "move"; @@ -184,11 +207,7 @@ export default { evt.dataTransfer.setData("text", JSON.stringify([this.item])); }, onEdit() { - if (this.item.collection_type) { - backboneRoute(`collection/edit/${this.item.id}`); - } else { - backboneRoute("datasets/edit", { dataset_id: this.item.id }); - } + backboneRoute(this.itemUrls.edit); }, onTags(newTags) { this.$emit("tag-change", this.item, newTags); diff --git a/client/src/components/History/Content/ContentOptions.vue b/client/src/components/History/Content/ContentOptions.vue index b24d51f1dc7..0e25a4eb405 100644 --- a/client/src/components/History/Content/ContentOptions.vue +++ b/client/src/components/History/Content/ContentOptions.vue @@ -7,7 +7,8 @@ class="px-1" size="sm" variant="link" - @click.stop="$emit('display')"> + :href="itemUrls.display" + @click.prevent.stop="$emit('display')"> + :href="itemUrls.edit" + @click.prevent.stop="$emit('edit')">
- + @@ -21,7 +28,8 @@ title="Dataset Details" size="sm" variant="link" - @click.stop="onInfo"> + :href="itemUrls.showDetails" + @click.prevent.stop="onInfo"> + :href="itemUrls.rerun" + @click.prevent.stop="onRerun"> + :href="itemUrls.visualize" + @click.prevent.stop="onVisualize"> {{ result.misc_info }}
- +
             
         
@@ -94,6 +98,7 @@ export default {
     props: {
         dataset: { type: Object, required: true },
         showHighlight: { type: Boolean, default: false },
+        itemUrls: { type: Object, required: true },
     },
     computed: {
         stateText() {

From 1638dc0210c9a04d6cab9d5823694efa2377d95b Mon Sep 17 00:00:00 2001
From: davelopez <46503462+davelopez@users.noreply.github.com>
Date: Thu, 14 Jul 2022 11:41:20 +0200
Subject: [PATCH 2/5] Add HREF to dataset download

---
 .../History/Content/Dataset/DatasetDownload.vue        | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/client/src/components/History/Content/Dataset/DatasetDownload.vue b/client/src/components/History/Content/Dataset/DatasetDownload.vue
index b0288e1d69f..14455e47d8e 100644
--- a/client/src/components/History/Content/Dataset/DatasetDownload.vue
+++ b/client/src/components/History/Content/Dataset/DatasetDownload.vue
@@ -14,12 +14,15 @@
         
-         Download Dataset 
+        
+            Download Dataset
+        
         
+            :href="metaDownloadUrl + metaFile.file_type"
+            @click.prevent.stop="onDownload(metaDownloadUrl, metaFile.file_type)">
             Download {{ metaFile.file_type }}
         
     
@@ -29,7 +32,8 @@
         title="Download"
         size="sm"
         variant="link"
-        @click.stop="onDownload(downloadUrl)">
+        :href="downloadUrl"
+        @click.prevent.stop="onDownload(downloadUrl)">
         
     
 

From 9feebb88cb4ad82aaf90d9b5b03b3925c00b8e5a Mon Sep 17 00:00:00 2001
From: davelopez <46503462+davelopez@users.noreply.github.com>
Date: Thu, 14 Jul 2022 12:54:58 +0200
Subject: [PATCH 3/5] Fix tours selectors

The buttons are now considered links so better use the class to select them since it will be less prone to change than the title.
---
 .../components/History/Content/ContentOptions.vue   | 10 +++++-----
 client/src/utils/navigation/navigation.yml          |  5 ++---
 config/plugins/tours/core.galaxy_ui.yaml            | 12 ++++++------
 config/plugins/tours/core.history.yaml              | 13 ++++++-------
 config/plugins/tours/core.windows.yaml              |  2 +-
 5 files changed, 20 insertions(+), 22 deletions(-)

diff --git a/client/src/components/History/Content/ContentOptions.vue b/client/src/components/History/Content/ContentOptions.vue
index 0e25a4eb405..52be3890cb9 100644
--- a/client/src/components/History/Content/ContentOptions.vue
+++ b/client/src/components/History/Content/ContentOptions.vue
@@ -4,7 +4,7 @@
             v-if="isDataset"
             :disabled="displayDisabled"
             :title="displayButtonTitle"
-            class="px-1"
+            class="display-btn px-1"
             size="sm"
             variant="link"
             :href="itemUrls.display"
@@ -15,7 +15,7 @@
             v-if="isHistoryItem"
             :disabled="editDisabled"
             :title="editButtonTitle"
-            class="px-1"
+            class="edit-btn px-1"
             size="sm"
             variant="link"
             :href="itemUrls.edit"
@@ -24,7 +24,7 @@
         
         
         
         
Date: Fri, 15 Jul 2022 13:18:38 +0200
Subject: [PATCH 4/5] Fix history item action URLs with prefix

Declare relative URLs only and then prefix the root when necessary.
---
 .../History/Content/ContentItem.vue           | 16 ++++++--------
 .../History/Content/ContentOptions.vue        | 11 ++++++++--
 .../Content/Dataset/DatasetActions.vue        | 22 ++++++++++++++-----
 3 files changed, 33 insertions(+), 16 deletions(-)

diff --git a/client/src/components/History/Content/ContentItem.vue b/client/src/components/History/Content/ContentItem.vue
index f8b4f8bc533..ba7a9be6227 100644
--- a/client/src/components/History/Content/ContentItem.vue
+++ b/client/src/components/History/Content/ContentItem.vue
@@ -101,12 +101,9 @@ import { JobStateSummary } from "./Collection/JobStateSummary";
 import { library } from "@fortawesome/fontawesome-svg-core";
 import { FontAwesomeIcon } from "@fortawesome/vue-fontawesome";
 import { faArrowCircleUp, faMinusCircle, faCheckCircle } from "@fortawesome/free-solid-svg-icons";
-import { getAppRoot } from "onload/loadConfig";
 
 library.add(faArrowCircleUp, faMinusCircle, faCheckCircle);
 
-const root = getAppRoot();
-
 export default {
     components: {
         CollectionDescription,
@@ -173,19 +170,20 @@ export default {
         isCollection() {
             return "collection_type" in this.item;
         },
+        /** Relative URLs for history item actions */
         itemUrls() {
             const id = this.item.id;
             if (this.isCollection) {
                 return {
-                    edit: `${root}collection/edit/${id}`,
+                    edit: `collection/edit/${id}`,
                 };
             }
             return {
-                display: `${root}datasets/${id}/display/?preview=True`,
-                edit: `${root}datasets/edit?dataset_id=${id}`,
-                showDetails: `${root}datasets/${id}/details`,
-                reportError: `${root}datasets/error?dataset_id=${id}`,
-                rerun: `${root}tool_runner/rerun?id=${id}`,
+                display: `datasets/${id}/display/?preview=True`,
+                edit: `datasets/edit?dataset_id=${id}`,
+                showDetails: `datasets/${id}/details`,
+                reportError: `datasets/error?dataset_id=${id}`,
+                rerun: `tool_runner/rerun?id=${id}`,
                 visualize: `visualizations?dataset_id=${id}`,
             };
         },
diff --git a/client/src/components/History/Content/ContentOptions.vue b/client/src/components/History/Content/ContentOptions.vue
index 52be3890cb9..4c708261858 100644
--- a/client/src/components/History/Content/ContentOptions.vue
+++ b/client/src/components/History/Content/ContentOptions.vue
@@ -7,7 +7,7 @@
             class="display-btn px-1"
             size="sm"
             variant="link"
-            :href="itemUrls.display"
+            :href="displayUrl"
             @click.prevent.stop="$emit('display')">
             
         
@@ -18,7 +18,7 @@
             class="edit-btn px-1"
             size="sm"
             variant="link"
-            :href="itemUrls.edit"
+            :href="editUrl"
             @click.prevent.stop="$emit('edit')">
             
         
@@ -53,6 +53,7 @@
 
 
 
diff --git a/client/src/components/History/Content/Dataset/DatasetActions.vue b/client/src/components/History/Content/Dataset/DatasetActions.vue
index a140fae183f..95dd7f7f86c 100644
--- a/client/src/components/History/Content/Dataset/DatasetActions.vue
+++ b/client/src/components/History/Content/Dataset/DatasetActions.vue
@@ -8,7 +8,7 @@
                     title="Error"
                     size="sm"
                     variant="link"
-                    :href="itemUrls.reportError"
+                    :href="reportErrorUrl"
                     @click.prevent.stop="onError">
                     
                 
@@ -28,7 +28,7 @@
                     title="Dataset Details"
                     size="sm"
                     variant="link"
-                    :href="itemUrls.showDetails"
+                    :href="showDetailsUrl"
                     @click.prevent.stop="onInfo">
                     
                 
@@ -38,7 +38,7 @@
                     title="Run Job Again"
                     size="sm"
                     variant="link"
-                    :href="itemUrls.rerun"
+                    :href="rerunUrl"
                     @click.prevent.stop="onRerun">
                     
                 
@@ -48,7 +48,7 @@
                     title="Visualize"
                     size="sm"
                     variant="link"
-                    :href="itemUrls.visualize"
+                    :href="visualizeUrl"
                     @click.prevent.stop="onVisualize">
                     
                 
@@ -72,7 +72,7 @@