fix: checklist show error when strategy provider list not fetched
This commit is contained in:
parent
4e29694a46
commit
b450c6f976
@ -62,12 +62,14 @@ export const useChecklist = (nodes: Node[], edges: Edge[]) => {
|
||||
|
||||
if (node.data.type === BlockEnum.Agent) {
|
||||
const data = node.data as AgentNodeType
|
||||
const isReadyForCheckValid = !!strategyProviders
|
||||
const provider = strategyProviders?.find(provider => provider.declaration.identity.name === data.agent_strategy_provider_name)
|
||||
const strategy = provider?.declaration.strategies?.find(s => s.identity.name === data.agent_strategy_name)
|
||||
moreDataForCheckValid = {
|
||||
provider,
|
||||
strategy,
|
||||
language,
|
||||
isReadyForCheckValid,
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -21,8 +21,15 @@ const nodeDefault: NodeDefault<AgentNodeType> = {
|
||||
strategyProvider?: StrategyPluginDetail,
|
||||
strategy?: StrategyDetail
|
||||
language: string
|
||||
isReadyForCheckValid: boolean
|
||||
}) {
|
||||
const { strategy, language } = moreDataForCheckValid
|
||||
const { strategy, language, isReadyForCheckValid } = moreDataForCheckValid
|
||||
if (!isReadyForCheckValid) {
|
||||
return {
|
||||
isValid: true,
|
||||
errorMessage: '',
|
||||
}
|
||||
}
|
||||
if (!strategy) {
|
||||
return {
|
||||
isValid: false,
|
||||
|
Loading…
Reference in New Issue
Block a user