feat: agent checklist i18n

This commit is contained in:
AkaraChen 2025-01-02 11:46:47 +08:00
parent 1b8ec6710a
commit c1ae681b6c
4 changed files with 11 additions and 3 deletions

View File

@ -67,6 +67,7 @@ export const useChecklist = (nodes: Node[], edges: Edge[]) => {
moreDataForCheckValid = {
provider,
strategy,
language,
}
}

View File

@ -19,19 +19,20 @@ const nodeDefault: NodeDefault<AgentNodeType> = {
checkValid(payload, t, moreDataForCheckValid: {
strategyProvider: StrategyPluginDetail | undefined,
strategy: StrategyDetail | undefined
language: string
}) {
const { strategy } = moreDataForCheckValid
const { strategy, language } = moreDataForCheckValid
if (!strategy) {
return {
isValid: false,
errorMessage: 'Please select a strategy',
errorMessage: t('workflow.checkList.strategyNotSelected'),
}
}
for (const param of strategy.parameters) {
if (param.required && !payload.agent_parameters?.[param.name]?.value) {
return {
isValid: false,
errorMessage: `Please select ${param.name}`,
errorMessage: t('workflow.errorMsg.fieldRequired', { field: param.label[language] }),
}
}
}

View File

@ -747,6 +747,9 @@ const translation = {
json: 'agent generated json',
},
},
checkList: {
strategyNotSelected: 'Strategy not selected',
},
},
tracing: {
stopBy: 'Stop by {{user}}',

View File

@ -746,6 +746,9 @@ const translation = {
},
json: 'agent 生成的json',
},
checkList: {
strategyNotSelected: '未选择策略',
},
},
},
tracing: {