Skip to content

Commit f8ee350

Browse files
committed
[WIP] Use tool request API from the tool form.
1 parent e7d1ed8 commit f8ee350

File tree

12 files changed

+1635
-99
lines changed

12 files changed

+1635
-99
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
@@ -72,3 +72,12 @@ export function fetchJobErrorMessage(jobDetails: ShowFullJobResponse): string |
7272
}
7373
return errorMessage;
7474
}
75+
76+
export async function getToolInputs(tool_id: string, tool_version: string) {
77+
return GalaxyApi().GET(`/api/tools/{tool_id}/inputs`, {
78+
params: {
79+
query: { tool_version },
80+
path: { tool_id },
81+
},
82+
});
83+
}

client/src/components/Tool/ToolForm.vue

Lines changed: 202 additions & 89 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
@@ -38,6 +38,7 @@ describe("ToolSuccessMessage", () => {
3838
propsData: {
3939
jobResponse: TEST_JOB_RESPONSE,
4040
toolName: TEST_TOOL_NAME,
41+
usedToolRequest: false,
4142
},
4243
stubs: {
4344
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
Lines changed: 305 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,305 @@
1+
/* tslint:disable */
2+
/* eslint-disable */
3+
/**
4+
/* This file was automatically generated from pydantic models by running pydantic2ts.
5+
/* Do not modify it by hand - just update the pydantic models and then re-run the script
6+
*/
7+
8+
export type ToolParameterModel =
9+
| TextParameterModel
10+
| IntegerParameterModel
11+
| FloatParameterModel
12+
| BooleanParameterModel
13+
| HiddenParameterModel
14+
| SelectParameterModel
15+
| DataParameterModel
16+
| DataCollectionParameterModel
17+
| DirectoryUriParameterModel
18+
| RulesParameterModel
19+
| ColorParameterModel
20+
| ConditionalParameterModel
21+
| RepeatParameterModel
22+
| CwlIntegerParameterModel
23+
| CwlFloatParameterModel
24+
| CwlStringParameterModel
25+
| CwlBooleanParameterModel
26+
| CwlNullParameterModel
27+
| CwlFileParameterModel
28+
| CwlDirectoryParameterModel
29+
| CwlUnionParameterModel;
30+
31+
export interface BaseGalaxyToolParameterModelDefinition {
32+
name: string;
33+
parameter_type: string;
34+
hidden?: boolean;
35+
label?: string;
36+
help?: string;
37+
argument?: string;
38+
refresh_on_change?: boolean;
39+
optional?: boolean;
40+
is_dynamic?: boolean;
41+
}
42+
export interface BaseToolParameterModelDefinition {
43+
name: string;
44+
parameter_type: string;
45+
}
46+
export interface BooleanParameterModel {
47+
name: string;
48+
parameter_type?: "gx_boolean";
49+
hidden?: boolean;
50+
label?: string;
51+
help?: string;
52+
argument?: string;
53+
refresh_on_change?: boolean;
54+
optional?: boolean;
55+
is_dynamic?: boolean;
56+
value?: boolean;
57+
truevalue?: string;
58+
falsevalue?: string;
59+
}
60+
export interface ColorParameterModel {
61+
name: string;
62+
parameter_type?: "gx_color";
63+
hidden?: boolean;
64+
label?: string;
65+
help?: string;
66+
argument?: string;
67+
refresh_on_change?: boolean;
68+
optional?: boolean;
69+
is_dynamic?: boolean;
70+
}
71+
export interface ConditionalParameterModel {
72+
name: string;
73+
parameter_type?: "gx_conditional";
74+
hidden?: boolean;
75+
label?: string;
76+
help?: string;
77+
argument?: string;
78+
refresh_on_change?: boolean;
79+
optional?: boolean;
80+
is_dynamic?: boolean;
81+
test_parameter: BooleanParameterModel | SelectParameterModel;
82+
whens: ConditionalWhen[];
83+
}
84+
export interface SelectParameterModel {
85+
name: string;
86+
parameter_type?: "gx_select";
87+
hidden?: boolean;
88+
label?: string;
89+
help?: string;
90+
argument?: string;
91+
refresh_on_change?: boolean;
92+
optional?: boolean;
93+
is_dynamic?: boolean;
94+
options?: LabelValue[];
95+
multiple: boolean;
96+
}
97+
export interface LabelValue {
98+
label: string;
99+
value: string;
100+
}
101+
export interface ConditionalWhen {
102+
discriminator: boolean | string;
103+
parameters: ToolParameterModel[];
104+
}
105+
export interface TextParameterModel {
106+
name: string;
107+
parameter_type?: "gx_text";
108+
hidden?: boolean;
109+
label?: string;
110+
help?: string;
111+
argument?: string;
112+
refresh_on_change?: boolean;
113+
optional?: boolean;
114+
is_dynamic?: boolean;
115+
area?: boolean;
116+
value?: string;
117+
default_options?: LabelValue[];
118+
}
119+
export interface IntegerParameterModel {
120+
name: string;
121+
parameter_type?: "gx_integer";
122+
hidden?: boolean;
123+
label?: string;
124+
help?: string;
125+
argument?: string;
126+
refresh_on_change?: boolean;
127+
optional: boolean;
128+
is_dynamic?: boolean;
129+
value?: number;
130+
min?: number;
131+
max?: number;
132+
}
133+
export interface FloatParameterModel {
134+
name: string;
135+
parameter_type?: "gx_float";
136+
hidden?: boolean;
137+
label?: string;
138+
help?: string;
139+
argument?: string;
140+
refresh_on_change?: boolean;
141+
optional?: boolean;
142+
is_dynamic?: boolean;
143+
value?: number;
144+
min?: number;
145+
max?: number;
146+
}
147+
export interface HiddenParameterModel {
148+
name: string;
149+
parameter_type?: "gx_hidden";
150+
hidden?: boolean;
151+
label?: string;
152+
help?: string;
153+
argument?: string;
154+
refresh_on_change?: boolean;
155+
optional?: boolean;
156+
is_dynamic?: boolean;
157+
}
158+
export interface DataParameterModel {
159+
name: string;
160+
parameter_type?: "gx_data";
161+
hidden?: boolean;
162+
label?: string;
163+
help?: string;
164+
argument?: string;
165+
refresh_on_change?: boolean;
166+
optional?: boolean;
167+
is_dynamic?: boolean;
168+
extensions?: string[];
169+
multiple?: boolean;
170+
min?: number;
171+
max?: number;
172+
}
173+
export interface DataCollectionParameterModel {
174+
name: string;
175+
parameter_type?: "gx_data_collection";
176+
hidden?: boolean;
177+
label?: string;
178+
help?: string;
179+
argument?: string;
180+
refresh_on_change?: boolean;
181+
optional?: boolean;
182+
is_dynamic?: boolean;
183+
collection_type?: string;
184+
extensions?: string[];
185+
}
186+
export interface DirectoryUriParameterModel {
187+
name: string;
188+
parameter_type: "gx_directory_uri";
189+
hidden?: boolean;
190+
label?: string;
191+
help?: string;
192+
argument?: string;
193+
refresh_on_change?: boolean;
194+
optional?: boolean;
195+
is_dynamic?: boolean;
196+
value?: string;
197+
}
198+
export interface RulesParameterModel {
199+
name: string;
200+
parameter_type?: "gx_rules";
201+
hidden?: boolean;
202+
label?: string;
203+
help?: string;
204+
argument?: string;
205+
refresh_on_change?: boolean;
206+
optional?: boolean;
207+
is_dynamic?: boolean;
208+
}
209+
export interface RepeatParameterModel {
210+
name: string;
211+
parameter_type?: "gx_repeat";
212+
hidden?: boolean;
213+
label?: string;
214+
help?: string;
215+
argument?: string;
216+
refresh_on_change?: boolean;
217+
optional?: boolean;
218+
is_dynamic?: boolean;
219+
parameters: ToolParameterModel[];
220+
}
221+
export interface CwlIntegerParameterModel {
222+
name: string;
223+
parameter_type?: "cwl_integer";
224+
}
225+
export interface CwlFloatParameterModel {
226+
name: string;
227+
parameter_type?: "cwl_float";
228+
}
229+
export interface CwlStringParameterModel {
230+
name: string;
231+
parameter_type?: "cwl_string";
232+
}
233+
export interface CwlBooleanParameterModel {
234+
name: string;
235+
parameter_type?: "cwl_boolean";
236+
}
237+
export interface CwlNullParameterModel {
238+
name: string;
239+
parameter_type?: "cwl_null";
240+
}
241+
export interface CwlFileParameterModel {
242+
name: string;
243+
parameter_type?: "cwl_file";
244+
hidden?: boolean;
245+
label?: string;
246+
help?: string;
247+
argument?: string;
248+
refresh_on_change?: boolean;
249+
optional?: boolean;
250+
is_dynamic?: boolean;
251+
}
252+
export interface CwlDirectoryParameterModel {
253+
name: string;
254+
parameter_type?: "cwl_directory";
255+
hidden?: boolean;
256+
label?: string;
257+
help?: string;
258+
argument?: string;
259+
refresh_on_change?: boolean;
260+
optional?: boolean;
261+
is_dynamic?: boolean;
262+
}
263+
export interface CwlUnionParameterModel {
264+
name: string;
265+
parameter_type?: "cwl_union";
266+
parameters: ToolParameterModel[];
267+
}
268+
export interface DataCollectionRequest {
269+
src: "hdca";
270+
id: string;
271+
}
272+
export interface DataCollectionRequestInternal {
273+
src: "hdca";
274+
id: number;
275+
}
276+
export interface DataRequest {
277+
src: "hda" | "ldda";
278+
id: string;
279+
}
280+
export interface DataRequestInteranl {
281+
src: "hda" | "ldda";
282+
id: number;
283+
}
284+
export interface MultiDataInstance {
285+
src: "hda" | "ldda" | "hdca";
286+
id: string;
287+
}
288+
export interface MultiDataInstanceInternal {
289+
src: "hda" | "ldda" | "hdca";
290+
id: number;
291+
}
292+
export interface RulesMapping {
293+
type: string;
294+
columns: number[];
295+
}
296+
export interface RulesModel {
297+
rules: {
298+
[k: string]: unknown;
299+
}[];
300+
mappings: RulesMapping[];
301+
}
302+
export interface StrictModel {}
303+
export interface ToolParameterBundleModel {
304+
input_models: ToolParameterModel[];
305+
}

0 commit comments

Comments
 (0)