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
0c51b423
Commit
0c51b423
authored
Jun 14, 2023
by
StyleZhang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: notion page type
parent
4354b680
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
9 additions
and
4 deletions
+9
-4
index.tsx
web/app/components/datasets/documents/index.tsx
+2
-2
list.tsx
web/app/components/datasets/documents/list.tsx
+1
-1
datasets.ts
web/models/datasets.ts
+2
-1
datasets.ts
web/service/datasets.ts
+4
-0
No files found.
web/app/components/datasets/documents/index.tsx
View file @
0c51b423
...
...
@@ -152,7 +152,7 @@ const Documents: FC<IDocumentsProps> = ({ datasetId }) => {
}
const
handleSync
=
async
()
=>
{
if
(
dataset
?.
data_source_type
===
'notion_import'
)
if
(
dataset
?.
data_source_type
===
DataSourceType
.
NOTION
)
mutate
()
}
...
...
@@ -174,7 +174,7 @@ const Documents: FC<IDocumentsProps> = ({ datasetId }) => {
<
Button
type=
'primary'
onClick=
{
routeToDocCreate
}
className=
'!h-8 !text-[13px]'
>
<
PlusIcon
className=
'h-4 w-4 mr-2 stroke-current'
/>
{
dataset
?.
data_source_type
===
'notion_import'
dataset
?.
data_source_type
===
DataSourceType
.
NOTION
?
t
(
'datasetDocuments.list.addPages'
)
:
t
(
'datasetDocuments.list.addFile'
)
}
...
...
web/app/components/datasets/documents/list.tsx
View file @
0c51b423
...
...
@@ -260,7 +260,7 @@ type IDocumentListProps = {
/**
* Document list component including basic information
*/
const
DocumentList
:
FC
<
IDocumentListProps
>
=
({
documents
=
[],
datasetId
,
onUpdate
,
onSync
})
=>
{
const
DocumentList
:
FC
<
IDocumentListProps
>
=
({
documents
=
[],
datasetId
,
onUpdate
})
=>
{
const
{
t
}
=
useTranslation
()
const
router
=
useRouter
()
const
[
localDocs
,
setLocalDocs
]
=
useState
<
DocumentListResponse
[
'data'
]
>
(
documents
)
...
...
web/models/datasets.ts
View file @
0c51b423
import
type
{
AppMode
}
from
'./app'
import
type
{
DataSourceNotionPage
}
from
'./common'
export
enum
DataSourceType
{
FILE
=
'upload_file'
,
...
...
@@ -182,7 +183,7 @@ export type DataSource = {
export
type
NotionInfo
=
{
workspace_id
:
string
pages
:
NotionPage
[]
pages
:
DataSource
NotionPage
[]
}
export
type
NotionPage
=
{
page_id
:
string
...
...
web/service/datasets.ts
View file @
0c51b423
...
...
@@ -107,6 +107,10 @@ export const modifyDocMetadata: Fetcher<CommonResponse, CommonDocReq & { body: {
return
put
(
`/datasets/
${
datasetId
}
/documents/
${
documentId
}
/metadata`
,
{
body
})
as
Promise
<
CommonResponse
>
}
export
const
getDatasetIndexingStatus
:
Fetcher
<
{
data
:
IndexingStatusResponse
[]
},
string
>
=
(
datasetId
)
=>
{
return
get
(
`/datasets/
${
datasetId
}
/indexing-status`
)
as
Promise
<
{
data
:
IndexingStatusResponse
[]
}
>
}
// apis for segments in a document
export
const
fetchSegments
:
Fetcher
<
SegmentsResponse
,
CommonDocReq
&
{
params
:
SegmentsQuery
}
>
=
({
datasetId
,
documentId
,
params
})
=>
{
...
...
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