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
2ec1930b
Commit
2ec1930b
authored
Jul 28, 2023
by
StyleZhang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: segment textarea
parent
eb439528
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
4 deletions
+10
-4
common.tsx
web/app/components/base/auto-height-textarea/common.tsx
+1
-1
new-segment-modal.tsx
...omponents/datasets/documents/detail/new-segment-modal.tsx
+9
-3
No files found.
web/app/components/base/auto-height-textarea/common.tsx
View file @
2ec1930b
...
...
@@ -28,7 +28,7 @@ const AutoHeightTextarea = forwardRef<HTMLTextAreaElement, AutoHeightTextareaPro
ref
.
current
?.
focus
()
}
}
},
[
autoFocus
,
disabled
,
ref
,
value
])
},
[
autoFocus
,
disabled
,
ref
])
return
(
<
div
className=
{
outerClassName
}
>
<
div
className=
'relative'
>
...
...
web/app/components/datasets/documents/detail/new-segment-modal.tsx
View file @
2ec1930b
...
...
@@ -30,6 +30,12 @@ const NewSegmentModal: FC<NewSegmentModalProps> = memo(({
const
[
answer
,
setAnswer
]
=
useState
(
''
)
const
{
datasetId
,
documentId
}
=
useParams
()
const
handleCancel
=
()
=>
{
setQuestion
(
''
)
setAnswer
(
''
)
onCancel
()
}
const
handleSave
=
async
()
=>
{
const
params
:
SegmentUpdator
=
{
content
:
''
}
if
(
docForm
===
'qa_model'
)
{
...
...
@@ -50,7 +56,7 @@ const NewSegmentModal: FC<NewSegmentModalProps> = memo(({
await
addSegment
({
datasetId
,
documentId
,
body
:
params
})
notify
({
type
:
'success'
,
message
:
t
(
'common.actionMsg.modifiedSuccessfully'
)
})
on
Cancel
()
handle
Cancel
()
onSave
()
}
...
...
@@ -94,7 +100,7 @@ const NewSegmentModal: FC<NewSegmentModalProps> = memo(({
<
Modal
isShow=
{
isShow
}
onClose=
{
()
=>
{}
}
className=
'pt-8 px-8 pb-6 !max-w-[640px] !rounded-xl'
>
<
div
className=
{
'flex flex-col relative'
}
>
<
div
className=
'absolute right-0 -top-0.5 flex items-center h-6'
>
<
div
className=
'flex justify-center items-center w-6 h-6 cursor-pointer'
onClick=
{
on
Cancel
}
>
<
div
className=
'flex justify-center items-center w-6 h-6 cursor-pointer'
onClick=
{
handle
Cancel
}
>
<
XClose
className=
'w-4 h-4 text-gray-500'
/>
</
div
>
</
div
>
...
...
@@ -116,7 +122,7 @@ const NewSegmentModal: FC<NewSegmentModalProps> = memo(({
<
div
className=
'flex justify-end'
>
<
Button
className=
'mr-2 !h-9 !px-4 !py-2 text-sm font-medium text-gray-700 !rounded-lg'
onClick=
{
on
Cancel
}
>
onClick=
{
handle
Cancel
}
>
{
t
(
'common.operation.cancel'
)
}
</
Button
>
<
Button
...
...
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