Skip to content

Commit

Permalink
Fix: support hide env & conversation var in prompt editor (#7256)
Browse files Browse the repository at this point in the history
  • Loading branch information
JzoNgKVO authored Aug 14, 2024
1 parent b5d472f commit 429e85f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -32,6 +36,8 @@ const useAvailableVarList = (nodeId: string, {
beforeNodes: availableNodes,
isChatMode,
filterVar,
hideEnv,
hideChatVar,
})

return {
Expand Down
2 changes: 2 additions & 0 deletions web/app/components/workflow/nodes/answer/panel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ const Panel: FC<NodePanelProps<AnswerNodeType>> = ({

const { availableVars, availableNodesWithParent } = useAvailableVarList(id, {
onlyLeafNodeVar: false,
hideChatVar: true,
hideEnv: true,
filterVar,
})

Expand Down

0 comments on commit 429e85f

Please sign in to comment.