feat: Add EntityTypesForm #162 (#1777)

### What problem does this PR solve?
feat: Add EntityTypesForm #162

### Type of change


- [x] New Feature (non-breaking change which adds functionality)
This commit is contained in:
balibabu
2024-08-02 10:03:05 +08:00
committed by GitHub
parent 4ba1ba973a
commit 3a739e3dd7
10 changed files with 62 additions and 12 deletions

View File

@ -22,6 +22,7 @@ import React, { useEffect, useMemo } from 'react';
import { useFetchParserListOnMount } from './hooks';
import { useTranslate } from '@/hooks/common-hooks';
import EntityTypesForm from '../entity-types-form';
import LayoutRecognize from '../layout-recognize';
import ParseConfiguration, {
showRaptorParseConfiguration,
@ -41,7 +42,14 @@ interface IProps extends Omit<IModalManagerChildrenProps, 'showModal'> {
documentId: string;
}
const hidePagesChunkMethods = ['qa', 'table', 'picture', 'resume', 'one'];
const hidePagesChunkMethods = [
'qa',
'table',
'picture',
'resume',
'one',
'knowledge_graph',
];
const ChunkMethodModal: React.FC<IProps> = ({
documentId,
@ -80,7 +88,7 @@ const ChunkMethodModal: React.FC<IProps> = ({
return (
isPdf &&
hidePagesChunkMethods
.filter((x) => x !== 'one')
.filter((x) => x !== 'one' && x !== 'knowledge_graph')
.every((x) => x !== selectedTag)
);
}, [selectedTag, isPdf]);
@ -91,6 +99,8 @@ const ChunkMethodModal: React.FC<IProps> = ({
(x) => x === false,
);
const showEntityTypes = selectedTag === 'knowledge_graph';
const afterClose = () => {
form.resetFields();
};
@ -262,6 +272,7 @@ const ChunkMethodModal: React.FC<IProps> = ({
{showRaptorParseConfiguration(selectedTag) && (
<ParseConfiguration></ParseConfiguration>
)}
{showEntityTypes && <EntityTypesForm></EntityTypesForm>}
</Form>
</Modal>
);