Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion ui/src/workflow/common/data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -847,6 +847,10 @@ export const applicationLoopMenuNodes = [
},
]
export const knowledgeLoopMenuNodes = [
{
label: t('views.tool.dataSource.title'),
list: [dataSourceLocalNode, dataSourceWebNode],
},
{
label: t('workflow.nodes.classify.aiCapability'),
list: [
Expand All @@ -864,7 +868,7 @@ export const knowledgeLoopMenuNodes = [
},
{
label: t('views.knowledge.title'),
list: [rerankerNode, documentExtractNode],
list: [documentSplitNode, knowledgeWriteNode, documentExtractNode],
},
{
label: t('workflow.nodes.classify.businessLogic'),
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here’s a review of the code snippet you provided, with some potential issues addressed:

  1. Duplicate list in "Views" Menu:

    {
      label: t('views.knowledge.title'),
      // List is defined twice here: one above (documentSplitNode) and below (knowledgeWriteNode)
    }

    This can be simplified to avoid redundancy.

  2. Missing Translation Keys:
    The code includes placeholders like t('views.tool.dataSource.title'), but these translations seem incomplete (...). It's important to ensure that all translation keys correspond to actual strings in your locale files.

  3. Suggested Optimization: Reduce duplication by consolidating lists if they share common elements.

export const applicationLoopMenuNodes = [
  { label: t('views.applications.title'), list: [appListNode] }
]

export const knowledgeLoopMenuNodes = [
  {
    label: t('views.tool.dataSource.title'),
    list: [dataSourceLocalNode, dataSourceWebNode]
  },
  {
    label: t('workflow.nodes.classify.aiCapability'),
    list: [aiCapabilityListNode]
  },
  {
    label: t('workflow.nodes.classify.businessLogic'),
    list: [logicFlowListNode]
  },
  {
    label: t('workflow.nodes.classify.dataPreprocessing'),
    list: [dataPreprocessListNode]
  },
  {
    label: t('views.knowledge.title'),
    list: [docSplitNode, knowledgeWriteNode, docExtractNode]
  }
]

This restructuring reduces repetition and improves readability.

  1. Ensure All Nodes Have Corresponding Translations:
    Make sure every key used in the t().

Feel free to adjust or expand upon these findings based on additional context or requirements!

Expand Down
Loading