diff --git a/web/src/components/entity-types-form-field.tsx b/web/src/components/entity-types-form-field.tsx index 3a5de8ce5..ddf08cb0b 100644 --- a/web/src/components/entity-types-form-field.tsx +++ b/web/src/components/entity-types-form-field.tsx @@ -12,7 +12,13 @@ import { type EntityTypesFormFieldProps = { name?: string; }; - +const initialEntityTypes = [ + 'organization', + 'person', + 'geo', + 'event', + 'category', +]; export function EntityTypesFormField({ name = 'parser_config.entity_types', }: EntityTypesFormFieldProps) { @@ -23,24 +29,27 @@ export function EntityTypesFormField({ ( - -
- - * {t('entityTypes')} - -
- - - + defaultValue={initialEntityTypes} + render={({ field }) => { + return ( + +
+ + * {t('entityTypes')} + +
+ + + +
-
-
-
- -
- - )} +
+
+ +
+ + ); + }} /> ); } diff --git a/web/src/components/entity-types-item.tsx b/web/src/components/entity-types-item.tsx index d52fb0e13..ba26e5f4c 100644 --- a/web/src/components/entity-types-item.tsx +++ b/web/src/components/entity-types-item.tsx @@ -25,7 +25,7 @@ const EntityTypesItem = ({ rules={[{ required: true }]} initialValue={initialEntityTypes} > - + ); }; diff --git a/web/src/components/list-filter-bar/use-handle-filter-submit.ts b/web/src/components/list-filter-bar/use-handle-filter-submit.ts index 55cc4c6fe..189a8d6b8 100644 --- a/web/src/components/list-filter-bar/use-handle-filter-submit.ts +++ b/web/src/components/list-filter-bar/use-handle-filter-submit.ts @@ -1,12 +1,17 @@ +import { useGetPaginationWithRouter } from '@/hooks/logic-hooks'; import { useCallback, useState } from 'react'; import { FilterChange, FilterValue } from './interface'; export function useHandleFilterSubmit() { const [filterValue, setFilterValue] = useState({}); - - const handleFilterSubmit: FilterChange = useCallback((value) => { - setFilterValue(value); - }, []); + const { setPagination } = useGetPaginationWithRouter(); + const handleFilterSubmit: FilterChange = useCallback( + (value) => { + setFilterValue(value); + setPagination({ page: 1 }); + }, + [setPagination], + ); return { filterValue, setFilterValue, handleFilterSubmit }; } diff --git a/web/src/components/max-token-number-from-field.tsx b/web/src/components/max-token-number-from-field.tsx index a9646f90f..f1762c1a8 100644 --- a/web/src/components/max-token-number-from-field.tsx +++ b/web/src/components/max-token-number-from-field.tsx @@ -7,7 +7,7 @@ interface IProps { max?: number; } -export function MaxTokenNumberFormField({ max = 2048 }: IProps) { +export function MaxTokenNumberFormField({ max = 2048, initialValue }: IProps) { const { t } = useTranslate('knowledgeConfiguration'); return ( @@ -15,6 +15,7 @@ export function MaxTokenNumberFormField({ max = 2048 }: IProps) { name={'parser_config.chunk_token_num'} label={t('chunkTokenNumber')} max={max} + defaultValue={initialValue ?? 0} layout={FormLayout.Horizontal} > ); diff --git a/web/src/components/originui/input.tsx b/web/src/components/originui/input.tsx index d8c125f91..18cf78f97 100644 --- a/web/src/components/originui/input.tsx +++ b/web/src/components/originui/input.tsx @@ -1,24 +1,49 @@ import * as React from 'react'; import { cn } from '@/lib/utils'; +type InputProps = React.ComponentProps<'input'> & { + icon?: React.ReactNode; + iconPosition?: 'left' | 'right'; +}; -function Input({ className, type, ...props }: React.ComponentProps<'input'>) { +function Input({ + className, + type, + icon, + iconPosition = 'left', + ...props +}: InputProps) { return ( - + {icon && ( +
+ {icon} +
)} - {...props} - /> + +
); } diff --git a/web/src/components/parse-configuration/raptor-form-fields.tsx b/web/src/components/parse-configuration/raptor-form-fields.tsx index b38db7c87..8ee184e46 100644 --- a/web/src/components/parse-configuration/raptor-form-fields.tsx +++ b/web/src/components/parse-configuration/raptor-form-fields.tsx @@ -64,10 +64,10 @@ const RaptorFormFields = () => { control={form.control} name={UseRaptorField} render={({ field }) => { - if (typeof field.value === 'undefined') { - // default value set - form.setValue('parser_config.raptor.use_raptor', false); - } + // if (typeof field.value === 'undefined') { + // // default value set + // form.setValue('parser_config.raptor.use_raptor', false); + // } return ( { ( - -
- - {t('prompt')} - -
- -