Skip to content
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion ui/src/locales/zh-CN/workflow/index.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"currentForm": "当前表单",
"exposedFields": {
"label": "外置参数设置",
"description": "仅支持模型、知识库、开关、日期、树形选项器、单选框、多选框组件类型"
"description": "仅支持模型、知识库、开关、日期、树形选择器、单选框、多选框组件类型"
},
"menuTitle": {
"label": "其他参数收纳菜单标题"
Expand Down
2 changes: 1 addition & 1 deletion ui/src/locales/zh-Hant/workflow/index.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"currentForm": "當前表單",
"exposedFields": {
"label": "外置參數設置",
"description": "僅支持模型、知識庫、開關、日期、樹形選項器、單選框、多選框組件類型"
"description": "僅支持模型、知識庫、開關、日期、樹形選擇器、單選框、多選框組件類型"
},
"menuTitle": {
"label": "其他參數收納菜單標題"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import type { McpSetting, McpSource } from '../../types'
import type { ToolItem } from '@/api/types'
import type { FormInstance } from 'element-plus'
import type { Ref } from 'vue'
import { TOOL_TYPE } from '@/api/enums'
import { TOOL_SCOPE, TOOL_TYPE } from '@/api/enums'
import { useWorkflowStore } from '@/workflow-canvas/store'
import { MsgError } from '@/utils/message'

Expand Down Expand Up @@ -118,8 +118,8 @@ defineExpose({ open })
<el-option v-for="option in mcpOptions" :key="option.id" :label="option.name" :value="option.id">
<div class="flex-align-center gap-2">
<ToolIcon :icon="option.icon" :size="20" :type="option.tool_type" />
<span>{{ option.name }}</span>
<el-tag v-if="option.source === 'shared'" size="small" type="info">{{ t('resource.shared') }}</el-tag>
<span class="min-w-0 truncate" :title="option.name">{{ option.name }}</span>
<el-tag v-if="option.scope === TOOL_SCOPE.SHARED" size="small" type="info">{{ t('resource.shared') }}</el-tag>
</div>
</el-option>
</el-select>

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.

The diff is small and generally reasonable, but there are a few things to verify:

  1. Confirm the field rename source → scope is correct

    • The template now checks option.scope === TOOL_SCOPE.SHARED.
    • Make sure every object in mcpOptions actually has a scope property.
    • If the API/type still exposes source, this will silently never show the shared tag, or cause a TypeScript error.
    • Search the codebase for other .source === 'shared' usages and update them consistently if this was a data-model change.
  2. Verify TOOL_SCOPE.SHARED matches the backend value

    • For example, if the enum is defined as SHARED = 'SHARED' but the backend returns 'shared', the condition will fail.
    • Ensure the enum value is exactly the same string as the runtime data.
  3. Check semantic correctness of using TOOL_SCOPE here

    • The option appears to represent an MCP source/setting. If “shared” here is an MCP-source concept, using TOOL_SCOPE may be semantically wrong. Prefer the matching enum such as MCP_SOURCE.SHARED if one exists.
    • If scope is intentionally the shared scope of the tool, then this is fine.
  4. Truncation styling is okay, but layout can be improved

    • min-w-0 truncate on the <span> is correct for allowing truncation inside a flex container.
    • To make truncation more reliable and prevent the tag from shrinking, consider:
    <span class="min-w-0 flex-1 truncate" :title="option.name">{{ option.name }}</span>
    <el-tag class="flex-shrink-0" ...>
    • flex-1 is optional; it makes the text consume available space and pushes the tag to the right. Without it, truncation still works as long as the parent width is constrained.
  5. Minor lint/type checks

    • Ensure TOOL_TYPE is still used in the file; otherwise it becomes an unused import.
    • :title="option.name" is fine, but if option.name can be undefined, the tooltip will simply be empty.

Overall: no obvious syntax problem, but the main risk is the source → scope change and whether TOOL_SCOPE.SHARED matches the actual data/enum.

Expand Down
Loading