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
f571d7e7
Commit
f571d7e7
authored
Jun 15, 2023
by
StyleZhang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: notion-page-selector
parent
fa3522dc
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
5 deletions
+13
-5
index.tsx
...ponents/base/notion-page-selector/page-selector/index.tsx
+13
-5
No files found.
web/app/components/base/notion-page-selector/page-selector/index.tsx
View file @
f571d7e7
...
...
@@ -39,11 +39,13 @@ const recursivePushInParentDescendants = (
const
parentId
=
current
.
parent_id
const
pageId
=
current
.
page_id
if
(
!
parentId
||
!
pageId
)
return
if
(
parentId
!==
'root'
)
{
if
(
!
listTreeMap
[
parentId
])
{
const
children
=
new
Set
([
pageId
])
const
descendants
=
new
Set
([
pageId
,
leafItem
.
page_id
])
listTreeMap
[
parentId
]
=
{
...
pagesMap
[
parentId
],
children
,
...
...
@@ -85,15 +87,21 @@ const Item = memo(({ index, style, data }: ListChildComponentProps<{
const
breadCrumbs
=
ancestors
.
length
?
[...
ancestors
,
current
.
page_name
]
:
[
current
.
page_name
]
const
renderArrow
=
()
=>
{
return
hasChild
?
(
if
(
hasChild
)
{
return
(
<
div
className=
{
cn
(
s
.
arrow
,
current
.
expand
&&
s
[
'arrow-expand'
],
'shrink-0 mr-1 w-5 h-5 hover:bg-gray-200 rounded-md'
)
}
style=
{
{
marginLeft
:
current
.
deepth
*
8
}
}
onClick=
{
()
=>
handleToggle
(
index
)
}
/>
)
:
(
}
if
(
current
.
parent_id
===
'root'
)
{
return
(
<
div
></
div
>
)
}
return
(
<
div
className=
'shrink-0 mr-1 w-5 h-5'
style=
{
{
marginLeft
:
current
.
deepth
*
8
}
}
/>
)
}
...
...
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