From 61ecc66e1f3f4385d7a0f70a7b28e0436fc98304 Mon Sep 17 00:00:00 2001 From: igorrCarvalho Date: Fri, 26 Jan 2024 10:55:54 -0300 Subject: [PATCH] Feat: Add support to another input types on IO --- .../src/components/IOInputField/index.tsx | 23 ++++++++++++++++ src/frontend/src/components/IOview/index.tsx | 26 +++++++++---------- src/frontend/src/controllers/API/index.ts | 1 - src/frontend/src/types/components/index.ts | 10 ++++++- 4 files changed, 44 insertions(+), 16 deletions(-) create mode 100644 src/frontend/src/components/IOInputField/index.tsx diff --git a/src/frontend/src/components/IOInputField/index.tsx b/src/frontend/src/components/IOInputField/index.tsx new file mode 100644 index 000000000..68d442648 --- /dev/null +++ b/src/frontend/src/components/IOInputField/index.tsx @@ -0,0 +1,23 @@ +import { Textarea } from "../ui/textarea"; +import InputFileComponent from "../inputFileComponent"; +import { IOInputProps } from "../../types/components"; + +export default function IOInputField({ + inputType, + value, + onChange, + styleClasses, + placeholder, +}: IOInputProps): JSX.Element | undefined { + switch (inputType) { + case "TextInput": + return ( + + }} + /> diff --git a/src/frontend/src/controllers/API/index.ts b/src/frontend/src/controllers/API/index.ts index f414db1eb..e761c76d2 100644 --- a/src/frontend/src/controllers/API/index.ts +++ b/src/frontend/src/controllers/API/index.ts @@ -856,7 +856,6 @@ export async function requestLogout() { export async function getVerticesOrder( flowId: string ): Promise> { - console.log; return await api.get(`${BASE_URL_API}build/${flowId}/vertices`); } diff --git a/src/frontend/src/types/components/index.ts b/src/frontend/src/types/components/index.ts index 7b1322f1b..e641ef1a3 100644 --- a/src/frontend/src/types/components/index.ts +++ b/src/frontend/src/types/components/index.ts @@ -1,4 +1,4 @@ -import { ReactElement, ReactNode } from "react"; +import { ChangeEvent, ReactElement, ReactNode } from "react"; import { ReactFlowJsonObject, XYPosition } from "reactflow"; import { APIClassType, APITemplateType, TemplateVariableType } from "../api"; import { ChatMessageType } from "../chat"; @@ -645,3 +645,11 @@ export type dropdownButtonPropsType = { onFirstBtnClick: () => void; options: Array<{ name: string; onBtnClick: () => void }>; }; + +export type IOInputProps = { + inputType: string; + value: string; + onChange: (e: ChangeEvent) => void; + styleClasses: string; + placeholder: string; +}