fix: show uninstalled plugin nodes in workflow checklist (#29630)

This commit is contained in:
yyh
2025-12-15 10:11:23 +08:00
committed by GitHub
parent b8d54d745e
commit 59137f1d05
24 changed files with 1315 additions and 1270 deletions

View File

@@ -66,6 +66,7 @@ export type ChecklistItem = {
unConnected?: boolean
errorMessage?: string
canNavigate: boolean
disableGoTo?: boolean
}
const START_NODE_TYPES: BlockEnum[] = [
@@ -75,6 +76,13 @@ const START_NODE_TYPES: BlockEnum[] = [
BlockEnum.TriggerPlugin,
]
// Node types that depend on plugins
const PLUGIN_DEPENDENT_TYPES: BlockEnum[] = [
BlockEnum.Tool,
BlockEnum.DataSource,
BlockEnum.TriggerPlugin,
]
export const useChecklist = (nodes: Node[], edges: Edge[]) => {
const { t } = useTranslation()
const language = useGetLanguage()
@@ -157,7 +165,14 @@ export const useChecklist = (nodes: Node[], edges: Edge[]) => {
if (node.type === CUSTOM_NODE) {
const checkData = getCheckData(node.data)
const validator = nodesExtraData?.[node.data.type as BlockEnum]?.checkValid
let errorMessage = validator ? validator(checkData, t, moreDataForCheckValid).errorMessage : undefined
const isPluginMissing = PLUGIN_DEPENDENT_TYPES.includes(node.data.type as BlockEnum) && node.data._pluginInstallLocked
// Check if plugin is installed for plugin-dependent nodes first
let errorMessage: string | undefined
if (isPluginMissing)
errorMessage = t('workflow.nodes.common.pluginNotInstalled')
else if (validator)
errorMessage = validator(checkData, t, moreDataForCheckValid).errorMessage
if (!errorMessage) {
const availableVars = map[node.id].availableVars
@@ -194,7 +209,8 @@ export const useChecklist = (nodes: Node[], edges: Edge[]) => {
toolIcon,
unConnected: isUnconnected && !canSkipConnectionCheck,
errorMessage,
canNavigate: true,
canNavigate: !isPluginMissing,
disableGoTo: isPluginMissing,
})
}
}