Skip to content

Commit

Permalink
Merge branch 'release_23.0' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
mvdbeek committed Mar 15, 2023
2 parents 1dc25d1 + a534db3 commit bd75316
Show file tree
Hide file tree
Showing 27 changed files with 529 additions and 393 deletions.
2 changes: 1 addition & 1 deletion client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@
"vue-template-compiler": "^2.7.14",
"webpack": "^5.75.0",
"webpack-cli": "^5.0.1",
"webpack-dev-server": "^4.11.1",
"webpack-dev-server": "^4.12.0",
"webpack-merge": "^5.8.0",
"yaml-jest": "^1.2.0",
"yaml-loader": "^0.8.0"
Expand Down
24 changes: 21 additions & 3 deletions client/src/components/Common/ExportRecordDetails.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,16 @@ import { BAlert, BCard, BCardTitle } from "bootstrap-vue";
import LoadingSpan from "components/LoadingSpan";
import { FontAwesomeIcon } from "@fortawesome/vue-fontawesome";
import { library } from "@fortawesome/fontawesome-svg-core";
import { faExclamationCircle, faExclamationTriangle, faCheckCircle, faClock } from "@fortawesome/free-solid-svg-icons";
import {
faExclamationCircle,
faExclamationTriangle,
faCheckCircle,
faClock,
faLink,
} from "@fortawesome/free-solid-svg-icons";
import { ExportRecordModel } from "./models/exportRecordModel";
library.add(faExclamationCircle, faExclamationTriangle, faCheckCircle, faClock);
library.add(faExclamationCircle, faExclamationTriangle, faCheckCircle, faClock, faLink);
const props = defineProps({
record: {
Expand All @@ -28,7 +34,7 @@ const props = defineProps({
},
});
const emit = defineEmits(["onReimport", "onDownload", "onActionMessageDismissed"]);
const emit = defineEmits(["onReimport", "onDownload", "onCopyDownloadLink", "onActionMessageDismissed"]);
const title = computed(() => (props.record.isReady ? `Exported` : `Export started`));
const preparingMessage = computed(
Expand All @@ -43,6 +49,10 @@ function downloadObject() {
emit("onDownload", props.record);
}
function copyDownloadLink() {
emit("onCopyDownloadLink", props.record);
}
function onMessageDismissed() {
emit("onActionMessageDismissed");
}
Expand Down Expand Up @@ -113,6 +123,14 @@ function onMessageDismissed() {
@click="downloadObject">
Download
</b-button>
<b-button
v-if="props.record.canDownload"
title="Copy Download Link"
size="sm"
variant="link"
@click.stop="copyDownloadLink">
<font-awesome-icon icon="link" />
</b-button>
<b-button
v-if="props.record.canReimport"
class="record-reimport-btn"
Expand Down
15 changes: 13 additions & 2 deletions client/src/components/Common/ExportRecordTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,10 @@ import {
faDownload,
faFileImport,
faSpinner,
faLink,
} from "@fortawesome/free-solid-svg-icons";
library.add(faExclamationCircle, faCheckCircle, faDownload, faFileImport, faSpinner);
library.add(faExclamationCircle, faCheckCircle, faDownload, faFileImport, faSpinner, faLink);
const props = defineProps({
records: {
Expand All @@ -32,7 +33,7 @@ const fields = [
];
const isExpanded = ref(false);
const title = computed(() => (isExpanded.value ? `Hide export records` : `Show export records`));
const title = computed(() => (isExpanded.value ? `Hide old export records` : `Show old export records`));
async function reimportObject(record) {
emit("onReimport", record);
Expand All @@ -41,6 +42,10 @@ async function reimportObject(record) {
function downloadObject(record) {
emit("onDownload", record);
}
function copyDownloadLink(record) {
emit("onCopyDownloadLink", record);
}
</script>

<template>
Expand Down Expand Up @@ -113,6 +118,12 @@ function downloadObject(record) {
@click="downloadObject(row.item)">
<font-awesome-icon icon="download" />
</b-button>
<b-button
v-if="row.item.canDownload"
title="Copy Download Link"
@click.stop="copyDownloadLink(row.item)">
<font-awesome-icon icon="link" />
</b-button>
<b-button
v-b-tooltip.hover.bottom
:disabled="!row.item.canReimport"
Expand Down
20 changes: 19 additions & 1 deletion client/src/components/History/Export/HistoryExport.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,25 @@ import { useTaskMonitor } from "composables/taskMonitor";
import { useFileSources } from "composables/fileSources";
import { useShortTermStorage, DEFAULT_EXPORT_PARAMS } from "composables/shortTermStorage";
import { useConfirmDialog } from "composables/confirmDialog";
import { copy as sendToClipboard } from "utils/clipboard";
import { absPath } from "@/utils/redirect";
const {
isRunning: isExportTaskRunning,
waitForTask,
requestHasFailed: taskMonitorRequestFailed,
hasFailed: taskHasFailed,
} = useTaskMonitor();
const { hasWritable: hasWritableFileSources } = useFileSources();
const { isPreparing: isPreparingDownload, downloadHistory, downloadObjectByRequestId } = useShortTermStorage();
const {
isPreparing: isPreparingDownload,
downloadHistory,
downloadObjectByRequestId,
getDownloadObjectUrl,
} = useShortTermStorage();
const { confirm } = useConfirmDialog();
const props = defineProps({
Expand Down Expand Up @@ -104,6 +114,13 @@ function downloadFromRecord(record) {
}
}
function copyDownloadLinkFromRecord(record) {
if (record.canDownload) {
const relativeLink = getDownloadObjectUrl(record.stsDownloadId);
sendToClipboard(absPath(relativeLink), "Download link copied to your clipboard");
}
}
function findValidUpToDateDownloadRecord() {
return exportRecords.value
? exportRecords.value.find(
Expand Down Expand Up @@ -203,6 +220,7 @@ function updateExportParams(newParams) {
:action-message="actionMessage"
:action-message-variant="actionMessageVariant"
@onDownload="downloadFromRecord"
@onCopyDownloadLink="copyDownloadLinkFromRecord"
@onReimport="reimportFromRecord"
@onActionMessageDismissed="onActionMessageDismissedFromRecord" />
<b-alert v-else id="no-export-records-alert" variant="info" class="mt-3" show>
Expand Down
2 changes: 1 addition & 1 deletion client/src/components/Panels/Common/ToolSearch.vue
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ export default {
this.$emit("onResults", this.favoritesResults);
} else {
// keys with sorting order
const keys = { exact: 3, name: 2, description: 1, combined: 0 };
const keys = { exact: 4, name: 3, hyphenated: 2, description: 1, combined: 0 };
this.$emit("onResults", searchToolsByKeys(this.toolsList, keys, q));
}
} else {
Expand Down
2 changes: 2 additions & 0 deletions client/src/components/Panels/utilities.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,8 @@ export function searchToolsByKeys(tools, keys, query) {
let actualValue = "";
if (key === "combined") {
actualValue = tool.name.toLowerCase() + " " + tool.description.toLowerCase();
} else if (key === "hyphenated") {
actualValue = tool.name.toLowerCase().replaceAll("-", " ");
} else {
actualValue = tool[key] ? tool[key].toLowerCase() : "";
}
Expand Down
22 changes: 22 additions & 0 deletions client/src/components/Panels/utilities.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,28 @@ describe("test helpers in tool searching utilities", () => {
keys = { description: 1, name: 2, combined: 0 };
results = searchToolsByKeys(normalizeTools(toolsList), keys, q);
expect(results).toEqual(expectedResults);

const tempToolsList = [
{
elems: [
{
panel_section_name: "FASTA/FASTQ",
description: "Extract UMI from fastq files",
id: "toolshed.g2.bx.psu.edu/repos/iuc/umi_tools_extract/umi_tools_extract/1.1.2+galaxy2",
name: "UMI-tools extract",
},
],
model_class: "ToolSection",
id: "fasta/fastq",
name: "FASTA/FASTQ",
},
];
// hyphenated tool-name is searchable
q = "uMi tools extract ";
expectedResults = ["toolshed.g2.bx.psu.edu/repos/iuc/umi_tools_extract/umi_tools_extract/1.1.2+galaxy2"];
keys = { description: 1, name: 2, hyphenated: 0 };
results = searchToolsByKeys(normalizeTools(tempToolsList), keys, q);
expect(results).toEqual(expectedResults);
});

it("test tool filtering helpers on toolsList given list of ids", async () => {
Expand Down
1 change: 1 addition & 0 deletions client/src/components/Workflow/Editor/Index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -656,6 +656,7 @@ export default {
getModule(stepData, id, this.stateStore.setLoadingState).then((response) => {
this.stepStore.updateStep({
...stepData,
id: id,
tool_state: response.tool_state,
inputs: response.inputs,
outputs: response.outputs,
Expand Down
11 changes: 8 additions & 3 deletions client/src/components/Workflow/Editor/Node.vue
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@
:root-offset="rootOffset"
:scroll="scroll"
:scale="scale"
v-on="$listeners"
@onChange="onChange" />
<div v-if="showRule" class="rule" />
<node-output
Expand All @@ -97,7 +96,7 @@
:scroll="scroll"
:scale="scale"
:datatypes-mapper="datatypesMapper"
v-on="$listeners"
@onDragConnector="onDragConnector"
@stopDragging="onStopDragging"
@onChange="onChange" />
</div>
Expand All @@ -117,7 +116,7 @@ import NodeOutput from "@/components/Workflow/Editor/NodeOutput.vue";
import DraggableWrapper from "@/components/Workflow/Editor/DraggablePan.vue";
import { computed, ref } from "vue";
import { useNodePosition } from "@/components/Workflow/Editor/composables/useNodePosition";
import { useWorkflowStateStore, type XYPosition } from "@/stores/workflowEditorStateStore";
import { useWorkflowStateStore, type TerminalPosition, type XYPosition } from "@/stores/workflowEditorStateStore";
import type { Step } from "@/stores/workflowStepStore";
import { DatatypesMapperModel } from "@/components/Datatypes/model";
import type { UseElementBoundingReturn, UseScrollReturn } from "@vueuse/core";
Expand All @@ -126,6 +125,7 @@ import { useWorkflowStepStore } from "@/stores/workflowStepStore";
import { faCodeBranch } from "@fortawesome/free-solid-svg-icons";
import { FontAwesomeIcon } from "@fortawesome/vue-fontawesome";
import { library } from "@fortawesome/fontawesome-svg-core";
import type { OutputTerminals } from "./modules/terminals";
Vue.use(BootstrapVue);
Expand Down Expand Up @@ -158,6 +158,7 @@ const emit = defineEmits([
"onClone",
"onUpdateStepPosition",
"pan-by",
"onDragConnector",
"stopDragging",
]);
Expand Down Expand Up @@ -240,6 +241,10 @@ const outputs = computed(() => {
return [...stepOutputs, ...invalidOutputs.value];
});
function onDragConnector(dragPosition: TerminalPosition, terminal: OutputTerminals) {
emit("onDragConnector", dragPosition, terminal);
}
function onMoveTo(position: XYPosition) {
emit("onUpdateStepPosition", props.id, {
top: position.y + props.scroll.y.value / props.scale,
Expand Down
3 changes: 0 additions & 3 deletions client/src/components/Workflow/Editor/NodeInput.vue
Original file line number Diff line number Diff line change
Expand Up @@ -196,9 +196,6 @@ export default {
dragLeave(event) {
this.$root.$emit("bv::hide::tooltip", this.iconId);
},
onChange() {
this.$emit("onChange");
},
onRemove() {
const connections = this.connectionStore.getConnectionsForTerminal(this.id);
connections.forEach((connection) => this.terminal.disconnect(connection));
Expand Down
Loading

0 comments on commit bd75316

Please sign in to comment.