Unverified Commit 38f322f2 authored by Marius van den Beek's avatar Marius van den Beek Committed by GitHub
Browse files

Merge pull request #20431 from ahmedhamidawan/workflow_legacy_form_indicator

[25.0] Add user-facing explanation for legacy workflow run form usage
parents 100612b3 795d3606
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" />
+19 −0
Original line number Diff line number Diff line
@@ -26,6 +26,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 +123,10 @@ export default {
            type: Boolean,
            default: false,
        },
        disableSimpleFormReason: {
            type: String,
            default: undefined,
        },
    },
    data() {
        return {