Skip to content

Commit 0fccb9b

Browse files
committed
Add tool requeset API support to tool form (sort of)
1 parent c3cf346 commit 0fccb9b

File tree

12 files changed

+4107
-105
lines changed

12 files changed

+4107
-105
lines changed

client/src/api/jobs.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,4 +39,5 @@ export interface ResponseVal {
3939
jobDef: JobDef;
4040
jobResponse: JobResponse;
4141
toolName: string;
42+
usedToolRequest: boolean;
4243
}

client/src/api/tools.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,3 +81,12 @@ export function fetchJobErrorMessage(jobDetails: ShowFullJobResponse): string |
8181
}
8282
return errorMessage;
8383
}
84+
85+
export async function getToolInputs(tool_id: string, tool_version: string) {
86+
return GalaxyApi().GET(`/api/tools/{tool_id}/inputs`, {
87+
params: {
88+
query: { tool_version },
89+
path: { tool_id },
90+
},
91+
});
92+
}

client/src/components/Tool/ToolForm.vue

Lines changed: 207 additions & 95 deletions
Large diffs are not rendered by default.

client/src/components/Tool/ToolSuccess.vue

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ const router = useRouter();
2020
2121
const jobDef = computed(() => latestResponse.value?.jobDef);
2222
const jobResponse = computed(() => latestResponse.value?.jobResponse);
23+
const responseVal = computed(() => jobStore.latestResponse);
24+
const usedToolRequest = computed(() => responseVal.value?.usedToolRequest);
2325
const showRecommendation = computed(() => config.value.enable_tool_recommendations);
2426
const toolName = computed(() => latestResponse.value?.toolName);
2527
@@ -38,7 +40,10 @@ if (!latestResponse.value || Object.keys(latestResponse.value).length === 0) {
3840
<div v-if="jobResponse?.produces_entry_points">
3941
<ToolEntryPoints v-for="job in jobResponse.jobs" :key="job.id" :job-id="job.id" />
4042
</div>
41-
<ToolSuccessMessage :job-response="jobResponse" :tool-name="toolName || '...'" />
43+
<ToolSuccessMessage
44+
:job-response="jobResponse"
45+
:tool-name="toolName || '...'"
46+
:used-tool-request="usedToolRequest || false" />
4247
<Webhook v-if="jobDef" type="tool" :tool-id="jobDef.tool_id" />
4348
<ToolRecommendation v-if="showRecommendation && jobDef" :tool-id="jobDef.tool_id" />
4449
</div>

client/src/components/Tool/ToolSuccessMessage.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ describe("ToolSuccessMessage", () => {
4545
propsData: {
4646
jobResponse: TEST_JOB_RESPONSE,
4747
toolName: TEST_TOOL_NAME,
48+
usedToolRequest: false,
4849
},
4950
stubs: {
5051
FontAwesomeIcon: true,

client/src/components/Tool/ToolSuccessMessage.vue

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import ExternalLink from "../ExternalLink.vue";
99
const props = defineProps<{
1010
jobResponse: JobResponse;
1111
toolName: string;
12+
usedToolRequest: boolean;
1213
}>();
1314
1415
const outputs = computed(() => props.jobResponse.outputs.concat(props.jobResponse.output_collections));
@@ -22,15 +23,23 @@ const nOutputsText = computed(() => (outputs.value.length > 1 ? `${outputs.value
2223

2324
<template>
2425
<div class="donemessagelarge">
25-
<p>
26-
Started tool <b>{{ props.toolName }}</b> and successfully added {{ nJobsText }} to the queue.
27-
</p>
28-
<p>It produces {{ nOutputsText }}:</p>
29-
<ul data-description="list of outputs">
30-
<li v-for="item of outputs" :key="item.hid">
31-
<b>{{ item.hid }}: {{ item.name }}</b>
32-
</li>
33-
</ul>
26+
<div v-if="usedToolRequest">
27+
You used the fancy new API... something new will be here.
28+
<img
29+
src="https://www.animatedimages.org/data/media/695/animated-under-construction-image-0055.gif"
30+
alt="90s style under construction" />
31+
</div>
32+
<div v-else>
33+
<p>
34+
Started tool <b>{{ props.toolName }}</b> and successfully added {{ nJobsText }} to the queue.
35+
</p>
36+
<p>It produces {{ nOutputsText }}:</p>
37+
<ul data-description="list of outputs">
38+
<li v-for="item of outputs" :key="item.hid">
39+
<b>{{ item.hid }}: {{ item.name }}</b>
40+
</li>
41+
</ul>
42+
</div>
3443
<p>
3544
You can check the status of queued jobs and view the resulting data by refreshing the History panel. When
3645
the job has been run the status will change from 'running' to 'finished' if completed successfully or

0 commit comments

Comments
 (0)