mirror of
https://github.com/infiniflow/ragflow.git
synced 2025-12-08 20:42:30 +08:00
### What problem does this PR solve? fix(edit-tag): Fix the bug that the edit-tag tag cannot be deleted #9869 ### Type of change - [x] Bug Fix (non-breaking change which fixes an issue)
This commit is contained in:
@ -1,5 +1,4 @@
|
|||||||
import { PlusOutlined } from '@ant-design/icons';
|
import { PlusOutlined } from '@ant-design/icons';
|
||||||
import { TweenOneGroup } from 'rc-tween-one';
|
|
||||||
import React, { useEffect, useRef, useState } from 'react';
|
import React, { useEffect, useRef, useState } from 'react';
|
||||||
|
|
||||||
import { X } from 'lucide-react';
|
import { X } from 'lucide-react';
|
||||||
@ -57,7 +56,7 @@ const EditTag = React.forwardRef<HTMLDivElement, EditTagsProps>(
|
|||||||
<HoverCard key={tag}>
|
<HoverCard key={tag}>
|
||||||
<HoverCardContent side="top">{tag}</HoverCardContent>
|
<HoverCardContent side="top">{tag}</HoverCardContent>
|
||||||
<HoverCardTrigger asChild>
|
<HoverCardTrigger asChild>
|
||||||
<div className="w-fit flex items-center justify-center gap-2 border-dashed border px-1 rounded-sm bg-bg-card">
|
<div className="w-fit flex items-center justify-center gap-2 border-dashed border px-2 py-1 rounded-sm bg-bg-card">
|
||||||
<div className="flex gap-2 items-center">
|
<div className="flex gap-2 items-center">
|
||||||
<div className="max-w-80 overflow-hidden text-ellipsis">
|
<div className="max-w-80 overflow-hidden text-ellipsis">
|
||||||
{tag}
|
{tag}
|
||||||
@ -84,11 +83,11 @@ const EditTag = React.forwardRef<HTMLDivElement, EditTagsProps>(
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
{inputVisible ? (
|
{inputVisible && (
|
||||||
<Input
|
<Input
|
||||||
ref={inputRef}
|
ref={inputRef}
|
||||||
type="text"
|
type="text"
|
||||||
className="h-8 bg-bg-card"
|
className="h-8 bg-bg-card mb-1"
|
||||||
value={inputValue}
|
value={inputValue}
|
||||||
onChange={handleInputChange}
|
onChange={handleInputChange}
|
||||||
onBlur={handleInputConfirm}
|
onBlur={handleInputConfirm}
|
||||||
@ -98,36 +97,20 @@ const EditTag = React.forwardRef<HTMLDivElement, EditTagsProps>(
|
|||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
) : (
|
|
||||||
<Button
|
|
||||||
variant="dashed"
|
|
||||||
className="w-fit flex items-center justify-center gap-2 bg-bg-card"
|
|
||||||
onClick={showInput}
|
|
||||||
style={tagPlusStyle}
|
|
||||||
>
|
|
||||||
<PlusOutlined />
|
|
||||||
</Button>
|
|
||||||
)}
|
|
||||||
{Array.isArray(tagChild) && tagChild.length > 0 && (
|
|
||||||
<TweenOneGroup
|
|
||||||
className="flex gap-2 flex-wrap mt-2"
|
|
||||||
enter={{
|
|
||||||
scale: 0.8,
|
|
||||||
opacity: 0,
|
|
||||||
type: 'from',
|
|
||||||
duration: 100,
|
|
||||||
}}
|
|
||||||
onEnd={(e) => {
|
|
||||||
if (e.type === 'appear' || e.type === 'enter') {
|
|
||||||
(e.target as any).style = 'display: inline-block';
|
|
||||||
}
|
|
||||||
}}
|
|
||||||
leave={{ opacity: 0, width: 0, scale: 0, duration: 200 }}
|
|
||||||
appear={false}
|
|
||||||
>
|
|
||||||
{tagChild}
|
|
||||||
</TweenOneGroup>
|
|
||||||
)}
|
)}
|
||||||
|
<div className="flex gap-2 py-1">
|
||||||
|
{Array.isArray(tagChild) && tagChild.length > 0 && <>{tagChild}</>}
|
||||||
|
{!inputVisible && (
|
||||||
|
<Button
|
||||||
|
variant="dashed"
|
||||||
|
className="w-fit flex items-center justify-center gap-2 bg-bg-card"
|
||||||
|
onClick={showInput}
|
||||||
|
style={tagPlusStyle}
|
||||||
|
>
|
||||||
|
<PlusOutlined />
|
||||||
|
</Button>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
|||||||
@ -148,6 +148,6 @@ export interface NavigateToDataflowResultProps {
|
|||||||
[PipelineResultSearchParams.AgentTitle]?: string;
|
[PipelineResultSearchParams.AgentTitle]?: string;
|
||||||
[PipelineResultSearchParams.IsReadOnly]?: string;
|
[PipelineResultSearchParams.IsReadOnly]?: string;
|
||||||
[PipelineResultSearchParams.Type]: string;
|
[PipelineResultSearchParams.Type]: string;
|
||||||
[PipelineResultSearchParams.CreatedBy]: string;
|
[PipelineResultSearchParams.CreatedBy]?: string;
|
||||||
[PipelineResultSearchParams.DocumentExtension]: string;
|
[PipelineResultSearchParams.DocumentExtension]?: string;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -311,7 +311,6 @@ const FileLogsTable: FC<FileLogsTableProps> = ({
|
|||||||
data,
|
data,
|
||||||
pagination,
|
pagination,
|
||||||
setPagination,
|
setPagination,
|
||||||
loading,
|
|
||||||
active = LogTabs.FILE_LOGS,
|
active = LogTabs.FILE_LOGS,
|
||||||
}) => {
|
}) => {
|
||||||
const [sorting, setSorting] = useState<SortingState>([]);
|
const [sorting, setSorting] = useState<SortingState>([]);
|
||||||
@ -328,13 +327,13 @@ const FileLogsTable: FC<FileLogsTableProps> = ({
|
|||||||
fileName: row.original.document_name,
|
fileName: row.original.document_name,
|
||||||
source: row.original.source_from,
|
source: row.original.source_from,
|
||||||
task: row.original?.task_type,
|
task: row.original?.task_type,
|
||||||
status: row.original.statusName,
|
status: row.original.status as RunningStatus,
|
||||||
startDate: formatDate(row.original.process_begin_at),
|
startDate: formatDate(row.original.process_begin_at),
|
||||||
duration: formatSecondsToHumanReadable(
|
duration: formatSecondsToHumanReadable(
|
||||||
row.original.process_duration || 0,
|
row.original.process_duration || 0,
|
||||||
),
|
),
|
||||||
details: row.original.progress_msg,
|
details: row.original.progress_msg,
|
||||||
};
|
} as unknown as IFileLogItem;
|
||||||
console.log('logDetail', logDetail);
|
console.log('logDetail', logDetail);
|
||||||
setLogInfo(logDetail);
|
setLogInfo(logDetail);
|
||||||
setIsModalVisible(true);
|
setIsModalVisible(true);
|
||||||
|
|||||||
Reference in New Issue
Block a user