Commit 5df4a4dc authored by Ahmed Awan's avatar Ahmed Awan
Browse files

[25.0] Add user-facing explanation for legacy workflow run form usage

parent e067f0e2
Loading
Loading
Loading
Loading
+7 −3
Original line number Diff line number Diff line
@@ -54,6 +54,9 @@ const hasStepVersionChanges = ref(false);
const invocations = ref([]);
const simpleForm = ref(false);
const disableSimpleForm = ref(false);
const disableSimpleFormReason = ref<
    "hasReplacementParameters" | "hasDisconnectedInputs" | "hasWorkflowResourceParameters" | undefined
>(undefined);
const submissionError = ref("");
const workflowError = ref("");
const workflowName = ref("");
@@ -115,24 +118,24 @@ async function loadRun() {
            // on the frontend. If these are implemented on the backend at some
            // point this restriction can be lifted.
            if (incomingModel.hasReplacementParametersInToolForm) {
                console.log("cannot render simple workflow form - has ${} values in tool steps");
                simpleForm.value = false;
                disableSimpleForm.value = true;
                disableSimpleFormReason.value = "hasReplacementParameters";
            }
            // If there are required parameters in a tool form (a disconnected runtime
            // input), we have to render the tool form steps and cannot use the
            // simplified tool form.
            if (incomingModel.hasOpenToolSteps) {
                console.log("cannot render simple workflow form - one or more tools have disconnected runtime inputs");
                simpleForm.value = false;
                disableSimpleForm.value = true;
                disableSimpleFormReason.value = "hasDisconnectedInputs";
            }
            // Just render the whole form for resource request parameters (kind of
            // niche - I'm not sure anyone is using these currently anyway).
            if (incomingModel.hasWorkflowResourceParameters) {
                console.log(`Cannot render simple workflow form - workflow resource parameters are configured`);
                simpleForm.value = false;
                disableSimpleForm.value = true;
                disableSimpleFormReason.value = "hasWorkflowResourceParameters";
            }
        }

@@ -260,6 +263,7 @@ defineExpose({
                        :model="workflowModel"
                        :can-mutate-current-history="canRunOnHistory"
                        :disable-simple-form="disableSimpleForm"
                        :disable-simple-form-reason="disableSimpleFormReason"
                        @submissionSuccess="handleInvocations"
                        @submissionError="handleSubmissionError"
                        @showSimple="advancedForm = false" />
+22 −0
Original line number Diff line number Diff line
@@ -18,6 +18,9 @@
                    @click="$emit('showSimple')">
                    <span class="fas fa-arrow-left" /> Simple Form
                </b-button>
                <b-badge v-else class="d-flex align-items-center flex-gapx-1" variant="warning">
                    <span class="fas fa-exclamation-triangle" /> Legacy Form
                </b-badge>
                <ButtonSpinner
                    id="run-workflow"
                    title="Run Workflow"
@@ -26,6 +29,21 @@
                    @onClick="onExecute" />
            </div>
        </div>
        <BAlert v-if="disableSimpleFormReason" show variant="warning">
            This is the legacy workflow run form.
            <span v-if="disableSimpleFormReason === 'hasReplacementParameters'">
                This workflow contains parameters in tool steps that require advanced handling. The simplified form does
                not support these parameters.
            </span>
            <span v-else-if="disableSimpleFormReason === 'hasDisconnectedInputs'">
                One or more tools in this workflow have required inputs that are not connected to other steps. The
                simplified form cannot handle disconnected runtime inputs.
            </span>
            <span v-else-if="disableSimpleFormReason === 'hasWorkflowResourceParameters'">
                This workflow is configured with resource request parameters. The simplified form does not support
                workflows with resource options.
            </span>
        </BAlert>
        <FormCard v-if="wpInputsAvailable" title="Workflow Parameters">
            <template v-slot:body>
                <FormDisplay :inputs="wpInputs" @onChange="onWpInputs" />
@@ -108,6 +126,10 @@ export default {
            type: Boolean,
            default: false,
        },
        disableSimpleFormReason: {
            type: String,
            default: undefined,
        },
    },
    data() {
        return {