Skip to content

RAGFlow is an agent-native database: a Retrieval-Augmented Generation (RAG) engine that grew into context infrastructure.

Fix(edit-tag): Fix the bug that the edit-tag tag cannot be deleted #9869 (#10679)

chanx8013505daf59
diff --git a/web/src/components/edit-tag/index.tsx b/web/src/components/edit-tag/index.tsx
index 7b0b973729..1921853d03 100644
--- a/web/src/components/edit-tag/index.tsx
+++ b/web/src/components/edit-tag/index.tsx
@@ -1,5 +1,4 @@
import { PlusOutlined } from '@ant-design/icons';
-import { TweenOneGroup } from 'rc-tween-one';
import React, { useEffect, useRef, useState } from 'react';
import { X } from 'lucide-react';
@@ -57,7 +56,7 @@ const EditTag = React.forwardRef<HTMLDivElement, EditTagsProps>(
<HoverCard key={tag}>
<HoverCardContent side="top">{tag}</HoverCardContent>
<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="max-w-80 overflow-hidden text-ellipsis">
{tag}
@@ -84,11 +83,11 @@ const EditTag = React.forwardRef<HTMLDivElement, EditTagsProps>(
return (
<div>
- {inputVisible ? (
+ {inputVisible && (
<Input
ref={inputRef}
type="text"
- className="h-8 bg-bg-card"
+ className="h-8 bg-bg-card mb-1"
value={inputValue}
onChange={handleInputChange}
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>
);
},
diff --git a/web/src/pages/dataflow-result/interface.ts b/web/src/pages/dataflow-result/interface.ts
index 93f4bb7851..0772b4ceaf 100644
--- a/web/src/pages/dataflow-result/interface.ts
+++ b/web/src/pages/dataflow-result/interface.ts
@@ -148,6 +148,6 @@ export interface NavigateToDataflowResultProps {
[PipelineResultSearchParams.AgentTitle]?: string;
[PipelineResultSearchParams.IsReadOnly]?: string;
[PipelineResultSearchParams.Type]: string;
- [PipelineResultSearchParams.CreatedBy]: string;
- [PipelineResultSearchParams.DocumentExtension]: string;
+ [PipelineResultSearchParams.CreatedBy]?: string;
+ [PipelineResultSearchParams.DocumentExtension]?: string;
}
diff --git a/web/src/pages/dataset/dataset-overview/overview-table.tsx b/web/src/pages/dataset/dataset-overview/overview-table.tsx
index af18c7ed4f..c2cdb061a7 100644
--- a/web/src/pages/dataset/dataset-overview/overview-table.tsx
+++ b/web/src/pages/dataset/dataset-overview/overview-table.tsx
@@ -311,7 +311,6 @@ const FileLogsTable: FC<FileLogsTableProps> = ({
data,
pagination,
setPagination,
- loading,
active = LogTabs.FILE_LOGS,
}) => {
const [sorting, setSorting] = useState<SortingState>([]);
@@ -328,13 +327,13 @@ const FileLogsTable: FC<FileLogsTableProps> = ({
fileName: row.original.document_name,
source: row.original.source_from,
task: row.original?.task_type,
- status: row.original.statusName,
+ status: row.original.status as RunningStatus,
startDate: formatDate(row.original.process_begin_at),
duration: formatSecondsToHumanReadable(
row.original.process_duration || 0,
),
details: row.original.progress_msg,
- };
+ } as unknown as IFileLogItem;
console.log('logDetail', logDetail);
setLogInfo(logDetail);
setIsModalVisible(true);