From 7ca0f8d60dba8aaa99a16fc7dd25cfb790af7a18 Mon Sep 17 00:00:00 2001 From: Igor Carvalho Date: Wed, 19 Jul 2023 17:05:40 -0300 Subject: [PATCH 001/139] refactor[EditFlowSettingsComponent]: Move type InputProps to types directorie --- .../components/EditFlowSettingsComponent/index.tsx | 12 +----------- src/frontend/src/types/components/index.ts | 11 +++++++++++ 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/src/frontend/src/components/EditFlowSettingsComponent/index.tsx b/src/frontend/src/components/EditFlowSettingsComponent/index.tsx index a0beb11f3..6c1b77b6c 100644 --- a/src/frontend/src/components/EditFlowSettingsComponent/index.tsx +++ b/src/frontend/src/components/EditFlowSettingsComponent/index.tsx @@ -2,17 +2,7 @@ import React, { ChangeEvent, useState } from "react"; import { Input } from "../../components/ui/input"; import { Label } from "../../components/ui/label"; import { Textarea } from "../../components/ui/textarea"; - -type InputProps = { - name: string | null; - description: string | null; - maxLength?: number; - flows: Array<{ id: string; name: string }>; - tabId: string; - setName: (name: string) => void; - setDescription: (description: string) => void; - updateFlow: (flow: { id: string; name: string }) => void; -}; +import { InputProps } from "../../types/components"; export const EditFlowSettings: React.FC = ({ name, diff --git a/src/frontend/src/types/components/index.ts b/src/frontend/src/types/components/index.ts index 813ed28a3..be13ac5e4 100644 --- a/src/frontend/src/types/components/index.ts +++ b/src/frontend/src/types/components/index.ts @@ -168,3 +168,14 @@ export type IconComponentProps = { className: string; iconColor?: string; }; + +export type InputProps = { + name: string | null; + description: string | null; + maxLength?: number; + flows: Array<{ id: string; name: string }>; + tabId: string; + setName: (name: string) => void; + setDescription: (description: string) => void; + updateFlow: (flow: { id: string; name: string }) => void; +}; From 83772eeefd2565ca55185e68cdae97ef1f275ad1 Mon Sep 17 00:00:00 2001 From: Igor Carvalho Date: Wed, 19 Jul 2023 17:11:56 -0300 Subject: [PATCH 002/139] refactor[ReactTooltipComponent]: Move type TooltipProps to types directorie --- .../src/components/ReactTooltipComponent/index.tsx | 13 +------------ src/frontend/src/types/components/index.ts | 12 ++++++++++++ 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/src/frontend/src/components/ReactTooltipComponent/index.tsx b/src/frontend/src/components/ReactTooltipComponent/index.tsx index 0f0c64b89..2e3733e2a 100644 --- a/src/frontend/src/components/ReactTooltipComponent/index.tsx +++ b/src/frontend/src/components/ReactTooltipComponent/index.tsx @@ -4,18 +4,7 @@ import React from "react"; import { Tooltip as ReactTooltip } from "react-tooltip"; import "react-tooltip/dist/react-tooltip.css"; import { classNames } from "../../utils/utils"; - -type TooltipProps = { - selector: string; - content?: string; - disabled?: boolean; - htmlContent?: React.ReactNode; - className?: string; // This should use !impornant to override the default styles eg: '!bg-white' - position?: "top" | "right" | "bottom" | "left"; - clickable?: boolean; - children: React.ReactNode; - delayShow?: number; -}; +import { TooltipProps } from "../../types/components"; const TooltipReact: FC = ({ selector, diff --git a/src/frontend/src/types/components/index.ts b/src/frontend/src/types/components/index.ts index be13ac5e4..e21ca0da2 100644 --- a/src/frontend/src/types/components/index.ts +++ b/src/frontend/src/types/components/index.ts @@ -179,3 +179,15 @@ export type InputProps = { setDescription: (description: string) => void; updateFlow: (flow: { id: string; name: string }) => void; }; + +export type TooltipProps = { + selector: string; + content?: string; + disabled?: boolean; + htmlContent?: React.ReactNode; + className?: string; // This should use !impornant to override the default styles eg: '!bg-white' + position?: "top" | "right" | "bottom" | "left"; + clickable?: boolean; + children: React.ReactNode; + delayShow?: number; +}; From 67be60c9375e39acdf180b24321d0cbce6cc87a3 Mon Sep 17 00:00:00 2001 From: Igor Carvalho Date: Wed, 19 Jul 2023 17:14:17 -0300 Subject: [PATCH 003/139] refactor[loadingComponent]: Move type LoadingComponentProps to types directorie --- src/frontend/src/components/loadingComponent/index.tsx | 4 +--- src/frontend/src/types/components/index.ts | 4 ++++ 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/frontend/src/components/loadingComponent/index.tsx b/src/frontend/src/components/loadingComponent/index.tsx index 31e78d474..a1e406710 100644 --- a/src/frontend/src/components/loadingComponent/index.tsx +++ b/src/frontend/src/components/loadingComponent/index.tsx @@ -1,6 +1,4 @@ -type LoadingComponentProps = { - remSize: number; -}; +import { LoadingComponentProps } from "../../types/components"; export default function LoadingComponent({ remSize }: LoadingComponentProps) { return ( diff --git a/src/frontend/src/types/components/index.ts b/src/frontend/src/types/components/index.ts index e21ca0da2..8a606bd8a 100644 --- a/src/frontend/src/types/components/index.ts +++ b/src/frontend/src/types/components/index.ts @@ -191,3 +191,7 @@ export type TooltipProps = { children: React.ReactNode; delayShow?: number; }; + +export type LoadingComponentProps = { + remSize: number; +}; From a2ebec1a87af504c48771469ef5e79577086d6c2 Mon Sep 17 00:00:00 2001 From: Igor Carvalho Date: Wed, 19 Jul 2023 17:20:34 -0300 Subject: [PATCH 004/139] refactor[alertContext]: Move type alertContextType to types directorie --- src/frontend/src/contexts/alertContext.tsx | 23 +------------------- src/frontend/src/types/typesContext/index.ts | 22 +++++++++++++++++++ 2 files changed, 23 insertions(+), 22 deletions(-) diff --git a/src/frontend/src/contexts/alertContext.tsx b/src/frontend/src/contexts/alertContext.tsx index 62ae2e396..781ecd2af 100644 --- a/src/frontend/src/contexts/alertContext.tsx +++ b/src/frontend/src/contexts/alertContext.tsx @@ -1,30 +1,9 @@ import { createContext, ReactNode, useState } from "react"; import { AlertItemType } from "../types/alerts"; +import { alertContextType } from "../types/typesContext"; import _ from "lodash"; -//types for alertContextType -type alertContextType = { - errorData: { title: string; list?: Array }; - setErrorData: (newState: { title: string; list?: Array }) => void; - errorOpen: boolean; - setErrorOpen: (newState: boolean) => void; - noticeData: { title: string; link?: string }; - setNoticeData: (newState: { title: string; link?: string }) => void; - noticeOpen: boolean; - setNoticeOpen: (newState: boolean) => void; - successData: { title: string }; - setSuccessData: (newState: { title: string }) => void; - successOpen: boolean; - setSuccessOpen: (newState: boolean) => void; - notificationCenter: boolean; - setNotificationCenter: (newState: boolean) => void; - notificationList: Array; - pushNotificationList: (Object: AlertItemType) => void; - clearNotificationList: () => void; - removeFromNotificationList: (index: string) => void; -}; - //initial values to alertContextType const initialValue: alertContextType = { errorData: { title: "", list: [] }, diff --git a/src/frontend/src/types/typesContext/index.ts b/src/frontend/src/types/typesContext/index.ts index 64b6e3e9d..984dda332 100644 --- a/src/frontend/src/types/typesContext/index.ts +++ b/src/frontend/src/types/typesContext/index.ts @@ -1,5 +1,6 @@ import { ReactFlowInstance } from "reactflow"; import { APIClassType } from "../api"; +import { AlertItemType } from "../alerts"; const types: { [char: string]: string } = {}; const template: { [char: string]: APIClassType } = {}; @@ -16,3 +17,24 @@ export type typesContextType = { data: typeof data; setData: (newState: {}) => void; }; + +export type alertContextType = { + errorData: { title: string; list?: Array }; + setErrorData: (newState: { title: string; list?: Array }) => void; + errorOpen: boolean; + setErrorOpen: (newState: boolean) => void; + noticeData: { title: string; link?: string }; + setNoticeData: (newState: { title: string; link?: string }) => void; + noticeOpen: boolean; + setNoticeOpen: (newState: boolean) => void; + successData: { title: string }; + setSuccessData: (newState: { title: string }) => void; + successOpen: boolean; + setSuccessOpen: (newState: boolean) => void; + notificationCenter: boolean; + setNotificationCenter: (newState: boolean) => void; + notificationList: Array; + pushNotificationList: (Object: AlertItemType) => void; + clearNotificationList: () => void; + removeFromNotificationList: (index: string) => void; +}; From 2c8b0e1aaf3a71e432e2b86799c22f83857d1cfe Mon Sep 17 00:00:00 2001 From: Igor Carvalho Date: Wed, 19 Jul 2023 17:27:09 -0300 Subject: [PATCH 005/139] refactor[darkContext]: Move type darkContextType to types directorie --- src/frontend/src/contexts/darkContext.tsx | 6 +----- src/frontend/src/types/typesContext/index.ts | 5 +++++ 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/frontend/src/contexts/darkContext.tsx b/src/frontend/src/contexts/darkContext.tsx index 2a76d0e53..d152ced34 100644 --- a/src/frontend/src/contexts/darkContext.tsx +++ b/src/frontend/src/contexts/darkContext.tsx @@ -1,9 +1,5 @@ import { createContext, useEffect, useState } from "react"; - -type darkContextType = { - dark: {}; - setDark: (newState: {}) => void; -}; +import { darkContextType } from "../types/typesContext"; const initialValue = { dark: {}, diff --git a/src/frontend/src/types/typesContext/index.ts b/src/frontend/src/types/typesContext/index.ts index 984dda332..f0debe77a 100644 --- a/src/frontend/src/types/typesContext/index.ts +++ b/src/frontend/src/types/typesContext/index.ts @@ -38,3 +38,8 @@ export type alertContextType = { clearNotificationList: () => void; removeFromNotificationList: (index: string) => void; }; + +export type darkContextType = { + dark: {}; + setDark: (newState: {}) => void; +}; From ca8e8e3f087473cf2eddfdda93665f4bcb614767 Mon Sep 17 00:00:00 2001 From: Igor Carvalho Date: Wed, 19 Jul 2023 17:30:41 -0300 Subject: [PATCH 006/139] refactor[locationContext]: Move type locationContextType to types directorie --- src/frontend/src/contexts/locationContext.tsx | 31 +------------------ src/frontend/src/types/typesContext/index.ts | 29 +++++++++++++++++ 2 files changed, 30 insertions(+), 30 deletions(-) diff --git a/src/frontend/src/contexts/locationContext.tsx b/src/frontend/src/contexts/locationContext.tsx index 474062d69..b0a9ef8c5 100644 --- a/src/frontend/src/contexts/locationContext.tsx +++ b/src/frontend/src/contexts/locationContext.tsx @@ -1,34 +1,5 @@ import { createContext, ReactNode, useState } from "react"; - -//types for location context -type locationContextType = { - current: Array; - setCurrent: (newState: Array) => void; - isStackedOpen: boolean; - setIsStackedOpen: (newState: boolean) => void; - showSideBar: boolean; - setShowSideBar: (newState: boolean) => void; - extraNavigation: { - title: string; - options?: Array<{ - name: string; - href: string; - icon: any; - children?: Array; - }>; - }; - setExtraNavigation: (newState: { - title: string; - options?: Array<{ - name: string; - href: string; - icon: any; - children?: Array; - }>; - }) => void; - extraComponent: any; - setExtraComponent: (newState: any) => void; -}; +import { locationContextType } from "../types/typesContext"; //initial value for location context const initialValue = { diff --git a/src/frontend/src/types/typesContext/index.ts b/src/frontend/src/types/typesContext/index.ts index f0debe77a..76a1fc17c 100644 --- a/src/frontend/src/types/typesContext/index.ts +++ b/src/frontend/src/types/typesContext/index.ts @@ -43,3 +43,32 @@ export type darkContextType = { dark: {}; setDark: (newState: {}) => void; }; + +export type locationContextType = { + current: Array; + setCurrent: (newState: Array) => void; + isStackedOpen: boolean; + setIsStackedOpen: (newState: boolean) => void; + showSideBar: boolean; + setShowSideBar: (newState: boolean) => void; + extraNavigation: { + title: string; + options?: Array<{ + name: string; + href: string; + icon: any; + children?: Array; + }>; + }; + setExtraNavigation: (newState: { + title: string; + options?: Array<{ + name: string; + href: string; + icon: any; + children?: Array; + }>; + }) => void; + extraComponent: any; + setExtraComponent: (newState: any) => void; +}; From bfee2ffe70b2b7cbdaf7c80f8d4329b2d46ba56d Mon Sep 17 00:00:00 2001 From: Igor Carvalho Date: Wed, 19 Jul 2023 17:39:36 -0300 Subject: [PATCH 007/139] refactor[undoRedoContext]: Move undoRedoContext types to types directorie --- src/frontend/src/contexts/undoRedoContext.tsx | 27 ++----------------- src/frontend/src/types/typesContext/index.ts | 26 +++++++++++++++++- 2 files changed, 27 insertions(+), 26 deletions(-) diff --git a/src/frontend/src/contexts/undoRedoContext.tsx b/src/frontend/src/contexts/undoRedoContext.tsx index 3df201082..e3084cc5a 100644 --- a/src/frontend/src/contexts/undoRedoContext.tsx +++ b/src/frontend/src/contexts/undoRedoContext.tsx @@ -6,32 +6,9 @@ import { useEffect, useState, } from "react"; -import { Edge, Node, useReactFlow } from "reactflow"; +import { useReactFlow } from "reactflow"; import { TabsContext } from "./tabsContext"; - -type undoRedoContextType = { - undo: () => void; - redo: () => void; - takeSnapshot: () => void; -}; - -type UseUndoRedoOptions = { - maxHistorySize: number; - enableShortcuts: boolean; -}; - -type UseUndoRedo = (options?: UseUndoRedoOptions) => { - undo: () => void; - redo: () => void; - takeSnapshot: () => void; - canUndo: boolean; - canRedo: boolean; -}; - -type HistoryItem = { - nodes: Node[]; - edges: Edge[]; -}; +import { undoRedoContextType, UseUndoRedoOptions , UseUndoRedo, HistoryItem } from "../types/typesContext"; const initialValue = { undo: () => {}, diff --git a/src/frontend/src/types/typesContext/index.ts b/src/frontend/src/types/typesContext/index.ts index 76a1fc17c..ab655f6e7 100644 --- a/src/frontend/src/types/typesContext/index.ts +++ b/src/frontend/src/types/typesContext/index.ts @@ -1,4 +1,4 @@ -import { ReactFlowInstance } from "reactflow"; +import { ReactFlowInstance, Edge, Node } from "reactflow"; import { APIClassType } from "../api"; import { AlertItemType } from "../alerts"; @@ -72,3 +72,27 @@ export type locationContextType = { extraComponent: any; setExtraComponent: (newState: any) => void; }; + +export type undoRedoContextType = { + undo: () => void; + redo: () => void; + takeSnapshot: () => void; +}; + +export type UseUndoRedoOptions = { + maxHistorySize: number; + enableShortcuts: boolean; +}; + +export type UseUndoRedo = (options?: UseUndoRedoOptions) => { + undo: () => void; + redo: () => void; + takeSnapshot: () => void; + canUndo: boolean; + canRedo: boolean; +}; + +export type HistoryItem = { + nodes: Node[]; + edges: Edge[]; +}; From f990b0e39b5730abfcacdbbe1ab74267b50a4f23 Mon Sep 17 00:00:00 2001 From: Igor Carvalho Date: Wed, 19 Jul 2023 18:01:15 -0300 Subject: [PATCH 008/139] refactor[baseModal]: Move baseModal types to types directorie --- src/frontend/src/modals/baseModal/index.tsx | 4 +--- src/frontend/src/types/components/index.ts | 4 ++++ 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/frontend/src/modals/baseModal/index.tsx b/src/frontend/src/modals/baseModal/index.tsx index 4b135383c..d670546ac 100644 --- a/src/frontend/src/modals/baseModal/index.tsx +++ b/src/frontend/src/modals/baseModal/index.tsx @@ -10,9 +10,7 @@ import { DialogTrigger, } from "../../components/ui/dialog"; import { PopUpContext } from "../../contexts/popUpContext"; - -type ContentProps = { children: ReactNode }; -type HeaderProps = { children: ReactNode; description: string }; +import { ContentProps, HeaderProps } from "../../types/components"; const Content: React.FC = ({ children }) => { return
{children}
; diff --git a/src/frontend/src/types/components/index.ts b/src/frontend/src/types/components/index.ts index 8a606bd8a..555a0d1b0 100644 --- a/src/frontend/src/types/components/index.ts +++ b/src/frontend/src/types/components/index.ts @@ -2,6 +2,7 @@ import { ReactElement, ReactNode } from "react"; import { APIClassType } from "../api"; import { NodeDataType } from "../flow/index"; import { typesContextType } from "../typesContext"; + export type InputComponentType = { value: string; disabled?: boolean; @@ -195,3 +196,6 @@ export type TooltipProps = { export type LoadingComponentProps = { remSize: number; }; + +export type ContentProps = { children: ReactNode }; +export type HeaderProps = { children: ReactNode; description: string }; From 7601fca2f7835383b78bf1859fdc9c2782dccbea Mon Sep 17 00:00:00 2001 From: Igor Carvalho Date: Wed, 19 Jul 2023 18:07:51 -0300 Subject: [PATCH 009/139] Format code --- src/frontend/src/components/ReactTooltipComponent/index.tsx | 2 +- src/frontend/src/contexts/undoRedoContext.tsx | 6 +++++- src/frontend/src/types/typesContext/index.ts | 4 ++-- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/frontend/src/components/ReactTooltipComponent/index.tsx b/src/frontend/src/components/ReactTooltipComponent/index.tsx index 2e3733e2a..9b4120ee2 100644 --- a/src/frontend/src/components/ReactTooltipComponent/index.tsx +++ b/src/frontend/src/components/ReactTooltipComponent/index.tsx @@ -3,8 +3,8 @@ import type { FC } from "react"; import React from "react"; import { Tooltip as ReactTooltip } from "react-tooltip"; import "react-tooltip/dist/react-tooltip.css"; -import { classNames } from "../../utils/utils"; import { TooltipProps } from "../../types/components"; +import { classNames } from "../../utils/utils"; const TooltipReact: FC = ({ selector, diff --git a/src/frontend/src/contexts/undoRedoContext.tsx b/src/frontend/src/contexts/undoRedoContext.tsx index e3084cc5a..9fe07ab76 100644 --- a/src/frontend/src/contexts/undoRedoContext.tsx +++ b/src/frontend/src/contexts/undoRedoContext.tsx @@ -7,8 +7,12 @@ import { useState, } from "react"; import { useReactFlow } from "reactflow"; +import { + HistoryItem, + UseUndoRedoOptions, + undoRedoContextType, +} from "../types/typesContext"; import { TabsContext } from "./tabsContext"; -import { undoRedoContextType, UseUndoRedoOptions , UseUndoRedo, HistoryItem } from "../types/typesContext"; const initialValue = { undo: () => {}, diff --git a/src/frontend/src/types/typesContext/index.ts b/src/frontend/src/types/typesContext/index.ts index ab655f6e7..0f470862d 100644 --- a/src/frontend/src/types/typesContext/index.ts +++ b/src/frontend/src/types/typesContext/index.ts @@ -1,6 +1,6 @@ -import { ReactFlowInstance, Edge, Node } from "reactflow"; -import { APIClassType } from "../api"; +import { Edge, Node, ReactFlowInstance } from "reactflow"; import { AlertItemType } from "../alerts"; +import { APIClassType } from "../api"; const types: { [char: string]: string } = {}; const template: { [char: string]: APIClassType } = {}; From 54f1f5c504ecf20659655ebd78e7bb02b83dc1dd Mon Sep 17 00:00:00 2001 From: Igor Carvalho Date: Thu, 20 Jul 2023 16:02:09 -0300 Subject: [PATCH 010/139] refactor[utils.ts]: Add type to functions that didnt have it --- src/frontend/src/types/components/index.ts | 212 +++++++++++++++++++++ src/frontend/src/utils/utils.ts | 21 +- 2 files changed, 223 insertions(+), 10 deletions(-) diff --git a/src/frontend/src/types/components/index.ts b/src/frontend/src/types/components/index.ts index df2a5ef81..476fa284e 100644 --- a/src/frontend/src/types/components/index.ts +++ b/src/frontend/src/types/components/index.ts @@ -203,3 +203,215 @@ export type HeaderProps = { children: ReactNode; description: string }; export interface languageMap { [key: string]: string | undefined; } + +export type groupedObjType = { + component: string; + family: string; + type: string; +}; + +export type dataObjType = { + base_classes: string[]; + custom_fields: object; + description: string; + display_name: string; + documentation: string; + output_types: Array; + template: object; +}; + +export type documentloadersType = { + AZLyricsLoader: dataObjType; + AirbyteJSONLoader: dataObjType; + BSHTMLLoader: dataObjType; + CSVLoader: dataObjType; + CoNLLULoader: dataObjType; + CollegeConfidentialLoader: dataObjType; + DirectoryLoader: dataObjType; + EverNoteLoader: dataObjType; + FacebookChatLoader: dataObjType; + GitLoader: dataObjType; + GitbookLoader: dataObjType; + GutenbergLoader: dataObjType; + HNLoader: dataObjType; + IFixitLoader: dataObjType; + IMSDbLoader: dataObjType; + NotionDirectoryLoader: dataObjType; + PyPDFDirectoryLoader: dataObjType; + PyPDFLoader: dataObjType; + ReadTheDocsLoader: dataObjType; + SRTLoader: dataObjType; + SlackDirectoryLoader: dataObjType; + TextLoader: dataObjType; + UnstructuredEmailLoader: dataObjType; + UnstructuredHTMLLoader: dataObjType; + UnstructuredMarkdownLoader: dataObjType; + UnstructuredPowerPointLoader: dataObjType; + UnstructuredWordDocumentLoader: dataObjType; + WebBaseLoader: dataObjType; +}; + +export type agentsType = { + AgentInitializer: dataObjType; + CSVAgent: dataObjType; + JsonAgent: dataObjType; + SQLAgent: dataObjType; + VectorStoreAgent: dataObjType; + VectorStoreRouterAgent: dataObjType; + ZeroShotAgent: dataObjType; +}; + +export type chainsType = { + CombineDocsChain: dataObjType; + ConversationChain: dataObjType; + ConversationalRetrievalChain: dataObjType; + LLMChain: dataObjType; + LLMCheckerChain: dataObjType; + LLMMathChain: dataObjType; + MidJourneyPromptChain: dataObjType; + RetrievalQA: dataObjType + RetrievalQAWithSourcesChain: dataObjType; + SQLDatabaseChain: dataObjType; + SeriesCharacterChain: dataObjType; + TimeTravelGuideChain: dataObjType; +} + +export type embeddingsType = { + CohereEmbeddings: dataObjType; + HuggingFaceEmbeddings: dataObjType; + OpenAIEmbeddings: dataObjType; +}; + +export type llmsTypes = { + Anthropic: dataObjType; + CTransformers: dataObjType; + ChatAnthropic: dataObjType; + ChatOpenAI: dataObjType; + Cohere: dataObjType; + HuggingFaceHub: dataObjType; + LlamaCpp: dataObjType; + OpenAI: dataObjType; + VertexAI: dataObjType; +} + +export type memoriesType = { + ConversationBufferMemory: dataObjType; + ConversationBufferWindowMemory: dataObjType; + ConversationEntityMemory: dataObjType; + ConversationKGMemory: dataObjType; + ConversationSummaryMemory: dataObjType; + MongoDBChatMessageHistory: dataObjType; + PostgresChatMessageHistory: dataObjType; + VectorStoreRetrieverMemory: dataObjType; +}; + +export type outputParsersType = { + ResponseSchema: dataObjType; + StructuredOutputParser: dataObjType; +}; + +export type promptsType = { + ChatMessagePromptTemplate: dataObjType; + ChatPromptTemplate: dataObjType; + HumanMessagePromptTemplate: dataObjType; + PromptTemplate: dataObjType; + SystemMessagePromptTemplate: dataObjType; +} + +export type retrieversType = { + MultiQueryRetriever: dataObjType; +}; + +export type textSplittersType = { + CharacterTextSplitter: dataObjType; + RecursiveCharacterTextSplitter: dataObjType; +}; + +export type toolkitsType = { + JsonToolkit: dataObjType; + OpenAPIToolkit: dataObjType; + VectorStoreInfo: dataObjType; + VectorStoreRouterToolkit: dataObjType; + VectorStoreToolkit: dataObjType; +}; + +export type toolsType = { + BingSearchRun: dataObjType; + Calculator: dataObjType; + GoogleSearchResults: dataObjType; + GoogleSearchRun: dataObjType; + GoogleSerperRun: dataObjType; + InfoSQLDatabaseTool: dataObjType; + JsonGetValueTool: dataObjType; + JsonListKeysTool: dataObjType; + JsonSpec: dataObjType; + ListSQLDatabaseTool: dataObjType; + "News API": dataObjType; + 'PAL-MATH': dataObjType; + "Podcast API": dataObjType; + PythonAstREPLTool: dataObjType; + PythonFunction: dataObjType; + PythonFunctionTool: dataObjType; + PythonREPLTool: dataObjType; + QuerySQLDataBaseTool: dataObjType; + RequestsDeleteTool: dataObjType; + RequestsGetTool: dataObjType; + RequestsPatchTool: dataObjType; + RequestsPostTool: dataObjType; + RequestsPutTool: dataObjType; + Search: dataObjType; + 'TMDB API': dataObjType; + Tool: dataObjType; + WikipediaQueryRun: dataObjType; + WolframAlphaQueryRun: dataObjType; +}; + +export type utilitiesType = { + BingSearchAPIWrapper: dataObjType; + GoogleSearchAPIWrapper: dataObjType; + GoogleSerperAPIWrapper: dataObjType; + SearxSearchWrapper: dataObjType; + SerpAPIWrapper: dataObjType; + WikipediaAPIWrapper: dataObjType; + WolframAlphaAPIWrapper: dataObjType; +}; + +export type vectorStoresType = { + Chroma: dataObjType; + FAISS: dataObjType; + MongoDBAtlasVectorSearch: dataObjType; + Pinecone: dataObjType; + Qdrant: dataObjType; + SupabaseVectorStore: dataObjType; + Weaviate: dataObjType; +}; + +export type wrappersType = { + SQLDatabase: dataObjType; + TextRequestsWrapper: dataObjType; +}; + +export type dataType = { + agents?: agentsType; + chains?: chainsType; + documentloaders?: documentloadersType; + embeddings?: embeddingsType; + llms?: llmsTypes; + memories?: memoriesType; + output_parsers?: outputParsersType; + prompts?: promptsType; + retrievers?: retrieversType; + textsplitters?: textSplittersType; + toolkits?: toolkitsType; + tools?: toolsType + utilities?: utilitiesType; + vectorstores?: vectorStoresType; + wrappers?: wrappersType; +}; + +export type tweakType = { + "ChatOpenAI-TxuiN": object; + "LLMChain-zPC3w": object; + "PromptTemplate-iNj5W": object; + "ConversationBufferMemory-JnodM": object; +} diff --git a/src/frontend/src/utils/utils.ts b/src/frontend/src/utils/utils.ts index a537dad37..78dcf3be7 100644 --- a/src/frontend/src/utils/utils.ts +++ b/src/frontend/src/utils/utils.ts @@ -1,20 +1,20 @@ import clsx, { ClassValue } from "clsx"; import { twMerge } from "tailwind-merge"; import { ADJECTIVES, DESCRIPTIONS, NOUNS } from "../flow_constants"; -import { IVarHighlightType } from "../types/components"; +import { IVarHighlightType, dataType, groupedObjType, tweakType } from "../types/components"; import { FlowType } from "../types/flow"; import { TabsState } from "../types/tabs"; import { buildTweaks } from "./reactflowUtils"; -export function classNames(...classes: Array) { +export function classNames(...classes: Array): string { return classes.filter(Boolean).join(" "); } -export function cn(...inputs: ClassValue[]) { +export function cn(...inputs: ClassValue[]): string { return twMerge(clsx(inputs)); } -export function toNormalCase(str: string) { +export function toNormalCase(str: string): string { let result = str .split("_") .map((word, index) => { @@ -36,7 +36,7 @@ export function toNormalCase(str: string) { .join(" "); } -export function normalCaseToSnakeCase(str: string) { +export function normalCaseToSnakeCase(str: string): string { return str .split(" ") .map((word, index) => { @@ -48,7 +48,7 @@ export function normalCaseToSnakeCase(str: string) { .join("_"); } -export function toTitleCase(str: string) { +export function toTitleCase(str: string): string { let result = str .split("_") .map((word, index) => { @@ -75,7 +75,7 @@ export function toTitleCase(str: string) { } export const upperCaseWords: string[] = ["llm", "uri"]; -export function checkUpperWords(str: string) { +export function checkUpperWords(str: string): string { const words = str.split(" ").map((word) => { return upperCaseWords.includes(word.toLowerCase()) ? word.toUpperCase() @@ -85,7 +85,7 @@ export function checkUpperWords(str: string) { return words.join(" "); } -export function groupByFamily(data, baseClasses, left, type) { +export function groupByFamily(data: dataType, baseClasses: string, left: boolean, type: string): groupedObjType[] { let parentOutput: string; let arrOfParent: string[] = []; let arrOfType: { family: string; type: string; component: string }[] = []; @@ -200,7 +200,7 @@ export function groupByFamily(data, baseClasses, left, type) { } } -export function buildInputs(tabsState, id) { +export function buildInputs(tabsState: object, id: string): string { return tabsState && tabsState[id] && tabsState[id].formKeysData && @@ -261,7 +261,8 @@ export function varHighlightHTML({ name }: IVarHighlightType): string { return html; }; -export function buildTweakObject(tweak) { +export function buildTweakObject(tweak: tweakType[]): string { + console.log(tweak) tweak.forEach((el) => { Object.keys(el).forEach((key) => { for (let kp in el[key]) { From fff6e494dbe1489d8b222d2807b0fdf3fc3f12f6 Mon Sep 17 00:00:00 2001 From: Igor Carvalho Date: Thu, 20 Jul 2023 16:50:32 -0300 Subject: [PATCH 011/139] refactor[src/pages]: Add types to pages functions that didnt have it --- src/frontend/src/pages/CommunityPage/index.tsx | 2 +- .../ConnectionLineComponent/index.tsx | 2 +- .../components/DisclosureComponent/index.tsx | 2 +- .../FlowPage/components/PageComponent/index.tsx | 2 +- .../components/extraSidebarComponent/index.tsx | 2 +- .../components/nodeToolbarComponent/index.tsx | 4 +++- src/frontend/src/pages/FlowPage/index.tsx | 2 +- src/frontend/src/pages/MainPage/index.tsx | 2 +- src/frontend/src/types/components/index.ts | 17 +++++++++++++++++ 9 files changed, 27 insertions(+), 8 deletions(-) diff --git a/src/frontend/src/pages/CommunityPage/index.tsx b/src/frontend/src/pages/CommunityPage/index.tsx index c3d028314..2c9ae8a29 100644 --- a/src/frontend/src/pages/CommunityPage/index.tsx +++ b/src/frontend/src/pages/CommunityPage/index.tsx @@ -8,7 +8,7 @@ import { CardComponent } from "../../components/cardComponent"; import IconComponent from "../../components/genericIconComponent"; import { getExamples } from "../../controllers/API"; import { FlowType } from "../../types/flow"; -export default function CommunityPage() { +export default function CommunityPage(): JSX.Element { const { flows, setTabId, downloadFlows, uploadFlows, addFlow } = useContext(TabsContext); diff --git a/src/frontend/src/pages/FlowPage/components/ConnectionLineComponent/index.tsx b/src/frontend/src/pages/FlowPage/components/ConnectionLineComponent/index.tsx index 61a493613..0c535e4f8 100644 --- a/src/frontend/src/pages/FlowPage/components/ConnectionLineComponent/index.tsx +++ b/src/frontend/src/pages/FlowPage/components/ConnectionLineComponent/index.tsx @@ -6,7 +6,7 @@ const ConnectionLineComponent = ({ toX, toY, connectionLineStyle = {}, // provide a default value for connectionLineStyle -}: ConnectionLineComponentProps) => { +}: ConnectionLineComponentProps): JSX.Element => { return ( {({ open }) => ( diff --git a/src/frontend/src/pages/FlowPage/components/PageComponent/index.tsx b/src/frontend/src/pages/FlowPage/components/PageComponent/index.tsx index 5469c4300..5505ef101 100644 --- a/src/frontend/src/pages/FlowPage/components/PageComponent/index.tsx +++ b/src/frontend/src/pages/FlowPage/components/PageComponent/index.tsx @@ -34,7 +34,7 @@ const nodeTypes = { genericNode: GenericNode, }; -export default function Page({ flow }: { flow: FlowType }) { +export default function Page({ flow }: { flow: FlowType }): JSX.Element { let { updateFlow, uploadFlow, diff --git a/src/frontend/src/pages/FlowPage/components/extraSidebarComponent/index.tsx b/src/frontend/src/pages/FlowPage/components/extraSidebarComponent/index.tsx index 4ae486fda..877e2dae9 100644 --- a/src/frontend/src/pages/FlowPage/components/extraSidebarComponent/index.tsx +++ b/src/frontend/src/pages/FlowPage/components/extraSidebarComponent/index.tsx @@ -18,7 +18,7 @@ import { import { classNames } from "../../../../utils/utils"; import DisclosureComponent from "../DisclosureComponent"; -export default function ExtraSidebar() { +export default function ExtraSidebar(): JSX.Element { const { data } = useContext(typesContext); const { openPopUp } = useContext(PopUpContext); const { flows, tabId, uploadFlow, tabsState, saveFlow } = diff --git a/src/frontend/src/pages/FlowPage/components/nodeToolbarComponent/index.tsx b/src/frontend/src/pages/FlowPage/components/nodeToolbarComponent/index.tsx index 35e07c88b..9d26d45eb 100644 --- a/src/frontend/src/pages/FlowPage/components/nodeToolbarComponent/index.tsx +++ b/src/frontend/src/pages/FlowPage/components/nodeToolbarComponent/index.tsx @@ -5,8 +5,10 @@ import IconComponent from "../../../../components/genericIconComponent"; import { TabsContext } from "../../../../contexts/tabsContext"; import EditNodeModal from "../../../../modals/EditNodeModal"; import { classNames } from "../../../../utils/utils"; +import { nodeToolbarType } from "../../../../types/components"; -const NodeToolbarComponent = (props) => { +const NodeToolbarComponent = (props): JSX.Element => { + console.log(props); const [nodeLength, setNodeLength] = useState( Object.keys(props.data.node.template).filter( (t) => diff --git a/src/frontend/src/pages/FlowPage/index.tsx b/src/frontend/src/pages/FlowPage/index.tsx index f47a485ff..e854e35d9 100644 --- a/src/frontend/src/pages/FlowPage/index.tsx +++ b/src/frontend/src/pages/FlowPage/index.tsx @@ -4,7 +4,7 @@ import { TabsContext } from "../../contexts/tabsContext"; import { getVersion } from "../../controllers/API"; import Page from "./components/PageComponent"; -export default function FlowPage() { +export default function FlowPage(): JSX.Element { const { flows, tabId, setTabId } = useContext(TabsContext); const { id } = useParams(); diff --git a/src/frontend/src/pages/MainPage/index.tsx b/src/frontend/src/pages/MainPage/index.tsx index f8e657da3..6bfacc8b9 100644 --- a/src/frontend/src/pages/MainPage/index.tsx +++ b/src/frontend/src/pages/MainPage/index.tsx @@ -5,7 +5,7 @@ import IconComponent from "../../components/genericIconComponent"; import { Button } from "../../components/ui/button"; import { USER_PROJECTS_HEADER } from "../../constants/constants"; import { TabsContext } from "../../contexts/tabsContext"; -export default function HomePage() { +export default function HomePage(): JSX.Element { const { flows, setTabId, downloadFlows, uploadFlows, addFlow, removeFlow } = useContext(TabsContext); diff --git a/src/frontend/src/types/components/index.ts b/src/frontend/src/types/components/index.ts index 476fa284e..4e02e1403 100644 --- a/src/frontend/src/types/components/index.ts +++ b/src/frontend/src/types/components/index.ts @@ -415,3 +415,20 @@ export type tweakType = { "PromptTemplate-iNj5W": object; "ConversationBufferMemory-JnodM": object; } + +export type nodeToolbarType = { + data: { + id: string; + type: string; + node: { + base_classes: string[]; + description: string; + display_name: string; + documentation: string; + template: object; + }; + value: void; + }; + deleteNode: (idx: string) => void; + openPopUp: (element: any) => void; +}; From 84b2fb8aae4ea9cb89408e466a74bddd1c416bca Mon Sep 17 00:00:00 2001 From: Igor Carvalho Date: Thu, 20 Jul 2023 17:12:50 -0300 Subject: [PATCH 012/139] refactor[CustomNodes]: Add types to functions that didnt have it --- .../GenericNode/components/parameterComponent/index.tsx | 2 +- src/frontend/src/CustomNodes/GenericNode/index.tsx | 2 +- .../pages/FlowPage/components/nodeToolbarComponent/index.tsx | 1 - src/frontend/src/utils/utils.ts | 1 - 4 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/frontend/src/CustomNodes/GenericNode/components/parameterComponent/index.tsx b/src/frontend/src/CustomNodes/GenericNode/components/parameterComponent/index.tsx index 06094f970..600258de5 100644 --- a/src/frontend/src/CustomNodes/GenericNode/components/parameterComponent/index.tsx +++ b/src/frontend/src/CustomNodes/GenericNode/components/parameterComponent/index.tsx @@ -44,7 +44,7 @@ export default function ParameterComponent({ required = false, optionalHandle = null, info = "", -}: ParameterComponentType) { +}: ParameterComponentType): JSX.Element { const ref = useRef(null); const refHtml = useRef(null); const refNumberComponents = useRef(0); diff --git a/src/frontend/src/CustomNodes/GenericNode/index.tsx b/src/frontend/src/CustomNodes/GenericNode/index.tsx index ba506c855..f7fa61edf 100644 --- a/src/frontend/src/CustomNodes/GenericNode/index.tsx +++ b/src/frontend/src/CustomNodes/GenericNode/index.tsx @@ -20,7 +20,7 @@ export default function GenericNode({ }: { data: NodeDataType; selected: boolean; -}) { +}): JSX.Element { const { setErrorData } = useContext(alertContext); const showError = useRef(true); const { types, deleteNode } = useContext(typesContext); diff --git a/src/frontend/src/pages/FlowPage/components/nodeToolbarComponent/index.tsx b/src/frontend/src/pages/FlowPage/components/nodeToolbarComponent/index.tsx index 9d26d45eb..0dd042140 100644 --- a/src/frontend/src/pages/FlowPage/components/nodeToolbarComponent/index.tsx +++ b/src/frontend/src/pages/FlowPage/components/nodeToolbarComponent/index.tsx @@ -8,7 +8,6 @@ import { classNames } from "../../../../utils/utils"; import { nodeToolbarType } from "../../../../types/components"; const NodeToolbarComponent = (props): JSX.Element => { - console.log(props); const [nodeLength, setNodeLength] = useState( Object.keys(props.data.node.template).filter( (t) => diff --git a/src/frontend/src/utils/utils.ts b/src/frontend/src/utils/utils.ts index 78dcf3be7..63efde176 100644 --- a/src/frontend/src/utils/utils.ts +++ b/src/frontend/src/utils/utils.ts @@ -262,7 +262,6 @@ export function varHighlightHTML({ name }: IVarHighlightType): string { }; export function buildTweakObject(tweak: tweakType[]): string { - console.log(tweak) tweak.forEach((el) => { Object.keys(el).forEach((key) => { for (let kp in el[key]) { From b5c6b06b3cc47e20395d73160b6bf1050076d886 Mon Sep 17 00:00:00 2001 From: Igor Carvalho Date: Thu, 20 Jul 2023 17:58:48 -0300 Subject: [PATCH 013/139] refactor[components]: Add types to functions that didnt have it --- .../components/AccordionComponent/index.tsx | 2 +- .../components/CrashErrorComponent/index.tsx | 2 +- .../EditFlowSettingsComponent/index.tsx | 2 +- .../src/components/RadialProgress/index.tsx | 2 +- .../ReactTooltipComponent/index.tsx | 2 +- .../components/SanitizedHTMLWrapper/index.tsx | 2 +- .../components/ShadTooltipComponent/index.tsx | 2 +- .../src/components/TooltipComponent/index.tsx | 2 +- .../src/components/cardComponent/index.tsx | 2 +- .../chatComponent/buildTrigger/index.tsx | 2 +- .../chatComponent/chatTrigger/index.tsx | 5 ++-- .../src/components/chatComponent/index.tsx | 2 +- .../components/codeAreaComponent/index.tsx | 2 +- .../components/dropdownComponent/index.tsx | 2 +- .../src/components/floatComponent/index.tsx | 2 +- .../components/menuBar/index.tsx | 3 ++- .../src/components/headerComponent/index.tsx | 2 +- .../src/components/inputComponent/index.tsx | 2 +- .../components/inputFileComponent/index.tsx | 2 +- .../components/inputListComponent/index.tsx | 2 +- .../src/components/intComponent/index.tsx | 2 +- .../src/components/loadingComponent/index.tsx | 2 +- .../src/components/promptComponent/index.tsx | 2 +- .../components/textAreaComponent/index.tsx | 2 +- .../src/components/toggleComponent/index.tsx | 2 +- .../components/toggleShadComponent/index.tsx | 2 +- src/frontend/src/types/components/index.ts | 24 +++++++++++++++++-- 27 files changed, 51 insertions(+), 29 deletions(-) diff --git a/src/frontend/src/components/AccordionComponent/index.tsx b/src/frontend/src/components/AccordionComponent/index.tsx index 7212e6a1b..3f6597d2a 100644 --- a/src/frontend/src/components/AccordionComponent/index.tsx +++ b/src/frontend/src/components/AccordionComponent/index.tsx @@ -12,7 +12,7 @@ export default function AccordionComponent({ children, open = [], keyValue, -}: AccordionComponentType) { +}: AccordionComponentType): JSX.Element { const [value, setValue] = useState( open.length === 0 ? "" : getOpenAccordion() ); diff --git a/src/frontend/src/components/CrashErrorComponent/index.tsx b/src/frontend/src/components/CrashErrorComponent/index.tsx index fd7d22c36..b435cca0b 100644 --- a/src/frontend/src/components/CrashErrorComponent/index.tsx +++ b/src/frontend/src/components/CrashErrorComponent/index.tsx @@ -1,4 +1,4 @@ -export default function CrashErrorComponent({ error, resetErrorBoundary }) { +export default function CrashErrorComponent({ error, resetErrorBoundary }): JSX.Element { return (
diff --git a/src/frontend/src/components/EditFlowSettingsComponent/index.tsx b/src/frontend/src/components/EditFlowSettingsComponent/index.tsx index 6c1b77b6c..77dfc2422 100644 --- a/src/frontend/src/components/EditFlowSettingsComponent/index.tsx +++ b/src/frontend/src/components/EditFlowSettingsComponent/index.tsx @@ -13,7 +13,7 @@ export const EditFlowSettings: React.FC = ({ setName, setDescription, updateFlow, -}) => { +}): JSX.Element => { const [isMaxLength, setIsMaxLength] = useState(false); const handleNameChange = (event: ChangeEvent) => { diff --git a/src/frontend/src/components/RadialProgress/index.tsx b/src/frontend/src/components/RadialProgress/index.tsx index f277a9c80..f5160c40b 100644 --- a/src/frontend/src/components/RadialProgress/index.tsx +++ b/src/frontend/src/components/RadialProgress/index.tsx @@ -3,7 +3,7 @@ import { RadialProgressType } from "../../types/components"; export default function RadialProgressComponent({ value, color, -}: RadialProgressType) { +}: RadialProgressType): JSX.Element { const style = { "--value": value * 100, "--size": "1.5rem", diff --git a/src/frontend/src/components/ReactTooltipComponent/index.tsx b/src/frontend/src/components/ReactTooltipComponent/index.tsx index 9b4120ee2..9103ae21c 100644 --- a/src/frontend/src/components/ReactTooltipComponent/index.tsx +++ b/src/frontend/src/components/ReactTooltipComponent/index.tsx @@ -16,7 +16,7 @@ const TooltipReact: FC = ({ className, clickable, delayShow, -}) => { +}: TooltipProps): JSX.Element => { return (
{React.cloneElement(children as React.ReactElement, { diff --git a/src/frontend/src/components/SanitizedHTMLWrapper/index.tsx b/src/frontend/src/components/SanitizedHTMLWrapper/index.tsx index e76105c00..248f210a4 100644 --- a/src/frontend/src/components/SanitizedHTMLWrapper/index.tsx +++ b/src/frontend/src/components/SanitizedHTMLWrapper/index.tsx @@ -5,7 +5,7 @@ const SanitizedHTMLWrapper = ({ content, onClick, suppressWarning = false, -}) => { +}): JSX.Element => { const sanitizedHTML = DOMPurify.sanitize(content); return ( diff --git a/src/frontend/src/components/ShadTooltipComponent/index.tsx b/src/frontend/src/components/ShadTooltipComponent/index.tsx index 89f301e60..62d5bc2e4 100644 --- a/src/frontend/src/components/ShadTooltipComponent/index.tsx +++ b/src/frontend/src/components/ShadTooltipComponent/index.tsx @@ -8,7 +8,7 @@ export default function ShadTooltip({ children, styleClasses, delayDuration = 500, -}: ShadToolTipType) { +}: ShadToolTipType): JSX.Element { return ( {children} diff --git a/src/frontend/src/components/TooltipComponent/index.tsx b/src/frontend/src/components/TooltipComponent/index.tsx index 91fa006ec..5f105873d 100644 --- a/src/frontend/src/components/TooltipComponent/index.tsx +++ b/src/frontend/src/components/TooltipComponent/index.tsx @@ -5,7 +5,7 @@ export default function Tooltip({ children, title, placement, -}: TooltipComponentType) { +}: TooltipComponentType): JSX.Element { return ( {children} diff --git a/src/frontend/src/components/cardComponent/index.tsx b/src/frontend/src/components/cardComponent/index.tsx index 12c409047..3a1388f53 100644 --- a/src/frontend/src/components/cardComponent/index.tsx +++ b/src/frontend/src/components/cardComponent/index.tsx @@ -21,7 +21,7 @@ export const CardComponent = ({ id: string; onDelete?: () => void; button?: JSX.Element; -}) => { +}): JSX.Element => { const { removeFlow } = useContext(TabsContext); return ( diff --git a/src/frontend/src/components/chatComponent/buildTrigger/index.tsx b/src/frontend/src/components/chatComponent/buildTrigger/index.tsx index 4eb69546e..b82a65db0 100644 --- a/src/frontend/src/components/chatComponent/buildTrigger/index.tsx +++ b/src/frontend/src/components/chatComponent/buildTrigger/index.tsx @@ -21,7 +21,7 @@ export default function BuildTrigger({ flow: FlowType; setIsBuilt: any; isBuilt: boolean; -}) { +}): JSX.Element { const { updateSSEData, isBuilding, setIsBuilding, sseData } = useSSE(); const { reactFlowInstance } = useContext(typesContext); const { setTabsState } = useContext(TabsContext); diff --git a/src/frontend/src/components/chatComponent/chatTrigger/index.tsx b/src/frontend/src/components/chatComponent/chatTrigger/index.tsx index a92a8e0cd..2be327904 100644 --- a/src/frontend/src/components/chatComponent/chatTrigger/index.tsx +++ b/src/frontend/src/components/chatComponent/chatTrigger/index.tsx @@ -9,11 +9,12 @@ import { } from "../../../constants/constants"; import { alertContext } from "../../../contexts/alertContext"; import IconComponent from "../../genericIconComponent"; +import { chatTriggerPropType } from "../../../types/components"; -export default function ChatTrigger({ open, setOpen, isBuilt, canOpen }) { +export default function ChatTrigger({ open, setOpen, isBuilt, canOpen }: chatTriggerPropType): JSX.Element { const { setErrorData } = useContext(alertContext); - function handleClick() { + function handleClick(): void { if (isBuilt) { if (canOpen) { setOpen(true); diff --git a/src/frontend/src/components/chatComponent/index.tsx b/src/frontend/src/components/chatComponent/index.tsx index 58c058866..044bf64c0 100644 --- a/src/frontend/src/components/chatComponent/index.tsx +++ b/src/frontend/src/components/chatComponent/index.tsx @@ -10,7 +10,7 @@ import { getBuildStatus } from "../../controllers/API"; import FormModal from "../../modals/formModal"; import { NodeType } from "../../types/flow"; -export default function Chat({ flow }: ChatType) { +export default function Chat({ flow }: ChatType): JSX.Element { const [open, setOpen] = useState(false); const [isBuilt, setIsBuilt] = useState(false); const [canOpen, setCanOpen] = useState(false); diff --git a/src/frontend/src/components/codeAreaComponent/index.tsx b/src/frontend/src/components/codeAreaComponent/index.tsx index 4f0fc3b17..1e3797ec9 100644 --- a/src/frontend/src/components/codeAreaComponent/index.tsx +++ b/src/frontend/src/components/codeAreaComponent/index.tsx @@ -12,7 +12,7 @@ export default function CodeAreaComponent({ editNode = false, nodeClass, setNodeClass, -}: TextAreaComponentType) { +}: TextAreaComponentType): JSX.Element { const [myValue, setMyValue] = useState( typeof value == "string" ? value : JSON.stringify(value) ); diff --git a/src/frontend/src/components/dropdownComponent/index.tsx b/src/frontend/src/components/dropdownComponent/index.tsx index 9b614c7ae..bb7b75c05 100644 --- a/src/frontend/src/components/dropdownComponent/index.tsx +++ b/src/frontend/src/components/dropdownComponent/index.tsx @@ -12,7 +12,7 @@ export default function Dropdown({ editNode = false, numberOfOptions = 0, apiModal = false, -}: DropDownComponentType) { +}: DropDownComponentType): JSX.Element { const { closePopUp } = useContext(PopUpContext); let [internalValue, setInternalValue] = useState( diff --git a/src/frontend/src/components/floatComponent/index.tsx b/src/frontend/src/components/floatComponent/index.tsx index 66b97db1a..fcee0d1a5 100644 --- a/src/frontend/src/components/floatComponent/index.tsx +++ b/src/frontend/src/components/floatComponent/index.tsx @@ -9,7 +9,7 @@ export default function FloatComponent({ disableCopyPaste = false, disabled, editNode = false, -}: FloatComponentType) { +}: FloatComponentType): JSX.Element { const [myValue, setMyValue] = useState(value ?? ""); const { setDisableCopyPaste } = useContext(TabsContext); const { closePopUp } = useContext(PopUpContext); diff --git a/src/frontend/src/components/headerComponent/components/menuBar/index.tsx b/src/frontend/src/components/headerComponent/components/menuBar/index.tsx index 84777c5fe..6e5560bbd 100644 --- a/src/frontend/src/components/headerComponent/components/menuBar/index.tsx +++ b/src/frontend/src/components/headerComponent/components/menuBar/index.tsx @@ -15,8 +15,9 @@ import { undoRedoContext } from "../../../../contexts/undoRedoContext"; import FlowSettingsModal from "../../../../modals/flowSettingsModal"; import IconComponent from "../../../genericIconComponent"; import { Button } from "../../../ui/button"; +import { menuBarPropsType } from "../../../../types/components"; -export const MenuBar = ({ flows, tabId }) => { +export const MenuBar = ({ flows, tabId }: menuBarPropsType): JSX.Element => { const { updateFlow, setTabId, addFlow } = useContext(TabsContext); const { setErrorData } = useContext(alertContext); const { openPopUp } = useContext(PopUpContext); diff --git a/src/frontend/src/components/headerComponent/index.tsx b/src/frontend/src/components/headerComponent/index.tsx index 67f738821..ef067cd5c 100644 --- a/src/frontend/src/components/headerComponent/index.tsx +++ b/src/frontend/src/components/headerComponent/index.tsx @@ -14,7 +14,7 @@ import { Button } from "../ui/button"; import { Separator } from "../ui/separator"; import MenuBar from "./components/menuBar"; -export default function Header() { +export default function Header(): JSX.Element { const { flows, addFlow, tabId } = useContext(TabsContext); const { openPopUp } = useContext(PopUpContext); const { templates } = useContext(typesContext); diff --git a/src/frontend/src/components/inputComponent/index.tsx b/src/frontend/src/components/inputComponent/index.tsx index 1e6ca32ef..c976f1906 100644 --- a/src/frontend/src/components/inputComponent/index.tsx +++ b/src/frontend/src/components/inputComponent/index.tsx @@ -11,7 +11,7 @@ export default function InputComponent({ disabled, password, editNode = false, -}: InputComponentType) { +}: InputComponentType): JSX.Element { const [myValue, setMyValue] = useState(value ?? ""); const [pwdVisible, setPwdVisible] = useState(false); const { setDisableCopyPaste } = useContext(TabsContext); diff --git a/src/frontend/src/components/inputFileComponent/index.tsx b/src/frontend/src/components/inputFileComponent/index.tsx index 3f77734f3..4de6e3dbe 100644 --- a/src/frontend/src/components/inputFileComponent/index.tsx +++ b/src/frontend/src/components/inputFileComponent/index.tsx @@ -13,7 +13,7 @@ export default function InputFileComponent({ fileTypes, onFileChange, editNode = false, -}: FileComponentType) { +}: FileComponentType): JSX.Element { const [myValue, setMyValue] = useState(value); const [loading, setLoading] = useState(false); const { setErrorData } = useContext(alertContext); diff --git a/src/frontend/src/components/inputListComponent/index.tsx b/src/frontend/src/components/inputListComponent/index.tsx index 086473acc..853fd95d1 100644 --- a/src/frontend/src/components/inputListComponent/index.tsx +++ b/src/frontend/src/components/inputListComponent/index.tsx @@ -11,7 +11,7 @@ export default function InputListComponent({ disabled, editNode = false, onAddInput, -}: InputListComponentType) { +}: InputListComponentType): JSX.Element { const [inputList, setInputList] = useState(value ?? [""]); const { closePopUp } = useContext(PopUpContext); diff --git a/src/frontend/src/components/intComponent/index.tsx b/src/frontend/src/components/intComponent/index.tsx index ae47d856a..c3fc98c9c 100644 --- a/src/frontend/src/components/intComponent/index.tsx +++ b/src/frontend/src/components/intComponent/index.tsx @@ -9,7 +9,7 @@ export default function IntComponent({ disableCopyPaste = false, disabled, editNode = false, -}: FloatComponentType) { +}: FloatComponentType): JSX.Element { const [myValue, setMyValue] = useState(value ?? ""); const { setDisableCopyPaste } = useContext(TabsContext); const min = 0; diff --git a/src/frontend/src/components/loadingComponent/index.tsx b/src/frontend/src/components/loadingComponent/index.tsx index a1e406710..406dad793 100644 --- a/src/frontend/src/components/loadingComponent/index.tsx +++ b/src/frontend/src/components/loadingComponent/index.tsx @@ -1,6 +1,6 @@ import { LoadingComponentProps } from "../../types/components"; -export default function LoadingComponent({ remSize }: LoadingComponentProps) { +export default function LoadingComponent({ remSize }: LoadingComponentProps): JSX.Element { return (
{ diff --git a/src/frontend/src/components/toggleShadComponent/index.tsx b/src/frontend/src/components/toggleShadComponent/index.tsx index c06d42430..2af4696f4 100644 --- a/src/frontend/src/components/toggleShadComponent/index.tsx +++ b/src/frontend/src/components/toggleShadComponent/index.tsx @@ -6,7 +6,7 @@ export default function ToggleShadComponent({ setEnabled, disabled, size, -}: ToggleComponentType) { +}: ToggleComponentType): JSX.Element { let scaleX, scaleY; switch (size) { case "small": diff --git a/src/frontend/src/types/components/index.ts b/src/frontend/src/types/components/index.ts index 4e02e1403..81cfbcb15 100644 --- a/src/frontend/src/types/components/index.ts +++ b/src/frontend/src/types/components/index.ts @@ -1,6 +1,6 @@ import { ReactElement, ReactNode } from "react"; import { APIClassType } from "../api"; -import { NodeDataType } from "../flow/index"; +import { FlowStyleType, NodeDataType } from "../flow/index"; import { typesContextType } from "../typesContext"; export type InputComponentType = { @@ -430,5 +430,25 @@ export type nodeToolbarType = { value: void; }; deleteNode: (idx: string) => void; - openPopUp: (element: any) => void; + openPopUp: (element) => JSX.Element; }; + +export type chatTriggerPropType = { + open: boolean; + isBuilt: boolean; + canOpen: boolean; + setOpen: (can: boolean) => void; +} + +export type headerFlowsType = { + data: object; + description: string; + id: string; + name: string; + style?: FlowStyleType; +} + +export type menuBarPropsType = { + flows: Array; + tabId: string; +} From 3a055b74115b328bc39079b2a73da11eadfa72a3 Mon Sep 17 00:00:00 2001 From: Igor Carvalho Date: Thu, 20 Jul 2023 18:01:06 -0300 Subject: [PATCH 014/139] refactor[alerts]: Add types to functions that didnt have it --- .../alertDropDown/components/singleAlertComponent/index.tsx | 2 +- src/frontend/src/alerts/alertDropDown/index.tsx | 2 +- src/frontend/src/alerts/error/index.tsx | 2 +- src/frontend/src/alerts/notice/index.tsx | 2 +- src/frontend/src/alerts/success/index.tsx | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/frontend/src/alerts/alertDropDown/components/singleAlertComponent/index.tsx b/src/frontend/src/alerts/alertDropDown/components/singleAlertComponent/index.tsx index 9a94db7d5..efba9d27b 100644 --- a/src/frontend/src/alerts/alertDropDown/components/singleAlertComponent/index.tsx +++ b/src/frontend/src/alerts/alertDropDown/components/singleAlertComponent/index.tsx @@ -7,7 +7,7 @@ import { SingleAlertComponentType } from "../../../../types/alerts"; export default function SingleAlert({ dropItem, removeAlert, -}: SingleAlertComponentType) { +}: SingleAlertComponentType): JSX.Element { const [show, setShow] = useState(true); const type = dropItem.type; diff --git a/src/frontend/src/alerts/alertDropDown/index.tsx b/src/frontend/src/alerts/alertDropDown/index.tsx index a3f69d707..8600adfeb 100644 --- a/src/frontend/src/alerts/alertDropDown/index.tsx +++ b/src/frontend/src/alerts/alertDropDown/index.tsx @@ -6,7 +6,7 @@ import { AlertDropdownType } from "../../types/alerts"; import { useOnClickOutside } from "../hooks/useOnClickOutside"; import SingleAlert from "./components/singleAlertComponent"; -export default function AlertDropdown({}: AlertDropdownType) { +export default function AlertDropdown({}: AlertDropdownType): JSX.Element { const { closePopUp } = useContext(PopUpContext); const componentRef = useRef(null); diff --git a/src/frontend/src/alerts/error/index.tsx b/src/frontend/src/alerts/error/index.tsx index 2b898f58a..eb626df2f 100644 --- a/src/frontend/src/alerts/error/index.tsx +++ b/src/frontend/src/alerts/error/index.tsx @@ -8,7 +8,7 @@ export default function ErrorAlert({ list = [], id, removeAlert, -}: ErrorAlertType) { +}: ErrorAlertType): JSX.Element { const [show, setShow] = useState(true); useEffect(() => { if (show) { diff --git a/src/frontend/src/alerts/notice/index.tsx b/src/frontend/src/alerts/notice/index.tsx index 494d9d4dc..2e6d6929e 100644 --- a/src/frontend/src/alerts/notice/index.tsx +++ b/src/frontend/src/alerts/notice/index.tsx @@ -9,7 +9,7 @@ export default function NoticeAlert({ link = "", id, removeAlert, -}: NoticeAlertType) { +}: NoticeAlertType): JSX.Element { const [show, setShow] = useState(true); useEffect(() => { if (show) { diff --git a/src/frontend/src/alerts/success/index.tsx b/src/frontend/src/alerts/success/index.tsx index 5cb89b530..6d82b51e5 100644 --- a/src/frontend/src/alerts/success/index.tsx +++ b/src/frontend/src/alerts/success/index.tsx @@ -7,7 +7,7 @@ export default function SuccessAlert({ title, id, removeAlert, -}: SuccessAlertType) { +}: SuccessAlertType): JSX.Element { const [show, setShow] = useState(true); useEffect(() => { if (show) { From 76a0a40656008e5f8b557f972872864268d15e25 Mon Sep 17 00:00:00 2001 From: Igor Carvalho Date: Thu, 20 Jul 2023 18:24:04 -0300 Subject: [PATCH 015/139] refactor[modals]: Add types to functions that didnt have it --- .../components/CrashErrorComponent/index.tsx | 5 ++- .../chatComponent/chatTrigger/index.tsx | 9 ++++- .../components/menuBar/index.tsx | 2 +- .../src/components/loadingComponent/index.tsx | 4 +- .../src/components/toggleComponent/index.tsx | 1 - src/frontend/src/modals/ApiModal/index.tsx | 2 +- .../src/modals/EditNodeModal/index.tsx | 8 +++- src/frontend/src/modals/NodeModal/index.tsx | 6 ++- .../src/modals/codeAreaModal/index.tsx | 8 ++-- src/frontend/src/modals/exportModal/index.tsx | 2 +- .../src/modals/flowSettingsModal/index.tsx | 6 +-- .../src/modals/formModal/chatInput/index.tsx | 3 +- .../formModal/chatMessage/codeBlock/index.tsx | 2 +- .../modals/formModal/chatMessage/index.tsx | 2 +- src/frontend/src/modals/formModal/index.tsx | 21 ++++++----- .../src/modals/genericModal/index.tsx | 10 ++--- .../modals/importModal/buttonBox/index.tsx | 2 +- src/frontend/src/modals/importModal/index.tsx | 6 +-- .../components/nodeToolbarComponent/index.tsx | 1 - src/frontend/src/pages/MainPage/index.tsx | 2 +- src/frontend/src/types/components/index.ts | 37 ++++++++++++------- src/frontend/src/utils/utils.ts | 22 ++++++++--- 22 files changed, 101 insertions(+), 60 deletions(-) diff --git a/src/frontend/src/components/CrashErrorComponent/index.tsx b/src/frontend/src/components/CrashErrorComponent/index.tsx index b435cca0b..cd6a976be 100644 --- a/src/frontend/src/components/CrashErrorComponent/index.tsx +++ b/src/frontend/src/components/CrashErrorComponent/index.tsx @@ -1,4 +1,7 @@ -export default function CrashErrorComponent({ error, resetErrorBoundary }): JSX.Element { +export default function CrashErrorComponent({ + error, + resetErrorBoundary, +}): JSX.Element { return (
diff --git a/src/frontend/src/components/chatComponent/chatTrigger/index.tsx b/src/frontend/src/components/chatComponent/chatTrigger/index.tsx index 2be327904..a390da8d2 100644 --- a/src/frontend/src/components/chatComponent/chatTrigger/index.tsx +++ b/src/frontend/src/components/chatComponent/chatTrigger/index.tsx @@ -8,10 +8,15 @@ import { FLOW_NOT_BUILT_TITLE, } from "../../../constants/constants"; import { alertContext } from "../../../contexts/alertContext"; -import IconComponent from "../../genericIconComponent"; import { chatTriggerPropType } from "../../../types/components"; +import IconComponent from "../../genericIconComponent"; -export default function ChatTrigger({ open, setOpen, isBuilt, canOpen }: chatTriggerPropType): JSX.Element { +export default function ChatTrigger({ + open, + setOpen, + isBuilt, + canOpen, +}: chatTriggerPropType): JSX.Element { const { setErrorData } = useContext(alertContext); function handleClick(): void { diff --git a/src/frontend/src/components/headerComponent/components/menuBar/index.tsx b/src/frontend/src/components/headerComponent/components/menuBar/index.tsx index 6e5560bbd..8d71162de 100644 --- a/src/frontend/src/components/headerComponent/components/menuBar/index.tsx +++ b/src/frontend/src/components/headerComponent/components/menuBar/index.tsx @@ -13,9 +13,9 @@ import { Link, useNavigate } from "react-router-dom"; import { alertContext } from "../../../../contexts/alertContext"; import { undoRedoContext } from "../../../../contexts/undoRedoContext"; import FlowSettingsModal from "../../../../modals/flowSettingsModal"; +import { menuBarPropsType } from "../../../../types/components"; import IconComponent from "../../../genericIconComponent"; import { Button } from "../../../ui/button"; -import { menuBarPropsType } from "../../../../types/components"; export const MenuBar = ({ flows, tabId }: menuBarPropsType): JSX.Element => { const { updateFlow, setTabId, addFlow } = useContext(TabsContext); diff --git a/src/frontend/src/components/loadingComponent/index.tsx b/src/frontend/src/components/loadingComponent/index.tsx index 406dad793..0cd3c9ef0 100644 --- a/src/frontend/src/components/loadingComponent/index.tsx +++ b/src/frontend/src/components/loadingComponent/index.tsx @@ -1,6 +1,8 @@ import { LoadingComponentProps } from "../../types/components"; -export default function LoadingComponent({ remSize }: LoadingComponentProps): JSX.Element { +export default function LoadingComponent({ + remSize, +}: LoadingComponentProps): JSX.Element { return (
{ if (disabled) { diff --git a/src/frontend/src/modals/ApiModal/index.tsx b/src/frontend/src/modals/ApiModal/index.tsx index d4a5c887e..6afad22b5 100644 --- a/src/frontend/src/modals/ApiModal/index.tsx +++ b/src/frontend/src/modals/ApiModal/index.tsx @@ -53,7 +53,7 @@ import { getPythonApiCode, getPythonCode, } from "../../utils/utils"; -export default function ApiModal({ flow }: { flow: FlowType }) { +export default function ApiModal({ flow }: { flow: FlowType }): JSX.Element { const [open, setOpen] = useState(true); const { dark } = useContext(darkContext); const { closePopUp, closeEdit, setCloseEdit } = useContext(PopUpContext); diff --git a/src/frontend/src/modals/EditNodeModal/index.tsx b/src/frontend/src/modals/EditNodeModal/index.tsx index 901371d30..b9b97c97e 100644 --- a/src/frontend/src/modals/EditNodeModal/index.tsx +++ b/src/frontend/src/modals/EditNodeModal/index.tsx @@ -36,7 +36,11 @@ import { typesContext } from "../../contexts/typesContext"; import { NodeDataType } from "../../types/flow"; import { classNames } from "../../utils/utils"; -export default function EditNodeModal({ data }: { data: NodeDataType }) { +export default function EditNodeModal({ + data, +}: { + data: NodeDataType; +}): JSX.Element { const [open, setOpen] = useState(true); const [nodeLength, setNodeLength] = useState( Object.keys(data.node.template).filter( @@ -66,7 +70,7 @@ export default function EditNodeModal({ data }: { data: NodeDataType }) { closePopUp(); } - function setModalOpen(x: boolean) { + function setModalOpen(x: boolean): void { setOpen(x); if (x === false) { closePopUp(); diff --git a/src/frontend/src/modals/NodeModal/index.tsx b/src/frontend/src/modals/NodeModal/index.tsx index 162ffcf45..1a53ec312 100644 --- a/src/frontend/src/modals/NodeModal/index.tsx +++ b/src/frontend/src/modals/NodeModal/index.tsx @@ -9,7 +9,11 @@ import { nodeColors, nodeIconsLucide } from "../../utils/styleUtils"; import { classNames, toTitleCase } from "../../utils/utils"; import ModalField from "./components/ModalField"; -export default function NodeModal({ data }: { data: NodeDataType }) { +export default function NodeModal({ + data, +}: { + data: NodeDataType; +}): JSX.Element { const [open, setOpen] = useState(true); const { closePopUp } = useContext(PopUpContext); const { types } = useContext(typesContext); diff --git a/src/frontend/src/modals/codeAreaModal/index.tsx b/src/frontend/src/modals/codeAreaModal/index.tsx index deae92cbe..70cccf694 100644 --- a/src/frontend/src/modals/codeAreaModal/index.tsx +++ b/src/frontend/src/modals/codeAreaModal/index.tsx @@ -26,21 +26,21 @@ export default function CodeAreaModal({ value: string; nodeClass: APIClassType; setNodeClass: (Class: APIClassType) => void; -}) { +}): JSX.Element { const [code, setCode] = useState(value); const { dark } = useContext(darkContext); const { closePopUp, setCloseEdit } = useContext(PopUpContext); const { setErrorData, setSuccessData } = useContext(alertContext); - function setModalOpen(x: boolean) { + function setModalOpen(x: boolean): void { if (x === false) { setCloseEdit("codearea"); closePopUp(); } } - // Check for custom code errors - function handleClick() { + // Check for custom code errors + function handleClick(): void { postValidateCode(code) .then((apiReturn) => { if (apiReturn.data) { diff --git a/src/frontend/src/modals/exportModal/index.tsx b/src/frontend/src/modals/exportModal/index.tsx index d9574613b..b5ce1ce84 100644 --- a/src/frontend/src/modals/exportModal/index.tsx +++ b/src/frontend/src/modals/exportModal/index.tsx @@ -18,7 +18,7 @@ import { PopUpContext } from "../../contexts/popUpContext"; import { TabsContext } from "../../contexts/tabsContext"; import { removeApiKeys } from "../../utils/reactflowUtils"; -export default function ExportModal() { +export default function ExportModal(): JSX.Element { const [open, setOpen] = useState(true); const { closePopUp } = useContext(PopUpContext); const ref = useRef(); diff --git a/src/frontend/src/modals/flowSettingsModal/index.tsx b/src/frontend/src/modals/flowSettingsModal/index.tsx index ab5081dfc..82d663e3c 100644 --- a/src/frontend/src/modals/flowSettingsModal/index.tsx +++ b/src/frontend/src/modals/flowSettingsModal/index.tsx @@ -16,7 +16,7 @@ import { alertContext } from "../../contexts/alertContext"; import { PopUpContext } from "../../contexts/popUpContext"; import { TabsContext } from "../../contexts/tabsContext"; -export default function FlowSettingsModal() { +export default function FlowSettingsModal(): JSX.Element { const [open, setOpen] = useState(true); const { closePopUp } = useContext(PopUpContext); const { setErrorData, setSuccessData } = useContext(alertContext); @@ -28,7 +28,7 @@ export default function FlowSettingsModal() { const [description, setDescription] = useState( flows.find((f) => f.id === tabId).description ); - function setModalOpen(x: boolean) { + function setModalOpen(x: boolean): void { setOpen(x); if (x === false) { setTimeout(() => { @@ -36,7 +36,7 @@ export default function FlowSettingsModal() { }, 300); } } - function handleClick() { + function handleClick(): void { let savedFlow = flows.find((f) => f.id === tabId); savedFlow.name = name; savedFlow.description = description; diff --git a/src/frontend/src/modals/formModal/chatInput/index.tsx b/src/frontend/src/modals/formModal/chatInput/index.tsx index 63f224e92..1b4708549 100644 --- a/src/frontend/src/modals/formModal/chatInput/index.tsx +++ b/src/frontend/src/modals/formModal/chatInput/index.tsx @@ -1,5 +1,6 @@ import { useEffect } from "react"; import IconComponent from "../../../components/genericIconComponent"; +import { chatInputType } from "../../../types/components"; import { classNames } from "../../../utils/utils"; export default function ChatInput({ @@ -9,7 +10,7 @@ export default function ChatInput({ setChatValue, inputRef, noInput, -}) { +}: chatInputType): JSX.Element { useEffect(() => { if (!lockChat && inputRef.current) { inputRef.current.focus(); diff --git a/src/frontend/src/modals/formModal/chatMessage/codeBlock/index.tsx b/src/frontend/src/modals/formModal/chatMessage/codeBlock/index.tsx index ce121a7cf..2dd02eb05 100644 --- a/src/frontend/src/modals/formModal/chatMessage/codeBlock/index.tsx +++ b/src/frontend/src/modals/formModal/chatMessage/codeBlock/index.tsx @@ -9,7 +9,7 @@ interface Props { value: string; } -export function CodeBlock({ language, value }) { +export function CodeBlock({ language, value }: Props): JSX.Element { const [isCopied, setIsCopied] = useState(false); const copyToClipboard = () => { diff --git a/src/frontend/src/modals/formModal/chatMessage/index.tsx b/src/frontend/src/modals/formModal/chatMessage/index.tsx index 8a64e2f58..d2e643a10 100644 --- a/src/frontend/src/modals/formModal/chatMessage/index.tsx +++ b/src/frontend/src/modals/formModal/chatMessage/index.tsx @@ -20,7 +20,7 @@ export default function ChatMessage({ chat: ChatMessageType; lockChat: boolean; lastMessage: boolean; -}) { +}): JSX.Element { const convert = new Convert({ newline: true }); const [hidden, setHidden] = useState(true); const template = chat.template; diff --git a/src/frontend/src/modals/formModal/index.tsx b/src/frontend/src/modals/formModal/index.tsx index 48dfbc6ea..5b1f8277b 100644 --- a/src/frontend/src/modals/formModal/index.tsx +++ b/src/frontend/src/modals/formModal/index.tsx @@ -34,7 +34,7 @@ export default function FormModal({ open: boolean; setOpen: Function; flow: FlowType; -}) { +}): JSX.Element { const { tabsState, setTabsState } = useContext(TabsContext); const [chatValue, setChatValue] = useState(() => { try { @@ -147,7 +147,7 @@ export default function FormModal({ }); } - function handleOnClose(event: CloseEvent) { + function handleOnClose(event: CloseEvent): void { if (isOpen.current) { setErrorData({ title: event.reason }); setTimeout(() => { @@ -157,7 +157,10 @@ export default function FormModal({ } } - function getWebSocketUrl(chatId, isDevelopment = false) { + function getWebSocketUrl( + chatId: string, + isDevelopment: boolean = false + ): string { const isSecureProtocol = window.location.protocol === "https:"; const webSocketProtocol = isSecureProtocol ? "wss" : "ws"; const host = isDevelopment ? "localhost:7860" : window.location.host; @@ -238,7 +241,7 @@ export default function FormModal({ } } - function connectWS() { + function connectWS(): void { try { const urlWs = getWebSocketUrl( id.current, @@ -305,7 +308,7 @@ export default function FormModal({ // do not add connectWS on dependencies array }, [lockChat]); - async function sendAll(data: sendAllProps) { + async function sendAll(data: sendAllProps): Promise { try { if (ws) { ws.current.send(JSON.stringify(data)); @@ -332,7 +335,7 @@ export default function FormModal({ } }, [open]); - function sendMessage() { + function sendMessage(): void { let nodeValidationErrors = validateNodes(reactFlowInstance); if (nodeValidationErrors.length === 0) { setLockChat(true); @@ -365,17 +368,17 @@ export default function FormModal({ }); } } - function clearChat() { + function clearChat(): void { setChatHistory([]); ws.current.send(JSON.stringify({ clear_history: true })); if (lockChat) setLockChat(false); } - function setModalOpen(x: boolean) { + function setModalOpen(x: boolean): void { setOpen(x); } - function handleOnCheckedChange(checked: boolean, i: string) { + function handleOnCheckedChange(checked: boolean, i: string): void { if (checked === true) { setChatKey(i); setChatValue(tabsState[flow.id].formKeysData.input_keys[i]); diff --git a/src/frontend/src/modals/genericModal/index.tsx b/src/frontend/src/modals/genericModal/index.tsx index 5505f38c0..eacab3eeb 100644 --- a/src/frontend/src/modals/genericModal/index.tsx +++ b/src/frontend/src/modals/genericModal/index.tsx @@ -44,7 +44,7 @@ export default function GenericModal({ type: number; nodeClass?: APIClassType; setNodeClass?: (Class: APIClassType) => void; -}) { +}): JSX.Element { const [myButtonText] = useState(buttonText); const [myModalTitle] = useState(modalTitle); const [myModalType] = useState(type); @@ -56,7 +56,7 @@ export default function GenericModal({ useContext(alertContext); const { closePopUp, setCloseEdit } = useContext(PopUpContext); const ref = useRef(); - function setModalOpen(x: boolean) { + function setModalOpen(x: boolean): void { if (x === false) { setCloseEdit("generic"); closePopUp(); @@ -65,7 +65,7 @@ export default function GenericModal({ const divRef = useRef(null); const divRefPrompt = useRef(null); - function checkVariables(valueToCheck) { + function checkVariables(valueToCheck: string): void { const regex = /\{([^{}]+)\}/g; const matches = []; let match; @@ -111,7 +111,7 @@ export default function GenericModal({ .replace(regexHighlight, varHighlightHTML({ name: "$1" })) .replace(/\n/g, "
"); - const TextAreaContentView = () => { + const TextAreaContentView = (): JSX.Element => { return ( { sumOfCaracteres = sumOfCaracteres + element.replace(/[{}]/g, "").length; diff --git a/src/frontend/src/modals/importModal/buttonBox/index.tsx b/src/frontend/src/modals/importModal/buttonBox/index.tsx index 0a998d56e..5558dd13e 100644 --- a/src/frontend/src/modals/importModal/buttonBox/index.tsx +++ b/src/frontend/src/modals/importModal/buttonBox/index.tsx @@ -19,7 +19,7 @@ export default function ButtonBox({ textColor: string; deactivate?: boolean; size: "small" | "medium" | "big"; -}) { +}): JSX.Element { let bigCircle: string; let smallCircle: string; let titleFontSize: string; diff --git a/src/frontend/src/modals/importModal/index.tsx b/src/frontend/src/modals/importModal/index.tsx index 8c4f8a0d2..cf621807d 100644 --- a/src/frontend/src/modals/importModal/index.tsx +++ b/src/frontend/src/modals/importModal/index.tsx @@ -24,7 +24,7 @@ import { FlowType } from "../../types/flow"; import { classNames } from "../../utils/utils"; import ButtonBox from "./buttonBox"; -export default function ImportModal() { +export default function ImportModal(): JSX.Element { const [open, setOpen] = useState(true); const { setErrorData } = useContext(alertContext); const { closePopUp } = useContext(PopUpContext); @@ -33,7 +33,7 @@ export default function ImportModal() { const [loadingExamples, setLoadingExamples] = useState(false); const [examples, setExamples] = useState([]); const { uploadFlow, addFlow } = useContext(TabsContext); - function setModalOpen(x: boolean) { + function setModalOpen(x: boolean): void { setOpen(x); if (x === false) { setTimeout(() => { @@ -42,7 +42,7 @@ export default function ImportModal() { } } - function handleExamples() { + function handleExamples(): void { setLoadingExamples(true); getExamples() .then((result) => { diff --git a/src/frontend/src/pages/FlowPage/components/nodeToolbarComponent/index.tsx b/src/frontend/src/pages/FlowPage/components/nodeToolbarComponent/index.tsx index 0dd042140..18178d37f 100644 --- a/src/frontend/src/pages/FlowPage/components/nodeToolbarComponent/index.tsx +++ b/src/frontend/src/pages/FlowPage/components/nodeToolbarComponent/index.tsx @@ -5,7 +5,6 @@ import IconComponent from "../../../../components/genericIconComponent"; import { TabsContext } from "../../../../contexts/tabsContext"; import EditNodeModal from "../../../../modals/EditNodeModal"; import { classNames } from "../../../../utils/utils"; -import { nodeToolbarType } from "../../../../types/components"; const NodeToolbarComponent = (props): JSX.Element => { const [nodeLength, setNodeLength] = useState( diff --git a/src/frontend/src/pages/MainPage/index.tsx b/src/frontend/src/pages/MainPage/index.tsx index 6bfacc8b9..6fc218161 100644 --- a/src/frontend/src/pages/MainPage/index.tsx +++ b/src/frontend/src/pages/MainPage/index.tsx @@ -8,7 +8,7 @@ import { TabsContext } from "../../contexts/tabsContext"; export default function HomePage(): JSX.Element { const { flows, setTabId, downloadFlows, uploadFlows, addFlow, removeFlow } = useContext(TabsContext); - + // Set a null id useEffect(() => { setTabId(""); diff --git a/src/frontend/src/types/components/index.ts b/src/frontend/src/types/components/index.ts index 81cfbcb15..17ecee167 100644 --- a/src/frontend/src/types/components/index.ts +++ b/src/frontend/src/types/components/index.ts @@ -226,7 +226,7 @@ export type documentloadersType = { BSHTMLLoader: dataObjType; CSVLoader: dataObjType; CoNLLULoader: dataObjType; - CollegeConfidentialLoader: dataObjType; + CollegeConfidentialLoader: dataObjType; DirectoryLoader: dataObjType; EverNoteLoader: dataObjType; FacebookChatLoader: dataObjType; @@ -269,12 +269,12 @@ export type chainsType = { LLMCheckerChain: dataObjType; LLMMathChain: dataObjType; MidJourneyPromptChain: dataObjType; - RetrievalQA: dataObjType + RetrievalQA: dataObjType; RetrievalQAWithSourcesChain: dataObjType; SQLDatabaseChain: dataObjType; SeriesCharacterChain: dataObjType; TimeTravelGuideChain: dataObjType; -} +}; export type embeddingsType = { CohereEmbeddings: dataObjType; @@ -292,7 +292,7 @@ export type llmsTypes = { LlamaCpp: dataObjType; OpenAI: dataObjType; VertexAI: dataObjType; -} +}; export type memoriesType = { ConversationBufferMemory: dataObjType; @@ -316,7 +316,7 @@ export type promptsType = { HumanMessagePromptTemplate: dataObjType; PromptTemplate: dataObjType; SystemMessagePromptTemplate: dataObjType; -} +}; export type retrieversType = { MultiQueryRetriever: dataObjType; @@ -347,7 +347,7 @@ export type toolsType = { JsonSpec: dataObjType; ListSQLDatabaseTool: dataObjType; "News API": dataObjType; - 'PAL-MATH': dataObjType; + "PAL-MATH": dataObjType; "Podcast API": dataObjType; PythonAstREPLTool: dataObjType; PythonFunction: dataObjType; @@ -360,7 +360,7 @@ export type toolsType = { RequestsPostTool: dataObjType; RequestsPutTool: dataObjType; Search: dataObjType; - 'TMDB API': dataObjType; + "TMDB API": dataObjType; Tool: dataObjType; WikipediaQueryRun: dataObjType; WolframAlphaQueryRun: dataObjType; @@ -388,7 +388,7 @@ export type vectorStoresType = { export type wrappersType = { SQLDatabase: dataObjType; - TextRequestsWrapper: dataObjType; + TextRequestsWrapper: dataObjType; }; export type dataType = { @@ -403,7 +403,7 @@ export type dataType = { retrievers?: retrieversType; textsplitters?: textSplittersType; toolkits?: toolkitsType; - tools?: toolsType + tools?: toolsType; utilities?: utilitiesType; vectorstores?: vectorStoresType; wrappers?: wrappersType; @@ -414,7 +414,7 @@ export type tweakType = { "LLMChain-zPC3w": object; "PromptTemplate-iNj5W": object; "ConversationBufferMemory-JnodM": object; -} +}; export type nodeToolbarType = { data: { @@ -438,7 +438,7 @@ export type chatTriggerPropType = { isBuilt: boolean; canOpen: boolean; setOpen: (can: boolean) => void; -} +}; export type headerFlowsType = { data: object; @@ -446,9 +446,20 @@ export type headerFlowsType = { id: string; name: string; style?: FlowStyleType; -} +}; export type menuBarPropsType = { flows: Array; tabId: string; -} +}; + +export type chatInputType = { + chatValue: string; + inputRef: { + current: any; + }; + lockChat: boolean; + noInput: boolean; + sendMessage: () => void; + setChatValue: (value: string) => void; +}; diff --git a/src/frontend/src/utils/utils.ts b/src/frontend/src/utils/utils.ts index 63efde176..bea1fcb01 100644 --- a/src/frontend/src/utils/utils.ts +++ b/src/frontend/src/utils/utils.ts @@ -1,7 +1,12 @@ import clsx, { ClassValue } from "clsx"; import { twMerge } from "tailwind-merge"; import { ADJECTIVES, DESCRIPTIONS, NOUNS } from "../flow_constants"; -import { IVarHighlightType, dataType, groupedObjType, tweakType } from "../types/components"; +import { + IVarHighlightType, + dataType, + groupedObjType, + tweakType, +} from "../types/components"; import { FlowType } from "../types/flow"; import { TabsState } from "../types/tabs"; import { buildTweaks } from "./reactflowUtils"; @@ -85,7 +90,12 @@ export function checkUpperWords(str: string): string { return words.join(" "); } -export function groupByFamily(data: dataType, baseClasses: string, left: boolean, type: string): groupedObjType[] { +export function groupByFamily( + data: dataType, + baseClasses: string, + left: boolean, + type: string +): groupedObjType[] { let parentOutput: string; let arrOfParent: string[] = []; let arrOfType: { family: string; type: string; component: string }[] = []; @@ -259,7 +269,7 @@ export function getRandomKeyByssmm(): string { export function varHighlightHTML({ name }: IVarHighlightType): string { const html = `{${name}}`; return html; -}; +} export function buildTweakObject(tweak: tweakType[]): string { tweak.forEach((el) => { @@ -331,7 +341,7 @@ def run_flow(inputs: dict, flow_id: str, tweaks: Optional[dict] = None) -> dict: # Setup any tweaks you want to apply to the flow inputs = ${inputs} print(run_flow(inputs, flow_id=FLOW_ID, tweaks=TWEAKS))`; -}; +} /** * Function to get the curl code for the API @@ -357,7 +367,7 @@ export function getCurlCode( ? buildTweakObject(tweak) : JSON.stringify(tweaks, null, 2) }}'`; -}; +} /** * Function to get the python code for the API @@ -382,4 +392,4 @@ flow = load_flow_from_json("${flowName}.json", tweaks=TWEAKS) # Now you can use it like any chain inputs = ${inputs} flow(inputs)`; -}; +} From 6113aae86f187120e0f5da2bd4085468d9a947fc Mon Sep 17 00:00:00 2001 From: Igor Carvalho Date: Fri, 21 Jul 2023 17:08:15 -0300 Subject: [PATCH 016/139] Refactor[NodeModal]: Remove unnused code (NodeModal) --- .../src/CustomNodes/GenericNode/index.tsx | 8 - .../src/modals/EditNodeModal/index.tsx | 7 +- .../NodeModal/components/ModalField/index.tsx | 175 ------------------ src/frontend/src/modals/NodeModal/index.tsx | 167 ----------------- src/frontend/src/types/components/index.ts | 14 ++ 5 files changed, 19 insertions(+), 352 deletions(-) delete mode 100644 src/frontend/src/modals/NodeModal/components/ModalField/index.tsx delete mode 100644 src/frontend/src/modals/NodeModal/index.tsx diff --git a/src/frontend/src/CustomNodes/GenericNode/index.tsx b/src/frontend/src/CustomNodes/GenericNode/index.tsx index f7fa61edf..e3925fda9 100644 --- a/src/frontend/src/CustomNodes/GenericNode/index.tsx +++ b/src/frontend/src/CustomNodes/GenericNode/index.tsx @@ -7,7 +7,6 @@ import { useSSE } from "../../contexts/SSEContext"; import { alertContext } from "../../contexts/alertContext"; import { PopUpContext } from "../../contexts/popUpContext"; import { typesContext } from "../../contexts/typesContext"; -import NodeModal from "../../modals/NodeModal"; import NodeToolbarComponent from "../../pages/FlowPage/components/nodeToolbarComponent"; import { NodeDataType } from "../../types/flow"; import { nodeColors, nodeIconsLucide } from "../../utils/styleUtils"; @@ -91,13 +90,6 @@ export default function GenericNode({
-
diff --git a/src/frontend/src/modals/EditNodeModal/index.tsx b/src/frontend/src/modals/EditNodeModal/index.tsx index b9b97c97e..05885a242 100644 --- a/src/frontend/src/modals/EditNodeModal/index.tsx +++ b/src/frontend/src/modals/EditNodeModal/index.tsx @@ -35,6 +35,7 @@ import { TabsContext } from "../../contexts/tabsContext"; import { typesContext } from "../../contexts/typesContext"; import { NodeDataType } from "../../types/flow"; import { classNames } from "../../utils/utils"; +import { editNodeToggleType } from "../../types/components"; export default function EditNodeModal({ data, @@ -87,7 +88,8 @@ export default function EditNodeModal({ setNodeValue(!nodeValue); } - const handleOnNewValue = (newValue: any, name) => { + const handleOnNewValue = (newValue, name) => { + console.log({ newValue, name }) data.node.template[name].value = newValue; // Set state to pending setTabsState((prev) => { @@ -210,6 +212,7 @@ export default function EditNodeModal({ ) : data.node.template[n].type === "bool" ? (
{" "} + oi
- ) : data.node.template[n].type === "str" && + ) : data.node.template[n].type === "str" && data.node.template[n].options ? (
- t.charAt(0) !== "_" && - data.node.template[t].advanced && - data.node.template[t].show - ).length - - 1 === - index - ? "pb-4" - : "" - )} - > - {display && ( -
- {title} - {required ? " *" : ""} -
- )} - - {type === "str" && !data.node.template[name].options ? ( -
- {data.node.template[name].list ? ( - { - data.node.template[name].value = t; - }} - /> - ) : data.node.template[name].multiline ? ( - { - data.node.template[name].value = t; - }} - /> - ) : ( - { - data.node.template[name].value = t; - }} - /> - )} -
- ) : type === "bool" ? ( -
- {" "} - { - data.node.template[name].value = t; - setEnabled(t); - }} - size="small" - /> -
- ) : type === "float" ? ( -
- { - data.node.template[name].value = t; - }} - /> -
- ) : type === "str" && data.node.template[name].options ? ( -
- (data.node.template[name].value = newValue)} - value={data.node.template[name].value ?? "Choose an option"} - > -
- ) : type === "int" ? ( -
- { - data.node.template[name].value = t; - }} - /> -
- ) : type === "file" ? ( -
- { - data.node.template[name].value = t; - }} - fileTypes={data.node.template[name].fileTypes} - suffixes={data.node.template[name].suffixes} - onFileChange={(t: string) => { - data.node.template[name].content = t; - }} - > -
- ) : type === "prompt" ? ( -
- { - data.node.template[name].value = t; - }} - /> -
- ) : type === "code" ? ( -
- { - data.node.template[name].value = t; - }} - /> -
- ) : ( -
- )} -
- ); -} diff --git a/src/frontend/src/modals/NodeModal/index.tsx b/src/frontend/src/modals/NodeModal/index.tsx deleted file mode 100644 index 1a53ec312..000000000 --- a/src/frontend/src/modals/NodeModal/index.tsx +++ /dev/null @@ -1,167 +0,0 @@ -import { Dialog, Transition } from "@headlessui/react"; -import { Fragment, useContext, useRef, useState } from "react"; -import IconComponent from "../../components/genericIconComponent"; -import { limitScrollFieldsModal } from "../../constants/constants"; -import { PopUpContext } from "../../contexts/popUpContext"; -import { typesContext } from "../../contexts/typesContext"; -import { NodeDataType } from "../../types/flow"; -import { nodeColors, nodeIconsLucide } from "../../utils/styleUtils"; -import { classNames, toTitleCase } from "../../utils/utils"; -import ModalField from "./components/ModalField"; - -export default function NodeModal({ - data, -}: { - data: NodeDataType; -}): JSX.Element { - const [open, setOpen] = useState(true); - const { closePopUp } = useContext(PopUpContext); - const { types } = useContext(typesContext); - const ref = useRef(); - function setModalOpen(x: boolean) { - setOpen(x); - if (x === false) { - setTimeout(() => { - closePopUp(); - }, 300); - } - } - // any to avoid type conflict - const Icon: any = nodeIconsLucide[types[data.type]]; - return ( - - - -
- - -
-
- - -
- -
-
-
- -
- - {data.type} - -
-
-
-
-
- t.charAt(0) !== "_" && - data.node.template[t].advanced && - data.node.template[t].show - ).length > limitScrollFieldsModal - ? "overflow-scroll overflow-x-hidden custom-scroll" - : "overflow-hidden" - )} - > -
- {Object.keys(data.node.template) - .filter( - (t) => - t.charAt(0) !== "_" && - data.node.template[t].advanced && - data.node.template[t].show - ) - .map((t: string, idx) => { - return ( - - ); - })} -
-
-
-
-
- -
-
-
-
-
-
-
-
- ); -} diff --git a/src/frontend/src/types/components/index.ts b/src/frontend/src/types/components/index.ts index 17ecee167..0472e0a0f 100644 --- a/src/frontend/src/types/components/index.ts +++ b/src/frontend/src/types/components/index.ts @@ -2,6 +2,7 @@ import { ReactElement, ReactNode } from "react"; import { APIClassType } from "../api"; import { FlowStyleType, NodeDataType } from "../flow/index"; import { typesContextType } from "../typesContext"; +import { BlobOptions } from "buffer"; export type InputComponentType = { value: string; @@ -463,3 +464,16 @@ export type chatInputType = { sendMessage: () => void; setChatValue: (value: string) => void; }; + +export type editNodeToggleType = { + advanced: boolean; + info: string; + list: boolean; + multiline: boolean; + name: string; + password: boolean; + placeholder: string; + required: boolean; + show: boolean; + type: string; +}; From 4fc636cb9b2b03a4d41de434234bbc0c8f7393d3 Mon Sep 17 00:00:00 2001 From: Igor Carvalho Date: Mon, 24 Jul 2023 13:20:29 -0300 Subject: [PATCH 017/139] refactor[EditNodeModal]: Remove any types --- src/frontend/src/modals/EditNodeModal/index.tsx | 6 +++--- src/frontend/src/types/components/index.ts | 12 ++++++------ src/frontend/tsconfig.json | 2 +- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/frontend/src/modals/EditNodeModal/index.tsx b/src/frontend/src/modals/EditNodeModal/index.tsx index 05885a242..075bc22c9 100644 --- a/src/frontend/src/modals/EditNodeModal/index.tsx +++ b/src/frontend/src/modals/EditNodeModal/index.tsx @@ -78,7 +78,7 @@ export default function EditNodeModal({ } } - function changeAdvanced(node) { + function changeAdvanced(node: editNodeToggleType): void { Object.keys(data.node.template).map((n, i) => { if (n === node.name) { data.node.template[n].advanced = !data.node.template[n].advanced; @@ -88,8 +88,7 @@ export default function EditNodeModal({ setNodeValue(!nodeValue); } - const handleOnNewValue = (newValue, name) => { - console.log({ newValue, name }) + const handleOnNewValue = (newValue: string | string[] | boolean, name: string): void => { data.node.template[name].value = newValue; // Set state to pending setTabsState((prev) => { @@ -183,6 +182,7 @@ export default function EditNodeModal({ : data.node.template[n].value } onChange={(t: string[]) => { + console.log(t) handleOnNewValue(t, n); }} /> diff --git a/src/frontend/src/types/components/index.ts b/src/frontend/src/types/components/index.ts index 0472e0a0f..bdaf78982 100644 --- a/src/frontend/src/types/components/index.ts +++ b/src/frontend/src/types/components/index.ts @@ -466,13 +466,13 @@ export type chatInputType = { }; export type editNodeToggleType = { - advanced: boolean; - info: string; + advanced?: boolean; + info?: string; list: boolean; - multiline: boolean; - name: string; - password: boolean; - placeholder: string; + multiline?: boolean; + name?: string; + password?: boolean; + placeholder?: string; required: boolean; show: boolean; type: string; diff --git a/src/frontend/tsconfig.json b/src/frontend/tsconfig.json index c411ff4e7..88e7e83a6 100644 --- a/src/frontend/tsconfig.json +++ b/src/frontend/tsconfig.json @@ -15,7 +15,7 @@ "isolatedModules": true, "noEmit": true, "jsx": "react-jsx", - "noImplicitAny": false + "noImplicitAny": true }, "include": ["src"] } From 53a20ecccf03873ae8eb8e458f8b851207fdc3df Mon Sep 17 00:00:00 2001 From: Igor Carvalho Date: Mon, 24 Jul 2023 14:10:38 -0300 Subject: [PATCH 018/139] refactor[modals]: Remove any types --- src/frontend/src/modals/exportModal/index.tsx | 4 ++-- src/frontend/src/modals/formModal/chatInput/index.tsx | 6 +++--- .../modals/formModal/chatMessage/codeBlock/index.tsx | 10 +++------- .../src/modals/formModal/chatMessage/index.tsx | 2 +- .../src/modals/formModal/fileComponent/index.tsx | 10 ++++++---- src/frontend/src/types/components/index.ts | 11 +++++++++++ 6 files changed, 26 insertions(+), 17 deletions(-) diff --git a/src/frontend/src/modals/exportModal/index.tsx b/src/frontend/src/modals/exportModal/index.tsx index b5ce1ce84..7f6e9bd30 100644 --- a/src/frontend/src/modals/exportModal/index.tsx +++ b/src/frontend/src/modals/exportModal/index.tsx @@ -26,7 +26,7 @@ export default function ExportModal(): JSX.Element { const { flows, tabId, updateFlow, downloadFlow, saveFlow } = useContext(TabsContext); const [isMaxLength, setIsMaxLength] = useState(false); - function setModalOpen(x: boolean) { + function setModalOpen(x: boolean): void { setOpen(x); if (x === false) { setTimeout(() => { @@ -67,7 +67,7 @@ export default function ExportModal(): JSX.Element {
{ + onCheckedChange={(event: boolean): void => { setChecked(event); }} /> diff --git a/src/frontend/src/modals/formModal/chatInput/index.tsx b/src/frontend/src/modals/formModal/chatInput/index.tsx index 1b4708549..2050071d4 100644 --- a/src/frontend/src/modals/formModal/chatInput/index.tsx +++ b/src/frontend/src/modals/formModal/chatInput/index.tsx @@ -27,7 +27,7 @@ export default function ChatInput({ return (