mirror of
https://github.com/infiniflow/ragflow.git
synced 2025-12-23 06:46:40 +08:00
### What problem does this PR solve? Feat: Fixed the issue where the prompt menu content was hidden #3221 ### Type of change - [x] New Feature (non-breaking change which adds functionality)
This commit is contained in:
@ -723,7 +723,7 @@ export const initialStringTransformValues = {
|
||||
method: StringTransformMethod.Merge,
|
||||
split_ref: '',
|
||||
script: '',
|
||||
delimiters: [],
|
||||
delimiters: [StringTransformDelimiter.Comma],
|
||||
outputs: {
|
||||
result: {
|
||||
type: 'string',
|
||||
@ -851,6 +851,7 @@ export const RestrictedUpstreamMap = {
|
||||
[Operator.WaitingDialogue]: [Operator.Begin],
|
||||
[Operator.Agent]: [Operator.Begin],
|
||||
[Operator.TavilySearch]: [Operator.Begin],
|
||||
[Operator.StringTransform]: [Operator.Begin],
|
||||
};
|
||||
|
||||
export const NodeMap = {
|
||||
|
||||
@ -67,7 +67,6 @@ function VariablePickerMenuItem({
|
||||
option: VariableOption | VariableInnerOption,
|
||||
) => void;
|
||||
}) {
|
||||
console.info('xxxx');
|
||||
return (
|
||||
<li
|
||||
key={option.key}
|
||||
@ -245,11 +244,10 @@ export default function VariablePickerMenuPlugin({
|
||||
options={buildNextOptions()}
|
||||
menuRenderFn={(anchorElementRef, { selectOptionAndCleanUp }) => {
|
||||
const nextOptions = buildNextOptions();
|
||||
console.log('🚀 ~ nextOptions:', nextOptions);
|
||||
return anchorElementRef.current && nextOptions.length
|
||||
? ReactDOM.createPortal(
|
||||
<div className="typeahead-popover w-[200px] p-2">
|
||||
<ul>
|
||||
<ul className="overflow-y-auto !scrollbar-thin overflow-x-hidden">
|
||||
{nextOptions.map((option, i: number) => (
|
||||
<VariablePickerMenuItem
|
||||
index={i}
|
||||
|
||||
@ -6,20 +6,26 @@ import {
|
||||
StringTransformMethod,
|
||||
} from '../../constant';
|
||||
|
||||
function transferDelimiters(formData: typeof initialStringTransformValues) {
|
||||
return formData.method === StringTransformMethod.Merge
|
||||
? formData.delimiters[0]
|
||||
: formData.delimiters;
|
||||
}
|
||||
|
||||
export function useValues(node?: RAGFlowNodeType) {
|
||||
const values = useMemo(() => {
|
||||
const formData = node?.data?.form;
|
||||
|
||||
if (isEmpty(formData)) {
|
||||
return initialStringTransformValues;
|
||||
return {
|
||||
...initialStringTransformValues,
|
||||
delimiters: transferDelimiters(formData),
|
||||
};
|
||||
}
|
||||
|
||||
return {
|
||||
...formData,
|
||||
delimiters:
|
||||
formData.method === StringTransformMethod.Merge
|
||||
? formData.delimiters[0]
|
||||
: formData.delimiters,
|
||||
delimiters: transferDelimiters(formData),
|
||||
};
|
||||
}, [node?.data?.form]);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user