Unverified Commit af2d2408 authored by John Chilton's avatar John Chilton Committed by GitHub
Browse files

Merge pull request #20761 from mvdbeek/user_defined_tools_configfiles

Add configfiles support and various enhancements for user defined tools
parents 5777a716 eb823365
Loading
Loading
Loading
Loading
+59 −1
Original line number Diff line number Diff line
@@ -14066,6 +14066,11 @@ export interface components {
             * @description TODO
             */
            tool_inputs?: unknown;
            /**
             * Tool UUID
             * @description The universal unique identifier of the tool associated with this step. Takes precedence over tool_id if set.
             */
            tool_uuid?: string | null;
            /**
             * Tool Version
             * @description The version of the tool associated with this step.
@@ -14108,6 +14113,11 @@ export interface components {
             * @description TODO
             */
            tool_inputs?: unknown;
            /**
             * Tool UUID
             * @description The universal unique identifier of the tool associated with this step. Takes precedence over tool_id if set.
             */
            tool_uuid?: string | null;
            /**
             * Tool Version
             * @description The version of the tool associated with this step.
@@ -14150,6 +14160,11 @@ export interface components {
             * @description TODO
             */
            tool_inputs?: unknown;
            /**
             * Tool UUID
             * @description The universal unique identifier of the tool associated with this step. Takes precedence over tool_id if set.
             */
            tool_uuid?: string | null;
            /**
             * Tool Version
             * @description The version of the tool associated with this step.
@@ -14306,7 +14321,10 @@ export interface components {
             * @description Parameter name. Used when referencing parameter in workflows or inside command templating.
             */
            name: string;
            /** Optional */
            /**
             * Optional
             * @default false
             */
            optional: boolean;
            /**
             * Parameter Type
@@ -18103,6 +18121,11 @@ export interface components {
             * @description TODO
             */
            tool_inputs?: unknown;
            /**
             * Tool UUID
             * @description The universal unique identifier of the tool associated with this step. Takes precedence over tool_id if set.
             */
            tool_uuid?: string | null;
            /**
             * Tool Version
             * @description The version of the tool associated with this step.
@@ -20200,6 +20223,11 @@ export interface components {
             * @description TODO
             */
            tool_inputs?: unknown;
            /**
             * Tool UUID
             * @description The universal unique identifier of the tool associated with this step. Takes precedence over tool_id if set.
             */
            tool_uuid?: string | null;
            /**
             * Tool Version
             * @description The version of the tool associated with this step.
@@ -20729,6 +20757,11 @@ export interface components {
             * @description TODO
             */
            tool_inputs?: unknown;
            /**
             * Tool UUID
             * @description The universal unique identifier of the tool associated with this step. Takes precedence over tool_id if set.
             */
            tool_uuid?: string | null;
            /**
             * Tool Version
             * @description The version of the tool associated with this step.
@@ -21800,6 +21833,11 @@ export interface components {
             * @enum {string}
             */
            class: "GalaxyUserTool";
            /**
             * Configfiles
             * @description A list of config files for this tool.
             */
            configfiles?: components["schemas"]["YamlTemplateConfigFile"][] | null;
            /**
             * Container
             * @description Container image to use for this tool.
@@ -21882,6 +21920,11 @@ export interface components {
             * @constant
             */
            class: "GalaxyUserTool";
            /**
             * Configfiles
             * @description A list of config files for this tool.
             */
            configfiles?: components["schemas"]["YamlTemplateConfigFile"][] | null;
            /**
             * Container
             * @description Container image to use for this tool.
@@ -22797,6 +22840,21 @@ export interface components {
             */
            namespace: string;
        };
        /** YamlTemplateConfigFile */
        YamlTemplateConfigFile: {
            /** Content */
            content: string;
            /**
             * Eval Engine
             * @default ecmascript
             * @constant
             */
            eval_engine: "ecmascript";
            /** Filename */
            filename?: string | null;
            /** Name */
            name?: string | null;
        };
        /** Organization */
        galaxy__schema__drs__Organization: {
            /**
+1 −0
Original line number Diff line number Diff line
@@ -125,6 +125,7 @@ watch(
                            :tool-version="step.tool_version" />
                        <WorkflowStepTitle
                            :step-tool-id="step.tool_id"
                            :step-tool-uuid="step.tool_uuid"
                            :step-subworkflow-id="step.subworkflow_id"
                            :step-label="step.label"
                            :step-type="step.type"
+10 −0
Original line number Diff line number Diff line
<script setup lang="ts">
import { faEdit, faPlus, faWrench } from "@fortawesome/free-solid-svg-icons";
import { FontAwesomeIcon } from "@fortawesome/vue-fontawesome";
import { faCancel } from "font-awesome-6";
import { storeToRefs } from "pinia";
import { computed } from "vue";
import { useRoute, useRouter } from "vue-router/composables";
@@ -88,6 +89,15 @@ function getToolBadges(tool: UnprivilegedToolResponse) {

function getToolSecondaryActions(tool: UnprivilegedToolResponse) {
    return [
        {
            id: "deactivate",
            label: "Deactivate",
            icon: faCancel,
            title: "Deactivate this custom tool",
            handler: () => {
                unprivilegedToolStore.deactivateTool(tool.uuid);
            },
        },
        {
            id: "edit",
            label: "Edit",
+16 −2
Original line number Diff line number Diff line
<script setup lang="ts">
import { faSave } from "@fortawesome/free-regular-svg-icons";
import { FontAwesomeIcon } from "@fortawesome/vue-fontawesome";
import { loader, useMonaco, VueMonacoEditor } from "@guolao/vue-monaco-editor";
import * as monaco from "monaco-editor";
import { nextTick, onUnmounted, ref, watch } from "vue";
@@ -75,7 +77,9 @@ if (props.toolUuid) {
        })
        .then(({ data, error }) => {
            if (!error) {
                yamlRepresentation.value = stringify(data.representation);
                yamlRepresentation.value = stringify(data.representation, {
                    blockQuote: "literal",
                });
            }
        });
}
@@ -104,9 +108,19 @@ async function saveTool() {

<template>
    <div>
        <b-alert v-if="errorMsg" variant="danger" show dismissible>
            {{ errorMsg }}
        </b-alert>
        <div class="d-flex flex-gapx-1">
            <Heading h1 separator inline size="lg" class="flex-grow-1 mb-2">Tool Editor</Heading>
            <b-button variant="primary" size="m" @click="saveTool">Save</b-button>
            <b-button
                variant="primary"
                size="m"
                title="Save Custom Tool"
                data-description="save custom tool"
                @click="saveTool"
                ><FontAwesomeIcon :icon="faSave"
            /></b-button>
        </div>
        <VueMonacoEditor
            v-model="yamlRepresentation"
+1 −1
Original line number Diff line number Diff line
@@ -307,7 +307,7 @@ export default {
            this.disabled = true;
            this.loading = true;

            return getToolFormData(this.id, this.currentVersion, this.job_id, this.history_id)
            return getToolFormData(this.id || this.toolUuid, this.currentVersion, this.job_id, this.history_id)
                .then((data) => {
                    this.currentVersion = data.version;
                    this.formConfig = data;
Loading