Loading client/src/components/History/Content/ContentItem.vue +24 −7 Original line number Diff line number Diff line Loading @@ -53,6 +53,7 @@ :is-history-item="isHistoryItem" :is-visible="item.visible" :state="state" :item-urls="itemUrls" @delete="$emit('delete')" @display="onDisplay" @edit="onEdit" Loading Loading @@ -81,6 +82,7 @@ v-if="expandDataset" :dataset="item" :show-highlight="isHistoryItem" :item-urls="itemUrls" @edit="onEdit" @toggleHighlights="toggleHighlights" /> </b-collapse> Loading Loading @@ -165,6 +167,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?dataset_id=${id}`, showDetails: `datasets/${id}/details`, reportError: `datasets/error?dataset_id=${id}`, rerun: `tool_runner/rerun?id=${id}`, visualize: `visualizations?dataset_id=${id}`, }; }, }, methods: { onClick() { Loading @@ -175,8 +197,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"; Loading @@ -184,11 +205,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); Loading client/src/components/History/Content/ContentOptions.vue +17 −7 Original line number Diff line number Diff line Loading @@ -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')"> <icon icon="eye" /> </b-button> <b-button v-if="isHistoryItem" :disabled="editDisabled" :title="editButtonTitle" class="px-1" class="edit-btn px-1" size="sm" variant="link" @click.stop="$emit('edit')"> :href="editUrl" @click.prevent.stop="$emit('edit')"> <icon icon="pen" /> </b-button> <b-button v-if="isHistoryItem && !isDeleted" class="px-1" class="delete-btn px-1" title="Delete" size="sm" variant="link" Loading @@ -31,7 +33,7 @@ </b-button> <b-button v-if="isHistoryItem && isDeleted" class="px-1" class="undelete-btn px-1" title="Undelete" size="sm" variant="link" Loading @@ -40,7 +42,7 @@ </b-button> <b-button v-if="isHistoryItem && !isVisible" class="px-1" class="unhide-btn px-1" title="Unhide" size="sm" variant="link" Loading @@ -51,6 +53,7 @@ </template> <script> import { prependPath } from "utils/redirect.js"; export default { props: { isDataset: { type: Boolean, required: true }, Loading @@ -58,6 +61,7 @@ export default { isHistoryItem: { type: Boolean, required: true }, isVisible: { type: Boolean, default: true }, state: { type: String, default: "" }, itemUrls: { type: Object, required: true }, }, computed: { displayButtonTitle() { Loading @@ -78,6 +82,12 @@ export default { editDisabled() { return ["discarded", "new", "upload", "queued", "running", "waiting"].includes(this.state); }, displayUrl() { return prependPath(this.itemUrls.display); }, editUrl() { return prependPath(this.itemUrls.edit); }, }, }; </script> client/src/components/History/Content/Dataset/DatasetActions.vue +31 −8 Original line number Diff line number Diff line Loading @@ -2,7 +2,14 @@ <div class="dataset-actions mb-1"> <div class="clearfix"> <div class="btn-group float-left"> <b-button v-if="showError" class="px-1" title="Error" size="sm" variant="link" @click.stop="onError"> <b-button v-if="showError" class="px-1" title="Error" size="sm" variant="link" :href="reportErrorUrl" @click.prevent.stop="onError"> <span class="fa fa-bug" /> </b-button> <dataset-download v-if="showDownloads" :item="item" @on-download="onDownload" /> Loading @@ -21,7 +28,8 @@ title="Dataset Details" size="sm" variant="link" @click.stop="onInfo"> :href="showDetailsUrl" @click.prevent.stop="onInfo"> <span class="fa fa-info-circle" /> </b-button> <b-button Loading @@ -30,7 +38,8 @@ title="Run Job Again" size="sm" variant="link" @click.stop="onRerun"> :href="rerunUrl" @click.prevent.stop="onRerun"> <span class="fa fa-redo" /> </b-button> <b-button Loading @@ -39,7 +48,8 @@ title="Visualize" size="sm" variant="link" @click.stop="onVisualize"> :href="visualizeUrl" @click.prevent.stop="onVisualize"> <span class="fa fa-bar-chart-o" /> </b-button> <b-button Loading @@ -62,7 +72,7 @@ <script> import { legacyNavigationMixin } from "components/plugins/legacyNavigation"; import { copy as sendToClipboard } from "utils/clipboard"; import { absPath } from "utils/redirect"; import { absPath, prependPath } from "utils/redirect.js"; import { downloadUrlMixin } from "./mixins.js"; import DatasetDownload from "./DatasetDownload"; Loading @@ -74,6 +84,7 @@ export default { props: { item: { type: Object, required: true }, showHighlight: { type: Boolean, default: false }, itemUrls: { type: Object, required: true }, }, computed: { showDownloads() { Loading @@ -97,6 +108,18 @@ export default { // TODO: Check hasViz, if visualizations are activated in the config return !this.item.purged && ["ok", "failed_metadata", "error"].includes(this.item.state); }, reportErrorUrl() { return prependPath(this.itemUrls.reportError); }, showDetailsUrl() { return prependPath(this.itemUrls.showDetails); }, rerunUrl() { return prependPath(this.itemUrls.rerun); }, visualizeUrl() { return prependPath(this.itemUrls.visualize); }, }, methods: { onCopyLink() { Loading @@ -107,10 +130,10 @@ export default { window.location.href = resource; }, onError() { this.backboneRoute("datasets/error", { dataset_id: this.item.id }); this.backboneRoute(this.itemUrls.reportError); }, onInfo() { this.backboneRoute(`datasets/${this.item.id}/details`); this.backboneRoute(this.itemUrls.showDetails); }, onRerun() { this.backboneRoute(`root?job_id=${this.item.creating_job}`); Loading @@ -118,7 +141,7 @@ export default { onVisualize() { const name = this.item.name || ""; const title = `Visualization of ${name}`; const path = `visualizations?dataset_id=${this.item.id}`; const path = this.itemUrls.visualize; const redirectParams = { path: path, title: title, Loading client/src/components/History/Content/Dataset/DatasetDetails.vue +6 −1 Original line number Diff line number Diff line Loading @@ -21,7 +21,11 @@ <span class="value">{{ result.misc_info }}</span> </div> </div> <DatasetActions :item="result" :show-highlight="showHighlight" @toggleHighlights="toggleHighlights" /> <DatasetActions :item="result" :show-highlight="showHighlight" :item-urls="itemUrls" @toggleHighlights="toggleHighlights" /> <pre v-if="result.peek" class="dataset-peek p-1" v-html="result.peek" /> </div> </div> Loading Loading @@ -94,6 +98,7 @@ export default { props: { dataset: { type: Object, required: true }, showHighlight: { type: Boolean, default: false }, itemUrls: { type: Object, required: true }, }, computed: { stateText() { Loading client/src/components/History/Content/Dataset/DatasetDownload.vue +7 −3 Original line number Diff line number Diff line Loading @@ -14,12 +14,15 @@ <template v-slot:button-content> <span class="fa fa-save" /> </template> <b-dropdown-item v-localize @click.stop="onDownload(downloadUrl)"> Download Dataset </b-dropdown-item> <b-dropdown-item v-localize :href="downloadUrl" @click.prevent.stop="onDownload(downloadUrl)"> Download Dataset </b-dropdown-item> <b-dropdown-item v-for="(metaFile, index) of metaFiles" :key="index" :data-description="`download ${metaFile.file_type}`" @click.stop="onDownload(metaDownloadUrl, metaFile.file_type)"> :href="metaDownloadUrl + metaFile.file_type" @click.prevent.stop="onDownload(metaDownloadUrl, metaFile.file_type)"> Download {{ metaFile.file_type }} </b-dropdown-item> </b-dropdown> Loading @@ -29,7 +32,8 @@ title="Download" size="sm" variant="link" @click.stop="onDownload(downloadUrl)"> :href="downloadUrl" @click.prevent.stop="onDownload(downloadUrl)"> <span class="fa fa-save" /> </b-button> </template> Loading Loading
client/src/components/History/Content/ContentItem.vue +24 −7 Original line number Diff line number Diff line Loading @@ -53,6 +53,7 @@ :is-history-item="isHistoryItem" :is-visible="item.visible" :state="state" :item-urls="itemUrls" @delete="$emit('delete')" @display="onDisplay" @edit="onEdit" Loading Loading @@ -81,6 +82,7 @@ v-if="expandDataset" :dataset="item" :show-highlight="isHistoryItem" :item-urls="itemUrls" @edit="onEdit" @toggleHighlights="toggleHighlights" /> </b-collapse> Loading Loading @@ -165,6 +167,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?dataset_id=${id}`, showDetails: `datasets/${id}/details`, reportError: `datasets/error?dataset_id=${id}`, rerun: `tool_runner/rerun?id=${id}`, visualize: `visualizations?dataset_id=${id}`, }; }, }, methods: { onClick() { Loading @@ -175,8 +197,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"; Loading @@ -184,11 +205,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); Loading
client/src/components/History/Content/ContentOptions.vue +17 −7 Original line number Diff line number Diff line Loading @@ -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')"> <icon icon="eye" /> </b-button> <b-button v-if="isHistoryItem" :disabled="editDisabled" :title="editButtonTitle" class="px-1" class="edit-btn px-1" size="sm" variant="link" @click.stop="$emit('edit')"> :href="editUrl" @click.prevent.stop="$emit('edit')"> <icon icon="pen" /> </b-button> <b-button v-if="isHistoryItem && !isDeleted" class="px-1" class="delete-btn px-1" title="Delete" size="sm" variant="link" Loading @@ -31,7 +33,7 @@ </b-button> <b-button v-if="isHistoryItem && isDeleted" class="px-1" class="undelete-btn px-1" title="Undelete" size="sm" variant="link" Loading @@ -40,7 +42,7 @@ </b-button> <b-button v-if="isHistoryItem && !isVisible" class="px-1" class="unhide-btn px-1" title="Unhide" size="sm" variant="link" Loading @@ -51,6 +53,7 @@ </template> <script> import { prependPath } from "utils/redirect.js"; export default { props: { isDataset: { type: Boolean, required: true }, Loading @@ -58,6 +61,7 @@ export default { isHistoryItem: { type: Boolean, required: true }, isVisible: { type: Boolean, default: true }, state: { type: String, default: "" }, itemUrls: { type: Object, required: true }, }, computed: { displayButtonTitle() { Loading @@ -78,6 +82,12 @@ export default { editDisabled() { return ["discarded", "new", "upload", "queued", "running", "waiting"].includes(this.state); }, displayUrl() { return prependPath(this.itemUrls.display); }, editUrl() { return prependPath(this.itemUrls.edit); }, }, }; </script>
client/src/components/History/Content/Dataset/DatasetActions.vue +31 −8 Original line number Diff line number Diff line Loading @@ -2,7 +2,14 @@ <div class="dataset-actions mb-1"> <div class="clearfix"> <div class="btn-group float-left"> <b-button v-if="showError" class="px-1" title="Error" size="sm" variant="link" @click.stop="onError"> <b-button v-if="showError" class="px-1" title="Error" size="sm" variant="link" :href="reportErrorUrl" @click.prevent.stop="onError"> <span class="fa fa-bug" /> </b-button> <dataset-download v-if="showDownloads" :item="item" @on-download="onDownload" /> Loading @@ -21,7 +28,8 @@ title="Dataset Details" size="sm" variant="link" @click.stop="onInfo"> :href="showDetailsUrl" @click.prevent.stop="onInfo"> <span class="fa fa-info-circle" /> </b-button> <b-button Loading @@ -30,7 +38,8 @@ title="Run Job Again" size="sm" variant="link" @click.stop="onRerun"> :href="rerunUrl" @click.prevent.stop="onRerun"> <span class="fa fa-redo" /> </b-button> <b-button Loading @@ -39,7 +48,8 @@ title="Visualize" size="sm" variant="link" @click.stop="onVisualize"> :href="visualizeUrl" @click.prevent.stop="onVisualize"> <span class="fa fa-bar-chart-o" /> </b-button> <b-button Loading @@ -62,7 +72,7 @@ <script> import { legacyNavigationMixin } from "components/plugins/legacyNavigation"; import { copy as sendToClipboard } from "utils/clipboard"; import { absPath } from "utils/redirect"; import { absPath, prependPath } from "utils/redirect.js"; import { downloadUrlMixin } from "./mixins.js"; import DatasetDownload from "./DatasetDownload"; Loading @@ -74,6 +84,7 @@ export default { props: { item: { type: Object, required: true }, showHighlight: { type: Boolean, default: false }, itemUrls: { type: Object, required: true }, }, computed: { showDownloads() { Loading @@ -97,6 +108,18 @@ export default { // TODO: Check hasViz, if visualizations are activated in the config return !this.item.purged && ["ok", "failed_metadata", "error"].includes(this.item.state); }, reportErrorUrl() { return prependPath(this.itemUrls.reportError); }, showDetailsUrl() { return prependPath(this.itemUrls.showDetails); }, rerunUrl() { return prependPath(this.itemUrls.rerun); }, visualizeUrl() { return prependPath(this.itemUrls.visualize); }, }, methods: { onCopyLink() { Loading @@ -107,10 +130,10 @@ export default { window.location.href = resource; }, onError() { this.backboneRoute("datasets/error", { dataset_id: this.item.id }); this.backboneRoute(this.itemUrls.reportError); }, onInfo() { this.backboneRoute(`datasets/${this.item.id}/details`); this.backboneRoute(this.itemUrls.showDetails); }, onRerun() { this.backboneRoute(`root?job_id=${this.item.creating_job}`); Loading @@ -118,7 +141,7 @@ export default { onVisualize() { const name = this.item.name || ""; const title = `Visualization of ${name}`; const path = `visualizations?dataset_id=${this.item.id}`; const path = this.itemUrls.visualize; const redirectParams = { path: path, title: title, Loading
client/src/components/History/Content/Dataset/DatasetDetails.vue +6 −1 Original line number Diff line number Diff line Loading @@ -21,7 +21,11 @@ <span class="value">{{ result.misc_info }}</span> </div> </div> <DatasetActions :item="result" :show-highlight="showHighlight" @toggleHighlights="toggleHighlights" /> <DatasetActions :item="result" :show-highlight="showHighlight" :item-urls="itemUrls" @toggleHighlights="toggleHighlights" /> <pre v-if="result.peek" class="dataset-peek p-1" v-html="result.peek" /> </div> </div> Loading Loading @@ -94,6 +98,7 @@ export default { props: { dataset: { type: Object, required: true }, showHighlight: { type: Boolean, default: false }, itemUrls: { type: Object, required: true }, }, computed: { stateText() { Loading
client/src/components/History/Content/Dataset/DatasetDownload.vue +7 −3 Original line number Diff line number Diff line Loading @@ -14,12 +14,15 @@ <template v-slot:button-content> <span class="fa fa-save" /> </template> <b-dropdown-item v-localize @click.stop="onDownload(downloadUrl)"> Download Dataset </b-dropdown-item> <b-dropdown-item v-localize :href="downloadUrl" @click.prevent.stop="onDownload(downloadUrl)"> Download Dataset </b-dropdown-item> <b-dropdown-item v-for="(metaFile, index) of metaFiles" :key="index" :data-description="`download ${metaFile.file_type}`" @click.stop="onDownload(metaDownloadUrl, metaFile.file_type)"> :href="metaDownloadUrl + metaFile.file_type" @click.prevent.stop="onDownload(metaDownloadUrl, metaFile.file_type)"> Download {{ metaFile.file_type }} </b-dropdown-item> </b-dropdown> Loading @@ -29,7 +32,8 @@ title="Download" size="sm" variant="link" @click.stop="onDownload(downloadUrl)"> :href="downloadUrl" @click.prevent.stop="onDownload(downloadUrl)"> <span class="fa fa-save" /> </b-button> </template> Loading