balibabu commited on
Commit
561c37a
·
1 Parent(s): 7f98e24

feat: remove disabled from ChunkMethodModal (#148)

Browse files
web/src/pages/add-knowledge/components/knowledge-file/chunk-method-modal.tsx CHANGED
@@ -36,7 +36,6 @@ interface IProps extends Omit<IModalManagerChildrenProps, 'showModal'> {
36
  parserId: string;
37
  parserConfig: IKnowledgeFileParserConfig;
38
  documentType: string;
39
- disabled: boolean;
40
  }
41
 
42
  const hidePagesChunkMethods = ['qa', 'table', 'picture', 'resume', 'one'];
@@ -46,7 +45,6 @@ const ChunkMethodModal: React.FC<IProps> = ({
46
  onOk,
47
  hideModal,
48
  visible,
49
- disabled,
50
  documentType,
51
  parserConfig,
52
  }) => {
@@ -96,7 +94,6 @@ const ChunkMethodModal: React.FC<IProps> = ({
96
  onOk={handleOk}
97
  onCancel={hideModal}
98
  afterClose={afterClose}
99
- okButtonProps={{ disabled }}
100
  >
101
  <Space size={[0, 8]} wrap>
102
  <div className={styles.tags}>
@@ -106,9 +103,7 @@ const ChunkMethodModal: React.FC<IProps> = ({
106
  key={x.value}
107
  checked={selectedTag === x.value}
108
  onChange={(checked) => {
109
- if (!disabled) {
110
- handleChange(x.value, checked);
111
- }
112
  }}
113
  >
114
  {x.label}
@@ -120,12 +115,7 @@ const ChunkMethodModal: React.FC<IProps> = ({
120
  <Divider></Divider>
121
 
122
  {
123
- <Form
124
- name="dynamic_form_nest_item"
125
- autoComplete="off"
126
- form={form}
127
- disabled={disabled}
128
- >
129
  {showPages && (
130
  <>
131
  <Space>
 
36
  parserId: string;
37
  parserConfig: IKnowledgeFileParserConfig;
38
  documentType: string;
 
39
  }
40
 
41
  const hidePagesChunkMethods = ['qa', 'table', 'picture', 'resume', 'one'];
 
45
  onOk,
46
  hideModal,
47
  visible,
 
48
  documentType,
49
  parserConfig,
50
  }) => {
 
94
  onOk={handleOk}
95
  onCancel={hideModal}
96
  afterClose={afterClose}
 
97
  >
98
  <Space size={[0, 8]} wrap>
99
  <div className={styles.tags}>
 
103
  key={x.value}
104
  checked={selectedTag === x.value}
105
  onChange={(checked) => {
106
+ handleChange(x.value, checked);
 
 
107
  }}
108
  >
109
  {x.label}
 
115
  <Divider></Divider>
116
 
117
  {
118
+ <Form name="dynamic_form_nest_item" autoComplete="off" form={form}>
 
 
 
 
 
119
  {showPages && (
120
  <>
121
  <Space>
web/src/pages/add-knowledge/components/knowledge-file/index.tsx CHANGED
@@ -231,7 +231,6 @@ const KnowledgeFile = () => {
231
  onOk={onChangeParserOk}
232
  visible={changeParserVisible}
233
  hideModal={hideChangeParserModal}
234
- disabled={currentRecord.chunk_num > 0}
235
  loading={changeParserLoading}
236
  />
237
  <RenameModal
 
231
  onOk={onChangeParserOk}
232
  visible={changeParserVisible}
233
  hideModal={hideChangeParserModal}
 
234
  loading={changeParserLoading}
235
  />
236
  <RenameModal