From f69aa2d70fe2bd9c905ca72e86ca560014fcfcce Mon Sep 17 00:00:00 2001 From: Lucas Oliveira Date: Fri, 7 Jun 2024 12:04:28 -0300 Subject: [PATCH 1/2] Changed folders --- .../components/switchOutputView/components/index.tsx | 0 .../switchOutputView/helpers/convert-to-table-rows.ts | 0 .../outputModal/components/switchOutputView/index.tsx | 0 .../GenericNode}/components/outputModal/index.tsx | 0 .../GenericNode/components/parameterComponent/index.tsx | 4 ++-- src/frontend/src/CustomNodes/GenericNode/index.tsx | 4 ++-- .../src/{customNodes => CustomNodes}/helpers/count-handles.ts | 0 .../helpers/get-class-from-build-status.ts | 0 src/frontend/src/types/components/index.ts | 2 +- 9 files changed, 5 insertions(+), 5 deletions(-) rename src/frontend/src/{customNodes/genericNode => CustomNodes/GenericNode}/components/outputModal/components/switchOutputView/components/index.tsx (100%) rename src/frontend/src/{customNodes/genericNode => CustomNodes/GenericNode}/components/outputModal/components/switchOutputView/helpers/convert-to-table-rows.ts (100%) rename src/frontend/src/{customNodes/genericNode => CustomNodes/GenericNode}/components/outputModal/components/switchOutputView/index.tsx (100%) rename src/frontend/src/{customNodes/genericNode => CustomNodes/GenericNode}/components/outputModal/index.tsx (100%) rename src/frontend/src/{customNodes => CustomNodes}/helpers/count-handles.ts (100%) rename src/frontend/src/{customNodes => CustomNodes}/helpers/get-class-from-build-status.ts (100%) diff --git a/src/frontend/src/customNodes/genericNode/components/outputModal/components/switchOutputView/components/index.tsx b/src/frontend/src/CustomNodes/GenericNode/components/outputModal/components/switchOutputView/components/index.tsx similarity index 100% rename from src/frontend/src/customNodes/genericNode/components/outputModal/components/switchOutputView/components/index.tsx rename to src/frontend/src/CustomNodes/GenericNode/components/outputModal/components/switchOutputView/components/index.tsx diff --git a/src/frontend/src/customNodes/genericNode/components/outputModal/components/switchOutputView/helpers/convert-to-table-rows.ts b/src/frontend/src/CustomNodes/GenericNode/components/outputModal/components/switchOutputView/helpers/convert-to-table-rows.ts similarity index 100% rename from src/frontend/src/customNodes/genericNode/components/outputModal/components/switchOutputView/helpers/convert-to-table-rows.ts rename to src/frontend/src/CustomNodes/GenericNode/components/outputModal/components/switchOutputView/helpers/convert-to-table-rows.ts diff --git a/src/frontend/src/customNodes/genericNode/components/outputModal/components/switchOutputView/index.tsx b/src/frontend/src/CustomNodes/GenericNode/components/outputModal/components/switchOutputView/index.tsx similarity index 100% rename from src/frontend/src/customNodes/genericNode/components/outputModal/components/switchOutputView/index.tsx rename to src/frontend/src/CustomNodes/GenericNode/components/outputModal/components/switchOutputView/index.tsx diff --git a/src/frontend/src/customNodes/genericNode/components/outputModal/index.tsx b/src/frontend/src/CustomNodes/GenericNode/components/outputModal/index.tsx similarity index 100% rename from src/frontend/src/customNodes/genericNode/components/outputModal/index.tsx rename to src/frontend/src/CustomNodes/GenericNode/components/outputModal/index.tsx diff --git a/src/frontend/src/CustomNodes/GenericNode/components/parameterComponent/index.tsx b/src/frontend/src/CustomNodes/GenericNode/components/parameterComponent/index.tsx index be62de826..719bd9ab4 100644 --- a/src/frontend/src/CustomNodes/GenericNode/components/parameterComponent/index.tsx +++ b/src/frontend/src/CustomNodes/GenericNode/components/parameterComponent/index.tsx @@ -21,7 +21,7 @@ import { LANGFLOW_SUPPORTED_TYPES, TOOLTIP_EMPTY, } from "../../../../constants/constants"; -import OutputModal from "../../../../customNodes/genericNode/components/outputModal"; +import OutputModal from "../outputModal"; import { Case } from "../../../../shared/components/caseComponent"; import useFlowStore from "../../../../stores/flowStore"; import useFlowsManagerStore from "../../../../stores/flowsManagerStore"; @@ -430,7 +430,7 @@ export default function ParameterComponent({ }); }} name={name} - data={data.node?.template[name]} + data={data.node?.template[name]!} /> {data.node?.template[name]?.refresh_button && ( diff --git a/src/frontend/src/CustomNodes/GenericNode/index.tsx b/src/frontend/src/CustomNodes/GenericNode/index.tsx index 0dd8d9694..63b84a847 100644 --- a/src/frontend/src/CustomNodes/GenericNode/index.tsx +++ b/src/frontend/src/CustomNodes/GenericNode/index.tsx @@ -12,8 +12,8 @@ import { STATUS_BUILDING, } from "../../constants/constants"; import { BuildStatus } from "../../constants/enums"; -import { countHandlesFn } from "../../customNodes/helpers/count-handles"; -import { getSpecificClassFromBuildStatus } from "../../customNodes/helpers/get-class-from-build-status"; +import { countHandlesFn } from "../helpers/count-handles"; +import { getSpecificClassFromBuildStatus } from "../helpers/get-class-from-build-status"; import NodeToolbarComponent from "../../pages/FlowPage/components/nodeToolbarComponent"; import useAlertStore from "../../stores/alertStore"; import { useDarkStore } from "../../stores/darkStore"; diff --git a/src/frontend/src/customNodes/helpers/count-handles.ts b/src/frontend/src/CustomNodes/helpers/count-handles.ts similarity index 100% rename from src/frontend/src/customNodes/helpers/count-handles.ts rename to src/frontend/src/CustomNodes/helpers/count-handles.ts diff --git a/src/frontend/src/customNodes/helpers/get-class-from-build-status.ts b/src/frontend/src/CustomNodes/helpers/get-class-from-build-status.ts similarity index 100% rename from src/frontend/src/customNodes/helpers/get-class-from-build-status.ts rename to src/frontend/src/CustomNodes/helpers/get-class-from-build-status.ts diff --git a/src/frontend/src/types/components/index.ts b/src/frontend/src/types/components/index.ts index 484ed5c84..18bba4c2e 100644 --- a/src/frontend/src/types/components/index.ts +++ b/src/frontend/src/types/components/index.ts @@ -84,7 +84,7 @@ export type InputGlobalComponentType = { onChange: (value: string) => void; setDb: (value: boolean) => void; name: string; - data: NodeDataType; + data: TemplateVariableType; editNode?: boolean; playgroundDisabled?: boolean; }; From 638e6d66d99bcd05ad7ec01c638d7948568ef98b Mon Sep 17 00:00:00 2001 From: Lucas Oliveira Date: Fri, 7 Jun 2024 12:06:31 -0300 Subject: [PATCH 2/2] Removed unused code and fixed type of InputGlobalComponent --- .../GenericNode/components/parameterComponent/index.tsx | 2 +- .../sidebarComponent/components/sideBarFolderButtons/index.tsx | 1 - src/frontend/src/components/sidebarComponent/index.tsx | 2 -- src/frontend/src/types/components/index.ts | 2 +- 4 files changed, 2 insertions(+), 5 deletions(-) diff --git a/src/frontend/src/CustomNodes/GenericNode/components/parameterComponent/index.tsx b/src/frontend/src/CustomNodes/GenericNode/components/parameterComponent/index.tsx index 719bd9ab4..437e5a1b1 100644 --- a/src/frontend/src/CustomNodes/GenericNode/components/parameterComponent/index.tsx +++ b/src/frontend/src/CustomNodes/GenericNode/components/parameterComponent/index.tsx @@ -21,7 +21,6 @@ import { LANGFLOW_SUPPORTED_TYPES, TOOLTIP_EMPTY, } from "../../../../constants/constants"; -import OutputModal from "../outputModal"; import { Case } from "../../../../shared/components/caseComponent"; import useFlowStore from "../../../../stores/flowStore"; import useFlowsManagerStore from "../../../../stores/flowsManagerStore"; @@ -47,6 +46,7 @@ import useHandleNodeClass from "../../../hooks/use-handle-node-class"; import useHandleRefreshButtonPress from "../../../hooks/use-handle-refresh-buttons"; import TooltipRenderComponent from "../tooltipRenderComponent"; import { TEXT_FIELD_TYPES } from "./constants"; +import OutputModal from "../outputModal"; export default function ParameterComponent({ left, diff --git a/src/frontend/src/components/sidebarComponent/components/sideBarFolderButtons/index.tsx b/src/frontend/src/components/sidebarComponent/components/sideBarFolderButtons/index.tsx index 4289c7cbe..d43f753c5 100644 --- a/src/frontend/src/components/sidebarComponent/components/sideBarFolderButtons/index.tsx +++ b/src/frontend/src/components/sidebarComponent/components/sideBarFolderButtons/index.tsx @@ -16,7 +16,6 @@ import { Input } from "../../../ui/input"; import useFileDrop from "../../hooks/use-on-file-drop"; type SideBarFoldersButtonsComponentProps = { - folders: FolderType[]; pathname: string; handleChangeFolder?: (id: string) => void; handleDeleteFolder?: (item: FolderType) => void; diff --git a/src/frontend/src/components/sidebarComponent/index.tsx b/src/frontend/src/components/sidebarComponent/index.tsx index 315935965..efec5da1e 100644 --- a/src/frontend/src/components/sidebarComponent/index.tsx +++ b/src/frontend/src/components/sidebarComponent/index.tsx @@ -44,10 +44,8 @@ export default function SidebarNav({ folders?.length > 0 && isFolderPath && ( ) diff --git a/src/frontend/src/types/components/index.ts b/src/frontend/src/types/components/index.ts index 18bba4c2e..7d9712aa9 100644 --- a/src/frontend/src/types/components/index.ts +++ b/src/frontend/src/types/components/index.ts @@ -81,7 +81,7 @@ export type InputListComponentType = { export type InputGlobalComponentType = { disabled: boolean; - onChange: (value: string) => void; + onChange: (value: string, snapshot?: boolean) => void; setDb: (value: boolean) => void; name: string; data: TemplateVariableType;