mirror of
https://github.com/infiniflow/ragflow.git
synced 2026-01-04 03:25:30 +08:00
Feat: Globally defined conversation variables can be selected in the operator's query variables. #10427 (#11135)
### What problem does this PR solve? Feat: Globally defined conversation variables can be selected in the operator's query variables. #10427 ### Type of change - [x] New Feature (non-breaking change which adds functionality)
This commit is contained in:
@ -1,25 +0,0 @@
|
||||
import { Input } from '@/components/ui/input';
|
||||
import { ChangeEvent, useCallback } from 'react';
|
||||
|
||||
type KeyInputProps = {
|
||||
value?: string;
|
||||
onChange?: (value: string) => void;
|
||||
searchValue?: string | RegExp;
|
||||
};
|
||||
|
||||
export function KeyInput({
|
||||
value,
|
||||
onChange,
|
||||
searchValue = /[^a-zA-Z0-9_]/g,
|
||||
}: KeyInputProps) {
|
||||
const handleChange = useCallback(
|
||||
(e: ChangeEvent<HTMLInputElement>) => {
|
||||
const value = e.target.value ?? '';
|
||||
const filteredValue = value.replace(searchValue, '');
|
||||
onChange?.(filteredValue);
|
||||
},
|
||||
[onChange, searchValue],
|
||||
);
|
||||
|
||||
return <Input value={value} onChange={handleChange} />;
|
||||
}
|
||||
@ -1,3 +1,4 @@
|
||||
import { KeyInput } from '@/components/key-input';
|
||||
import { SelectWithSearch } from '@/components/originui/select-with-search';
|
||||
import { RAGFlowFormItem } from '@/components/ragflow-form';
|
||||
import { Button } from '@/components/ui/button';
|
||||
@ -8,7 +9,6 @@ import { ReactNode } from 'react';
|
||||
import { useFieldArray, useFormContext } from 'react-hook-form';
|
||||
import { DataOperationsOperatorOptions } from '../../constant';
|
||||
import { DynamicFormHeader } from '../components/dynamic-fom-header';
|
||||
import { KeyInput } from '../components/key-input';
|
||||
import { PromptEditor } from '../components/prompt-editor';
|
||||
|
||||
type SelectKeysProps = {
|
||||
|
||||
@ -1,3 +1,4 @@
|
||||
import { KeyInput } from '@/components/key-input';
|
||||
import { RAGFlowFormItem } from '@/components/ragflow-form';
|
||||
import { Button } from '@/components/ui/button';
|
||||
import { Separator } from '@/components/ui/separator';
|
||||
@ -5,7 +6,6 @@ import { X } from 'lucide-react';
|
||||
import { ReactNode } from 'react';
|
||||
import { useFieldArray, useFormContext } from 'react-hook-form';
|
||||
import { DynamicFormHeader } from '../components/dynamic-fom-header';
|
||||
import { KeyInput } from '../components/key-input';
|
||||
import { PromptEditor } from '../components/prompt-editor';
|
||||
|
||||
type SelectKeysProps = {
|
||||
|
||||
Reference in New Issue
Block a user