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
7104fba0
Commit
7104fba0
authored
Jun 09, 2023
by
StyleZhang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: notion-page-selector preview & setting
parent
111813c7
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
2 deletions
+14
-2
base.tsx
web/app/components/base/notion-page-selector/base.tsx
+13
-1
index.tsx
...ponents/base/notion-page-selector/page-selector/index.tsx
+1
-1
No files found.
web/app/components/base/notion-page-selector/base.tsx
View file @
7104fba0
...
...
@@ -6,6 +6,7 @@ import WorkspaceSelector from './workspace-selector'
import
SearchInput
from
'./search-input'
import
PageSelector
from
'./page-selector'
import
{
fetchDataSource
}
from
'@/service/common'
import
AccountSetting
from
'@/app/components/header/account-setting'
import
type
{
DataSourceNotionPage
}
from
'@/models/common'
type
NotionPageSelectorProps
=
{
...
...
@@ -20,6 +21,7 @@ const NotionPageSelector = ({
onPreview
,
}:
NotionPageSelectorProps
)
=>
{
const
[
searchValue
,
setSearchValue
]
=
useState
(
''
)
const
[
showDataSourceSetting
,
setShowDataSourceSetting
]
=
useState
(
false
)
const
{
data
}
=
useSWR
({
url
:
'data-source/integrates'
},
fetchDataSource
)
const
notionWorkspaces
=
data
?.
data
.
filter
(
item
=>
item
.
provider
===
'notion'
)
||
[]
const
firstWorkspace
=
notionWorkspaces
[
0
]?.
id
...
...
@@ -61,7 +63,10 @@ const NotionPageSelector = ({
onSelect=
{
handleSelectWorkspace
}
/>
<
div
className=
'mx-1 w-[1px] h-3 bg-gray-200'
/>
<
div
className=
{
cn
(
s
[
'setting-icon'
],
'w-6 h-6 cursor-pointer'
)
}
/>
<
div
className=
{
cn
(
s
[
'setting-icon'
],
'w-6 h-6 cursor-pointer'
)
}
onClick=
{
()
=>
setShowDataSourceSetting
(
true
)
}
/>
<
div
className=
'grow'
/>
<
SearchInput
value=
{
searchValue
}
...
...
@@ -80,6 +85,13 @@ const NotionPageSelector = ({
)
}
</
div
>
{
showDataSourceSetting
&&
(
<
AccountSetting
activeTab=
'data-source'
onCancel=
{
()
=>
{
setShowDataSourceSetting
(
false
)
}
}
/>
)
}
</
div
>
)
}
...
...
web/app/components/base/notion-page-selector/page-selector/index.tsx
View file @
7104fba0
...
...
@@ -120,7 +120,7 @@ const Item = memo(({ index, style, data }: ListChildComponentProps<{
const
PageSelector
=
({
list
,
onSelect
,
canPreview
,
canPreview
=
true
,
onPreview
,
}:
PageSelectorProps
)
=>
{
const
[
dataList
,
setDataList
]
=
useState
<
NotionPageItem
[]
>
(
...
...
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