Skip to content

Commit af2d240

Browse files
authored
Merge pull request #20761 from mvdbeek/user_defined_tools_configfiles
Add configfiles support and various enhancements for user defined tools
2 parents 5777a71 + eb82336 commit af2d240

File tree

38 files changed

+516
-100
lines changed

38 files changed

+516
-100
lines changed

client/src/api/schema/schema.ts

Lines changed: 59 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14066,6 +14066,11 @@ export interface components {
1406614066
* @description TODO
1406714067
*/
1406814068
tool_inputs?: unknown;
14069+
/**
14070+
* Tool UUID
14071+
* @description The universal unique identifier of the tool associated with this step. Takes precedence over tool_id if set.
14072+
*/
14073+
tool_uuid?: string | null;
1406914074
/**
1407014075
* Tool Version
1407114076
* @description The version of the tool associated with this step.
@@ -14108,6 +14113,11 @@ export interface components {
1410814113
* @description TODO
1410914114
*/
1411014115
tool_inputs?: unknown;
14116+
/**
14117+
* Tool UUID
14118+
* @description The universal unique identifier of the tool associated with this step. Takes precedence over tool_id if set.
14119+
*/
14120+
tool_uuid?: string | null;
1411114121
/**
1411214122
* Tool Version
1411314123
* @description The version of the tool associated with this step.
@@ -14150,6 +14160,11 @@ export interface components {
1415014160
* @description TODO
1415114161
*/
1415214162
tool_inputs?: unknown;
14163+
/**
14164+
* Tool UUID
14165+
* @description The universal unique identifier of the tool associated with this step. Takes precedence over tool_id if set.
14166+
*/
14167+
tool_uuid?: string | null;
1415314168
/**
1415414169
* Tool Version
1415514170
* @description The version of the tool associated with this step.
@@ -14306,7 +14321,10 @@ export interface components {
1430614321
* @description Parameter name. Used when referencing parameter in workflows or inside command templating.
1430714322
*/
1430814323
name: string;
14309-
/** Optional */
14324+
/**
14325+
* Optional
14326+
* @default false
14327+
*/
1431014328
optional: boolean;
1431114329
/**
1431214330
* Parameter Type
@@ -18103,6 +18121,11 @@ export interface components {
1810318121
* @description TODO
1810418122
*/
1810518123
tool_inputs?: unknown;
18124+
/**
18125+
* Tool UUID
18126+
* @description The universal unique identifier of the tool associated with this step. Takes precedence over tool_id if set.
18127+
*/
18128+
tool_uuid?: string | null;
1810618129
/**
1810718130
* Tool Version
1810818131
* @description The version of the tool associated with this step.
@@ -20200,6 +20223,11 @@ export interface components {
2020020223
* @description TODO
2020120224
*/
2020220225
tool_inputs?: unknown;
20226+
/**
20227+
* Tool UUID
20228+
* @description The universal unique identifier of the tool associated with this step. Takes precedence over tool_id if set.
20229+
*/
20230+
tool_uuid?: string | null;
2020320231
/**
2020420232
* Tool Version
2020520233
* @description The version of the tool associated with this step.
@@ -20729,6 +20757,11 @@ export interface components {
2072920757
* @description TODO
2073020758
*/
2073120759
tool_inputs?: unknown;
20760+
/**
20761+
* Tool UUID
20762+
* @description The universal unique identifier of the tool associated with this step. Takes precedence over tool_id if set.
20763+
*/
20764+
tool_uuid?: string | null;
2073220765
/**
2073320766
* Tool Version
2073420767
* @description The version of the tool associated with this step.
@@ -21800,6 +21833,11 @@ export interface components {
2180021833
* @enum {string}
2180121834
*/
2180221835
class: "GalaxyUserTool";
21836+
/**
21837+
* Configfiles
21838+
* @description A list of config files for this tool.
21839+
*/
21840+
configfiles?: components["schemas"]["YamlTemplateConfigFile"][] | null;
2180321841
/**
2180421842
* Container
2180521843
* @description Container image to use for this tool.
@@ -21882,6 +21920,11 @@ export interface components {
2188221920
* @constant
2188321921
*/
2188421922
class: "GalaxyUserTool";
21923+
/**
21924+
* Configfiles
21925+
* @description A list of config files for this tool.
21926+
*/
21927+
configfiles?: components["schemas"]["YamlTemplateConfigFile"][] | null;
2188521928
/**
2188621929
* Container
2188721930
* @description Container image to use for this tool.
@@ -22797,6 +22840,21 @@ export interface components {
2279722840
*/
2279822841
namespace: string;
2279922842
};
22843+
/** YamlTemplateConfigFile */
22844+
YamlTemplateConfigFile: {
22845+
/** Content */
22846+
content: string;
22847+
/**
22848+
* Eval Engine
22849+
* @default ecmascript
22850+
* @constant
22851+
*/
22852+
eval_engine: "ecmascript";
22853+
/** Filename */
22854+
filename?: string | null;
22855+
/** Name */
22856+
name?: string | null;
22857+
};
2280022858
/** Organization */
2280122859
galaxy__schema__drs__Organization: {
2280222860
/**

client/src/components/Markdown/Sections/Elements/Workflow/WorkflowDisplay.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,7 @@ watch(
125125
:tool-version="step.tool_version" />
126126
<WorkflowStepTitle
127127
:step-tool-id="step.tool_id"
128+
:step-tool-uuid="step.tool_uuid"
128129
:step-subworkflow-id="step.subworkflow_id"
129130
:step-label="step.label"
130131
:step-type="step.type"

client/src/components/Panels/UserToolPanel.vue

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<script setup lang="ts">
22
import { faEdit, faPlus, faWrench } from "@fortawesome/free-solid-svg-icons";
33
import { FontAwesomeIcon } from "@fortawesome/vue-fontawesome";
4+
import { faCancel } from "font-awesome-6";
45
import { storeToRefs } from "pinia";
56
import { computed } from "vue";
67
import { useRoute, useRouter } from "vue-router/composables";
@@ -88,6 +89,15 @@ function getToolBadges(tool: UnprivilegedToolResponse) {
8889
8990
function getToolSecondaryActions(tool: UnprivilegedToolResponse) {
9091
return [
92+
{
93+
id: "deactivate",
94+
label: "Deactivate",
95+
icon: faCancel,
96+
title: "Deactivate this custom tool",
97+
handler: () => {
98+
unprivilegedToolStore.deactivateTool(tool.uuid);
99+
},
100+
},
91101
{
92102
id: "edit",
93103
label: "Edit",

client/src/components/Tool/CustomToolEditor.vue

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
<script setup lang="ts">
2+
import { faSave } from "@fortawesome/free-regular-svg-icons";
3+
import { FontAwesomeIcon } from "@fortawesome/vue-fontawesome";
24
import { loader, useMonaco, VueMonacoEditor } from "@guolao/vue-monaco-editor";
35
import * as monaco from "monaco-editor";
46
import { nextTick, onUnmounted, ref, watch } from "vue";
@@ -75,7 +77,9 @@ if (props.toolUuid) {
7577
})
7678
.then(({ data, error }) => {
7779
if (!error) {
78-
yamlRepresentation.value = stringify(data.representation);
80+
yamlRepresentation.value = stringify(data.representation, {
81+
blockQuote: "literal",
82+
});
7983
}
8084
});
8185
}
@@ -104,9 +108,19 @@ async function saveTool() {
104108

105109
<template>
106110
<div>
111+
<b-alert v-if="errorMsg" variant="danger" show dismissible>
112+
{{ errorMsg }}
113+
</b-alert>
107114
<div class="d-flex flex-gapx-1">
108115
<Heading h1 separator inline size="lg" class="flex-grow-1 mb-2">Tool Editor</Heading>
109-
<b-button variant="primary" size="m" @click="saveTool">Save</b-button>
116+
<b-button
117+
variant="primary"
118+
size="m"
119+
title="Save Custom Tool"
120+
data-description="save custom tool"
121+
@click="saveTool"
122+
><FontAwesomeIcon :icon="faSave"
123+
/></b-button>
110124
</div>
111125
<VueMonacoEditor
112126
v-model="yamlRepresentation"

client/src/components/Tool/ToolForm.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,7 @@ export default {
307307
this.disabled = true;
308308
this.loading = true;
309309
310-
return getToolFormData(this.id, this.currentVersion, this.job_id, this.history_id)
310+
return getToolFormData(this.id || this.toolUuid, this.currentVersion, this.job_id, this.history_id)
311311
.then((data) => {
312312
this.currentVersion = data.version;
313313
this.formConfig = data;

client/src/components/Tool/ToolSourceSchema.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

client/src/components/Tool/services.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ export async function updateToolFormData(tool_id, tool_uuid, tool_version, histo
1010
inputs: inputs,
1111
history_id: history_id,
1212
};
13-
const url = `${getAppRoot()}api/tools/${tool_id}/build`;
13+
const url = `${getAppRoot()}api/tools/${tool_uuid || tool_id}/build`;
1414
try {
1515
const { data } = await axios.post(url, current_state);
1616
return data;

client/src/components/Workflow/Editor/Forms/FormTool.vue

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,7 @@ export default {
208208
postChanges(newVersion) {
209209
const payload = Object.assign({}, this.mainValues);
210210
const options = this.configForm;
211+
const toolUuid = options.uuid;
211212
let toolId = options.id;
212213
let toolVersion = options.version;
213214
if (newVersion) {
@@ -216,6 +217,7 @@ export default {
216217
}
217218
this.$emit("onSetData", this.stepId, {
218219
tool_id: toolId,
220+
tool_uuid: toolUuid,
219221
tool_version: toolVersion,
220222
type: "tool",
221223
inputs: payload,

client/src/components/WorkflowInvocationState/WorkflowInvocationError.vue

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@ function openJobInNewTab(jobId: string) {
114114
"
115115
:step-type="dependentWorkflowStep.type"
116116
:step-tool-id="dependentWorkflowStep.tool_id"
117+
:step-tool-uuid="dependentWorkflowStep.tool_uuid"
117118
:step-subworkflow-id="
118119
'workflow_id' in dependentWorkflowStep ? dependentWorkflowStep.workflow_id : null
119120
" />
@@ -132,6 +133,7 @@ function openJobInNewTab(jobId: string) {
132133
:step-label="invocationStep?.workflow_step_label || `Step ${workflowStep.id + 1}`"
133134
:step-type="workflowStep.type"
134135
:step-tool-id="workflowStep.tool_id"
136+
:step-tool-uuid="workflowStep.tool_uuid"
135137
:step-subworkflow-id="'workflow_id' in workflowStep ? workflowStep.workflow_id : null" />
136138
</strong>
137139
</GCard>

client/src/components/WorkflowInvocationState/WorkflowInvocationStep.vue

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -173,8 +173,9 @@ export default {
173173
...mapActions(useWorkflowStore, ["fetchWorkflowForInstanceId"]),
174174
...mapActions(useToolStore, ["fetchToolForId"]),
175175
fetchTool() {
176-
if (this.workflowStep.tool_id && !this.getToolForId(this.workflowStep.tool_id)) {
177-
this.fetchToolForId(this.workflowStep.tool_id);
176+
const toolId = this.workflowStep.tool_uuid || this.workflowStep.tool_id;
177+
if (toolId && !this.getToolForId(toolId)) {
178+
this.fetchToolForId(toolId);
178179
}
179180
},
180181
fetchSubworkflow() {
@@ -206,6 +207,7 @@ export default {
206207
stepLabel: invocationStep && invocationStep.workflow_step_label,
207208
stepType: this.workflowStep.type,
208209
stepToolId: this.workflowStep.tool_id,
210+
stepToolUuid: this.workflowStep.tool_uuid,
209211
stepSubworkflowId: this.workflowStep.workflow_id,
210212
};
211213
return rval;

0 commit comments

Comments
 (0)