Merge pull request #20431 from ahmedhamidawan/workflow_legacy_form_indicator

[25.0] Add user-facing explanation for legacy workflow run form usage
This commit is contained in:
Marius van den Beek
2025-06-11 21:08:43 +02:00
committed by GitHub
2 changed files with 26 additions and 3 deletions
@@ -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" />
@@ -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 {