Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
D
dify
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ai-tech
dify
Commits
f28cb849
Unverified
Commit
f28cb849
authored
Sep 07, 2023
by
Rhon Joe
Committed by
GitHub
Sep 07, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(web): fix AppCard Menu popover open bug (#1107)
parent
714872cd
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
5 deletions
+12
-5
AppCard.tsx
web/app/(commonLayout)/apps/AppCard.tsx
+5
-3
index.tsx
web/app/components/base/popover/index.tsx
+7
-2
No files found.
web/app/(commonLayout)/apps/AppCard.tsx
View file @
f28cb849
...
...
@@ -16,6 +16,7 @@ import { ToastContext } from '@/app/components/base/toast'
import
{
deleteApp
,
fetchAppDetail
,
updateAppSiteConfig
}
from
'@/service/apps'
import
AppIcon
from
'@/app/components/base/app-icon'
import
AppsContext
,
{
useAppContext
}
from
'@/context/app-context'
import
type
{
HtmlContentProps
}
from
'@/app/components/base/popover'
import
CustomPopover
from
'@/app/components/base/popover'
import
Divider
from
'@/app/components/base/divider'
import
{
asyncRunSafe
}
from
'@/utils'
...
...
@@ -100,14 +101,14 @@ const AppCard = ({ app, onRefresh }: AppCardProps) => {
[
app
.
id
],
)
const
Operations
=
(
props
:
any
)
=>
{
const
Operations
=
(
props
:
HtmlContentProps
)
=>
{
const
onClickSettings
=
async
(
e
:
React
.
MouseEvent
<
HTMLButtonElement
>
)
=>
{
props
?.
onClose
()
props
.
onClick
?.
()
e
.
preventDefault
()
await
getAppDetail
()
}
const
onClickDelete
=
async
(
e
:
React
.
MouseEvent
<
HTMLDivElement
>
)
=>
{
props
?.
onClose
()
props
.
onClick
?.
()
e
.
preventDefault
()
setShowConfirmDelete
(
true
)
}
...
...
@@ -157,6 +158,7 @@ const AppCard = ({ app, onRefresh }: AppCardProps) => {
)
}
className=
{
'!w-[128px] h-fit !z-20'
}
manualClose
/>
}
</
div
>
<
div
className=
{
style
.
listItemDescription
}
>
...
...
web/app/components/base/popover/index.tsx
View file @
f28cb849
...
...
@@ -2,9 +2,14 @@ import { Popover, Transition } from '@headlessui/react'
import
{
Fragment
,
cloneElement
,
useRef
}
from
'react'
import
s
from
'./style.module.css'
export
type
HtmlContentProps
=
{
onClose
?:
()
=>
void
onClick
?:
()
=>
void
}
type
IPopover
=
{
className
?:
string
htmlContent
:
React
.
React
Node
htmlContent
:
React
.
React
Element
<
HtmlContentProps
>
trigger
?:
'click'
|
'hover'
position
?:
'bottom'
|
'br'
btnElement
?:
string
|
React
.
ReactNode
...
...
@@ -84,7 +89,7 @@ export default function CustomPopover({
})
}
>
{
cloneElement
(
htmlContent
as
React
.
ReactElement
,
{
{
cloneElement
(
htmlContent
as
React
.
ReactElement
<
HtmlContentProps
>
,
{
onClose
:
()
=>
onMouseLeave
(
open
),
...(
manualClose
?
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment