diff --git a/eslint-suppressions.json b/eslint-suppressions.json index 614dd0b633..6ff584e4e9 100644 --- a/eslint-suppressions.json +++ b/eslint-suppressions.json @@ -4259,11 +4259,6 @@ "count": 1 } }, - "web/app/components/workflow/nodes/knowledge-retrieval/components/metadata/condition-list/condition-operator.tsx": { - "no-restricted-imports": { - "count": 1 - } - }, "web/app/components/workflow/nodes/knowledge-retrieval/components/metadata/condition-list/condition-value-method.tsx": { "no-restricted-imports": { "count": 1 diff --git a/web/app/components/workflow/nodes/knowledge-retrieval/components/metadata/condition-list/condition-operator.tsx b/web/app/components/workflow/nodes/knowledge-retrieval/components/metadata/condition-list/condition-operator.tsx index f14743ce9f..0784b99cfb 100644 --- a/web/app/components/workflow/nodes/knowledge-retrieval/components/metadata/condition-list/condition-operator.tsx +++ b/web/app/components/workflow/nodes/knowledge-retrieval/components/metadata/condition-list/condition-operator.tsx @@ -4,17 +4,17 @@ import type { } from '@/app/components/workflow/nodes/knowledge-retrieval/types' import { Button } from '@langgenius/dify-ui/button' import { cn } from '@langgenius/dify-ui/cn' +import { + Popover, + PopoverContent, + PopoverTrigger, +} from '@langgenius/dify-ui/popover' import { RiArrowDownSLine } from '@remixicon/react' import { useMemo, useState, } from 'react' import { useTranslation } from 'react-i18next' -import { - PortalToFollowElem, - PortalToFollowElemContent, - PortalToFollowElemTrigger, -} from '@/app/components/base/portal-to-follow-elem' import { getOperators, isComparisonOperatorNeedTranslate, @@ -49,31 +49,32 @@ const ConditionOperator = ({ }, [t, variableType]) const selectedOption = options.find(o => Array.isArray(value) ? o.value === value[0] : o.value === value) return ( - - setOpen(v => !v)}> - - - + + { + selectedOption + ? selectedOption.label + : t(`${i18nPrefix}.select`, { ns: 'workflow' }) + } + + + )} + /> +
{ options.map(option => ( @@ -90,8 +91,8 @@ const ConditionOperator = ({ )) }
-
-
+ + ) }