Closed johnpccd closed 3 days ago
Hey @johnpccd! I'm here to help you with any bugs, questions, or contributions. Let's get started!
To update the help link for the iteration node in Dify version 0.6.11, you need to modify the linkMap
object in the useNodeHelpLink
hook. Specifically, you should update the entry for BlockEnum.Iteration
to navigate to the correct documentation page.
Here is the updated code:
import { useMemo } from 'react'
import { useGetLanguage } from '@/context/i18n'
import { BlockEnum } from '@/app/components/workflow/types'
export const useNodeHelpLink = (nodeType: BlockEnum) => {
const language = useGetLanguage()
const prefixLink = useMemo(() => {
if (language === 'zh_Hans')
return 'https://docs.dify.ai/v/zh-hans/guides/workflow/node/'
return 'https://docs.dify.ai/guides/workflow/node/'
}, [language])
const linkMap = useMemo(() => {
if (language === 'zh_Hans') {
return {
[BlockEnum.Start]: 'start',
[BlockEnum.End]: 'end',
[BlockEnum.Answer]: 'answer',
[BlockEnum.LLM]: 'llm',
[BlockEnum.KnowledgeRetrieval]: 'knowledge_retrieval',
[BlockEnum.QuestionClassifier]: 'question_classifier',
[BlockEnum.IfElse]: 'ifelse',
[BlockEnum.Code]: 'code',
[BlockEnum.TemplateTransform]: 'template',
[BlockEnum.VariableAssigner]: 'variable_assigner',
[BlockEnum.VariableAggregator]: 'variable_assigner',
[BlockEnum.Iteration]: 'iteration', // Update this line
[BlockEnum.ParameterExtractor]: 'parameter_extractor',
[BlockEnum.HttpRequest]: 'http_request',
[BlockEnum.Tool]: 'tools',
}
}
return {
[BlockEnum.Start]: 'start',
[BlockEnum.End]: 'end',
[BlockEnum.Answer]: 'answer',
[BlockEnum.LLM]: 'llm',
[BlockEnum.KnowledgeRetrieval]: 'knowledge-retrieval',
[BlockEnum.QuestionClassifier]: 'question-classifier',
[BlockEnum.IfElse]: 'if-else',
[BlockEnum.Code]: 'code',
[BlockEnum.TemplateTransform]: 'template',
[BlockEnum.VariableAssigner]: 'variable-assigner',
[BlockEnum.VariableAggregator]: 'variable-assigner',
[BlockEnum.Iteration]: 'iteration', // Update this line
[BlockEnum.ParameterExtractor]: 'parameter-extractor',
[BlockEnum.HttpRequest]: 'http-request',
[BlockEnum.Tool]: 'tools',
}
}, [language])
return `${prefixLink}${linkMap[nodeType]}`
}
Replace 'iteration'
with the actual path to the correct documentation page for the iteration node [1][2].
To continue talking to Dosu, mention @dosu.
Could you submit a pr to fix this?
Could you submit a pr to fix this?
Self Checks
Dify version
0.6.11
Cloud or Self Hosted
Self Hosted (Docker)
Steps to reproduce
In a workflow, create an iteration node, right click and click "Help link"
✔️ Expected Behavior
Navigate to correct page in documentation: /guides/workflow/node/iteration
❌ Actual Behavior
Wrong link opened: /features/workflow/node/iteration