diff --git a/eslint-suppressions.json b/eslint-suppressions.json index e1c8bda126..c724609e88 100644 --- a/eslint-suppressions.json +++ b/eslint-suppressions.json @@ -3820,21 +3820,6 @@ "count": 4 } }, - "web/app/components/tools/workflow-tool/confirm-modal/index.tsx": { - "no-restricted-imports": { - "count": 1 - } - }, - "web/app/components/tools/workflow-tool/index.tsx": { - "no-restricted-imports": { - "count": 1 - } - }, - "web/app/components/tools/workflow-tool/method-selector.tsx": { - "no-restricted-imports": { - "count": 1 - } - }, "web/app/components/workflow-app/components/workflow-children.tsx": { "ts/no-explicit-any": { "count": 3 diff --git a/web/app/components/tools/workflow-tool/__tests__/configure-button.spec.tsx b/web/app/components/tools/workflow-tool/__tests__/configure-button.spec.tsx index 646a095622..7060e29f95 100644 --- a/web/app/components/tools/workflow-tool/__tests__/configure-button.spec.tsx +++ b/web/app/components/tools/workflow-tool/__tests__/configure-button.spec.tsx @@ -9,6 +9,8 @@ import WorkflowToolConfigureButton from '../configure-button' import WorkflowToolAsModal from '../index' import MethodSelector from '../method-selector' +vi.mock('@langgenius/dify-ui/popover', () => import('@/__mocks__/base-ui-popover')) + // Mock Next.js navigation const mockPush = vi.fn() vi.mock('@/next/navigation', () => ({ @@ -83,12 +85,11 @@ vi.mock('@/app/components/base/drawer-plus', () => ({ }, })) -// Mock EmojiPicker - simplified for testing -vi.mock('@/app/components/base/emoji-picker', () => ({ - default: ({ onSelect, onClose }: { onSelect: (icon: string, background: string) => void, onClose: () => void }) => ( +// Mock EmojiPickerInner - simplified for testing +vi.mock('@/app/components/base/emoji-picker/Inner', () => ({ + default: ({ onSelect }: { onSelect: (icon: string, background: string) => void }) => (
| {t('createTool.toolInput.name', { ns: 'tools' })} | -{t('createTool.toolInput.method', { ns: 'tools' })} | -{t('createTool.toolInput.description', { ns: 'tools' })} | -
|---|---|---|
|
-
-
-
- {item.name}
- {item.required ? t('createTool.toolInput.required', { ns: 'tools' }) : ''}
-
- {item.type}
- |
-
- {item.name === '__image' && (
-
-
- )}
- {item.name !== '__image' && (
-
- {t('createTool.toolInput.methodParameter', { ns: 'tools' })}
-
- |
- - handleParameterChange('description', e.target.value, index)} - /> - | -
| {t('createTool.name', { ns: 'tools' })} | -{t('createTool.toolOutput.description', { ns: 'tools' })} | -
|---|---|
|
-
-
-
- {item.name}
- {item.reserved ? t('createTool.toolOutput.reserved', { ns: 'tools' }) : ''}
- {
- !item.reserved && hasReservedWorkflowOutputConflict(reservedOutputParameters, item.name)
- ? (
-
- )}
- >
- {item.type}
-
- |
- - {item.description} - | -
| {t('createTool.toolInput.name', { ns: 'tools' })} | +{t('createTool.toolInput.method', { ns: 'tools' })} | +{t('createTool.toolInput.description', { ns: 'tools' })} | +
|---|---|---|
|
+
+
+
+ {item.name}
+ {item.required ? t('createTool.toolInput.required', { ns: 'tools' }) : ''}
+
+ {item.type}
+ |
+
+ {item.name === '__image' && (
+
+
+ )}
+ {item.name !== '__image' && (
+
+ {t('createTool.toolInput.methodParameter', { ns: 'tools' })}
+
+ |
+ + handleParameterChange('description', e.target.value, index)} + /> + | +
| {t('createTool.name', { ns: 'tools' })} | +{t('createTool.toolOutput.description', { ns: 'tools' })} | +
|---|---|
|
+
+
+
+ {item.name}
+ {item.reserved ? t('createTool.toolOutput.reserved', { ns: 'tools' }) : ''}
+ {
+ !item.reserved && hasReservedWorkflowOutputConflict(reservedOutputParameters, item.name)
+ ? (
+
+
+ {t('createTool.toolOutput.reservedParameterDuplicateTip', { ns: 'tools' })}
+
+ {item.type}
+ |
+ + {item.description} + | +