File tree Expand file tree Collapse file tree 3 files changed +4
-36
lines changed
app/workspace/[workspaceId]/w/[workflowId]/components/workflow-block Expand file tree Collapse file tree 3 files changed +4
-36
lines changed Original file line number Diff line number Diff line change @@ -35,7 +35,7 @@ import { getDependsOnFields } from '@/blocks/utils'
3535import { useMcpServers , useMcpToolsQuery } from '@/hooks/queries/mcp'
3636import { useCredentialName } from '@/hooks/queries/oauth-credentials'
3737import { useCollaborativeWorkflow } from '@/hooks/use-collaborative-workflow'
38- import { useKnowledgeBaseName } from '@/hooks/use-knowledge-base-name '
38+ import { useKnowledgeBase } from '@/hooks/use-knowledge'
3939import { useSelectorDisplayName } from '@/hooks/use-selector-display-name'
4040import { useVariablesStore } from '@/stores/panel/variables/store'
4141import { useWorkflowRegistry } from '@/stores/workflows/registry/store'
@@ -409,11 +409,10 @@ const SubBlockRow = ({
409409 planId : planIdValue ,
410410 } )
411411
412- const knowledgeBaseDisplayName = useKnowledgeBaseName (
413- subBlock ?. type === 'knowledge-base-selector' && typeof rawValue === 'string'
414- ? rawValue
415- : undefined
412+ const { knowledgeBase : kbForDisplayName } = useKnowledgeBase (
413+ subBlock ?. type === 'knowledge-base-selector' && typeof rawValue === 'string' ? rawValue : ''
416414 )
415+ const knowledgeBaseDisplayName = kbForDisplayName ?. name ?? null
417416
418417 const workflowMap = useWorkflowRegistry ( ( state ) => state . workflows )
419418 const workflowSelectionName =
Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -57,22 +57,6 @@ export function useKnowledgeBaseTagDefinitions(knowledgeBaseId: string | null) {
5757 }
5858 } , [ knowledgeBaseId ] )
5959
60- const getTagLabel = useCallback (
61- ( tagSlot : string ) : string => {
62- const definition = tagDefinitions . find ( ( def ) => def . tagSlot === tagSlot )
63- return definition ?. displayName || tagSlot
64- } ,
65- [ tagDefinitions ]
66- )
67-
68- const getTagDefinition = useCallback (
69- ( tagSlot : string ) : TagDefinition | undefined => {
70- return tagDefinitions . find ( ( def ) => def . tagSlot === tagSlot )
71- } ,
72- [ tagDefinitions ]
73- )
74-
75- // Auto-fetch on mount and when dependencies change
7660 useEffect ( ( ) => {
7761 fetchTagDefinitions ( )
7862 } , [ fetchTagDefinitions ] )
@@ -82,7 +66,5 @@ export function useKnowledgeBaseTagDefinitions(knowledgeBaseId: string | null) {
8266 isLoading,
8367 error,
8468 fetchTagDefinitions,
85- getTagLabel,
86- getTagDefinition,
8769 }
8870}
You can’t perform that action at this time.
0 commit comments