fix: flow experimental components (#3093)

* refactor(utils.py): simplify data processing logic in build_data_from_result_data function for better readability and maintainability

* feat: set default output type to "chat" in run_flow function

* refactor(FlowTool.py): refactor FlowToolComponent class to inherit from LCToolComponent

* Fixed Flow as Tool component

* Fixed refresh button not appearing at the end

* Added way of connecting SecretStrInput to messages

* Added real_time_refresh when field has button update too

* Refactored SubFlow component

* Fixed FlowTool to only output tool and removed async function def

* fix: two statements in the same line

* [autofix.ci] apply automated fixes

* Fixed lint issues

* fixed dataobj with wrong name

* changed tweaks dict type

* Fixed margin appearing in output too

* Fixed useless button that made styling worse on handlerendercomponent

---------

Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
This commit is contained in:
Lucas Oliveira 2024-07-31 13:03:42 -03:00 • committed by GitHub
commit 5076f2014e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 106 additions and 81 deletions

View file

@ -1,7 +1,5 @@
import { title } from "process";
import { Handle, Position } from "reactflow";
import ShadTooltip from "../../../../components/shadTooltipComponent";
import { Button } from "../../../../components/ui/button";
import {
isValidConnection,
scapedJSONStringfy,
@ -37,10 +35,7 @@ export default function HandleRenderComponent({
testIdComplement?: string;
}) {
return (
<Button
unstyled
className="h-7 truncate bg-muted p-0 text-sm font-normal text-black hover:bg-muted"
>
<div>
<ShadTooltip
styleClasses={"tooltip-fixed-width custom-scroll nowheel"}
delayDuration={1000}
@ -100,6 +95,6 @@ export default function HandleRenderComponent({
left ? "-left-[4px] -ml-0.5" : "-right-[4px] -mr-0.5",
)}
/>
</Button>
</div>
);
}

View file

@ -349,8 +349,8 @@ export default function ParameterComponent({
testIdComplement={`${data?.type?.toLowerCase()}-shownode`}
/>
)}
<div className="mt-2 w-full">
{data.node?.template[name] !== undefined && (
{data.node?.template[name] !== undefined && (
<div className="mt-2 w-full">
<ParameterRenderComponent
handleOnNewValue={handleOnNewValue}
name={name}
@ -362,8 +362,8 @@ export default function ParameterComponent({
nodeClass={data.node!}
disabled={disabled}
/>
)}
</div>
</div>
)}
{openOutputModal && (
<OutputModal
open={openOutputModal}

View file

@ -63,8 +63,7 @@ const useHandleOnNewValue = ({
if (value !== undefined) parameter[key] = value;
});
const shouldUpdate =
parameter.real_time_refresh && !parameter.refresh_button;
const shouldUpdate = parameter.real_time_refresh;
const setNodeClass = (newNodeClass: APIClassType) => {
options?.setNodeClass && options.setNodeClass(newNodeClass);

View file

@ -29,7 +29,7 @@ export function RefreshParameterComponent({
setErrorData,
);
return (
<div className="flex w-full items-center gap-2">
<div className="flex w-full items-center justify-between gap-2">
{children}
{templateData.refresh_button && (
<div className="shrink-0 flex-col">