diff --git a/client/src/components/History/Content/ContentItem.vue b/client/src/components/History/Content/ContentItem.vue index 077b7b6ed43..89701edd021 100644 --- a/client/src/components/History/Content/ContentItem.vue +++ b/client/src/components/History/Content/ContentItem.vue @@ -57,6 +57,7 @@ :is-history-item="isHistoryItem" :is-visible="item.visible" :state="state" + :item-urls="itemUrls" @delete="$emit('delete')" @display="onDisplay" @edit="onEdit" @@ -85,6 +86,7 @@ v-if="expandDataset" :dataset="item" :show-highlight="isHistoryItem" + :item-urls="itemUrls" @edit="onEdit" @toggleHighlights="toggleHighlights" /> @@ -169,6 +171,26 @@ export default { tagsDisabled() { return !this.expandDataset || !this.isHistoryItem; }, + isCollection() { + return "collection_type" in this.item; + }, + /** Relative URLs for history item actions */ + itemUrls() { + const id = this.item.id; + if (this.isCollection) { + return { + edit: `/collection/edit/${id}`, + }; + } + return { + display: `/datasets/${id}/display/?preview=True`, + edit: `/datasets/edit/${id}`, + showDetails: `/datasets/${id}/details`, + reportError: `/datasets/error?dataset_id=${id}`, + rerun: `/tool_runner/rerun?id=${id}`, + visualize: `/visualizations?dataset_id=${id}`, + }; + }, }, methods: { onClick() { @@ -179,8 +201,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"; @@ -188,11 +209,7 @@ export default { evt.dataTransfer.setData("text", JSON.stringify([this.item])); }, onEdit() { - if (this.item.collection_type) { - this.$router.push(`/collection/edit/${this.item.id}`); - } else { - this.$router.push(`/datasets/edit/${this.item.id}`); - } + this.$router.push(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..4c708261858 100644 --- a/client/src/components/History/Content/ContentOptions.vue +++ b/client/src/components/History/Content/ContentOptions.vue @@ -4,25 +4,27 @@ v-if="isDataset" :disabled="displayDisabled" :title="displayButtonTitle" - class="px-1" + class="display-btn px-1" size="sm" variant="link" - @click.stop="$emit('display')"> + :href="displayUrl" + @click.prevent.stop="$emit('display')"> + :href="editUrl" + @click.prevent.stop="$emit('edit')"> diff --git a/client/src/components/History/Content/Dataset/DatasetActions.vue b/client/src/components/History/Content/Dataset/DatasetActions.vue index 14507aac631..140271ca1d6 100644 --- a/client/src/components/History/Content/Dataset/DatasetActions.vue +++ b/client/src/components/History/Content/Dataset/DatasetActions.vue @@ -2,7 +2,14 @@
- + @@ -21,7 +28,8 @@ title="Dataset Details" size="sm" variant="link" - @click.stop="onInfo"> + :href="showDetailsUrl" + @click.prevent.stop="onInfo"> + :href="rerunUrl" + @click.prevent.stop="onRerun"> + :href="visualizeUrl" + @click.prevent.stop="onVisualize">