From 9525ac95ae526947030b65142d6e11e068dc6d6b Mon Sep 17 00:00:00 2001 From: cristhianzl Date: Thu, 6 Jun 2024 12:01:45 -0300 Subject: [PATCH 1/2] formatting code --- src/backend/base/langflow/api/v1/login.py | 4 +- src/backend/base/langflow/api/v1/monitor.py | 1 - src/backend/base/langflow/base/data/utils.py | 2 +- src/backend/base/langflow/helpers/flow.py | 4 +- .../base/langflow/initial_setup/setup.py | 6 +- .../base/langflow/processing/process.py | 2 +- .../base/langflow/services/auth/utils.py | 5 +- .../base/langflow/services/monitor/service.py | 4 +- .../base/langflow/services/settings/base.py | 1 - .../langflow/services/settings/service.py | 2 +- src/frontend/src/App.tsx | 7 +- .../src/alerts/alertDropDown/index.tsx | 6 +- .../src/components/ImageViewer/index.tsx | 14 +-- .../folderAccordionComponent/index.tsx | 2 +- .../components/accordionComponent/index.tsx | 5 +- .../addNewVariableButton.tsx | 6 +- .../components/dragCardComponent/index.tsx | 4 +- .../src/components/cardComponent/index.tsx | 20 ++-- .../components/cardsWrapComponent/index.tsx | 2 +- .../src/components/chatComponent/index.tsx | 8 +- .../components/codeAreaComponent/index.tsx | 2 +- .../components/codeTabsComponent/index.tsx | 40 +++---- .../components/csvOutputComponent/index.tsx | 2 +- .../src/components/dictComponent/index.tsx | 2 +- .../components/dropdownComponent/index.tsx | 4 +- .../editFlowSettingsComponent/index.tsx | 2 +- .../components/genericIconComponent/index.tsx | 6 +- .../components/menuBar/index.tsx | 4 +- .../src/components/headerComponent/index.tsx | 2 +- .../horizontalScrollFadeComponent/index.tsx | 4 +- .../components/popover/index.tsx | 16 +-- .../components/popoverObject/index.tsx | 24 ++-- .../src/components/inputComponent/index.tsx | 12 +- .../components/inputFileComponent/index.tsx | 5 +- .../components/inputGlobalComponent/index.tsx | 8 +- .../components/inputListComponent/index.tsx | 2 +- .../components/sideBarButtons/index.tsx | 3 +- .../components/sideBarFolderButtons/index.tsx | 18 +-- .../hooks/use-on-file-drop.tsx | 10 +- .../src/components/sidebarComponent/index.tsx | 3 - .../components/tableAutoCellRender/index.tsx | 2 +- .../components/ResetColumns/index.tsx | 2 - .../src/components/tableComponent/index.tsx | 14 +-- .../tagsSelectorComponent/index.tsx | 2 +- src/frontend/src/components/ui/accordion.tsx | 6 +- src/frontend/src/components/ui/alert.tsx | 2 +- src/frontend/src/components/ui/button.tsx | 6 +- src/frontend/src/components/ui/card.tsx | 4 +- src/frontend/src/components/ui/checkbox.tsx | 4 +- .../src/components/ui/custom-accordion.tsx | 4 +- src/frontend/src/components/ui/form.tsx | 8 +- src/frontend/src/components/ui/toggle.tsx | 4 +- src/frontend/src/components/ui/tooltip.tsx | 4 +- src/frontend/src/controllers/API/api.tsx | 10 +- .../API/helpers/check-duplicate-requests.ts | 2 +- src/frontend/src/controllers/API/index.ts | 54 ++++----- .../components/parameterComponent/index.tsx | 14 +-- .../tooltipRenderComponent/index.tsx | 2 +- .../src/customNodes/genericNode/index.tsx | 32 +++--- .../hooks/use-fetch-data-on-mount.tsx | 2 +- .../hooks/use-handle-new-value.tsx | 2 +- .../hooks/use-handle-node-class.tsx | 2 +- .../src/customNodes/utils/get-field-title.tsx | 2 +- src/frontend/src/icons/Streamlit/index.tsx | 2 +- .../BundleModal/hooks/submit-folder.tsx | 4 +- .../IOModal/components/IOFieldView/index.tsx | 2 +- .../components/chatView/chatMessage/index.tsx | 16 +-- .../IOModal/components/chatView/index.tsx | 12 +- src/frontend/src/modals/IOModal/index.tsx | 31 +++--- .../utils/check-can-build-tweak-object.ts | 2 +- .../apiModal/utils/get-changes-types.ts | 2 +- .../modals/apiModal/utils/get-curl-code.tsx | 6 +- .../utils/get-nodes-with-default-value.ts | 4 +- .../apiModal/utils/get-python-api-code.tsx | 2 +- .../modals/apiModal/utils/get-python-code.tsx | 2 +- .../src/modals/apiModal/utils/get-value.ts | 2 +- .../modals/apiModal/utils/get-widget-code.tsx | 2 +- .../src/modals/apiModal/utils/tabs-array.tsx | 2 +- .../src/modals/apiModal/views/index.tsx | 18 +-- src/frontend/src/modals/baseModal/index.tsx | 10 +- .../src/modals/editNodeModal/index.tsx | 42 +++---- src/frontend/src/modals/exportModal/index.tsx | 6 +- .../src/modals/flowLogsModal/index.tsx | 7 +- .../modals/foldersModal/component/index.tsx | 1 - .../foldersModal/hooks/submit-folder.tsx | 4 +- .../src/modals/genericModal/index.tsx | 6 +- .../src/modals/newFlowModal/index.tsx | 2 +- src/frontend/src/modals/shareModal/index.tsx | 6 +- .../modals/shareModal/utils/get-tags-ids.tsx | 2 +- .../components/PageComponent/index.tsx | 38 +++---- .../PageComponent/utils/get-random-name.tsx | 2 +- .../SelectionMenuComponent/index.tsx | 2 +- .../extraSidebarComponent/index.tsx | 28 ++--- .../components/nodeToolbarComponent/index.tsx | 24 ++-- src/frontend/src/pages/FlowPage/index.tsx | 2 +- .../components/componentsComponent/index.tsx | 20 ++-- .../components/emptyComponent/index.tsx | 6 +- .../components/headerComponent/index.tsx | 15 +-- .../headerTabsSearchComponent/index.tsx | 12 +- .../components/inputSearchComponent/index.tsx | 4 +- .../pages/MainPage/pages/mainPage/index.tsx | 2 +- .../MainPage/utils/handle-download-folder.ts | 2 +- src/frontend/src/pages/Playground/index.tsx | 2 +- src/frontend/src/pages/SettingsPage/index.tsx | 2 +- .../components/PasswordForm/index.tsx | 2 +- .../components/StoreApiKeyForm/index.tsx | 4 +- .../SettingsPage/pages/GeneralPage/index.tsx | 10 +- .../pages/GlobalVariablesPage/index.tsx | 10 +- .../pages/hooks/use-patch-gradient.tsx | 2 +- .../SettingsPage/pages/hooks/use-save-key.tsx | 4 +- .../components/headerMessages/index.tsx | 2 +- .../hooks/use-remove-messages.tsx | 2 +- .../messagesPage/hooks/use-updateMessage.tsx | 2 +- .../SettingsPage/pages/messagesPage/index.tsx | 4 +- src/frontend/src/pages/StorePage/index.tsx | 7 +- src/frontend/src/routes.tsx | 8 +- src/frontend/src/stores/darkStore.ts | 2 +- src/frontend/src/stores/flowStore.ts | 51 +++++---- src/frontend/src/stores/flowsManagerStore.ts | 30 ++--- src/frontend/src/stores/foldersStore.tsx | 10 +- .../globalVariablesStore/globalVariables.ts | 2 +- src/frontend/src/stores/messagesStore.ts | 4 +- src/frontend/src/types/components/index.ts | 8 +- src/frontend/src/types/zustand/flow/index.ts | 14 +-- .../src/types/zustand/flowsManager/index.ts | 8 +- .../types/zustand/globalVariables/index.ts | 2 +- src/frontend/src/utils/parameterUtils.ts | 4 +- src/frontend/src/utils/reactflowUtils.ts | 104 +++++++++--------- src/frontend/src/utils/storeUtils.ts | 2 +- src/frontend/src/utils/styleUtils.ts | 8 +- src/frontend/src/utils/utils.ts | 20 ++-- tests/conftest.py | 5 +- 132 files changed, 557 insertions(+), 588 deletions(-) diff --git a/src/backend/base/langflow/api/v1/login.py b/src/backend/base/langflow/api/v1/login.py index cde6bd28b..2637cc865 100644 --- a/src/backend/base/langflow/api/v1/login.py +++ b/src/backend/base/langflow/api/v1/login.py @@ -71,9 +71,7 @@ async def login_to_get_access_token( @router.get("/auto_login") async def auto_login( - response: Response, - db: Session = Depends(get_session), - settings_service=Depends(get_settings_service) + response: Response, db: Session = Depends(get_session), settings_service=Depends(get_settings_service) ): auth_settings = settings_service.auth_settings if settings_service.auth_settings.AUTO_LOGIN: diff --git a/src/backend/base/langflow/api/v1/monitor.py b/src/backend/base/langflow/api/v1/monitor.py index e419ed5bf..ffd01b470 100644 --- a/src/backend/base/langflow/api/v1/monitor.py +++ b/src/backend/base/langflow/api/v1/monitor.py @@ -1,5 +1,4 @@ from typing import List, Optional -from uuid import UUID from fastapi import APIRouter, Depends, HTTPException, Query from langflow.services.deps import get_monitor_service diff --git a/src/backend/base/langflow/base/data/utils.py b/src/backend/base/langflow/base/data/utils.py index 2aaf3b23d..c72c9b5b8 100644 --- a/src/backend/base/langflow/base/data/utils.py +++ b/src/backend/base/langflow/base/data/utils.py @@ -92,7 +92,7 @@ def read_text_file(file_path: str) -> str: with open(file_path, "rb") as f: raw_data = f.read() result = chardet.detect(raw_data) - encoding = result['encoding'] + encoding = result["encoding"] with open(file_path, "r", encoding=encoding) as f: return f.read() diff --git a/src/backend/base/langflow/helpers/flow.py b/src/backend/base/langflow/helpers/flow.py index 9a8a7c3b5..7eb901274 100644 --- a/src/backend/base/langflow/helpers/flow.py +++ b/src/backend/base/langflow/helpers/flow.py @@ -90,7 +90,9 @@ async def run_flow( fallback_to_env_vars = get_settings_service().settings.fallback_to_env_var - return await graph.arun(inputs_list, inputs_components=inputs_components, types=types, fallback_to_env_vars=fallback_to_env_vars) + return await graph.arun( + inputs_list, inputs_components=inputs_components, types=types, fallback_to_env_vars=fallback_to_env_vars + ) def generate_function_for_flow( diff --git a/src/backend/base/langflow/initial_setup/setup.py b/src/backend/base/langflow/initial_setup/setup.py index 27574950c..83408d8b9 100644 --- a/src/backend/base/langflow/initial_setup/setup.py +++ b/src/backend/base/langflow/initial_setup/setup.py @@ -20,7 +20,7 @@ from langflow.services.database.models.user.crud import get_user_by_username from langflow.services.deps import get_settings_service, session_scope from langflow.services.database.models.folder.utils import create_default_folder_if_it_doesnt_exist -from langflow.services.deps import get_settings_service, session_scope, get_variable_service +from langflow.services.deps import get_variable_service STARTER_FOLDER_NAME = "Starter Projects" @@ -221,6 +221,7 @@ def _is_valid_uuid(val): return False return str(uuid_obj) == val + def load_flows_from_directory(): settings_service = get_settings_service() flows_path = settings_service.settings.load_flows_path @@ -262,6 +263,7 @@ def load_flows_from_directory(): session.add(flow) session.commit() + def find_existing_flow(session, flow_id, flow_endpoint_name): if flow_endpoint_name: stmt = select(Flow).where(Flow.endpoint_name == flow_endpoint_name) @@ -271,6 +273,8 @@ def find_existing_flow(session, flow_id, flow_endpoint_name): if existing := session.exec(stmt).first(): return existing return None + + def create_or_update_starter_projects(): components_paths = get_settings_service().settings.components_path try: diff --git a/src/backend/base/langflow/processing/process.py b/src/backend/base/langflow/processing/process.py index aeff0f1a4..1b54d3f08 100644 --- a/src/backend/base/langflow/processing/process.py +++ b/src/backend/base/langflow/processing/process.py @@ -59,7 +59,7 @@ async def run_graph_internal( outputs or [], stream=stream, session_id=session_id_str or "", - fallback_to_env_vars=fallback_to_env_vars + fallback_to_env_vars=fallback_to_env_vars, ) if session_id_str and session_service: await session_service.update_session(session_id_str, (graph, artifacts)) diff --git a/src/backend/base/langflow/services/auth/utils.py b/src/backend/base/langflow/services/auth/utils.py index 0e0aead88..f62d3ce4f 100644 --- a/src/backend/base/langflow/services/auth/utils.py +++ b/src/backend/base/langflow/services/auth/utils.py @@ -215,10 +215,7 @@ def create_user_longterm_token(db: Session = Depends(get_session)) -> tuple[UUID username = settings_service.auth_settings.SUPERUSER super_user = get_user_by_username(db, username) if not super_user: - raise HTTPException( - status_code=status.HTTP_400_BAD_REQUEST, - detail="Super user hasn't been created" - ) + raise HTTPException(status_code=status.HTTP_400_BAD_REQUEST, detail="Super user hasn't been created") access_token_expires_longterm = timedelta(days=365) access_token = create_token( data={"sub": str(super_user.id)}, diff --git a/src/backend/base/langflow/services/monitor/service.py b/src/backend/base/langflow/services/monitor/service.py index ab5a87f08..02bc59cc2 100644 --- a/src/backend/base/langflow/services/monitor/service.py +++ b/src/backend/base/langflow/services/monitor/service.py @@ -115,7 +115,9 @@ class MonitorService(Service): return self.exec_query(query) def update_message(self, message_id: int, **kwargs): - query = f"""UPDATE messages SET {', '.join(f"{k} = '{v}'" for k, v in kwargs.items())} WHERE index = {message_id}""" + query = ( + f"""UPDATE messages SET {', '.join(f"{k} = '{v}'" for k, v in kwargs.items())} WHERE index = {message_id}""" + ) return self.exec_query(query) diff --git a/src/backend/base/langflow/services/settings/base.py b/src/backend/base/langflow/services/settings/base.py index 259e10170..4f50cb756 100644 --- a/src/backend/base/langflow/services/settings/base.py +++ b/src/backend/base/langflow/services/settings/base.py @@ -78,7 +78,6 @@ class Settings(BaseSettings): langchain_cache: str = "InMemoryCache" load_flows_path: Optional[str] = None - # Redis redis_host: str = "localhost" redis_port: int = 6379 diff --git a/src/backend/base/langflow/services/settings/service.py b/src/backend/base/langflow/services/settings/service.py index 95088e829..3ecdb683d 100644 --- a/src/backend/base/langflow/services/settings/service.py +++ b/src/backend/base/langflow/services/settings/service.py @@ -1,5 +1,4 @@ import os -from typing import Optional import yaml from loguru import logger @@ -8,6 +7,7 @@ from langflow.services.base import Service from langflow.services.settings.auth import AuthSettings from langflow.services.settings.base import Settings + class SettingsService(Service): name = "settings_service" diff --git a/src/frontend/src/App.tsx b/src/frontend/src/App.tsx index b9e02a27d..36f2ad9f9 100644 --- a/src/frontend/src/App.tsx +++ b/src/frontend/src/App.tsx @@ -1,4 +1,3 @@ -import axios from "axios"; import { useContext, useEffect, useState } from "react"; import { ErrorBoundary } from "react-error-boundary"; import { useNavigate } from "react-router-dom"; @@ -30,10 +29,10 @@ export default function App() { useTrackLastVisitedPath(); const removeFromTempNotificationList = useAlertStore( - (state) => state.removeFromTempNotificationList, + (state) => state.removeFromTempNotificationList ); const tempNotificationList = useAlertStore( - (state) => state.tempNotificationList, + (state) => state.tempNotificationList ); const [fetchError, setFetchError] = useState(false); const isLoading = useFlowsManagerStore((state) => state.isLoading); @@ -51,7 +50,7 @@ export default function App() { const refreshVersion = useDarkStore((state) => state.refreshVersion); const refreshStars = useDarkStore((state) => state.refreshStars); const setGlobalVariables = useGlobalVariablesStore( - (state) => state.setGlobalVariables, + (state) => state.setGlobalVariables ); const checkHasStore = useStoreStore((state) => state.checkHasStore); const navigate = useNavigate(); diff --git a/src/frontend/src/alerts/alertDropDown/index.tsx b/src/frontend/src/alerts/alertDropDown/index.tsx index 05f42922d..6eff32fe2 100644 --- a/src/frontend/src/alerts/alertDropDown/index.tsx +++ b/src/frontend/src/alerts/alertDropDown/index.tsx @@ -16,13 +16,13 @@ export default function AlertDropdown({ }: AlertDropdownType): JSX.Element { const notificationList = useAlertStore((state) => state.notificationList); const clearNotificationList = useAlertStore( - (state) => state.clearNotificationList, + (state) => state.clearNotificationList ); const removeFromNotificationList = useAlertStore( - (state) => state.removeFromNotificationList, + (state) => state.removeFromNotificationList ); const setNotificationCenter = useAlertStore( - (state) => state.setNotificationCenter, + (state) => state.setNotificationCenter ); const [open, setOpen] = useState(false); diff --git a/src/frontend/src/components/ImageViewer/index.tsx b/src/frontend/src/components/ImageViewer/index.tsx index 8433962a7..dc7f41ad7 100644 --- a/src/frontend/src/components/ImageViewer/index.tsx +++ b/src/frontend/src/components/ImageViewer/index.tsx @@ -31,14 +31,14 @@ export default function ImageViewer({ image }) { const fullPageButton = document.getElementById("full-page-button"); zoomInButton!.addEventListener("click", () => - viewer.viewport.zoomBy(1.2), + viewer.viewport.zoomBy(1.2) ); zoomOutButton!.addEventListener("click", () => - viewer.viewport.zoomBy(0.8), + viewer.viewport.zoomBy(0.8) ); homeButton!.addEventListener("click", () => viewer.viewport.goHome()); fullPageButton!.addEventListener("click", () => - viewer.setFullScreen(true), + viewer.setFullScreen(true) ); // Optionally, you can set additional viewer options here @@ -47,16 +47,16 @@ export default function ImageViewer({ image }) { return () => { viewer.destroy(); zoomInButton!.removeEventListener("click", () => - viewer.viewport.zoomBy(1.2), + viewer.viewport.zoomBy(1.2) ); zoomOutButton!.removeEventListener("click", () => - viewer.viewport.zoomBy(0.8), + viewer.viewport.zoomBy(0.8) ); homeButton!.removeEventListener("click", () => - viewer.viewport.goHome(), + viewer.viewport.goHome() ); fullPageButton!.removeEventListener("click", () => - viewer.setFullScreen(true), + viewer.setFullScreen(true) ); }; } diff --git a/src/frontend/src/components/accordionComponent/composite/folderAccordionComponent/index.tsx b/src/frontend/src/components/accordionComponent/composite/folderAccordionComponent/index.tsx index d4fb95b5c..212a03fa2 100644 --- a/src/frontend/src/components/accordionComponent/composite/folderAccordionComponent/index.tsx +++ b/src/frontend/src/components/accordionComponent/composite/folderAccordionComponent/index.tsx @@ -15,7 +15,7 @@ export default function FolderAccordionComponent({ options, }: AccordionComponentType): JSX.Element { const [value, setValue] = useState( - open.length === 0 ? "" : getOpenAccordion(), + open.length === 0 ? "" : getOpenAccordion() ); function getOpenAccordion(): string { diff --git a/src/frontend/src/components/accordionComponent/index.tsx b/src/frontend/src/components/accordionComponent/index.tsx index 7c5562e7f..43a0aef79 100644 --- a/src/frontend/src/components/accordionComponent/index.tsx +++ b/src/frontend/src/components/accordionComponent/index.tsx @@ -7,7 +7,6 @@ import { } from "../../components/ui/accordion"; import { AccordionComponentType } from "../../types/components"; import { cn } from "../../utils/utils"; -import ShadTooltip from "../shadTooltipComponent"; export default function AccordionComponent({ trigger, @@ -18,7 +17,7 @@ export default function AccordionComponent({ sideBar, }: AccordionComponentType): JSX.Element { const [value, setValue] = useState( - open.length === 0 ? "" : getOpenAccordion(), + open.length === 0 ? "" : getOpenAccordion() ); function getOpenAccordion(): string { @@ -53,7 +52,7 @@ export default function AccordionComponent({ disabled={disabled} className={cn( sideBar ? "w-full bg-muted px-[0.75rem] py-[0.5rem]" : "ml-3", - disabled ? "cursor-not-allowed" : "cursor-pointer", + disabled ? "cursor-not-allowed" : "cursor-pointer" )} > {trigger} diff --git a/src/frontend/src/components/addNewVariableButtonComponent/addNewVariableButton.tsx b/src/frontend/src/components/addNewVariableButtonComponent/addNewVariableButton.tsx index 36b68a7e8..61dada650 100644 --- a/src/frontend/src/components/addNewVariableButtonComponent/addNewVariableButton.tsx +++ b/src/frontend/src/components/addNewVariableButtonComponent/addNewVariableButton.tsx @@ -23,19 +23,19 @@ export default function AddNewVariableButton({ children }): JSX.Element { const setErrorData = useAlertStore((state) => state.setErrorData); const componentFields = useTypesStore((state) => state.ComponentFields); const unavaliableFields = new Set( - Object.keys(useGlobalVariablesStore((state) => state.unavaliableFields)), + Object.keys(useGlobalVariablesStore((state) => state.unavaliableFields)) ); const availableFields = () => { const fields = Array.from(componentFields).filter( - (field) => !unavaliableFields.has(field), + (field) => !unavaliableFields.has(field) ); return sortByName(fields); }; const addGlobalVariable = useGlobalVariablesStore( - (state) => state.addGlobalVariable, + (state) => state.addGlobalVariable ); function handleSaveVariable() { diff --git a/src/frontend/src/components/cardComponent/components/dragCardComponent/index.tsx b/src/frontend/src/components/cardComponent/components/dragCardComponent/index.tsx index 28674f3bc..54dbf4846 100644 --- a/src/frontend/src/components/cardComponent/components/dragCardComponent/index.tsx +++ b/src/frontend/src/components/cardComponent/components/dragCardComponent/index.tsx @@ -10,7 +10,7 @@ export default function DragCardComponent({ data }: { data: storeComponent }) { draggable //TODO check color schema className={cn( - "group relative flex flex-col justify-between overflow-hidden transition-all hover:bg-muted/50 hover:shadow-md hover:dark:bg-[#ffffff10]", + "group relative flex flex-col justify-between overflow-hidden transition-all hover:bg-muted/50 hover:shadow-md hover:dark:bg-[#ffffff10]" )} >
@@ -22,7 +22,7 @@ export default function DragCardComponent({ data }: { data: storeComponent }) { "visible flex-shrink-0", data.is_component ? "mx-0.5 h-6 w-6 text-component-icon" - : "h-7 w-7 flex-shrink-0 text-flow-icon", + : "h-7 w-7 flex-shrink-0 text-flow-icon" )} name={data.is_component ? "ToyBrick" : "Group"} /> diff --git a/src/frontend/src/components/cardComponent/index.tsx b/src/frontend/src/components/cardComponent/index.tsx index 09b8ff833..a5d671aa0 100644 --- a/src/frontend/src/components/cardComponent/index.tsx +++ b/src/frontend/src/components/cardComponent/index.tsx @@ -27,8 +27,8 @@ import { import { Checkbox } from "../ui/checkbox"; import { FormControl, FormField } from "../ui/form"; import Loading from "../ui/loading"; -import { convertTestName } from "./utils/convert-test-name"; import DragCardComponent from "./components/dragCardComponent"; +import { convertTestName } from "./utils/convert-test-name"; export default function CollectionCardComponent({ data, @@ -60,11 +60,11 @@ export default function CollectionCardComponent({ const [loading, setLoading] = useState(false); const [loadingLike, setLoadingLike] = useState(false); const [liked_by_user, setLiked_by_user] = useState( - data?.liked_by_user ?? false, + data?.liked_by_user ?? false ); const [likes_count, setLikes_count] = useState(data?.liked_by_count ?? 0); const [downloads_count, setDownloads_count] = useState( - data?.downloads_count ?? 0, + data?.downloads_count ?? 0 ); const currentFlow = useFlowsManagerStore((state) => state.currentFlow); const setCurrentFlow = useFlowsManagerStore((state) => state.setCurrentFlow); @@ -75,12 +75,12 @@ export default function CollectionCardComponent({ const [openPlayground, setOpenPlayground] = useState(false); const [openDelete, setOpenDelete] = useState(false); const setCurrentFlowId = useFlowsManagerStore( - (state) => state.setCurrentFlowId, + (state) => state.setCurrentFlowId ); const [loadingPlayground, setLoadingPlayground] = useState(false); const selectedFlowsComponentsCards = useFlowsManagerStore( - (state) => state.selectedFlowsComponentsCards, + (state) => state.selectedFlowsComponentsCards ); const name = data.is_component ? "Component" : "Flow"; @@ -220,7 +220,7 @@ export default function CollectionCardComponent({ "group relative flex min-h-[11rem] flex-col justify-between overflow-hidden transition-all hover:bg-muted/50 hover:shadow-md hover:dark:bg-[#ffffff10]", disabled ? "pointer-events-none opacity-50" : "", onClick ? "cursor-pointer" : "", - isSelectedCard ? "border border-selected" : "", + isSelectedCard ? "border border-selected" : "" )} onClick={onClick} > @@ -233,7 +233,7 @@ export default function CollectionCardComponent({ "visible flex-shrink-0", data.is_component ? "mx-0.5 h-6 w-6 text-component-icon" - : "h-7 w-7 flex-shrink-0 text-flow-icon", + : "h-7 w-7 flex-shrink-0 text-flow-icon" )} name={data.is_component ? "ToyBrick" : "Group"} /> @@ -428,7 +428,7 @@ export default function CollectionCardComponent({ name="Trash2" className={cn( "h-5 w-5", - !authorized ? " text-ring" : "", + !authorized ? " text-ring" : "" )} /> @@ -463,7 +463,7 @@ export default function CollectionCardComponent({ liked_by_user ? "fill-destructive stroke-destructive" : "", - !authorized ? " text-ring" : "", + !authorized ? " text-ring" : "" )} /> @@ -501,7 +501,7 @@ export default function CollectionCardComponent({ } className={cn( loading ? "h-5 w-5 animate-spin" : "h-5 w-5", - !authorized ? " text-ring" : "", + !authorized ? " text-ring" : "" )} /> diff --git a/src/frontend/src/components/cardsWrapComponent/index.tsx b/src/frontend/src/components/cardsWrapComponent/index.tsx index c7ca01588..0de3f1a2f 100644 --- a/src/frontend/src/components/cardsWrapComponent/index.tsx +++ b/src/frontend/src/components/cardsWrapComponent/index.tsx @@ -65,7 +65,7 @@ export default function CardsWrapComponent({ "h-full w-full", isDragging ? "mb-36 flex flex-col items-center justify-center gap-4 text-2xl font-light" - : "", + : "" )} > {isDragging ? ( diff --git a/src/frontend/src/components/chatComponent/index.tsx b/src/frontend/src/components/chatComponent/index.tsx index 81dade485..1fa82e9dd 100644 --- a/src/frontend/src/components/chatComponent/index.tsx +++ b/src/frontend/src/components/chatComponent/index.tsx @@ -50,7 +50,7 @@ export default function FlowToolbar(): JSX.Element { "relative inline-flex h-full w-full items-center justify-center gap-[4px] bg-muted px-5 py-3 text-sm font-semibold text-foreground transition-all duration-150 ease-in-out hover:bg-background hover:bg-hover ", !hasApiKey || !validApiKey || !hasStore ? " button-disable text-muted-foreground " - : "", + : "" )} > Share ), - [hasApiKey, validApiKey, currentFlow, hasStore], + [hasApiKey, validApiKey, currentFlow, hasStore] ); return ( @@ -118,7 +118,7 @@ export default function FlowToolbar(): JSX.Element {
{ if (disabled && myValue !== "") { diff --git a/src/frontend/src/components/codeTabsComponent/index.tsx b/src/frontend/src/components/codeTabsComponent/index.tsx index 0a0b691c8..9f1fc99b6 100644 --- a/src/frontend/src/components/codeTabsComponent/index.tsx +++ b/src/frontend/src/components/codeTabsComponent/index.tsx @@ -236,7 +236,7 @@ export default function CodeTabsComponent({
{data?.map((node: any, i) => ( @@ -275,8 +275,8 @@ export default function CodeTabsComponent({ .show && LANGFLOW_SUPPORTED_TYPES.has( node.data.node.template[templateField] - .type, - ), + .type + ) ) .map((templateField, indx) => { return ( @@ -334,7 +334,7 @@ export default function CodeTabsComponent({ target, node.data.node.template[ templateField - ], + ] ); }} /> @@ -380,7 +380,7 @@ export default function CodeTabsComponent({ target, node.data.node.template[ templateField - ], + ] ); }} /> @@ -433,7 +433,7 @@ export default function CodeTabsComponent({ target, node.data.node.template[ templateField - ], + ] ); }} /> @@ -470,7 +470,7 @@ export default function CodeTabsComponent({ e, node.data.node.template[ templateField - ], + ] ); }} size="small" @@ -501,7 +501,7 @@ export default function CodeTabsComponent({ ].fileTypes } onFileChange={( - value: any, + value: any ) => { node.data.node.template[ templateField @@ -554,7 +554,7 @@ export default function CodeTabsComponent({ target, node.data.node.template[ templateField - ], + ] ); }} /> @@ -594,7 +594,7 @@ export default function CodeTabsComponent({ target, node.data.node.template[ templateField - ], + ] ); }} value={ @@ -656,7 +656,7 @@ export default function CodeTabsComponent({ target, node.data.node.template[ templateField - ], + ] ); }} /> @@ -702,7 +702,7 @@ export default function CodeTabsComponent({ target, node.data.node.template[ templateField - ], + ] ); }} /> @@ -748,7 +748,7 @@ export default function CodeTabsComponent({ target, node.data.node.template[ templateField - ], + ] ); }} /> @@ -780,8 +780,8 @@ export default function CodeTabsComponent({ ].value, type( node, - templateField, - ), + templateField + ) ) } duplicateKey={ @@ -790,15 +790,15 @@ export default function CodeTabsComponent({ onChange={(target) => { const valueToNumbers = convertValuesToNumbers( - target, + target ); node.data.node!.template[ templateField ].value = valueToNumbers; setErrorDuplicateKey( hasDuplicateKeys( - valueToNumbers, - ), + valueToNumbers + ) ); setData((old) => { let newInputList = @@ -815,7 +815,7 @@ export default function CodeTabsComponent({ target, node.data.node.template[ templateField - ], + ] ); }} isList={ @@ -863,7 +863,7 @@ export default function CodeTabsComponent({ target, node.data.node.template[ templateField - ], + ] ); }} /> diff --git a/src/frontend/src/components/csvOutputComponent/index.tsx b/src/frontend/src/components/csvOutputComponent/index.tsx index a98d9c028..a25cfb679 100644 --- a/src/frontend/src/components/csvOutputComponent/index.tsx +++ b/src/frontend/src/components/csvOutputComponent/index.tsx @@ -67,7 +67,7 @@ function CsvOutputComponent({ if (file) { const { rowData: data, colDefs: columns } = convertCSVToData( file, - separator, + separator ); setRowData(data); setColDefs(columns); diff --git a/src/frontend/src/components/dictComponent/index.tsx b/src/frontend/src/components/dictComponent/index.tsx index 39850e6e3..5161135ed 100644 --- a/src/frontend/src/components/dictComponent/index.tsx +++ b/src/frontend/src/components/dictComponent/index.tsx @@ -29,7 +29,7 @@ export default function DictComponent({
1 && editNode ? "my-1" : "", - "flex flex-col gap-3", + "flex flex-col gap-3" )} > { diff --git a/src/frontend/src/components/dropdownComponent/index.tsx b/src/frontend/src/components/dropdownComponent/index.tsx index 8402d166e..bff138681 100644 --- a/src/frontend/src/components/dropdownComponent/index.tsx +++ b/src/frontend/src/components/dropdownComponent/index.tsx @@ -59,7 +59,7 @@ export default function Dropdown({ ? "dropdown-component-outline" : "dropdown-component-false-outline", "w-full justify-between font-normal", - editNode ? "input-edit-node" : "py-2", + editNode ? "input-edit-node" : "py-2" )} > @@ -107,7 +107,7 @@ export default function Dropdown({ name="Check" className={cn( "ml-auto h-4 w-4 text-primary", - value === option ? "opacity-100" : "opacity-0", + value === option ? "opacity-100" : "opacity-0" )} /> diff --git a/src/frontend/src/components/editFlowSettingsComponent/index.tsx b/src/frontend/src/components/editFlowSettingsComponent/index.tsx index 26bc138e3..3dd813965 100644 --- a/src/frontend/src/components/editFlowSettingsComponent/index.tsx +++ b/src/frontend/src/components/editFlowSettingsComponent/index.tsx @@ -99,7 +99,7 @@ export const EditFlowSettings: React.FC = ({ {description === "" ? "No description" : description} diff --git a/src/frontend/src/components/genericIconComponent/index.tsx b/src/frontend/src/components/genericIconComponent/index.tsx index 9f7c687a1..398ae6e7f 100644 --- a/src/frontend/src/components/genericIconComponent/index.tsx +++ b/src/frontend/src/components/genericIconComponent/index.tsx @@ -18,7 +18,7 @@ export const ForwardedIconComponent = memo( strokeWidth, id = "", }: IconComponentProps, - ref, + ref ) => { const [showFallback, setShowFallback] = useState(false); @@ -65,8 +65,8 @@ export const ForwardedIconComponent = memo( /> ); - }, - ), + } + ) ); export default ForwardedIconComponent; diff --git a/src/frontend/src/components/headerComponent/components/menuBar/index.tsx b/src/frontend/src/components/headerComponent/components/menuBar/index.tsx index 35542ca2a..78a21113a 100644 --- a/src/frontend/src/components/headerComponent/components/menuBar/index.tsx +++ b/src/frontend/src/components/headerComponent/components/menuBar/index.tsx @@ -113,7 +113,7 @@ export const MenuBar = ({}: {}): JSX.Element => { title: UPLOAD_ERROR_ALERT, list: [error], }); - }, + } ); }} > @@ -195,7 +195,7 @@ export const MenuBar = ({}: {}): JSX.Element => { name={isBuilding || saveLoading ? "Loader2" : "CheckCircle2"} className={cn( "h-4 w-4", - isBuilding || saveLoading ? "animate-spin" : "animate-wiggle", + isBuilding || saveLoading ? "animate-spin" : "animate-wiggle" )} /> {printByBuildStatus()} diff --git a/src/frontend/src/components/headerComponent/index.tsx b/src/frontend/src/components/headerComponent/index.tsx index 0abd16d3d..209445b17 100644 --- a/src/frontend/src/components/headerComponent/index.tsx +++ b/src/frontend/src/components/headerComponent/index.tsx @@ -56,7 +56,7 @@ export default function Header(): JSX.Element { const lastFlowVisitedIndex = routeHistory .reverse() .findIndex( - (path) => path.includes("/flow/") && path !== location.pathname, + (path) => path.includes("/flow/") && path !== location.pathname ); const lastFlowVisited = routeHistory[lastFlowVisitedIndex]; diff --git a/src/frontend/src/components/horizontalScrollFadeComponent/index.tsx b/src/frontend/src/components/horizontalScrollFadeComponent/index.tsx index e0bf48917..7e0c788a6 100644 --- a/src/frontend/src/components/horizontalScrollFadeComponent/index.tsx +++ b/src/frontend/src/components/horizontalScrollFadeComponent/index.tsx @@ -32,11 +32,11 @@ export default function HorizontalScrollFadeComponent({ fadeContainerRef.current.classList.toggle( "fade-left", - isScrollable && !atStart, + isScrollable && !atStart ); fadeContainerRef.current.classList.toggle( "fade-right", - isScrollable && !atEnd, + isScrollable && !atEnd ); }; diff --git a/src/frontend/src/components/inputComponent/components/popover/index.tsx b/src/frontend/src/components/inputComponent/components/popover/index.tsx index 78fc5bd3d..45c326c2c 100644 --- a/src/frontend/src/components/inputComponent/components/popover/index.tsx +++ b/src/frontend/src/components/inputComponent/components/popover/index.tsx @@ -68,9 +68,9 @@ const CustomInputPopover = ({ (selectedOption !== "" || !onChange) && setSelectedOption ? selectedOption : (selectedOptions?.length !== 0 || !onChange) && - setSelectedOptions - ? selectedOptions?.join(", ") - : value + setSelectedOptions + ? selectedOptions?.join(", ") + : value } autoFocus={autoFocus} disabled={disabled} @@ -96,7 +96,7 @@ const CustomInputPopover = ({ (password && !(setSelectedOption || setSelectedOptions)) ? "pr-8" : "", - className!, + className! )} placeholder={password && editNode ? "Key" : placeholder} onChange={handleInputChange} @@ -134,15 +134,15 @@ const CustomInputPopover = ({ onSelect={(currentValue) => { setSelectedOption && setSelectedOption( - currentValue === selectedOption ? "" : currentValue, + currentValue === selectedOption ? "" : currentValue ); setSelectedOptions && setSelectedOptions( selectedOptions?.includes(currentValue) ? selectedOptions.filter( - (item) => item !== currentValue, + (item) => item !== currentValue ) - : [...selectedOptions, currentValue], + : [...selectedOptions, currentValue] ); !setSelectedOptions && setShowOptions(false); }} @@ -155,7 +155,7 @@ const CustomInputPopover = ({ selectedOption === option || selectedOptions?.includes(option) ? "opacity-100" - : "opacity-0", + : "opacity-0" )} >
diff --git a/src/frontend/src/components/inputComponent/components/popoverObject/index.tsx b/src/frontend/src/components/inputComponent/components/popoverObject/index.tsx index 7b30ac897..d7c9e83a7 100644 --- a/src/frontend/src/components/inputComponent/components/popoverObject/index.tsx +++ b/src/frontend/src/components/inputComponent/components/popoverObject/index.tsx @@ -51,14 +51,14 @@ const CustomInputPopoverObject = ({ ? options.find((option) => option.id === selectedOption)?.name || "" : (selectedOptions?.length !== 0 || !onChange) && - setSelectedOptions - ? selectedOptions - .map( - (optionId) => - options.find((option) => option.id === optionId)?.name, - ) - .join(", ") - : value + setSelectedOptions + ? selectedOptions + .map( + (optionId) => + options.find((option) => option.id === optionId)?.name + ) + .join(", ") + : value } autoFocus={autoFocus} disabled={disabled} @@ -106,15 +106,15 @@ const CustomInputPopoverObject = ({ onSelect={(currentValue) => { setSelectedOption && setSelectedOption( - currentValue === selectedOption ? "" : currentValue, + currentValue === selectedOption ? "" : currentValue ); setSelectedOptions && setSelectedOptions( selectedOptions?.includes(currentValue) ? selectedOptions.filter( - (item) => item !== currentValue, + (item) => item !== currentValue ) - : [...selectedOptions, currentValue], + : [...selectedOptions, currentValue] ); !setSelectedOptions && setShowOptions(false); }} @@ -127,7 +127,7 @@ const CustomInputPopoverObject = ({ selectedOption === option.id || selectedOptions?.includes(option.id) ? "opacity-100" - : "opacity-0", + : "opacity-0" )} >
diff --git a/src/frontend/src/components/inputComponent/index.tsx b/src/frontend/src/components/inputComponent/index.tsx index 8fb749279..331f5c089 100644 --- a/src/frontend/src/components/inputComponent/index.tsx +++ b/src/frontend/src/components/inputComponent/index.tsx @@ -71,7 +71,7 @@ export default function InputComponent({ editNode ? " input-edit-node " : "", password && editNode ? "pr-8" : "", password && !editNode ? "pr-10" : "", - className!, + className! )} placeholder={password && editNode ? "Key" : placeholder} onChange={(e) => { @@ -153,7 +153,7 @@ export default function InputComponent({