mirror of
https://github.com/langgenius/dify.git
synced 2026-04-16 18:39:18 +08:00
fix(web): set app card dropdown menu to non-modal (#35302)
This commit is contained in:
parent
c661d5c43a
commit
c3eff6abdc
@ -208,14 +208,16 @@ vi.mock('@/app/components/base/ui/dropdown-menu', () => {
|
||||
DropdownMenu: ({
|
||||
children,
|
||||
open = false,
|
||||
modal,
|
||||
onOpenChange,
|
||||
}: {
|
||||
children: React.ReactNode
|
||||
open?: boolean
|
||||
modal?: boolean
|
||||
onOpenChange?: (open: boolean) => void
|
||||
}) => (
|
||||
<DropdownMenuContext value={{ isOpen: open, setOpen: onOpenChange ?? vi.fn() }}>
|
||||
<div data-testid="dropdown-menu" data-open={open}>
|
||||
<div data-testid="dropdown-menu" data-open={open} data-modal={modal}>
|
||||
{children}
|
||||
</div>
|
||||
</DropdownMenuContext>
|
||||
@ -461,6 +463,11 @@ describe('AppCard', () => {
|
||||
expect(screen.getByTestId('dropdown-menu')).toBeInTheDocument()
|
||||
})
|
||||
|
||||
it('should render dropdown menu as non-modal', () => {
|
||||
render(<AppCard app={mockApp} />)
|
||||
expect(screen.getByTestId('dropdown-menu')).toHaveAttribute('data-modal', 'false')
|
||||
})
|
||||
|
||||
it('should show edit option when dropdown menu is opened', async () => {
|
||||
render(<AppCard app={mockApp} />)
|
||||
|
||||
|
||||
@ -514,7 +514,7 @@ const AppCard = ({ app, onlineUsers = [], onRefresh }: AppCardProps) => {
|
||||
)}
|
||||
>
|
||||
<div className="mx-1 h-[14px] w-px shrink-0 bg-divider-regular" />
|
||||
<DropdownMenu open={isOperationsMenuOpen} onOpenChange={setIsOperationsMenuOpen}>
|
||||
<DropdownMenu modal={false} open={isOperationsMenuOpen} onOpenChange={setIsOperationsMenuOpen}>
|
||||
<DropdownMenuTrigger
|
||||
aria-label={t('operation.more', { ns: 'common' })}
|
||||
className={cn(
|
||||
|
||||
Loading…
Reference in New Issue
Block a user