Skip to content

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

feat: deleting a node does not require a confirmation box to pop up #918 (#1380)

balibabu957cd55e4a5f
diff --git a/web/src/components/operate-dropdown/index.tsx b/web/src/components/operate-dropdown/index.tsx
index d89bfc1d9e..09eb75145e 100644
--- a/web/src/components/operate-dropdown/index.tsx
+++ b/web/src/components/operate-dropdown/index.tsx
@@ -11,6 +11,7 @@ interface IProps {
iconFontSize?: number;
items?: MenuProps['items'];
height?: number;
+ needsDeletionValidation?: boolean;
}
const OperateDropdown = ({
@@ -19,12 +20,17 @@ const OperateDropdown = ({
iconFontSize = 30,
items: otherItems = [],
height = 24,
+ needsDeletionValidation = true,
}: React.PropsWithChildren<IProps>) => {
const { t } = useTranslation();
const showDeleteConfirm = useShowDeleteConfirm();
const handleDelete = () => {
- showDeleteConfirm({ onOk: deleteItem });
+ if (needsDeletionValidation) {
+ showDeleteConfirm({ onOk: deleteItem });
+ } else {
+ deleteItem();
+ }
};
const handleDropdownMenuClick: MenuProps['onClick'] = ({ domEvent, key }) => {
diff --git a/web/src/pages/flow/canvas/node/dropdown.tsx b/web/src/pages/flow/canvas/node/dropdown.tsx
index 1d4fa0f852..b3fdce9e1f 100644
--- a/web/src/pages/flow/canvas/node/dropdown.tsx
+++ b/web/src/pages/flow/canvas/node/dropdown.tsx
@@ -41,6 +41,7 @@ const NodeDropdown = ({ id }: IProps) => {
height={14}
deleteItem={deleteNode}
items={items}
+ needsDeletionValidation={false}
></OperateDropdown>
);
};