Merge branch 'form_io' of personal:logspace-ai/langflow into form_io
This commit is contained in:
commit
93ab5b115c
10 changed files with 15 additions and 23 deletions
|
|
@ -177,7 +177,7 @@ export default function ParameterComponent({
|
||||||
<></>
|
<></>
|
||||||
) : (
|
) : (
|
||||||
<ShadTooltip
|
<ShadTooltip
|
||||||
style="tooltip-fixed-width custom-scroll"
|
styleClasses="tooltip-fixed-width custom-scroll"
|
||||||
delayDuration={0}
|
delayDuration={0}
|
||||||
content={refHtml.current}
|
content={refHtml.current}
|
||||||
side={left ? "left" : "right"}
|
side={left ? "left" : "right"}
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@ export default function ShadTooltip({
|
||||||
side,
|
side,
|
||||||
asChild = true,
|
asChild = true,
|
||||||
children,
|
children,
|
||||||
style,
|
styleClasses,
|
||||||
delayDuration = 500,
|
delayDuration = 500,
|
||||||
}: ShadToolTipType) {
|
}: ShadToolTipType) {
|
||||||
return (
|
return (
|
||||||
|
|
@ -14,7 +14,7 @@ export default function ShadTooltip({
|
||||||
<TooltipTrigger asChild={asChild}>{children}</TooltipTrigger>
|
<TooltipTrigger asChild={asChild}>{children}</TooltipTrigger>
|
||||||
|
|
||||||
<TooltipContent
|
<TooltipContent
|
||||||
className={style}
|
className={styleClasses}
|
||||||
side={side}
|
side={side}
|
||||||
avoidCollisions={false}
|
avoidCollisions={false}
|
||||||
sticky="always"
|
sticky="always"
|
||||||
|
|
|
||||||
|
|
@ -72,7 +72,7 @@ export default function Chat({ flow }: ChatType) {
|
||||||
}
|
}
|
||||||
|
|
||||||
prevNodesRef.current = currentNodes;
|
prevNodesRef.current = currentNodes;
|
||||||
}, [tabsState, flow.id]);
|
}, [tabsState, flow.id, nodes]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
|
|
|
||||||
|
|
@ -44,7 +44,7 @@ export default function PromptAreaComponent({
|
||||||
})
|
})
|
||||||
.catch((error) => {});
|
.catch((error) => {});
|
||||||
}
|
}
|
||||||
}, [reactFlowInstance, field_name, myValue, nodeClass, setNodeClass]);
|
}, [reactFlowInstance, field_name, myValue, nodeClass, setNodeClass, value]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={disabled ? "pointer-events-none w-full " : " w-full"}>
|
<div className={disabled ? "pointer-events-none w-full " : " w-full"}>
|
||||||
|
|
|
||||||
|
|
@ -27,9 +27,7 @@ export default function CodeAreaModal({
|
||||||
nodeClass: APIClassType;
|
nodeClass: APIClassType;
|
||||||
setNodeClass: (Class: APIClassType) => void;
|
setNodeClass: (Class: APIClassType) => void;
|
||||||
}) {
|
}) {
|
||||||
const [open, setOpen] = useState(true);
|
|
||||||
const [code, setCode] = useState(value);
|
const [code, setCode] = useState(value);
|
||||||
const [loading, setLoading] = useState(false);
|
|
||||||
const { dark } = useContext(darkContext);
|
const { dark } = useContext(darkContext);
|
||||||
const { closePopUp, setCloseEdit } = useContext(PopUpContext);
|
const { closePopUp, setCloseEdit } = useContext(PopUpContext);
|
||||||
const { setErrorData, setSuccessData } = useContext(alertContext);
|
const { setErrorData, setSuccessData } = useContext(alertContext);
|
||||||
|
|
@ -46,10 +44,8 @@ export default function CodeAreaModal({
|
||||||
}
|
}
|
||||||
|
|
||||||
function handleClick() {
|
function handleClick() {
|
||||||
setLoading(true);
|
|
||||||
postValidateCode(code)
|
postValidateCode(code)
|
||||||
.then((apiReturn) => {
|
.then((apiReturn) => {
|
||||||
setLoading(false);
|
|
||||||
if (apiReturn.data) {
|
if (apiReturn.data) {
|
||||||
let importsErrors = apiReturn.data.imports.errors;
|
let importsErrors = apiReturn.data.imports.errors;
|
||||||
let funcErrors = apiReturn.data.function.errors;
|
let funcErrors = apiReturn.data.function.errors;
|
||||||
|
|
@ -58,7 +54,6 @@ export default function CodeAreaModal({
|
||||||
title: "Code is ready to run",
|
title: "Code is ready to run",
|
||||||
});
|
});
|
||||||
setValue(code);
|
setValue(code);
|
||||||
setOpen((old) => !old);
|
|
||||||
setModalOpen(false);
|
setModalOpen(false);
|
||||||
} else {
|
} else {
|
||||||
if (funcErrors.length !== 0) {
|
if (funcErrors.length !== 0) {
|
||||||
|
|
@ -81,7 +76,6 @@ export default function CodeAreaModal({
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.catch((_) => {
|
.catch((_) => {
|
||||||
setLoading(false);
|
|
||||||
setErrorData({
|
setErrorData({
|
||||||
title: "There is something wrong with this code, please review it",
|
title: "There is something wrong with this code, please review it",
|
||||||
});
|
});
|
||||||
|
|
@ -89,7 +83,7 @@ export default function CodeAreaModal({
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<BaseModal open={true} setOpen={setOpen}>
|
<BaseModal open={true} setOpen={setModalOpen}>
|
||||||
<BaseModal.Header description={CODE_PROMPT_DIALOG_SUBTITLE}>
|
<BaseModal.Header description={CODE_PROMPT_DIALOG_SUBTITLE}>
|
||||||
<DialogTitle className="flex items-center">
|
<DialogTitle className="flex items-center">
|
||||||
<span className="pr-2">Edit Code</span>
|
<span className="pr-2">Edit Code</span>
|
||||||
|
|
|
||||||
|
|
@ -24,7 +24,7 @@ export default function ChatMessage({
|
||||||
}) {
|
}) {
|
||||||
const convert = new Convert({ newline: true });
|
const convert = new Convert({ newline: true });
|
||||||
const [hidden, setHidden] = useState(true);
|
const [hidden, setHidden] = useState(true);
|
||||||
const [template, setTemplate] = useState(chat.template);
|
const template = chat.template;
|
||||||
const [promptOpen, setPromptOpen] = useState(false);
|
const [promptOpen, setPromptOpen] = useState(false);
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
|
|
@ -127,7 +127,7 @@ export default function ChatMessage({
|
||||||
{chat.message.toString()}
|
{chat.message.toString()}
|
||||||
</ReactMarkdown>
|
</ReactMarkdown>
|
||||||
),
|
),
|
||||||
[chat.message.toString()]
|
[chat.message, chat.message.toString()]
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
{chat.files && (
|
{chat.files && (
|
||||||
|
|
|
||||||
|
|
@ -292,7 +292,7 @@ export default function FormModal({
|
||||||
ws.current.close();
|
ws.current.close();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}, []);
|
}, [connectWS]);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (
|
if (
|
||||||
|
|
@ -303,7 +303,7 @@ export default function FormModal({
|
||||||
connectWS();
|
connectWS();
|
||||||
setLockChat(false);
|
setLockChat(false);
|
||||||
}
|
}
|
||||||
}, [lockChat]);
|
}, [lockChat, connectWS]);
|
||||||
|
|
||||||
async function sendAll(data: sendAllProps) {
|
async function sendAll(data: sendAllProps) {
|
||||||
try {
|
try {
|
||||||
|
|
|
||||||
|
|
@ -57,7 +57,6 @@ export default function GenericModal({
|
||||||
const [myModalType] = useState(type);
|
const [myModalType] = useState(type);
|
||||||
const [inputValue, setInputValue] = useState(value);
|
const [inputValue, setInputValue] = useState(value);
|
||||||
const [isEdit, setIsEdit] = useState(true);
|
const [isEdit, setIsEdit] = useState(true);
|
||||||
const [wordsHighlightInvalid, setWordsHighlightInvalid] = useState([]);
|
|
||||||
const [wordsHighlight, setWordsHighlight] = useState([]);
|
const [wordsHighlight, setWordsHighlight] = useState([]);
|
||||||
const { dark } = useContext(darkContext);
|
const { dark } = useContext(darkContext);
|
||||||
const { setErrorData, setSuccessData, setNoticeData } =
|
const { setErrorData, setSuccessData, setNoticeData } =
|
||||||
|
|
@ -102,15 +101,14 @@ export default function GenericModal({
|
||||||
(word) => !invalid_chars.includes(word)
|
(word) => !invalid_chars.includes(word)
|
||||||
);
|
);
|
||||||
|
|
||||||
setWordsHighlightInvalid(invalid_chars);
|
|
||||||
setWordsHighlight(filteredWordsHighlight);
|
setWordsHighlight(filteredWordsHighlight);
|
||||||
}
|
}
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (type == TypeModal.PROMPT && inputValue && inputValue != "") {
|
if (type === TypeModal.PROMPT && inputValue && inputValue != "") {
|
||||||
checkVariables(inputValue);
|
checkVariables(inputValue);
|
||||||
}
|
}
|
||||||
}, []);
|
}, [inputValue, type]);
|
||||||
|
|
||||||
const coloredContent = (inputValue || "")
|
const coloredContent = (inputValue || "")
|
||||||
.replace(/</g, "<")
|
.replace(/</g, "<")
|
||||||
|
|
|
||||||
|
|
@ -288,7 +288,7 @@ export default function Page({ flow }: { flow: FlowType }) {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
// Specify dependencies for useCallback
|
// Specify dependencies for useCallback
|
||||||
[getNodeId, reactFlowInstance, setErrorData, setNodes, takeSnapshot]
|
[getNodeId, reactFlowInstance, setNodes, takeSnapshot]
|
||||||
);
|
);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
|
@ -322,7 +322,7 @@ export default function Page({ flow }: { flow: FlowType }) {
|
||||||
setEdges((els) => updateEdge(oldEdge, newConnection, els));
|
setEdges((els) => updateEdge(oldEdge, newConnection, els));
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
[]
|
[reactFlowInstance, setEdges]
|
||||||
);
|
);
|
||||||
|
|
||||||
const onEdgeUpdateEnd = useCallback((_, edge) => {
|
const onEdgeUpdateEnd = useCallback((_, edge) => {
|
||||||
|
|
|
||||||
|
|
@ -147,7 +147,7 @@ export type ShadToolTipType = {
|
||||||
asChild?: boolean;
|
asChild?: boolean;
|
||||||
children?: ReactElement;
|
children?: ReactElement;
|
||||||
delayDuration?: number;
|
delayDuration?: number;
|
||||||
style?: string;
|
styleClasses?: string;
|
||||||
};
|
};
|
||||||
|
|
||||||
export type TextHighlightType = {
|
export type TextHighlightType = {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue