mirror of https://github.com/langgenius/dify.git
human input step run when no variables
This commit is contained in:
parent
be3c6da654
commit
8703515153
|
|
@ -158,11 +158,11 @@ const BeforeRunForm: FC<BeforeRunFormProps> = ({
|
|||
if(hasRun.current)
|
||||
return
|
||||
hasRun.current = true
|
||||
if(filteredExistVarForms.length === 0)
|
||||
if(filteredExistVarForms.length === 0 && !isHumanInput)
|
||||
onRun({})
|
||||
}, [filteredExistVarForms, onRun])
|
||||
|
||||
if(filteredExistVarForms.length === 0)
|
||||
if(filteredExistVarForms.length === 0 && !isHumanInput)
|
||||
return null
|
||||
|
||||
return (
|
||||
|
|
@ -189,6 +189,7 @@ const BeforeRunForm: FC<BeforeRunFormProps> = ({
|
|||
<SingleRunForm
|
||||
nodeName={nodeName}
|
||||
handleBack={handleHideGeneratedForm}
|
||||
showBackButton={generatedFormContentData.showBackButton}
|
||||
formContent={generatedFormContentData.formContent}
|
||||
inputFields={generatedFormContentData.inputFields}
|
||||
userActions={generatedFormContentData.userActions}
|
||||
|
|
|
|||
|
|
@ -300,6 +300,12 @@ const useLastRun = <T>({
|
|||
if(!isValid)
|
||||
return
|
||||
const vars = singleRunParams?.getDependentVars?.()
|
||||
// TODO human input
|
||||
if (singleRunParams?.generatedFormContentData) {
|
||||
singleRunParams?.handleShowGeneratedForm()
|
||||
showSingleRun()
|
||||
return
|
||||
}
|
||||
// no need to input params
|
||||
if (isAggregatorNode ? checkAggregatorVarsSet(vars) : isAllVarsHasValue(vars)) {
|
||||
callRunApi({}, async () => {
|
||||
|
|
|
|||
|
|
@ -14,6 +14,7 @@ type Props = {
|
|||
formContent: string
|
||||
inputFields: GeneratedFormInputItem[]
|
||||
userActions: UserAction[]
|
||||
showBackButton?: boolean
|
||||
handleBack?: () => void
|
||||
}
|
||||
|
||||
|
|
@ -22,6 +23,7 @@ const FormContent = ({
|
|||
formContent,
|
||||
inputFields,
|
||||
userActions,
|
||||
showBackButton,
|
||||
handleBack,
|
||||
}: Props) => {
|
||||
const { t } = useTranslation()
|
||||
|
|
@ -72,7 +74,7 @@ const FormContent = ({
|
|||
|
||||
return (
|
||||
<>
|
||||
{inputFields.length > 0 && (
|
||||
{showBackButton && (
|
||||
<div className='flex items-center p-4 pb-1'>
|
||||
<div className='system-sm-semibold-uppercase flex cursor-pointer items-center text-text-accent' onClick={handleBack}>
|
||||
<RiArrowLeftLine className='mr-1 h-4 w-4' />
|
||||
|
|
|
|||
|
|
@ -75,6 +75,7 @@ const useSingleRunFormParams = ({
|
|||
formContent: inputs.form_content,
|
||||
inputFields: formContentOutputFields,
|
||||
userActions: inputs.user_actions,
|
||||
showBackButton: false,
|
||||
}
|
||||
}
|
||||
else {
|
||||
|
|
@ -89,6 +90,7 @@ const useSingleRunFormParams = ({
|
|||
formContent: newContent,
|
||||
inputFields: formContentOutputFields,
|
||||
userActions: inputs.user_actions,
|
||||
showBackButton: true,
|
||||
}
|
||||
}
|
||||
}, [inputs.form_content, inputs.user_actions, submittedData, formContentOutputFields])
|
||||
|
|
|
|||
Loading…
Reference in New Issue