mirror of
https://github.com/langgenius/dify.git
synced 2026-09-19 10:11:30 +08:00
fix(web): name human input delete action (#40293)
This commit is contained in:
+2
-2
@@ -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()
|
||||
})
|
||||
})
|
||||
|
||||
@@ -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>
|
||||
)}
|
||||
|
||||
Reference in New Issue
Block a user