balibabu commited on
Commit
ccbf758
·
1 Parent(s): 086a0cb

feat: Add top_n to DeepLForm #1739 (#2629)

Browse files

### What problem does this PR solve?

feat: Add top_n to DeepLForm #1739

### Type of change

- [ ] Bug Fix (non-breaking change which fixes an issue)
- [x] New Feature (non-breaking change which adds functionality)
- [ ] Documentation Update
- [ ] Refactoring
- [ ] Performance Improvement
- [ ] Other (please describe):

web/src/pages/flow/constant.tsx CHANGED
@@ -410,7 +410,7 @@ export const initialGoogleScholarValues = {
410
  };
411
 
412
  export const initialDeepLValues = {
413
- text: 5,
414
  auth_key: 'relevance',
415
  };
416
 
 
410
  };
411
 
412
  export const initialDeepLValues = {
413
+ top_n: 5,
414
  auth_key: 'relevance',
415
  };
416
 
web/src/pages/flow/deepl-form/index.tsx CHANGED
@@ -1,5 +1,6 @@
 
1
  import { useTranslate } from '@/hooks/common-hooks';
2
- import { Form, InputNumber, Select } from 'antd';
3
  import { DeepLSourceLangOptions, DeepLTargetLangOptions } from '../constant';
4
  import { useBuildSortOptions } from '../form-hooks';
5
  import { IOperatorForm } from '../interface';
@@ -17,9 +18,7 @@ const DeepLForm = ({ onValuesChange, form }: IOperatorForm) => {
17
  form={form}
18
  onValuesChange={onValuesChange}
19
  >
20
- <Form.Item label={t('text')} name={'text'}>
21
- <InputNumber></InputNumber>
22
- </Form.Item>
23
  <Form.Item label={t('authKey')} name={'auth_key'}>
24
  <Select options={options}></Select>
25
  </Form.Item>
 
1
+ import TopNItem from '@/components/top-n-item';
2
  import { useTranslate } from '@/hooks/common-hooks';
3
+ import { Form, Select } from 'antd';
4
  import { DeepLSourceLangOptions, DeepLTargetLangOptions } from '../constant';
5
  import { useBuildSortOptions } from '../form-hooks';
6
  import { IOperatorForm } from '../interface';
 
18
  form={form}
19
  onValuesChange={onValuesChange}
20
  >
21
+ <TopNItem initialValue={5}></TopNItem>
 
 
22
  <Form.Item label={t('authKey')} name={'auth_key'}>
23
  <Select options={options}></Select>
24
  </Form.Item>