Fix: support hide env & conversation var in prompt editor (#7256)

This commit is contained in:
KVOJJJin 2024-08-14 15:14:39 +08:00 committed by GitHub
parent b5d472fad7
commit 429e85f5d6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 8 additions and 0 deletions

View File

@ -7,12 +7,16 @@ import {
import type { ValueSelector, Var } from '@/app/components/workflow/types'
type Params = {
onlyLeafNodeVar?: boolean
hideEnv?: boolean
hideChatVar?: boolean
filterVar: (payload: Var, selector: ValueSelector) => boolean
}
const useAvailableVarList = (nodeId: string, {
onlyLeafNodeVar,
filterVar,
hideEnv,
hideChatVar,
}: Params = {
onlyLeafNodeVar: false,
filterVar: () => true,
@ -32,6 +36,8 @@ const useAvailableVarList = (nodeId: string, {
beforeNodes: availableNodes,
isChatMode,
filterVar,
hideEnv,
hideChatVar,
})
return {

View File

@ -23,6 +23,8 @@ const Panel: FC<NodePanelProps<AnswerNodeType>> = ({
const { availableVars, availableNodesWithParent } = useAvailableVarList(id, {
onlyLeafNodeVar: false,
hideChatVar: true,
hideEnv: true,
filterVar,
})