From 74419e5f0c47dd39dfe4866ac3dc6879417cf92e Mon Sep 17 00:00:00 2001
From: balibabu <cike8899@users.noreply.github.com>
Date: Mon, 25 Mar 2024 14:56:56 +0800
Subject: [PATCH] feat: remove disabled from ChunkMethodModal (#148)

---
 .../knowledge-file/chunk-method-modal.tsx          | 14 ++------------
 .../components/knowledge-file/index.tsx            |  1 -
 2 files changed, 2 insertions(+), 13 deletions(-)

diff --git a/web/src/pages/add-knowledge/components/knowledge-file/chunk-method-modal.tsx b/web/src/pages/add-knowledge/components/knowledge-file/chunk-method-modal.tsx
index 10a3092..0d9a527 100644
--- a/web/src/pages/add-knowledge/components/knowledge-file/chunk-method-modal.tsx
+++ b/web/src/pages/add-knowledge/components/knowledge-file/chunk-method-modal.tsx
@@ -36,7 +36,6 @@ interface IProps extends Omit<IModalManagerChildrenProps, 'showModal'> {
   parserId: string;
   parserConfig: IKnowledgeFileParserConfig;
   documentType: string;
-  disabled: boolean;
 }
 
 const hidePagesChunkMethods = ['qa', 'table', 'picture', 'resume', 'one'];
@@ -46,7 +45,6 @@ const ChunkMethodModal: React.FC<IProps> = ({
   onOk,
   hideModal,
   visible,
-  disabled,
   documentType,
   parserConfig,
 }) => {
@@ -96,7 +94,6 @@ const ChunkMethodModal: React.FC<IProps> = ({
       onOk={handleOk}
       onCancel={hideModal}
       afterClose={afterClose}
-      okButtonProps={{ disabled }}
     >
       <Space size={[0, 8]} wrap>
         <div className={styles.tags}>
@@ -106,9 +103,7 @@ const ChunkMethodModal: React.FC<IProps> = ({
                 key={x.value}
                 checked={selectedTag === x.value}
                 onChange={(checked) => {
-                  if (!disabled) {
-                    handleChange(x.value, checked);
-                  }
+                  handleChange(x.value, checked);
                 }}
               >
                 {x.label}
@@ -120,12 +115,7 @@ const ChunkMethodModal: React.FC<IProps> = ({
       <Divider></Divider>
 
       {
-        <Form
-          name="dynamic_form_nest_item"
-          autoComplete="off"
-          form={form}
-          disabled={disabled}
-        >
+        <Form name="dynamic_form_nest_item" autoComplete="off" form={form}>
           {showPages && (
             <>
               <Space>
diff --git a/web/src/pages/add-knowledge/components/knowledge-file/index.tsx b/web/src/pages/add-knowledge/components/knowledge-file/index.tsx
index c3edece..18f8475 100644
--- a/web/src/pages/add-knowledge/components/knowledge-file/index.tsx
+++ b/web/src/pages/add-knowledge/components/knowledge-file/index.tsx
@@ -231,7 +231,6 @@ const KnowledgeFile = () => {
         onOk={onChangeParserOk}
         visible={changeParserVisible}
         hideModal={hideChangeParserModal}
-        disabled={currentRecord.chunk_num > 0}
         loading={changeParserLoading}
       />
       <RenameModal
-- 
GitLab