Skip to content

armgit / dify

Public Imported from GitHub
0

Build Agentic workflows, RAG pipelines, with rich AI model and tool support on one collaborative workspace. Deploy on cloud, VPC, or self-hosted, so teams move from prototype to production without rebuilding the stack.

fix(web): name human input delete action (#40293)

yyh2a66b49bc7c1
diff --git a/web/app/components/workflow/nodes/human-input/components/__tests__/user-action.spec.tsx b/web/app/components/workflow/nodes/human-input/components/__tests__/user-action.spec.tsx
index f6c07d2c778..bc83181ee8b 100644
--- a/web/app/components/workflow/nodes/human-input/components/__tests__/user-action.spec.tsx
+++ b/web/app/components/workflow/nodes/human-input/components/__tests__/user-action.spec.tsx
@@ -122,7 +122,7 @@ describe('UserActionItem', () => {
target: { value: ' ' },
})
fireEvent.click(screen.getByText('change-style'))
- fireEvent.click(screen.getAllByRole('button')[1]!)
+ fireEvent.click(screen.getByRole('button', { name: 'operation.delete' }))
expect(onChange).toHaveBeenNthCalledWith(1, expect.objectContaining({ id: '' }))
expect(onChange).toHaveBeenNthCalledWith(
@@ -135,6 +135,6 @@ describe('UserActionItem', () => {
expect(screen.getByTestId('nodes.humanInput.userActions.actionNamePlaceholder'))!.toBeDisabled()
expect(screen.getByTestId('nodes.humanInput.userActions.buttonTextPlaceholder'))!.toBeDisabled()
- expect(screen.getAllByRole('button')).toHaveLength(1)
+ expect(screen.queryByRole('button', { name: 'operation.delete' })).not.toBeInTheDocument()
})
})
diff --git a/web/app/components/workflow/nodes/human-input/components/user-action.tsx b/web/app/components/workflow/nodes/human-input/components/user-action.tsx
index 5e76e9e9152..0a2705729de 100644
--- a/web/app/components/workflow/nodes/human-input/components/user-action.tsx
+++ b/web/app/components/workflow/nodes/human-input/components/user-action.tsx
@@ -101,7 +101,12 @@ const UserActionItem: FC<UserActionItemProps> = ({ data, onChange, onDelete, rea
readonly={readonly}
/>
{!readonly && (
- <Button className="px-2" variant="tertiary" onClick={() => onDelete(data.id)}>
+ <Button
+ aria-label={t(($) => $['operation.delete'], { ns: 'common' })}
+ className="px-2"
+ variant="tertiary"
+ onClick={() => onDelete(data.id)}
+ >
<RiDeleteBinLine className="size-4" />
</Button>
)}