feat: support chatflow start node custom input field hidden (#19678)

This commit is contained in:
Panpan authored and GitHub committed 2025-05-21 13:52:21 +08:00
1 parent 627911d4ff
commit ef3569e667
19 files changed
+76 -18

No files matched your search

@@ -39,6 +39,7 @@ const DebugAndPreview = () => {
const nodes = useNodes<StartNodeType>()
const startNode = nodes.find(node => node.data.type === BlockEnum.Start)
const variables = startNode?.data.variables || []
const visibleVariables = variables.filter(v => v.hide !== true)
const [showConversationVariableModal, setShowConversationVariableModal] = useState(false)
@@ -107,7 +108,7 @@ const DebugAndPreview = () => {
</ActionButton>
</Tooltip>
)}
{variables.length > 0 && (
{visibleVariables.length > 0 && (
<div className='relative'>
<Tooltip
popupContent={t('workflow.panel.userInputField')}
@@ -17,6 +17,7 @@ const UserInput = () => {
const nodes = useNodes<StartNodeType>()
const startNode = nodes.find(node => node.data.type === BlockEnum.Start)
const variables = startNode?.data.variables || []
const visibleVariables = variables.filter(v => v.hide !== true)
const handleValueChange = (variable: string, v: string) => {
const {
@@ -29,13 +30,13 @@ const UserInput = () => {
})
}
if (!variables.length)
if (!visibleVariables.length)
return null
return (
<div className={cn('sticky top-0 z-[1] rounded-xl border-[0.5px] border-components-panel-border-subtle bg-components-panel-on-panel-item-bg shadow-xs')}>
<div className='px-4 pb-4 pt-3'>
{variables.map((variable, index) => (
{visibleVariables.map((variable, index) => (
<div
key={variable.variable}
className='mb-4 last-of-type:mb-0'
+1
View File
@@ -198,6 +198,7 @@ export type InputVar = {
hint?: string
options?: string[]
value_selector?: ValueSelector
hide: boolean
} & Partial<UploadFileSetting>
export type ModelConfig = {