mirror of
https://github.com/langgenius/dify.git
synced 2026-05-06 10:06:51 +08:00
fix: node actions menu delete item
This commit is contained in:
parent
d2097736fd
commit
cb6bca4fc9
@ -226,6 +226,11 @@ describe('node actions menu details', () => {
|
||||
const user = userEvent.setup()
|
||||
renderDropdownContent()
|
||||
|
||||
const deleteMenuItem = screen.getByText('common.operation.delete').closest('[role="menuitem"]')
|
||||
expect(deleteMenuItem).toHaveAttribute('data-variant', 'default')
|
||||
expect(deleteMenuItem).toHaveClass('text-text-secondary')
|
||||
expect(deleteMenuItem).toHaveClass('data-highlighted:text-text-destructive')
|
||||
|
||||
await user.click(screen.getByText('workflow.panel.runThisStep'))
|
||||
await user.click(screen.getByText('workflow.common.copy'))
|
||||
await user.click(screen.getByText('workflow.common.duplicate'))
|
||||
|
||||
@ -8,6 +8,7 @@ import {
|
||||
import { useTranslation } from 'react-i18next'
|
||||
import { ChangeBlockMenuTrigger } from './change-block-menu-trigger'
|
||||
import {
|
||||
NODE_ACTIONS_MENU_DELETE_ITEM_CLASS_NAME,
|
||||
NODE_ACTIONS_MENU_ITEM_WITH_SHORTCUT_CLASS_NAME,
|
||||
NodeActionsMenuAbout,
|
||||
NodeActionsMenuItemContent,
|
||||
@ -64,8 +65,7 @@ export function NodeActionsContextMenuContent(props: NodeActionsMenuProps) {
|
||||
{hasDeleteGroup && (
|
||||
<ContextMenuGroup>
|
||||
<ContextMenuItem
|
||||
variant="destructive"
|
||||
className={NODE_ACTIONS_MENU_ITEM_WITH_SHORTCUT_CLASS_NAME}
|
||||
className={NODE_ACTIONS_MENU_DELETE_ITEM_CLASS_NAME}
|
||||
onClick={model.handleDelete}
|
||||
>
|
||||
<NodeActionsMenuItemContent shortcut="workflow.delete">
|
||||
|
||||
@ -8,6 +8,7 @@ import {
|
||||
import { useTranslation } from 'react-i18next'
|
||||
import { ChangeBlockMenuTrigger } from './change-block-menu-trigger'
|
||||
import {
|
||||
NODE_ACTIONS_MENU_DELETE_ITEM_CLASS_NAME,
|
||||
NODE_ACTIONS_MENU_ITEM_WITH_SHORTCUT_CLASS_NAME,
|
||||
NodeActionsMenuAbout,
|
||||
NodeActionsMenuItemContent,
|
||||
@ -64,8 +65,7 @@ export function NodeActionsDropdownContent(props: NodeActionsMenuProps) {
|
||||
{hasDeleteGroup && (
|
||||
<DropdownMenuGroup>
|
||||
<DropdownMenuItem
|
||||
variant="destructive"
|
||||
className={NODE_ACTIONS_MENU_ITEM_WITH_SHORTCUT_CLASS_NAME}
|
||||
className={NODE_ACTIONS_MENU_DELETE_ITEM_CLASS_NAME}
|
||||
onClick={model.handleDelete}
|
||||
>
|
||||
<NodeActionsMenuItemContent shortcut="workflow.delete">
|
||||
|
||||
@ -5,6 +5,7 @@ import { ShortcutKbd } from '@/app/components/workflow/shortcuts/shortcut-kbd'
|
||||
|
||||
export const NODE_ACTIONS_MENU_WIDTH_CLASS_NAME = 'w-[240px] rounded-lg'
|
||||
export const NODE_ACTIONS_MENU_ITEM_WITH_SHORTCUT_CLASS_NAME = 'w-auto justify-between gap-4'
|
||||
export const NODE_ACTIONS_MENU_DELETE_ITEM_CLASS_NAME = `${NODE_ACTIONS_MENU_ITEM_WITH_SHORTCUT_CLASS_NAME} text-text-secondary data-highlighted:bg-state-destructive-hover data-highlighted:text-text-destructive`
|
||||
|
||||
export function NodeActionsMenuItemContent({
|
||||
children,
|
||||
|
||||
Loading…
Reference in New Issue
Block a user