-
-
{
- setCode(value);
- }}
- className="h-full w-full rounded-lg border-[1px] border-gray-300 custom-scroll dark:border-gray-600"
- />
-
-
-
-
- {error?.detail?.error}
-
-
-
- {error?.detail?.traceback}
-
-
+
+ {children}
+
+ {EDIT_CODE_TITLE}
+
+
+
+
+
+
+
{
+ setCode(value);
+ }}
+ className="h-full w-full rounded-lg border-[1px] border-gray-300 custom-scroll dark:border-gray-600"
+ />
+
+
+
+
+ {error?.detail?.error}
+
+
+
+ {error?.detail?.traceback}
+
-
-
-
-
-
-
+
+
+
+
+
+
);
}
diff --git a/src/frontend/src/modals/dictAreaModal/index.tsx b/src/frontend/src/modals/dictAreaModal/index.tsx
index 7aee82d14..afcab7857 100644
--- a/src/frontend/src/modals/dictAreaModal/index.tsx
+++ b/src/frontend/src/modals/dictAreaModal/index.tsx
@@ -4,15 +4,15 @@ import "ace-builds/src-noconflict/mode-python";
import "ace-builds/src-noconflict/theme-github";
import "ace-builds/src-noconflict/theme-twilight";
// import "ace-builds/webpack-resolver";
-import { useEffect, useRef, useState } from "react";
+import { useEffect, useState } from "react";
import JsonView from "react18-json-view";
import "react18-json-view/src/dark.css";
import "react18-json-view/src/style.css";
import IconComponent from "../../components/genericIconComponent";
-import { Button } from "../../components/ui/button";
import { CODE_DICT_DIALOG_SUBTITLE } from "../../constants/constants";
import { useDarkStore } from "../../stores/darkStore";
import BaseModal from "../baseModal";
+import { cloneDeep } from "lodash";
export default function DictAreaModal({
children,
@@ -25,14 +25,26 @@ export default function DictAreaModal({
}): JSX.Element {
const [open, setOpen] = useState(false);
const isDark = useDarkStore((state) => state.dark);
- const ref = useRef(value);
+ const [myValue, setMyValue] = useState(value);
useEffect(() => {
- if (value) ref.current = value;
- }, [value]);
+ setMyValue(value);
+ }, [value, open]);
return (
-
+ {
+ onChange(myValue);
+ setOpen(false);
+ }
+ : undefined
+ }
+ >
{children}
{
- ref.current = edit["src"];
- }}
onChange={(edit) => {
- ref.current = edit["src"];
+ setMyValue(edit.src);
}}
- src={ref.current}
+ src={cloneDeep(myValue)}
/>
- {onChange && (
-
-
-
- )}
+
);
}
diff --git a/src/frontend/src/modals/editNodeModal/hooks/use-column-defs.tsx b/src/frontend/src/modals/editNodeModal/hooks/use-column-defs.tsx
index b05696791..14263a9c6 100644
--- a/src/frontend/src/modals/editNodeModal/hooks/use-column-defs.tsx
+++ b/src/frontend/src/modals/editNodeModal/hooks/use-column-defs.tsx
@@ -6,13 +6,14 @@ import TableToggleCellRender from "../../../components/tableComponent/components
const useColumnDefs = (
myData: any,
handleOnNewValue: (newValue: any, name: string) => void,
+ handleOnChangeDb: (value: boolean, key: string) => void,
changeAdvanced: (n: string) => void,
- open: boolean
+ open: boolean,
) => {
const columnDefs: ColDef[] = useMemo(
() => [
{
- headerName: "Name",
+ headerName: "Field Name",
field: "display_name",
valueGetter: (params) => {
const templateParam = params.data;
@@ -47,12 +48,10 @@ const useColumnDefs = (
value: params.data.value,
nodeClass: myData.node,
handleOnNewValue: handleOnNewValue,
- handleOnChangeDb: (value, key) => {
- myData.node!.template[key].load_from_db = value;
- },
+ handleOnChangeDb: handleOnChangeDb,
};
},
- minWidth: 330,
+ minWidth: 340,
autoHeight: true,
flex: 1,
resizable: false,
@@ -77,7 +76,7 @@ const useColumnDefs = (
cellClass: "no-border",
},
],
- [open, myData]
+ [open, myData],
);
return columnDefs;
diff --git a/src/frontend/src/modals/editNodeModal/index.tsx b/src/frontend/src/modals/editNodeModal/index.tsx
index 6c603288a..b8e6a11a5 100644
--- a/src/frontend/src/modals/editNodeModal/index.tsx
+++ b/src/frontend/src/modals/editNodeModal/index.tsx
@@ -9,6 +9,7 @@ import { NodeDataType } from "../../types/flow";
import BaseModal from "../baseModal";
import useColumnDefs from "./hooks/use-column-defs";
import useRowData from "./hooks/use-row-data";
+import { cloneDeep } from "lodash";
const EditNodeModal = forwardRef(
(
@@ -25,9 +26,9 @@ const EditNodeModal = forwardRef(
// setOpenWDoubleClick: (open: boolean) => void;
data: NodeDataType;
},
- ref
+ ref,
) => {
- const myData = useRef(data);
+ const myData = useRef(cloneDeep(data));
const isDark = useDarkStore((state) => state.dark);
@@ -38,8 +39,12 @@ const EditNodeModal = forwardRef(
!myData.current.node!.template[n]?.advanced;
}
- const handleOnNewValue = (newValue: any, name) => {
- myData.current.node!.template[name].value = newValue;
+ const handleOnNewValue = (newValue: any, key: string) => {
+ myData.current.node!.template[key].value = newValue;
+ };
+
+ const handleOnChangeDb = (newValue: boolean, key: string) => {
+ myData.current.node!.template[key].load_from_db = newValue;
};
const rowData = useRowData(data, open);
@@ -47,15 +52,16 @@ const EditNodeModal = forwardRef(
const columnDefs: ColDef[] = useColumnDefs(
data,
handleOnNewValue,
+ handleOnChangeDb,
changeAdvanced,
- open
+ open,
);
const [gridApi, setGridApi] = useState
(null);
useEffect(() => {
if (gridApi && open) {
- myData.current = data;
+ myData.current = cloneDeep(data);
gridApi.refreshCells();
}
}, [gridApi, open]);
@@ -67,22 +73,7 @@ const EditNodeModal = forwardRef(
// }, []);
return (
- {
- setNode(data.id, (old) => ({
- ...old,
- data: {
- ...old.data,
- node: myData.current.node,
- },
- }));
- setOpen(false);
- }}
- >
+
<>>
@@ -94,14 +85,6 @@ const EditNodeModal = forwardRef(
-
-
- Parameters
-
-
{nodeLength > 0 && (
-
+ {
+ setNode(data.id, (old) => ({
+ ...old,
+ data: {
+ ...old.data,
+ node: myData.current.node,
+ },
+ }));
+ setOpen(false);
+ },
+ }}
+ />
);
- }
+ },
);
export default EditNodeModal;
diff --git a/src/frontend/src/modals/exportModal/index.tsx b/src/frontend/src/modals/exportModal/index.tsx
index 5a95e3f56..b7e7e0f9d 100644
--- a/src/frontend/src/modals/exportModal/index.tsx
+++ b/src/frontend/src/modals/exportModal/index.tsx
@@ -45,7 +45,7 @@ const ExportModal = forwardRef(
is_component: false,
},
name!,
- description
+ description,
);
setNoticeData({
title: API_WARNING_NOTICE_ALERT,
@@ -61,7 +61,7 @@ const ExportModal = forwardRef(
is_component: false,
}),
name!,
- description
+ description,
);
setOpen(false);
}}
@@ -99,9 +99,9 @@ const ExportModal = forwardRef(
-
+
);
- }
+ },
);
export default ExportModal;
diff --git a/src/frontend/src/modals/flowLogsModal/index.tsx b/src/frontend/src/modals/flowLogsModal/index.tsx
index 840de14ca..1ba42f9eb 100644
--- a/src/frontend/src/modals/flowLogsModal/index.tsx
+++ b/src/frontend/src/modals/flowLogsModal/index.tsx
@@ -37,7 +37,7 @@ export default function FlowLogsModal({
const { columns, rows } = data;
setColumns(columns.map((col) => ({ ...col, editable: true })));
setRows(rows);
- }
+ },
);
}
@@ -47,7 +47,7 @@ export default function FlowLogsModal({
.some((template) => template["stream"] && template["stream"].value);
console.log(
haStream,
- nodes.map((nodes) => (nodes.data as NodeDataType).node!.template)
+ nodes.map((nodes) => (nodes.data as NodeDataType).node!.template),
);
if (haStream) {
setNoticeData({
diff --git a/src/frontend/src/modals/foldersModal/hooks/submit-folder.tsx b/src/frontend/src/modals/foldersModal/hooks/submit-folder.tsx
index c35d7c450..71a8ac944 100644
--- a/src/frontend/src/modals/foldersModal/hooks/submit-folder.tsx
+++ b/src/frontend/src/modals/foldersModal/hooks/submit-folder.tsx
@@ -33,7 +33,7 @@ const useFolderSubmit = (setOpen, folderToEdit) => {
getFoldersApi(true);
setOpen(false);
}
- }
+ },
);
} else {
addFolder(data).then(
@@ -49,7 +49,7 @@ const useFolderSubmit = (setOpen, folderToEdit) => {
setErrorData({
title: `Error creating folder.`,
});
- }
+ },
);
}
};
diff --git a/src/frontend/src/modals/genericModal/index.tsx b/src/frontend/src/modals/genericModal/index.tsx
index 250192dc9..326be58db 100644
--- a/src/frontend/src/modals/genericModal/index.tsx
+++ b/src/frontend/src/modals/genericModal/index.tsx
@@ -83,7 +83,7 @@ export default function GenericModal({
}
const filteredWordsHighlight = matches.filter(
- (word) => !invalid_chars.includes(word)
+ (word) => !invalid_chars.includes(word),
);
setWordsHighlight(filteredWordsHighlight);
@@ -134,7 +134,7 @@ export default function GenericModal({
// to the first key of the custom_fields object
if (field_name === "") {
field_name = Array.isArray(
- apiReturn.data?.frontend_node?.custom_fields?.[""]
+ apiReturn.data?.frontend_node?.custom_fields?.[""],
)
? apiReturn.data?.frontend_node?.custom_fields?.[""][0] ?? ""
: apiReturn.data?.frontend_node?.custom_fields?.[""] ?? "";
@@ -209,7 +209,7 @@ export default function GenericModal({
{type === TypeModal.PROMPT && isEdit && !readonly ? (
diff --git a/src/frontend/src/modals/newFlowModal/index.tsx b/src/frontend/src/modals/newFlowModal/index.tsx
index 7e64ed5dc..f9d1f98b2 100644
--- a/src/frontend/src/modals/newFlowModal/index.tsx
+++ b/src/frontend/src/modals/newFlowModal/index.tsx
@@ -32,7 +32,7 @@ export default function NewFlowModal({
key={0}
flow={
examples.find(
- (e) => e.name == "Basic Prompting (Hello, World)"
+ (e) => e.name == "Basic Prompting (Hello, World)",
)!
}
/>
diff --git a/src/frontend/src/modals/shareModal/index.tsx b/src/frontend/src/modals/shareModal/index.tsx
index 0bc66092a..ac6832082 100644
--- a/src/frontend/src/modals/shareModal/index.tsx
+++ b/src/frontend/src/modals/shareModal/index.tsx
@@ -131,14 +131,14 @@ export default function ShareModal({
title: "Error sharing " + is_component ? "component" : "flow",
list: [err["response"]["data"]["detail"]],
});
- }
+ },
);
else
updateFlowStore(
flow!,
getTagsIds(selectedTags, tags),
sharePublic,
- unavaliableNames.find((e) => e.name === name)!.id
+ unavaliableNames.find((e) => e.name === name)!.id,
).then(successShare, (err) => {
setErrorData({
title: "Error sharing " + is_component ? "component" : "flow",
@@ -205,7 +205,7 @@ export default function ShareModal({
setOpen={internalSetOpen}
onSubmit={() => {
const isNameAvailable = !unavaliableNames.some(
- (element) => element.name === name
+ (element) => element.name === name,
);
if (isNameAvailable) {
diff --git a/src/frontend/src/modals/shareModal/utils/get-tags-ids.tsx b/src/frontend/src/modals/shareModal/utils/get-tags-ids.tsx
index 1eb1c650e..364d310a5 100644
--- a/src/frontend/src/modals/shareModal/utils/get-tags-ids.tsx
+++ b/src/frontend/src/modals/shareModal/utils/get-tags-ids.tsx
@@ -1,6 +1,6 @@
export default function getTagsIds(
tags: string[],
- tagListId: { name: string; id: string }[]
+ tagListId: { name: string; id: string }[],
) {
return tags
.map((tag) => tagListId.find((tagObj) => tagObj.name === tag))!
diff --git a/src/frontend/src/pages/FlowPage/components/PageComponent/index.tsx b/src/frontend/src/pages/FlowPage/components/PageComponent/index.tsx
index 2844df8f3..c788f680f 100644
--- a/src/frontend/src/pages/FlowPage/components/PageComponent/index.tsx
+++ b/src/frontend/src/pages/FlowPage/components/PageComponent/index.tsx
@@ -61,19 +61,19 @@ export default function Page({
const preventDefault = true;
const uploadFlow = useFlowsManagerStore((state) => state.uploadFlow);
const autoSaveCurrentFlow = useFlowsManagerStore(
- (state) => state.autoSaveCurrentFlow
+ (state) => state.autoSaveCurrentFlow,
);
const types = useTypesStore((state) => state.types);
const templates = useTypesStore((state) => state.templates);
const setFilterEdge = useFlowStore((state) => state.setFilterEdge);
const reactFlowWrapper = useRef
(null);
const [showCanvas, setSHowCanvas] = useState(
- Object.keys(templates).length > 0 && Object.keys(types).length > 0
+ Object.keys(templates).length > 0 && Object.keys(types).length > 0,
);
const reactFlowInstance = useFlowStore((state) => state.reactFlowInstance);
const setReactFlowInstance = useFlowStore(
- (state) => state.setReactFlowInstance
+ (state) => state.setReactFlowInstance,
);
const nodes = useFlowStore((state) => state.nodes);
const edges = useFlowStore((state) => state.edges);
@@ -90,10 +90,10 @@ export default function Page({
const paste = useFlowStore((state) => state.paste);
const resetFlow = useFlowStore((state) => state.resetFlow);
const lastCopiedSelection = useFlowStore(
- (state) => state.lastCopiedSelection
+ (state) => state.lastCopiedSelection,
);
const setLastCopiedSelection = useFlowStore(
- (state) => state.setLastCopiedSelection
+ (state) => state.setLastCopiedSelection,
);
const onConnect = useFlowStore((state) => state.onConnect);
const currentFlowId = useFlowsManagerStore((state) => state.currentFlowId);
@@ -116,7 +116,7 @@ export default function Page({
clonedSelection!,
clonedNodes,
clonedEdges,
- getRandomName()
+ getRandomName(),
);
const newGroupNode = generateNodeFromFlow(newFlow, getNodeId);
// const newEdges = reconnectEdges(newGroupNode, removedEdges);
@@ -124,8 +124,8 @@ export default function Page({
...clonedNodes.filter(
(oldNodes) =>
!clonedSelection?.nodes.some(
- (selectionNode) => selectionNode.id === oldNodes.id
- )
+ (selectionNode) => selectionNode.id === oldNodes.id,
+ ),
),
newGroupNode,
]);
@@ -179,7 +179,7 @@ export default function Page({
function handleUndo(e: KeyboardEvent) {
e.preventDefault();
- e.stopImmediatePropagation();
+ (e as unknown as Event).stopImmediatePropagation();
if (!isWrappedWithClass(e, "noundo")) {
undo();
}
@@ -187,7 +187,7 @@ export default function Page({
function handleRedo(e: KeyboardEvent) {
e.preventDefault();
- e.stopImmediatePropagation();
+ (e as unknown as Event).stopImmediatePropagation();
if (!isWrappedWithClass(e, "noundo")) {
redo();
}
@@ -195,7 +195,7 @@ export default function Page({
function handleGroup(e: KeyboardEvent) {
e.preventDefault();
- e.stopImmediatePropagation();
+ (e as unknown as Event).stopImmediatePropagation();
if (selectionMenuVisible) {
handleGroupNode();
}
@@ -204,7 +204,7 @@ export default function Page({
function handleDuplicate(e: KeyboardEvent) {
e.preventDefault();
e.stopPropagation();
- e.stopImmediatePropagation();
+ (e as unknown as Event).stopImmediatePropagation();
const selectedNode = nodes.filter((obj) => obj.selected);
if (selectedNode.length > 0) {
paste(
@@ -212,14 +212,14 @@ export default function Page({
{
x: position.current.x,
y: position.current.y,
- }
+ },
);
}
}
function handleCopy(e: KeyboardEvent) {
e.preventDefault();
- e.stopImmediatePropagation();
+ (e as unknown as Event).stopImmediatePropagation();
if (
!isWrappedWithClass(e, "nocopy") &&
window.getSelection()?.toString().length === 0 &&
@@ -231,7 +231,7 @@ export default function Page({
function handleCut(e: KeyboardEvent) {
e.preventDefault();
- e.stopImmediatePropagation();
+ (e as unknown as Event).stopImmediatePropagation();
if (
!isWrappedWithClass(e, "nocopy") &&
window.getSelection()?.toString().length === 0 &&
@@ -243,7 +243,7 @@ export default function Page({
function handlePaste(e: KeyboardEvent) {
e.preventDefault();
- e.stopImmediatePropagation();
+ (e as unknown as Event).stopImmediatePropagation();
if (
!isWrappedWithClass(e, "nocopy") &&
window.getSelection()?.toString().length === 0 &&
@@ -259,7 +259,7 @@ export default function Page({
function handleDelete(e: KeyboardEvent) {
e.preventDefault();
- e.stopImmediatePropagation();
+ (e as unknown as Event).stopImmediatePropagation();
if (!isWrappedWithClass(e, "nodelete") && lastSelection) {
takeSnapshot();
deleteNode(lastSelection.nodes.map((node) => node.id));
@@ -296,7 +296,7 @@ export default function Page({
useEffect(() => {
setSHowCanvas(
- Object.keys(templates).length > 0 && Object.keys(types).length > 0
+ Object.keys(templates).length > 0 && Object.keys(types).length > 0,
);
}, [templates, types]);
@@ -305,7 +305,7 @@ export default function Page({
takeSnapshot();
onConnect(params);
},
- [takeSnapshot, onConnect]
+ [takeSnapshot, onConnect],
);
const onNodeDragStart: NodeDragHandler = useCallback(() => {
@@ -346,7 +346,7 @@ export default function Page({
// Extract the data from the drag event and parse it as a JSON object
const data: { type: string; node?: APIClassType } = JSON.parse(
- event.dataTransfer.getData("nodedata")
+ event.dataTransfer.getData("nodedata"),
);
const newId = getNodeId(data.type);
@@ -362,7 +362,7 @@ export default function Page({
};
paste(
{ nodes: [newNode], edges: [] },
- { x: event.clientX, y: event.clientY }
+ { x: event.clientX, y: event.clientY },
);
} else if (event.dataTransfer.types.some((types) => types === "Files")) {
takeSnapshot();
@@ -391,7 +391,7 @@ export default function Page({
}
},
// Specify dependencies for useCallback
- [getNodeId, setNodes, takeSnapshot, paste]
+ [getNodeId, setNodes, takeSnapshot, paste],
);
const onEdgeUpdateStart = useCallback(() => {
@@ -407,7 +407,7 @@ export default function Page({
setEdges((els) => updateEdge(oldEdge, newConnection, els));
}
},
- [setEdges]
+ [setEdges],
);
const onEdgeUpdateEnd = useCallback((_, edge: Edge): void => {
@@ -440,7 +440,7 @@ export default function Page({
(flow: OnSelectionChangeParams): void => {
setLastSelection(flow);
},
- []
+ [],
);
const onPaneClick = useCallback((flow) => {
diff --git a/src/frontend/src/pages/FlowPage/components/PageComponent/utils/get-random-name.tsx b/src/frontend/src/pages/FlowPage/components/PageComponent/utils/get-random-name.tsx
index a58b83ec3..d3bcf4d55 100644
--- a/src/frontend/src/pages/FlowPage/components/PageComponent/utils/get-random-name.tsx
+++ b/src/frontend/src/pages/FlowPage/components/PageComponent/utils/get-random-name.tsx
@@ -5,7 +5,7 @@ import { toTitleCase } from "../../../../../utils/utils";
export default function getRandomName(
retry: number = 0,
noSpace: boolean = false,
- maxRetries: number = 3
+ maxRetries: number = 3,
): string {
const left: string[] = ADJECTIVES;
const right: string[] = NOUNS;
diff --git a/src/frontend/src/pages/FlowPage/components/SelectionMenuComponent/index.tsx b/src/frontend/src/pages/FlowPage/components/SelectionMenuComponent/index.tsx
index d850ce1e2..7b8193caa 100644
--- a/src/frontend/src/pages/FlowPage/components/SelectionMenuComponent/index.tsx
+++ b/src/frontend/src/pages/FlowPage/components/SelectionMenuComponent/index.tsx
@@ -13,7 +13,7 @@ export default function SelectionMenu({
const [disable, setDisable] = useState(
lastSelection && edges.length > 0
? validateSelection(lastSelection!, edges).length > 0
- : false
+ : false,
);
const [isOpen, setIsOpen] = useState(false);
const [isTransitioning, setIsTransitioning] = useState(false);
@@ -65,7 +65,7 @@ export default function SelectionMenu({
className={`${
disable
? "flex h-full w-full cursor-not-allowed items-center justify-between text-sm text-muted-foreground"
- : "flex h-full w-full items-center justify-between text-sm hover:text-indigo-500"
+ : "flex h-full w-full items-center justify-between text-sm"
}`}
onClick={onClick}
disabled={disable}
diff --git a/src/frontend/src/pages/FlowPage/components/extraSidebarComponent/index.tsx b/src/frontend/src/pages/FlowPage/components/extraSidebarComponent/index.tsx
index f67817151..5a80e49c1 100644
--- a/src/frontend/src/pages/FlowPage/components/extraSidebarComponent/index.tsx
+++ b/src/frontend/src/pages/FlowPage/components/extraSidebarComponent/index.tsx
@@ -41,7 +41,7 @@ export default function ExtraSidebar(): JSX.Element {
const [search, setSearch] = useState("");
function onDragStart(
event: React.DragEvent,
- data: { type: string; node?: APIClassType }
+ data: { type: string; node?: APIClassType },
): void {
//start drag event
var crt = event.currentTarget.cloneNode(true);
@@ -67,7 +67,7 @@ export default function ExtraSidebar(): JSX.Element {
let keys = Object.keys(data[d]).filter(
(nd) =>
nd.toLowerCase().includes(e.toLowerCase()) ||
- data[d][nd].display_name?.toLowerCase().includes(e.toLowerCase())
+ data[d][nd].display_name?.toLowerCase().includes(e.toLowerCase()),
);
keys.forEach((element) => {
ret[d][element] = data[d][element];
@@ -134,7 +134,7 @@ export default function ExtraSidebar(): JSX.Element {
if (filtered.some((x) => x !== "")) {
let keys = Object.keys(dataClone[d]).filter((nd) =>
- filtered.includes(nd)
+ filtered.includes(nd),
);
Object.keys(dataClone[d]).forEach((element) => {
if (!keys.includes(element)) {
@@ -171,7 +171,7 @@ export default function ExtraSidebar(): JSX.Element {
if (filtered.some((x) => x !== "")) {
let keys = Object.keys(dataClone[d]).filter((nd) =>
- filtered.includes(nd)
+ filtered.includes(nd),
);
Object.keys(dataClone[d]).forEach((element) => {
if (!keys.includes(element)) {
@@ -200,7 +200,7 @@ export default function ExtraSidebar(): JSX.Element {
"extra-side-bar-buttons gap-[4px] text-sm font-semibold",
!hasApiKey || !validApiKey || !hasStore
? "button-disable cursor-default text-muted-foreground"
- : ""
+ : "",
)}
>
Share
),
- [hasApiKey, validApiKey, currentFlow, hasStore]
+ [hasApiKey, validApiKey, currentFlow, hasStore],
);
const ExportMemo = useMemo(
@@ -227,7 +227,7 @@ export default function ExtraSidebar(): JSX.Element {
),
- []
+ [],
);
const getIcon = useMemo(() => {
@@ -311,8 +311,8 @@ export default function ExtraSidebar(): JSX.Element {
.sort((a, b) =>
sensitiveSort(
dataFilter[SBSectionName][a].display_name,
- dataFilter[SBSectionName][b].display_name
- )
+ dataFilter[SBSectionName][b].display_name,
+ ),
)
.map((SBItemName: string, index) => (
) : (
- )
+ ),
)}{" "}
sensitiveSort(
dataFilter[SBSectionName][a].display_name,
- dataFilter[SBSectionName][b].display_name
- )
+ dataFilter[SBSectionName][b].display_name,
+ ),
)
.map((SBItemName: string, index) => (
) : (
- )
+ ),
)}
diff --git a/src/frontend/src/pages/FlowPage/components/nodeToolbarComponent/index.tsx b/src/frontend/src/pages/FlowPage/components/nodeToolbarComponent/index.tsx
index dd2c4ce5b..ec6b2b364 100644
--- a/src/frontend/src/pages/FlowPage/components/nodeToolbarComponent/index.tsx
+++ b/src/frontend/src/pages/FlowPage/components/nodeToolbarComponent/index.tsx
@@ -43,13 +43,14 @@ export default function NodeToolbarComponent({
selected,
setShowState,
onCloseAdvancedModal,
+ updateNode,
}: nodeToolbarPropsType): JSX.Element {
const version = useDarkStore((state) => state.version);
const [showModalAdvanced, setShowModalAdvanced] = useState(false);
const [showconfirmShare, setShowconfirmShare] = useState(false);
const [showOverrideModal, setShowOverrideModal] = useState(false);
const [flowComponent, setFlowComponent] = useState(
- createFlowComponent(cloneDeep(data), version)
+ createFlowComponent(cloneDeep(data), version),
);
const preventDefault = true;
const isMac = navigator.platform.toUpperCase().includes("MAC");
@@ -66,7 +67,7 @@ export default function NodeToolbarComponent({
data.node.template[templateField].type === "Any" ||
data.node.template[templateField].type === "int" ||
data.node.template[templateField].type === "dict" ||
- data.node.template[templateField].type === "NestedDict")
+ data.node.template[templateField].type === "NestedDict"),
).length;
const hasStore = useStoreStore((state) => state.hasStore);
@@ -170,19 +171,17 @@ export default function NodeToolbarComponent({
const advanced = useShortcutsStore((state) => state.advanced);
const minimize = useShortcutsStore((state) => state.minimize);
- const share = useShortcutsStore((state) => state.share);
+ const component = useShortcutsStore((state) => state.component);
const save = useShortcutsStore((state) => state.save);
const docs = useShortcutsStore((state) => state.docs);
const code = useShortcutsStore((state) => state.code);
const group = useShortcutsStore((state) => state.group);
- const update = useShortcutsStore((state) => state.update);
const download = useShortcutsStore((state) => state.download);
const freeze = useShortcutsStore((state) => state.freeze);
useHotkeys(minimize, handleMinimizeWShortcut, { preventDefault });
- useHotkeys(update, handleUpdateWShortcut, { preventDefault });
useHotkeys(group, handleGroupWShortcut, { preventDefault });
- useHotkeys(share, handleShareWShortcut, { preventDefault });
+ useHotkeys(component, handleShareWShortcut, { preventDefault });
useHotkeys(code, handleCodeWShortcut, { preventDefault });
useHotkeys(advanced, handleAdvancedWShortcut, { preventDefault });
useHotkeys(save, handleSaveWShortcut, { preventDefault });
@@ -221,7 +220,7 @@ export default function NodeToolbarComponent({
const updateNodeInternals = useUpdateNodeInternals();
const setLastCopiedSelection = useFlowStore(
- (state) => state.setLastCopiedSelection
+ (state) => state.setLastCopiedSelection,
);
const setSuccessData = useAlertStore((state) => state.setSuccessData);
@@ -296,7 +295,7 @@ export default function NodeToolbarComponent({
edges,
setNodes,
setEdges,
- data.node?.outputs
+ data.node?.outputs,
);
break;
case "override":
@@ -305,6 +304,9 @@ export default function NodeToolbarComponent({
case "delete":
deleteNode(data.id);
break;
+ case "update":
+ updateNode();
+ break;
case "copy":
const node = nodes.filter((node) => node.id === data.id);
setLastCopiedSelection({ nodes: _.cloneDeep(node), edges: [] });
@@ -320,14 +322,14 @@ export default function NodeToolbarComponent({
y: 10,
paneX: nodes.find((node) => node.id === data.id)?.position.x,
paneY: nodes.find((node) => node.id === data.id)?.position.y,
- }
+ },
);
break;
}
};
const isSaved = flows.some((flow) =>
- Object.values(flow).includes(data.node?.display_name!)
+ Object.values(flow).includes(data.node?.display_name!),
);
function displayShortcut({
@@ -345,7 +347,7 @@ export default function NodeToolbarComponent({
}
});
const filteredShortcut = fixedShortcut.filter(
- (key) => !key.toLowerCase().includes("shift")
+ (key) => !key.toLowerCase().includes("shift"),
);
let shortcutWPlus: string[] = [];
if (!hasShift) shortcutWPlus = filteredShortcut.join("+").split(" ");
@@ -353,7 +355,7 @@ export default function NodeToolbarComponent({
{name}
state.setNode);
const handleOnNewValue = (
- newValue: string | string[] | boolean | Object[]
+ newValue: string | string[] | boolean | Object[],
): void => {
if (data.node!.template[name].value !== newValue) {
takeSnapshot();
@@ -415,6 +417,7 @@ export default function NodeToolbarComponent({
const [openModal, setOpenModal] = useState(false);
const hasCode = Object.keys(data.node!.template).includes("code");
+ const [deleteIsFocus, setDeleteIsFocus] = useState(false);
return (
<>
@@ -424,8 +427,8 @@ export default function NodeToolbarComponent({
name.split(" ")[0].toLowerCase() === "code"
- )!
+ ({ name }) => name.split(" ")[0].toLowerCase() === "code",
+ )!,
)}
side="top"
>
@@ -444,8 +447,8 @@ export default function NodeToolbarComponent({
name.split(" ")[0].toLowerCase() === "advanced"
- )!
+ ({ name }) => name.split(" ")[0].toLowerCase() === "advanced",
+ )!,
)}
side="top"
>
@@ -456,7 +459,7 @@ export default function NodeToolbarComponent({
onClick={() => {
setShowModalAdvanced(true);
}}
- data-testid="code-button-modal"
+ data-testid="advanced-button-modal"
>
@@ -484,14 +487,14 @@ export default function NodeToolbarComponent({
name.split(" ")[0].toLowerCase() === "freeze"
- )!
+ ({ name }) => name.split(" ")[0].toLowerCase() === "freeze",
+ )!,
)}
side="top"
>
@@ -540,7 +543,7 @@ export default function NodeToolbarComponent({
obj.name === "Share")?.shortcut!
+ shortcuts.find((obj) => obj.name === "Component Share")
+ ?.shortcut!
}
value={"Share"}
icon={"Share3"}
@@ -694,14 +698,23 @@ export default function NodeToolbarComponent({
dataTestId="download-button-modal"
/>
-
+ setDeleteIsFocus(true)}
+ onBlur={() => setDeleteIsFocus(false)}
+ >
{" "}
Delete{" "}
-
+
!key.toLowerCase().includes("shift")
+ (key) => !key.toLowerCase().includes("shift"),
);
let shortcutWPlus: string[] = [];
if (!hasShift) shortcutWPlus = filteredShortcut.join("+").split(" ");
@@ -38,7 +38,7 @@ export default function ToolbarSelectItem({
{value}
state.setCurrentFlowId
+ (state) => state.setCurrentFlowId,
);
const version = useDarkStore((state) => state.version);
const setOnFlowPage = useFlowStore((state) => state.setOnFlowPage);
diff --git a/src/frontend/src/pages/MainPage/components/componentsComponent/hooks/use-delete-multiple.tsx b/src/frontend/src/pages/MainPage/components/componentsComponent/hooks/use-delete-multiple.tsx
index af78db50d..395088193 100644
--- a/src/frontend/src/pages/MainPage/components/componentsComponent/hooks/use-delete-multiple.tsx
+++ b/src/frontend/src/pages/MainPage/components/componentsComponent/hooks/use-delete-multiple.tsx
@@ -9,7 +9,7 @@ const useDeleteMultipleFlows = (
myCollectionId,
getFolderById,
setSuccessData,
- setErrorData
+ setErrorData,
) => {
const handleDeleteMultiple = useCallback(() => {
removeFlow(selectedFlowsComponentsCards)
diff --git a/src/frontend/src/pages/MainPage/components/componentsComponent/hooks/use-filtered-flows.tsx b/src/frontend/src/pages/MainPage/components/componentsComponent/hooks/use-filtered-flows.tsx
index b391d9c8e..96b1757ff 100644
--- a/src/frontend/src/pages/MainPage/components/componentsComponent/hooks/use-filtered-flows.tsx
+++ b/src/frontend/src/pages/MainPage/components/componentsComponent/hooks/use-filtered-flows.tsx
@@ -4,7 +4,7 @@ import { useEffect } from "react";
const useFilteredFlows = (
flowsFromFolder,
searchFlowsComponents,
- setAllFlows
+ setAllFlows,
) => {
useEffect(() => {
const newFlows = cloneDeep(flowsFromFolder || []);
@@ -13,7 +13,7 @@ const useFilteredFlows = (
f.name.toLowerCase().includes(searchFlowsComponents.toLowerCase()) ||
f.description
.toLowerCase()
- .includes(searchFlowsComponents.toLowerCase())
+ .includes(searchFlowsComponents.toLowerCase()),
);
if (searchFlowsComponents === "") {
diff --git a/src/frontend/src/pages/MainPage/components/componentsComponent/hooks/use-handle-duplicate.tsx b/src/frontend/src/pages/MainPage/components/componentsComponent/hooks/use-handle-duplicate.tsx
index 97e966b91..fc49fc0d1 100644
--- a/src/frontend/src/pages/MainPage/components/componentsComponent/hooks/use-handle-duplicate.tsx
+++ b/src/frontend/src/pages/MainPage/components/componentsComponent/hooks/use-handle-duplicate.tsx
@@ -12,16 +12,16 @@ const useDuplicateFlows = (
setSuccessData,
setSelectedFlowsComponentsCards,
handleSelectAll,
- cardTypes
+ cardTypes,
) => {
const handleDuplicate = useCallback(() => {
Promise.all(
selectedFlowsComponentsCards.map((selectedFlow) =>
addFlow(
true,
- allFlows.find((flow) => flow.id === selectedFlow)
- )
- )
+ allFlows.find((flow) => flow.id === selectedFlow),
+ ),
+ ),
).then(() => {
resetFilter();
getFoldersApi(true);
diff --git a/src/frontend/src/pages/MainPage/components/componentsComponent/hooks/use-handle-export.tsx b/src/frontend/src/pages/MainPage/components/componentsComponent/hooks/use-handle-export.tsx
index 446525f13..bd742045b 100644
--- a/src/frontend/src/pages/MainPage/components/componentsComponent/hooks/use-handle-export.tsx
+++ b/src/frontend/src/pages/MainPage/components/componentsComponent/hooks/use-handle-export.tsx
@@ -9,7 +9,7 @@ const useExportFlows = (
setSuccessData,
setSelectedFlowsComponentsCards,
handleSelectAll,
- cardTypes
+ cardTypes,
) => {
const handleExport = useCallback(() => {
selectedFlowsComponentsCards.forEach((selectedFlowId) => {
@@ -25,7 +25,7 @@ const useExportFlows = (
is_component: false,
}),
selectedFlow.name,
- selectedFlow.description
+ selectedFlow.description,
);
}
});
diff --git a/src/frontend/src/pages/MainPage/components/componentsComponent/hooks/use-handle-select-all.tsx b/src/frontend/src/pages/MainPage/components/componentsComponent/hooks/use-handle-select-all.tsx
index 5b20a4ddc..a81515e0a 100644
--- a/src/frontend/src/pages/MainPage/components/componentsComponent/hooks/use-handle-select-all.tsx
+++ b/src/frontend/src/pages/MainPage/components/componentsComponent/hooks/use-handle-select-all.tsx
@@ -16,7 +16,7 @@ const useSelectAll = (flowsFromFolder, getValues, setValue) => {
setValue(key, false);
});
},
- [flowsFromFolder, getValues, setValue]
+ [flowsFromFolder, getValues, setValue],
);
return { handleSelectAll };
diff --git a/src/frontend/src/pages/MainPage/components/componentsComponent/hooks/use-select-options-change.tsx b/src/frontend/src/pages/MainPage/components/componentsComponent/hooks/use-select-options-change.tsx
index b19ec4f4f..56dc204c7 100644
--- a/src/frontend/src/pages/MainPage/components/componentsComponent/hooks/use-select-options-change.tsx
+++ b/src/frontend/src/pages/MainPage/components/componentsComponent/hooks/use-select-options-change.tsx
@@ -5,7 +5,7 @@ const useSelectOptionsChange = (
setErrorData,
setOpenDelete,
handleDuplicate,
- handleExport
+ handleExport,
) => {
const handleSelectOptionsChange = useCallback(
(action) => {
@@ -31,7 +31,7 @@ const useSelectOptionsChange = (
setOpenDelete,
handleDuplicate,
handleExport,
- ]
+ ],
);
return { handleSelectOptionsChange };
diff --git a/src/frontend/src/pages/MainPage/components/componentsComponent/hooks/use-selected-flows.tsx b/src/frontend/src/pages/MainPage/components/componentsComponent/hooks/use-selected-flows.tsx
index aa70b025f..b6f00934e 100644
--- a/src/frontend/src/pages/MainPage/components/componentsComponent/hooks/use-selected-flows.tsx
+++ b/src/frontend/src/pages/MainPage/components/componentsComponent/hooks/use-selected-flows.tsx
@@ -2,7 +2,7 @@ import { useEffect } from "react";
const useSelectedFlows = (
entireFormValues,
- setSelectedFlowsComponentsCards
+ setSelectedFlowsComponentsCards,
) => {
useEffect(() => {
if (!entireFormValues || Object.keys(entireFormValues).length === 0) return;
diff --git a/src/frontend/src/pages/MainPage/components/componentsComponent/index.tsx b/src/frontend/src/pages/MainPage/components/componentsComponent/index.tsx
index 81d2aa18d..af13e2bb4 100644
--- a/src/frontend/src/pages/MainPage/components/componentsComponent/index.tsx
+++ b/src/frontend/src/pages/MainPage/components/componentsComponent/index.tsx
@@ -40,22 +40,22 @@ export default function ComponentsComponent({
const allFlows = useFlowsManagerStore((state) => state.allFlows);
const flowsFromFolder = useFolderStore(
- (state) => state.selectedFolder?.flows
+ (state) => state.selectedFolder?.flows,
);
const setSuccessData = useAlertStore((state) => state.setSuccessData);
const setErrorData = useAlertStore((state) => state.setErrorData);
const [openDelete, setOpenDelete] = useState(false);
const searchFlowsComponents = useFlowsManagerStore(
- (state) => state.searchFlowsComponents
+ (state) => state.searchFlowsComponents,
);
const setSelectedFlowsComponentsCards = useFlowsManagerStore(
- (state) => state.setSelectedFlowsComponentsCards
+ (state) => state.setSelectedFlowsComponentsCards,
);
const selectedFlowsComponentsCards = useFlowsManagerStore(
- (state) => state.selectedFlowsComponentsCards
+ (state) => state.selectedFlowsComponentsCards,
);
const [handleFileDrop] = useFileDrop(uploadFlow, type)!;
@@ -109,7 +109,7 @@ export default function ComponentsComponent({
const { handleSelectAll } = useSelectAll(
flowsFromFolder,
getValues,
- setValue
+ setValue,
);
const { handleDuplicate } = useDuplicateFlows(
@@ -124,7 +124,7 @@ export default function ComponentsComponent({
setSuccessData,
setSelectedFlowsComponentsCards,
handleSelectAll,
- cardTypes
+ cardTypes,
);
const version = useDarkStore((state) => state.version);
@@ -138,7 +138,7 @@ export default function ComponentsComponent({
setSuccessData,
setSelectedFlowsComponentsCards,
handleSelectAll,
- cardTypes
+ cardTypes,
);
const { handleSelectOptionsChange } = useSelectOptionsChange(
@@ -146,7 +146,7 @@ export default function ComponentsComponent({
setErrorData,
setOpenDelete,
handleDuplicate,
- handleExport
+ handleExport,
);
const { handleDeleteMultiple } = useDeleteMultipleFlows(
@@ -158,21 +158,21 @@ export default function ComponentsComponent({
myCollectionId,
getFolderById,
setSuccessData,
- setErrorData
+ setErrorData,
);
useSelectedFlows(entireFormValues, setSelectedFlowsComponentsCards);
const descriptionModal = useDescriptionModal(
selectedFlowsComponentsCards,
- type
+ type,
);
const getTotalRowsCount = () => {
if (type === "all") return allFlows?.length;
return allFlows?.filter(
- (f) => (f.is_component ?? false) === (type === "component")
+ (f) => (f.is_component ?? false) === (type === "component"),
)?.length;
};
diff --git a/src/frontend/src/pages/MainPage/components/headerComponent/index.tsx b/src/frontend/src/pages/MainPage/components/headerComponent/index.tsx
index 26999fbd5..151cdd902 100644
--- a/src/frontend/src/pages/MainPage/components/headerComponent/index.tsx
+++ b/src/frontend/src/pages/MainPage/components/headerComponent/index.tsx
@@ -107,7 +107,7 @@ const HeaderComponent = ({
name="Trash2"
className={cn(
"h-5 w-5 text-primary transition-all",
- disableFunctions ? "" : "hover:text-status-red"
+ disableFunctions ? "" : "hover:text-status-red",
)}
/>
diff --git a/src/frontend/src/pages/MainPage/components/myCollectionComponent/components/headerTabsSearchComponent/index.tsx b/src/frontend/src/pages/MainPage/components/myCollectionComponent/components/headerTabsSearchComponent/index.tsx
index 17916f05b..2c1b9cd49 100644
--- a/src/frontend/src/pages/MainPage/components/myCollectionComponent/components/headerTabsSearchComponent/index.tsx
+++ b/src/frontend/src/pages/MainPage/components/myCollectionComponent/components/headerTabsSearchComponent/index.tsx
@@ -20,7 +20,7 @@ const HeaderTabsSearchComponent = ({}: HeaderTabsSearchComponentProps) => {
const [inputValue, setInputValue] = useState("");
const setSearchFlowsComponents = useFlowsManagerStore(
- (state) => state.setSearchFlowsComponents
+ (state) => state.setSearchFlowsComponents,
);
const handleDownloadFolder = () => {
diff --git a/src/frontend/src/pages/MainPage/components/myCollectionComponent/components/inputSearchComponent/index.tsx b/src/frontend/src/pages/MainPage/components/myCollectionComponent/components/inputSearchComponent/index.tsx
index 8619cb2d5..59809425e 100644
--- a/src/frontend/src/pages/MainPage/components/myCollectionComponent/components/inputSearchComponent/index.tsx
+++ b/src/frontend/src/pages/MainPage/components/myCollectionComponent/components/inputSearchComponent/index.tsx
@@ -23,7 +23,7 @@ const InputSearchComponent = ({
const pagePath = window.location.pathname;
const allFlows = useFlowsManagerStore((state) => state.allFlows);
const searchFlowsComponents = useFlowsManagerStore(
- (state) => state.searchFlowsComponents
+ (state) => state.searchFlowsComponents,
);
const disableInputSearch =
diff --git a/src/frontend/src/pages/MainPage/pages/mainPage/index.tsx b/src/frontend/src/pages/MainPage/pages/mainPage/index.tsx
index 0daa61257..ce2b653a2 100644
--- a/src/frontend/src/pages/MainPage/pages/mainPage/index.tsx
+++ b/src/frontend/src/pages/MainPage/pages/mainPage/index.tsx
@@ -16,7 +16,7 @@ import useDropdownOptions from "../../hooks/use-dropdown-options";
export default function HomePage(): JSX.Element {
const uploadFlow = useFlowsManagerStore((state) => state.uploadFlow);
const setCurrentFlowId = useFlowsManagerStore(
- (state) => state.setCurrentFlowId
+ (state) => state.setCurrentFlowId,
);
const location = useLocation();
diff --git a/src/frontend/src/pages/MainPage/services/index.ts b/src/frontend/src/pages/MainPage/services/index.ts
index fbfc34389..3e1286d5e 100644
--- a/src/frontend/src/pages/MainPage/services/index.ts
+++ b/src/frontend/src/pages/MainPage/services/index.ts
@@ -30,12 +30,12 @@ export async function addFolder(data: AddFolderType): Promise {
export async function updateFolder(
body: FolderType,
- folderId: string
+ folderId: string,
): Promise {
try {
const response = await api.patch(
`${BASE_URL_API}folders/${folderId}`,
- body
+ body,
);
return response?.data;
} catch (error) {
@@ -68,7 +68,7 @@ export async function downloadFlowsFromFolders(folderId: string): Promise<{
}> {
try {
const response = await api.get(
- `${BASE_URL_API}folders/download/${folderId}`
+ `${BASE_URL_API}folders/download/${folderId}`,
);
if (response?.status !== 200) {
throw new Error(`HTTP error! status: ${response?.status}`);
@@ -82,7 +82,7 @@ export async function downloadFlowsFromFolders(folderId: string): Promise<{
}
export async function uploadFlowsFromFolders(
- flows: FormData
+ flows: FormData,
): Promise {
try {
const response = await api.post(`${BASE_URL_API}folders/upload/`, flows);
@@ -99,11 +99,11 @@ export async function uploadFlowsFromFolders(
export async function moveFlowToFolder(
flowId: string,
- folderId: string
+ folderId: string,
): Promise {
try {
const response = await api.patch(
- `${BASE_URL_API}folders/move_to_folder/${flowId}/${folderId}`
+ `${BASE_URL_API}folders/move_to_folder/${flowId}/${folderId}`,
);
return response?.data;
} catch (error) {
diff --git a/src/frontend/src/pages/MainPage/utils/handle-download-folder.ts b/src/frontend/src/pages/MainPage/utils/handle-download-folder.ts
index d6a8e957c..6817622d0 100644
--- a/src/frontend/src/pages/MainPage/utils/handle-download-folder.ts
+++ b/src/frontend/src/pages/MainPage/utils/handle-download-folder.ts
@@ -11,7 +11,7 @@ export function handleDownloadFolderFn(folderId: string) {
data.folder_description = folder?.description || "";
const jsonString = `data:text/json;chatset=utf-8,${encodeURIComponent(
- JSON.stringify(data)
+ JSON.stringify(data),
)}`;
const link = document.createElement("a");
diff --git a/src/frontend/src/pages/Playground/index.tsx b/src/frontend/src/pages/Playground/index.tsx
index d26147df6..4ea3cc506 100644
--- a/src/frontend/src/pages/Playground/index.tsx
+++ b/src/frontend/src/pages/Playground/index.tsx
@@ -11,7 +11,7 @@ export default function PlaygroundPage() {
const currentFlow = useFlowsManagerStore((state) => state.currentFlow);
const getFlowById = useFlowsManagerStore((state) => state.getFlowById);
const setCurrentFlowId = useFlowsManagerStore(
- (state) => state.setCurrentFlowId
+ (state) => state.setCurrentFlowId,
);
const currentFlowId = useFlowsManagerStore((state) => state.currentFlowId);
const setCurrentFlow = useFlowsManagerStore((state) => state.setCurrentFlow);
diff --git a/src/frontend/src/pages/ProfileSettingsPage/index.tsx b/src/frontend/src/pages/ProfileSettingsPage/index.tsx
index c1635dc9e..5cedc5841 100644
--- a/src/frontend/src/pages/ProfileSettingsPage/index.tsx
+++ b/src/frontend/src/pages/ProfileSettingsPage/index.tsx
@@ -24,11 +24,11 @@ import { gradients } from "../../utils/styleUtils";
import GradientChooserComponent from "../SettingsPage/pages/GeneralPage/components/ProfilePictureForm/components/profilePictureChooserComponent";
export default function ProfileSettingsPage(): JSX.Element {
const setCurrentFlowId = useFlowsManagerStore(
- (state) => state.setCurrentFlowId
+ (state) => state.setCurrentFlowId,
);
const [inputState, setInputState] = useState(
- CONTROL_PATCH_USER_STATE
+ CONTROL_PATCH_USER_STATE,
);
// set null id
diff --git a/src/frontend/src/pages/SettingsPage/index.tsx b/src/frontend/src/pages/SettingsPage/index.tsx
index 353b7a17c..2e8f49cfc 100644
--- a/src/frontend/src/pages/SettingsPage/index.tsx
+++ b/src/frontend/src/pages/SettingsPage/index.tsx
@@ -8,7 +8,7 @@ import useFlowsManagerStore from "../../stores/flowsManagerStore";
export default function SettingsPage(): JSX.Element {
const pathname = location.pathname;
const setCurrentFlowId = useFlowsManagerStore(
- (state) => state.setCurrentFlowId
+ (state) => state.setCurrentFlowId,
);
useEffect(() => {
setCurrentFlowId("");
@@ -36,7 +36,7 @@ export default function SettingsPage(): JSX.Element {
),
},
{
- title: "API Keys",
+ title: "Langflow API",
href: "/settings/api-keys",
icon: (
- API Keys
+ Langflow API
diff --git a/src/frontend/src/pages/SettingsPage/pages/ApiKeysPage/hooks/use-handle-delete-key.tsx b/src/frontend/src/pages/SettingsPage/pages/ApiKeysPage/hooks/use-handle-delete-key.tsx
index 01b4b7415..74d5dae99 100644
--- a/src/frontend/src/pages/SettingsPage/pages/ApiKeysPage/hooks/use-handle-delete-key.tsx
+++ b/src/frontend/src/pages/SettingsPage/pages/ApiKeysPage/hooks/use-handle-delete-key.tsx
@@ -10,7 +10,7 @@ const useDeleteApiKeys = (
selectedRows,
resetFilter,
setSuccessData,
- setErrorData
+ setErrorData,
) => {
const handleDeleteKey = () => {
Promise.all(selectedRows.map((selectedRow) => deleteApiKey(selectedRow)))
diff --git a/src/frontend/src/pages/SettingsPage/pages/ApiKeysPage/index.tsx b/src/frontend/src/pages/SettingsPage/pages/ApiKeysPage/index.tsx
index e5b224a58..af5280f72 100644
--- a/src/frontend/src/pages/SettingsPage/pages/ApiKeysPage/index.tsx
+++ b/src/frontend/src/pages/SettingsPage/pages/ApiKeysPage/index.tsx
@@ -25,7 +25,7 @@ export default function ApiKeysPage() {
userData,
setLoadingKeys,
keysList,
- setUserId
+ setUserId,
);
function resetFilter() {
@@ -36,7 +36,7 @@ export default function ApiKeysPage() {
selectedRows,
resetFilter,
setSuccessData,
- setErrorData
+ setErrorData,
);
const columnDefs = getColumnDefs();
diff --git a/src/frontend/src/pages/SettingsPage/pages/GeneralPage/components/PasswordForm/index.tsx b/src/frontend/src/pages/SettingsPage/pages/GeneralPage/components/PasswordForm/index.tsx
index d99752e7b..28edb2f09 100644
--- a/src/frontend/src/pages/SettingsPage/pages/GeneralPage/components/PasswordForm/index.tsx
+++ b/src/frontend/src/pages/SettingsPage/pages/GeneralPage/components/PasswordForm/index.tsx
@@ -17,7 +17,7 @@ type PasswordFormComponentProps = {
handlePatchPassword: (
password: string,
cnfPassword: string,
- handleInput: any
+ handleInput: any,
) => void;
};
const PasswordFormComponent = ({
diff --git a/src/frontend/src/pages/SettingsPage/pages/GeneralPage/components/ProfilePictureForm/components/profilePictureChooserComponent/hooks/use-preload-images.tsx b/src/frontend/src/pages/SettingsPage/pages/GeneralPage/components/ProfilePictureForm/components/profilePictureChooserComponent/hooks/use-preload-images.tsx
new file mode 100644
index 000000000..988af6ea9
--- /dev/null
+++ b/src/frontend/src/pages/SettingsPage/pages/GeneralPage/components/ProfilePictureForm/components/profilePictureChooserComponent/hooks/use-preload-images.tsx
@@ -0,0 +1,42 @@
+import { useEffect } from "react";
+import {
+ BACKEND_URL,
+ BASE_URL_API,
+} from "../../../../../../../../../constants/constants";
+
+const usePreloadImages = (profilePictures, setImagesLoaded) => {
+ const preloadImages = async (imageUrls) => {
+ return Promise.all(
+ imageUrls.map(
+ (src) =>
+ new Promise((resolve) => {
+ const img = new Image();
+ img.src = src;
+ img.onload = resolve;
+ img.onerror = resolve;
+ }),
+ ),
+ );
+ };
+
+ useEffect(() => {
+ const imageArray: string[] = [];
+ const firstUrl = `${BACKEND_URL.slice(0, BACKEND_URL.length - 1)}`;
+
+ Object.keys(profilePictures).flatMap((folder) =>
+ profilePictures[folder].map((path) =>
+ imageArray.push(
+ `${firstUrl}${BASE_URL_API}files/profile_pictures/${folder}/${path}`,
+ ),
+ ),
+ );
+
+ preloadImages(imageArray).then(() => {
+ setImagesLoaded(true);
+ });
+ }, [profilePictures]);
+
+ return;
+};
+
+export default usePreloadImages;
diff --git a/src/frontend/src/pages/SettingsPage/pages/GeneralPage/components/ProfilePictureForm/components/profilePictureChooserComponent/index.tsx b/src/frontend/src/pages/SettingsPage/pages/GeneralPage/components/ProfilePictureForm/components/profilePictureChooserComponent/index.tsx
index f085bba23..408bd8ee1 100644
--- a/src/frontend/src/pages/SettingsPage/pages/GeneralPage/components/ProfilePictureForm/components/profilePictureChooserComponent/index.tsx
+++ b/src/frontend/src/pages/SettingsPage/pages/GeneralPage/components/ProfilePictureForm/components/profilePictureChooserComponent/index.tsx
@@ -1,4 +1,4 @@
-import { useEffect, useRef } from "react";
+import { useEffect, useRef, useState } from "react";
import { Button } from "../../../../../../../../components/ui/button";
import Loading from "../../../../../../../../components/ui/loading";
import {
@@ -7,6 +7,7 @@ import {
} from "../../../../../../../../constants/constants";
import { useDarkStore } from "../../../../../../../../stores/darkStore";
import { cn } from "../../../../../../../../utils/utils";
+import usePreloadImages from "./hooks/use-preload-images";
type ProfilePictureChooserComponentProps = {
profilePictures: { [key: string]: string[] };
@@ -23,16 +24,19 @@ export default function ProfilePictureChooserComponent({
}: ProfilePictureChooserComponentProps) {
const ref = useRef(null);
const dark = useDarkStore((state) => state.dark);
+ const [imagesLoaded, setImagesLoaded] = useState(false);
useEffect(() => {
if (value && ref) {
ref.current?.scrollIntoView({ behavior: "smooth", block: "center" });
}
- }, [ref]);
+ }, [ref, value]);
+
+ usePreloadImages(profilePictures, setImagesLoaded);
return (
- {loading ? (
+ {loading || !imagesLoaded ? (
) : (
Object.keys(profilePictures).map((folder, idx) => (
@@ -41,7 +45,7 @@ export default function ProfilePictureChooserComponent({
{folder}
-
+
{profilePictures[folder].map((path, idx) => (
-
+
diff --git a/src/frontend/src/pages/SettingsPage/pages/ShortcutsPage/EditShortcutButton/index.tsx b/src/frontend/src/pages/SettingsPage/pages/ShortcutsPage/EditShortcutButton/index.tsx
index 894969f52..e2e49e815 100644
--- a/src/frontend/src/pages/SettingsPage/pages/ShortcutsPage/EditShortcutButton/index.tsx
+++ b/src/frontend/src/pages/SettingsPage/pages/ShortcutsPage/EditShortcutButton/index.tsx
@@ -31,7 +31,7 @@ export default function EditShortcutButton({
? defaultShortcuts.find(
(s) =>
s.name.split(" ")[0].toLowerCase().toLowerCase() ===
- shortcut[0]?.split(" ")[0].toLowerCase()
+ shortcut[0]?.split(" ")[0].toLowerCase(),
)?.shortcut
: "";
const [key, setKey] = useState(null);
@@ -50,7 +50,7 @@ export default function EditShortcutButton({
}
const setUniqueShortcut = useShortcutsStore(
- (state) => state.updateUniqueShortcut
+ (state) => state.updateUniqueShortcut,
);
function editCombination(): void {
@@ -74,7 +74,7 @@ export default function EditShortcutButton({
setShortcuts(newCombination);
localStorage.setItem(
"langflow-shortcuts",
- JSON.stringify(newCombination)
+ JSON.stringify(newCombination),
);
setKey(null);
setOpen(false);
@@ -116,7 +116,7 @@ export default function EditShortcutButton({
const keysArr = keys.split(" ");
let hasNewKey = false;
return keysArr.some(
- (k) => k.toLowerCase().trim() === keyToCompare.toLowerCase().trim()
+ (k) => k.toLowerCase().trim() === keyToCompare.toLowerCase().trim(),
);
}
@@ -137,7 +137,7 @@ export default function EditShortcutButton({
if (checkForKeys(key, fixedKey)) return;
}
setKey((oldKey) =>
- getFixedCombination({ oldKey: oldKey!, key: fixedKey })
+ getFixedCombination({ oldKey: oldKey!, key: fixedKey }),
);
}
diff --git a/src/frontend/src/pages/SettingsPage/pages/ShortcutsPage/index.tsx b/src/frontend/src/pages/SettingsPage/pages/ShortcutsPage/index.tsx
index 90e442897..5e1228c7d 100644
--- a/src/frontend/src/pages/SettingsPage/pages/ShortcutsPage/index.tsx
+++ b/src/frontend/src/pages/SettingsPage/pages/ShortcutsPage/index.tsx
@@ -40,7 +40,7 @@ export default function ShortcutsPage() {
const combinationToEdit = shortcuts.filter((s) => s.name === selectedRows[0]);
const [open, setOpen] = useState(false);
const updateUniqueShortcut = useShortcutsStore(
- (state) => state.updateUniqueShortcut
+ (state) => state.updateUniqueShortcut,
);
function handleRestore() {
diff --git a/src/frontend/src/pages/SettingsPage/pages/hooks/use-patch-profile-picture.tsx b/src/frontend/src/pages/SettingsPage/pages/hooks/use-patch-profile-picture.tsx
index 537c579af..584300fdf 100644
--- a/src/frontend/src/pages/SettingsPage/pages/hooks/use-patch-profile-picture.tsx
+++ b/src/frontend/src/pages/SettingsPage/pages/hooks/use-patch-profile-picture.tsx
@@ -9,7 +9,7 @@ const usePatchProfilePicture = (
setSuccessData,
setErrorData,
currentUserData,
- setUserData
+ setUserData,
) => {
const handlePatchProfilePicture = async (profile_picture) => {
try {
diff --git a/src/frontend/src/pages/SettingsPage/pages/hooks/use-save-key.tsx b/src/frontend/src/pages/SettingsPage/pages/hooks/use-save-key.tsx
index bdd105fef..cf5871a26 100644
--- a/src/frontend/src/pages/SettingsPage/pages/hooks/use-save-key.tsx
+++ b/src/frontend/src/pages/SettingsPage/pages/hooks/use-save-key.tsx
@@ -11,7 +11,7 @@ const useSaveKey = (
setErrorData,
setHasApiKey,
setValidApiKey,
- setLoadingApiKey
+ setLoadingApiKey,
) => {
const { storeApiKey } = useContext(AuthContext);
@@ -35,7 +35,7 @@ const useSaveKey = (
setHasApiKey(false);
setValidApiKey(false);
setLoadingApiKey(false);
- }
+ },
);
}
};
diff --git a/src/frontend/src/pages/SettingsPage/pages/messagesPage/hooks/use-remove-messages.tsx b/src/frontend/src/pages/SettingsPage/pages/messagesPage/hooks/use-remove-messages.tsx
index f4de52cbb..d7f4d5202 100644
--- a/src/frontend/src/pages/SettingsPage/pages/messagesPage/hooks/use-remove-messages.tsx
+++ b/src/frontend/src/pages/SettingsPage/pages/messagesPage/hooks/use-remove-messages.tsx
@@ -5,7 +5,7 @@ const useRemoveMessages = (
setSelectedRows,
setSuccessData,
setErrorData,
- selectedRows
+ selectedRows,
) => {
const deleteMessages = useMessagesStore((state) => state.removeMessages);
diff --git a/src/frontend/src/pages/SettingsPage/pages/messagesPage/index.tsx b/src/frontend/src/pages/SettingsPage/pages/messagesPage/index.tsx
index 553db9ba5..e08475173 100644
--- a/src/frontend/src/pages/SettingsPage/pages/messagesPage/index.tsx
+++ b/src/frontend/src/pages/SettingsPage/pages/messagesPage/index.tsx
@@ -26,7 +26,7 @@ export default function MessagesPage() {
setSelectedRows,
setSuccessData,
setErrorData,
- selectedRows
+ selectedRows,
);
const { handleUpdate } = useUpdateMessage(setSuccessData, setErrorData);
@@ -60,7 +60,7 @@ export default function MessagesPage() {
overlayNoRowsTemplate="No data available"
onSelectionChanged={(event: SelectionChangedEvent) => {
setSelectedRows(
- event.api.getSelectedRows().map((row) => row.index)
+ event.api.getSelectedRows().map((row) => row.index),
);
}}
rowSelection="multiple"
diff --git a/src/frontend/src/pages/StorePage/index.tsx b/src/frontend/src/pages/StorePage/index.tsx
index 80b842db7..718888c66 100644
--- a/src/frontend/src/pages/StorePage/index.tsx
+++ b/src/frontend/src/pages/StorePage/index.tsx
@@ -46,7 +46,7 @@ export default function StorePage(): JSX.Element {
const setErrorData = useAlertStore((state) => state.setErrorData);
const setCurrentFlowId = useFlowsManagerStore(
- (state) => state.setCurrentFlowId
+ (state) => state.setCurrentFlowId,
);
const currentFlowId = useFlowsManagerStore((state) => state.currentFlowId);
const [loading, setLoading] = useState(true);
@@ -143,7 +143,7 @@ export default function StorePage(): JSX.Element {
setTotalRowsCount(
filteredCategories?.length === 0
? Number(res?.count ?? 0)
- : res?.results?.length ?? 0
+ : res?.results?.length ?? 0,
);
}
})
@@ -183,7 +183,7 @@ export default function StorePage(): JSX.Element {
disabled={loading}
className={cn(
`${!validApiKey ? "animate-pulse border-error" : ""}`,
- loading ? "cursor-not-allowed" : ""
+ loading ? "cursor-not-allowed" : "",
)}
variant="primary"
onClick={() => {
diff --git a/src/frontend/src/routes.tsx b/src/frontend/src/routes.tsx
index 5623f0871..a1997e510 100644
--- a/src/frontend/src/routes.tsx
+++ b/src/frontend/src/routes.tsx
@@ -11,25 +11,25 @@ import MessagesPage from "./pages/SettingsPage/pages/messagesPage";
const AdminPage = lazy(() => import("./pages/AdminPage"));
const LoginAdminPage = lazy(() => import("./pages/AdminPage/LoginPage"));
const ApiKeysPage = lazy(
- () => import("./pages/SettingsPage/pages/ApiKeysPage")
+ () => import("./pages/SettingsPage/pages/ApiKeysPage"),
);
const DeleteAccountPage = lazy(() => import("./pages/DeleteAccountPage"));
const FlowPage = lazy(() => import("./pages/FlowPage"));
const LoginPage = lazy(() => import("./pages/LoginPage"));
const MyCollectionComponent = lazy(
- () => import("./pages/MainPage/components/myCollectionComponent")
+ () => import("./pages/MainPage/components/myCollectionComponent"),
);
const HomePage = lazy(() => import("./pages/MainPage/pages/mainPage"));
const PlaygroundPage = lazy(() => import("./pages/Playground"));
const SettingsPage = lazy(() => import("./pages/SettingsPage"));
const GeneralPage = lazy(
- () => import("./pages/SettingsPage/pages/GeneralPage")
+ () => import("./pages/SettingsPage/pages/GeneralPage"),
);
const GlobalVariablesPage = lazy(
- () => import("./pages/SettingsPage/pages/GlobalVariablesPage")
+ () => import("./pages/SettingsPage/pages/GlobalVariablesPage"),
);
const ShortcutsPage = lazy(
- () => import("./pages/SettingsPage/pages/ShortcutsPage")
+ () => import("./pages/SettingsPage/pages/ShortcutsPage"),
);
const SignUp = lazy(() => import("./pages/SignUpPage"));
const StorePage = lazy(() => import("./pages/StorePage"));
diff --git a/src/frontend/src/shared/components/suspenseImageComponent/index.tsx b/src/frontend/src/shared/components/suspenseImageComponent/index.tsx
new file mode 100644
index 000000000..9299b2035
--- /dev/null
+++ b/src/frontend/src/shared/components/suspenseImageComponent/index.tsx
@@ -0,0 +1,43 @@
+type SuspenseImageComponentProps = { src: string };
+
+const imgCache = {
+ __cache: {},
+ read(src) {
+ if (!this.__cache[src]) {
+ this.__cache[src] = new Promise((resolve, reject) => {
+ const img = new Image();
+ img.onload = () => {
+ this.__cache[src] = true;
+ resolve(true);
+ };
+ img.onerror = () => {
+ delete this.__cache[src]; // Remove failed cache entry
+ reject(new Error("Image failed to load"));
+ };
+ img.src = src;
+ });
+ }
+ if (this.__cache[src] instanceof Promise) {
+ throw this.__cache[src];
+ }
+ return this.__cache[src];
+ },
+};
+
+const SuspenseImageComponent = ({
+ src,
+ ...rest
+}: SuspenseImageComponentProps) => {
+ try {
+ imgCache.read(src);
+ } catch (promise) {
+ if (promise instanceof Promise) {
+ throw promise;
+ }
+ throw new Error("Unexpected error in image loading");
+ }
+
+ return
;
+};
+
+export default SuspenseImageComponent;
diff --git a/src/frontend/src/stores/darkStore.ts b/src/frontend/src/stores/darkStore.ts
index 79f5518da..8c9c10951 100644
--- a/src/frontend/src/stores/darkStore.ts
+++ b/src/frontend/src/stores/darkStore.ts
@@ -36,7 +36,7 @@ export const useDarkStore = create((set, get) => ({
window.localStorage.setItem("githubStars", res?.toString() ?? "0");
window.localStorage.setItem(
"githubStarsLastUpdated",
- new Date().toString()
+ new Date().toString(),
);
set(() => ({ stars: res, lastUpdated: new Date() }));
});
diff --git a/src/frontend/src/stores/flowStore.ts b/src/frontend/src/stores/flowStore.ts
index 6d1c2ad5c..99aea0515 100644
--- a/src/frontend/src/stores/flowStore.ts
+++ b/src/frontend/src/stores/flowStore.ts
@@ -74,7 +74,7 @@ const useFlowStore = create((set, get) => ({
updateFlowPool: (
nodeId: string,
data: VertexBuildTypeAPI | ChatOutputType | ChatInputType,
- buildId?: string
+ buildId?: string,
) => {
let newFlowPool = cloneDeep({ ...get().flowPool });
if (!newFlowPool[nodeId]) {
@@ -167,7 +167,7 @@ const useFlowStore = create((set, get) => ({
flowsManager.autoSaveCurrentFlow(
newChange,
newEdges,
- get().reactFlowInstance?.getViewport() ?? { x: 0, y: 0, zoom: 1 }
+ get().reactFlowInstance?.getViewport() ?? { x: 0, y: 0, zoom: 1 },
);
}
},
@@ -183,7 +183,7 @@ const useFlowStore = create((set, get) => ({
flowsManager.autoSaveCurrentFlow(
get().nodes,
newChange,
- get().reactFlowInstance?.getViewport() ?? { x: 0, y: 0, zoom: 1 }
+ get().reactFlowInstance?.getViewport() ?? { x: 0, y: 0, zoom: 1 },
);
}
},
@@ -201,7 +201,7 @@ const useFlowStore = create((set, get) => ({
return newChange;
}
return node;
- })
+ }),
);
},
getNode: (id: string) => {
@@ -212,8 +212,8 @@ const useFlowStore = create((set, get) => ({
get().nodes.filter((node) =>
typeof nodeId === "string"
? node.id !== nodeId
- : !nodeId.includes(node.id)
- )
+ : !nodeId.includes(node.id),
+ ),
);
},
deleteEdge: (edgeId) => {
@@ -221,8 +221,8 @@ const useFlowStore = create((set, get) => ({
get().edges.filter((edge) =>
typeof edgeId === "string"
? edge.id !== edgeId
- : !edgeId.includes(edge.id)
- )
+ : !edgeId.includes(edge.id),
+ ),
);
},
paste: (selection, position) => {
@@ -288,7 +288,7 @@ const useFlowStore = create((set, get) => ({
let source = idsMap[edge.source];
let target = idsMap[edge.target];
const sourceHandleObject: sourceHandleType = scapeJSONParse(
- edge.sourceHandle!
+ edge.sourceHandle!,
);
let sourceHandle = scapedJSONStringfy({
...sourceHandleObject,
@@ -298,7 +298,7 @@ const useFlowStore = create((set, get) => ({
edge.data.sourceHandle = sourceHandleObject;
const targetHandleObject: targetHandleType = scapeJSONParse(
- edge.targetHandle!
+ edge.targetHandle!,
);
let targetHandle = scapedJSONStringfy({
...targetHandleObject,
@@ -317,7 +317,7 @@ const useFlowStore = create((set, get) => ({
data: cloneDeep(edge.data),
selected: false,
},
- newEdges.map((edge) => ({ ...edge, selected: false }))
+ newEdges.map((edge) => ({ ...edge, selected: false })),
);
});
get().setEdges(newEdges);
@@ -336,10 +336,10 @@ const useFlowStore = create((set, get) => ({
});
const newNodes = get().nodes.filter(
- (node) => !nodesIdsSelected.includes(node.id)
+ (node) => !nodesIdsSelected.includes(node.id),
);
const newEdges = get().edges.filter(
- (edge) => !edgesIdsSelected.includes(edge.id)
+ (edge) => !edgesIdsSelected.includes(edge.id),
);
set({ nodes: newNodes, edges: newEdges });
@@ -397,7 +397,7 @@ const useFlowStore = create((set, get) => ({
// style: { stroke: "#555" },
// className: "stroke-foreground stroke-connection",
},
- oldEdges
+ oldEdges,
);
return newEdges;
@@ -407,7 +407,7 @@ const useFlowStore = create((set, get) => ({
.autoSaveCurrentFlow(
get().nodes,
newEdges,
- get().reactFlowInstance?.getViewport() ?? { x: 0, y: 0, zoom: 1 }
+ get().reactFlowInstance?.getViewport() ?? { x: 0, y: 0, zoom: 1 },
);
},
unselectAll: () => {
@@ -442,7 +442,7 @@ const useFlowStore = create((set, get) => ({
function validateSubgraph(nodes: string[]) {
const errorsObjs = validateNodes(
get().nodes.filter((node) => nodes.includes(node.id)),
- get().edges
+ get().edges,
);
const errors = errorsObjs.map((obj) => obj.errors).flat();
@@ -461,13 +461,13 @@ const useFlowStore = create((set, get) => ({
function handleBuildUpdate(
vertexBuildData: VertexBuildTypeAPI,
status: BuildStatus,
- runId: string
+ runId: string,
) {
if (vertexBuildData && vertexBuildData.inactivated_vertices) {
get().removeFromVerticesBuild(vertexBuildData.inactivated_vertices);
get().updateBuildStatus(
vertexBuildData.inactivated_vertices,
- BuildStatus.INACTIVE
+ BuildStatus.INACTIVE,
);
}
@@ -483,14 +483,14 @@ const useFlowStore = create((set, get) => ({
// next_vertices_ids should be next_vertices_ids without the inactivated vertices
const next_vertices_ids = vertexBuildData.next_vertices_ids.filter(
- (id) => !vertexBuildData.inactivated_vertices?.includes(id)
+ (id) => !vertexBuildData.inactivated_vertices?.includes(id),
);
const top_level_vertices = vertexBuildData.top_level_vertices.filter(
- (vertex) => !vertexBuildData.inactivated_vertices?.includes(vertex)
+ (vertex) => !vertexBuildData.inactivated_vertices?.includes(vertex),
);
const nextVertices: VertexLayerElementType[] = zip(
next_vertices_ids,
- top_level_vertices
+ top_level_vertices,
).map(([id, reference]) => ({ id: id!, reference }));
const newLayers = [
@@ -512,7 +512,7 @@ const useFlowStore = create((set, get) => ({
get().addDataToFlowPool(
{ ...vertexBuildData, run_id: runId },
- vertexBuildData.id
+ vertexBuildData.id,
);
useFlowStore.getState().updateBuildStatus([vertexBuildData.id], status);
@@ -521,7 +521,7 @@ const useFlowStore = create((set, get) => ({
const newFlowBuildStatus = { ...get().flowBuildStatus };
// filter out the vertices that are not status
const verticesToUpdate = verticesIds?.filter(
- (id) => newFlowBuildStatus[id]?.status !== BuildStatus.BUILT
+ (id) => newFlowBuildStatus[id]?.status !== BuildStatus.BUILT,
);
if (verticesToUpdate) {
@@ -591,7 +591,7 @@ const useFlowStore = create((set, get) => ({
verticesLayers: VertexLayerElementType[][];
runId: string;
verticesToRun: string[];
- } | null
+ } | null,
) => {
set({ verticesBuild: vertices });
},
@@ -616,7 +616,7 @@ const useFlowStore = create((set, get) => ({
// that are going to be built
verticesIds: get().verticesBuild!.verticesIds.filter(
// keep the vertices that are not in the list of vertices to remove
- (vertex) => !vertices.includes(vertex)
+ (vertex) => !vertices.includes(vertex),
),
},
});
diff --git a/src/frontend/src/stores/flowsManagerStore.ts b/src/frontend/src/stores/flowsManagerStore.ts
index 8006494bf..78444145c 100644
--- a/src/frontend/src/stores/flowsManagerStore.ts
+++ b/src/frontend/src/stores/flowsManagerStore.ts
@@ -87,12 +87,12 @@ const useFlowsManagerStore = create((set, get) => ({
if (dbData) {
const { data, flows } = processFlows(dbData);
const examples = flows.filter(
- (flow) => flow.folder_id === starterFolderId
+ (flow) => flow.folder_id === starterFolderId,
);
get().setExamples(examples);
const flowsWithoutStarterFolder = flows.filter(
- (flow) => flow.folder_id !== starterFolderId
+ (flow) => flow.folder_id !== starterFolderId,
);
get().setFlows(flowsWithoutStarterFolder);
@@ -120,7 +120,7 @@ const useFlowsManagerStore = create((set, get) => ({
if (get().currentFlow) {
get().saveFlow(
{ ...get().currentFlow!, data: { nodes, edges, viewport } },
- true
+ true,
);
}
},
@@ -146,7 +146,7 @@ const useFlowsManagerStore = create((set, get) => ({
return updatedFlow;
}
return flow;
- })
+ }),
);
//update tabs state
@@ -197,7 +197,7 @@ const useFlowsManagerStore = create((set, get) => ({
flow?: FlowType,
override?: boolean,
position?: XYPosition,
- fromDragAndDrop?: boolean
+ fromDragAndDrop?: boolean,
): Promise => {
let flowData = flow
? processDataFromFlow(flow)
@@ -212,7 +212,7 @@ const useFlowsManagerStore = create((set, get) => ({
const newFlow = createNewFlow(
flowData!,
flow!,
- folder_id || my_collection_id!
+ folder_id || my_collection_id!,
);
const { id } = await saveFlowToDatabase(newFlow);
newFlow.id = id;
@@ -236,7 +236,7 @@ const useFlowsManagerStore = create((set, get) => ({
const newFlow = createNewFlow(
flowData!,
flow!,
- folder_id || my_collection_id!
+ folder_id || my_collection_id!,
);
const newName = addVersionToDuplicates(newFlow, get().flows);
@@ -272,7 +272,7 @@ const useFlowsManagerStore = create((set, get) => ({
.getState()
.paste(
{ nodes: flow!.data!.nodes, edges: flow!.data!.edges },
- position ?? { x: 10, y: 10 }
+ position ?? { x: 10, y: 10 },
);
}
},
@@ -282,7 +282,7 @@ const useFlowsManagerStore = create((set, get) => ({
multipleDeleteFlowsComponents(id)
.then(() => {
const { data, flows } = processFlows(
- get().flows.filter((flow) => !id.includes(flow.id))
+ get().flows.filter((flow) => !id.includes(flow.id)),
);
get().setFlows(flows);
set({ isLoading: false });
@@ -302,7 +302,7 @@ const useFlowsManagerStore = create((set, get) => ({
deleteFlowFromDatabase(id)
.then(() => {
const { data, flows } = processFlows(
- get().flows.filter((flow) => flow.id !== id)
+ get().flows.filter((flow) => flow.id !== id),
);
get().setFlows(flows);
set({ isLoading: false });
@@ -324,7 +324,7 @@ const useFlowsManagerStore = create((set, get) => ({
return new Promise((resolve) => {
let componentFlow = get().flows.find(
(componentFlow) =>
- componentFlow.is_component && componentFlow.name === key
+ componentFlow.is_component && componentFlow.name === key,
);
if (componentFlow) {
@@ -372,7 +372,7 @@ const useFlowsManagerStore = create((set, get) => ({
fileData,
undefined,
position,
- true
+ true,
);
resolve(id);
}
@@ -413,7 +413,7 @@ const useFlowsManagerStore = create((set, get) => ({
return get().addFlow(
true,
createFlowComponent(component, useDarkStore.getState().version),
- override
+ override,
);
},
takeSnapshot: () => {
@@ -434,7 +434,7 @@ const useFlowsManagerStore = create((set, get) => ({
if (pastLength > 0) {
past[currentFlowId] = past[currentFlowId].slice(
pastLength - defaultOptions.maxHistorySize + 1,
- pastLength
+ pastLength,
);
past[currentFlowId].push(newState);
diff --git a/src/frontend/src/stores/foldersStore.tsx b/src/frontend/src/stores/foldersStore.tsx
index 25247ce76..e72610987 100644
--- a/src/frontend/src/stores/foldersStore.tsx
+++ b/src/frontend/src/stores/foldersStore.tsx
@@ -17,18 +17,18 @@ export const useFolderStore = create((set, get) => ({
getFolders().then(
(res) => {
const foldersWithoutStarterProjects = res.filter(
- (folder) => folder.name !== STARTER_FOLDER_NAME
+ (folder) => folder.name !== STARTER_FOLDER_NAME,
);
const starterProjects = res.find(
- (folder) => folder.name === STARTER_FOLDER_NAME
+ (folder) => folder.name === STARTER_FOLDER_NAME,
);
set({ starterProjectId: starterProjects!.id ?? "" });
set({ folders: foldersWithoutStarterProjects });
const myCollectionId = res?.find(
- (f) => f.name === DEFAULT_FOLDER
+ (f) => f.name === DEFAULT_FOLDER,
)?.id;
set({ myCollectionId });
@@ -45,7 +45,7 @@ export const useFolderStore = create((set, get) => ({
set({ folders: [] });
get().setLoading(false);
reject(error);
- }
+ },
);
}
});
@@ -65,7 +65,7 @@ export const useFolderStore = create((set, get) => ({
},
() => {
get().setLoadingById(false);
- }
+ },
);
}
},
diff --git a/src/frontend/src/stores/globalVariablesStore/globalVariables.ts b/src/frontend/src/stores/globalVariablesStore/globalVariables.ts
index c07813858..708f7ec09 100644
--- a/src/frontend/src/stores/globalVariablesStore/globalVariables.ts
+++ b/src/frontend/src/stores/globalVariablesStore/globalVariables.ts
@@ -45,5 +45,5 @@ export const useGlobalVariablesStore = create(
getVariableId: (name) => {
return get().globalVariables[name]?.id;
},
- })
+ }),
);
diff --git a/src/frontend/src/stores/locationStore.ts b/src/frontend/src/stores/locationStore.ts
index 8ef3554e0..a57390343 100644
--- a/src/frontend/src/stores/locationStore.ts
+++ b/src/frontend/src/stores/locationStore.ts
@@ -7,7 +7,7 @@ export const useLocationStore = create((set, get) => ({
let routeHistoryArray = get().routeHistory;
routeHistoryArray.push(location);
- if (routeHistoryArray?.length > 9) {
+ if (routeHistoryArray?.length > 100) {
routeHistoryArray.shift();
set({
routeHistory: routeHistoryArray,
diff --git a/src/frontend/src/stores/messagesStore.ts b/src/frontend/src/stores/messagesStore.ts
index c6bf2042b..349a1c447 100644
--- a/src/frontend/src/stores/messagesStore.ts
+++ b/src/frontend/src/stores/messagesStore.ts
@@ -5,7 +5,7 @@ export const useMessagesStore = create((set, get) => ({
deleteSession: (id) => {
set((state) => {
const updatedMessages = state.messages.filter(
- (msg) => msg.session_id !== id
+ (msg) => msg.session_id !== id,
);
return { messages: updatedMessages };
});
@@ -29,7 +29,7 @@ export const useMessagesStore = create((set, get) => ({
updateMessage: (message) => {
set(() => ({
messages: get().messages.map((msg) =>
- msg.index === message.index ? message : msg
+ msg.index === message.index ? message : msg,
),
}));
},
@@ -41,7 +41,7 @@ export const useMessagesStore = create((set, get) => ({
try {
set((state) => {
const updatedMessages = state.messages.filter(
- (msg) => !ids.includes(msg.index)
+ (msg) => !ids.includes(msg.index),
);
get().setMessages(updatedMessages);
resolve(updatedMessages);
diff --git a/src/frontend/src/stores/shortcuts.ts b/src/frontend/src/stores/shortcuts.ts
index d792a0d6c..4925ef3c2 100644
--- a/src/frontend/src/stores/shortcuts.ts
+++ b/src/frontend/src/stores/shortcuts.ts
@@ -7,6 +7,8 @@ export const useShortcutsStore = create((set, get) => ({
setShortcuts: (newShortcuts) => {
set({ shortcuts: newShortcuts });
},
+ output: "o",
+ play: "p",
flow: "mod+b",
undo: "mod+z",
redo: "mod+y",
@@ -16,14 +18,14 @@ export const useShortcutsStore = create((set, get) => ({
code: "space",
copy: "mod+c",
duplicate: "mod+d",
- share: "mod+shift+s",
+ component: "mod+shift+s",
docs: "mod+shift+d",
save: "mod+s",
delete: "backspace",
group: "mod+g",
cut: "mod+x",
paste: "mod+v",
- api: "mod+shift+r",
+ api: "r",
update: "mod+u",
download: "mod+j",
freeze: "mod+f",
diff --git a/src/frontend/src/style/ag-theme-shadcn.css b/src/frontend/src/style/ag-theme-shadcn.css
index 3605d53b3..93e996493 100644
--- a/src/frontend/src/style/ag-theme-shadcn.css
+++ b/src/frontend/src/style/ag-theme-shadcn.css
@@ -1,7 +1,7 @@
/* set the background color of many elements across the grid */
.ag-theme-shadcn {
--ag-foreground-color: hsl(var(--foreground));
- --ag-background-color: hsl(var(--background));
+ --ag-background-color: hsl(var(--background));
--ag-secondary-foreground-color: hsl(var(--secondary-foreground));
--ag-data-color: hsl(var(--foreground));
--ag-header-foreground-color: hsl(var(--muted-foreground));
@@ -19,3 +19,47 @@
.ag-theme-shadcn .ag-paging-panel {
height: 3rem;
}
+
+.ag-row .ag-cell {
+ align-content: center !important;
+}
+.ag-cell {
+ line-height: 1.25rem;
+ padding-top: 0.675rem;
+ padding-bottom: 0.675rem;
+}
+
+.ag-body-horizontal-scroll-viewport,
+.ag-body-vertical-scroll-viewport {
+ cursor: auto;
+}
+
+.ag-body-horizontal-scroll-viewport::-webkit-scrollbar,
+.ag-body-vertical-scroll-viewport::-webkit-scrollbar {
+ width: 8px;
+ height: 8px;
+}
+
+.ag-body-horizontal-scroll-viewport::-webkit-scrollbar-track,
+.ag-body-vertical-scroll-viewport::-webkit-scrollbar-track {
+ background-color: hsl(var(--muted));
+}
+
+.ag-body-horizontal-scroll-viewport::-webkit-scrollbar-thumb,
+.ag-body-vertical-scroll-viewport::-webkit-scrollbar-thumb {
+ background-color: hsl(var(--border));
+ border-radius: 999px;
+}
+
+.ag-body-horizontal-scroll-viewport::-webkit-scrollbar-thumb:hover,
+.ag-body-vertical-scroll-viewport::-webkit-scrollbar-thumb:hover {
+ background-color: hsl(var(--ring));
+}
+
+.ag-paging-page-size {
+ display: none;
+}
+
+.ag-row {
+ cursor: pointer;
+}
diff --git a/src/frontend/src/style/applies.css b/src/frontend/src/style/applies.css
index f9b1b3278..fe51b6af4 100644
--- a/src/frontend/src/style/applies.css
+++ b/src/frontend/src/style/applies.css
@@ -291,7 +291,7 @@
}
.main-page-nav-button {
- @apply mr-2 w-4;
+ @apply w-4;
}
.main-page-description-text {
@@ -330,16 +330,16 @@
@apply grid w-full gap-4 p-4 md:grid-cols-2 lg:grid-cols-4;
}
.generic-node-div {
- @apply relative flex flex-col justify-center bg-background transition-all hover:shadow-node;
+ @apply relative flex flex-col justify-center bg-background transition-all;
}
.generic-node-div-title {
- @apply flex w-full items-center gap-2 border-b bg-muted p-4;
+ @apply flex w-full items-center gap-2 border-b bg-muted p-5;
}
.generic-node-title-arrangement {
@apply flex-max-width items-center truncate;
}
.generic-node-icon {
- @apply h-10 w-10 rounded p-1;
+ @apply h-8 w-8 rounded;
}
.generic-node-tooltip-div {
@apply ml-2 max-w-[220px] truncate;
@@ -801,10 +801,6 @@
@apply flex-max-width mt-2 h-full;
}
- .button-box-modal-div {
- @apply flex transform flex-col items-center justify-center rounded-lg border border-ring text-center shadow hover:scale-105 hover:shadow-lg;
- }
-
.dialog-header-modal-div {
@apply absolute left-0 top-2 z-50 hidden pl-4 pt-4 sm:block;
}
@@ -896,7 +892,7 @@
@apply mx-auto mt-4 flex h-12 w-12 flex-shrink-0 items-center justify-center rounded-full bg-almost-light-blue sm:mx-0 sm:h-10 sm:w-10;
}
.prompt-modal-icon {
- @apply h-6 w-6 text-almost-medium-blue;
+ @apply h-6 w-6 text-primary;
}
.prompt-modal-txtarea-arrangement {
@apply flex-max-width h-full flex-row items-center justify-center gap-4 overflow-auto bg-accent p-4;
diff --git a/src/frontend/src/style/classes.css b/src/frontend/src/style/classes.css
index b375d166e..55ab7a4cc 100644
--- a/src/frontend/src/style/classes.css
+++ b/src/frontend/src/style/classes.css
@@ -15,14 +15,6 @@ pre {
font-family: inherit;
}
-.ag-paging-page-size {
- display: none;
-}
-
-.ag-row {
- cursor: pointer;
-}
-
.react-flow__pane {
cursor: default;
}
@@ -64,16 +56,16 @@ select:-webkit-autofill:focus {
}
.ace_scrollbar::-webkit-scrollbar-track {
- background-color: #f1f1f1;
+ background-color: hsl(var(--muted));
}
.ace_scrollbar::-webkit-scrollbar-thumb {
- background-color: #ccc;
+ background-color: hsl(var(--border));
border-radius: 999px;
}
.ace_scrollbar::-webkit-scrollbar-thumb:hover {
- background-color: #bbb;
+ background-color: hsl(var(--ring));
border-radius: 999px;
}
@@ -105,11 +97,10 @@ select:-webkit-autofill:focus {
background-color: #141924 !important;
}
-.ag-row .ag-cell {
- align-content: center !important;
+.grabbing {
+ cursor: grabbing;
}
-.ag-cell {
- line-height: 1.25rem;
- padding-top: 0.675rem;
- padding-bottom: 0.675rem;
+
+.react-flow__node {
+ cursor: grab;
}
diff --git a/src/frontend/src/types/api/index.ts b/src/frontend/src/types/api/index.ts
index 4466bbe02..a228e9f29 100644
--- a/src/frontend/src/types/api/index.ts
+++ b/src/frontend/src/types/api/index.ts
@@ -187,7 +187,7 @@ export type VertexDataTypeAPI = {
inactive?: boolean;
timedelta?: number;
duration?: string;
- artifacts?: any;
+ artifacts?: any | ChatOutputType | ChatInputType;
message: ChatOutputType | ChatInputType;
};
diff --git a/src/frontend/src/types/components/index.ts b/src/frontend/src/types/components/index.ts
index 26c13411a..8fa1edb22 100644
--- a/src/frontend/src/types/components/index.ts
+++ b/src/frontend/src/types/components/index.ts
@@ -59,6 +59,7 @@ export type DropDownComponentType = {
children?: ReactNode;
};
export type ParameterComponentType = {
+ selected: boolean;
data: NodeDataType;
title: string;
conditionPath?: string | null;
@@ -509,7 +510,7 @@ export type ChatInputType = {
isDragging: boolean;
files: FilePreviewType[];
setFiles: (
- files: FilePreviewType[] | ((prev: FilePreviewType[]) => FilePreviewType[])
+ files: FilePreviewType[] | ((prev: FilePreviewType[]) => FilePreviewType[]),
) => void;
chatValue: string;
inputRef: {
@@ -565,6 +566,7 @@ export type nodeToolbarPropsType = {
onCloseAdvancedModal?: (close: boolean) => void;
selected: boolean;
setShowState: (show: boolean | SetStateAction) => void;
+ updateNode: () => void;
};
export type parsedDataType = {
@@ -611,7 +613,7 @@ export type chatMessagePropsType = {
updateChat: (
chat: ChatMessageType,
message: string,
- stream_url?: string
+ stream_url?: string,
) => void;
};
@@ -703,12 +705,12 @@ export type codeTabsPropsType = {
value: string,
node: NodeType,
template: InputFieldType,
- tweak: tweakType
+ tweak: tweakType,
) => string;
buildTweakObject?: (
tw: string,
changes: string | string[] | boolean | number | Object[] | Object,
- template: InputFieldType
+ template: InputFieldType,
) => Promise;
};
activeTweaks?: boolean;
diff --git a/src/frontend/src/types/store/index.ts b/src/frontend/src/types/store/index.ts
index 31eb985e9..54b7cb478 100644
--- a/src/frontend/src/types/store/index.ts
+++ b/src/frontend/src/types/store/index.ts
@@ -21,6 +21,8 @@ export type StoreComponentResponse = {
export type shortcutsStoreType = {
updateUniqueShortcut: (name: string, combination: string) => void;
+ output: string;
+ play: string;
flow: string;
group: string;
cut: string;
@@ -34,7 +36,7 @@ export type shortcutsStoreType = {
code: string;
copy: string;
duplicate: string;
- share: string;
+ component: string;
docs: string;
save: string;
delete: string;
@@ -46,7 +48,7 @@ export type shortcutsStoreType = {
shortcut: string;
}>;
setShortcuts: (
- newShortcuts: Array<{ name: string; shortcut: string }>
+ newShortcuts: Array<{ name: string; shortcut: string }>,
) => void;
getShortcutsFromStorage: () => void;
};
diff --git a/src/frontend/src/types/zustand/flow/index.ts b/src/frontend/src/types/zustand/flow/index.ts
index e8b88e8d3..7449f7bc1 100644
--- a/src/frontend/src/types/zustand/flow/index.ts
+++ b/src/frontend/src/types/zustand/flow/index.ts
@@ -86,7 +86,7 @@ export type FlowStoreType = {
state:
| FlowState
| undefined
- | ((oldState: FlowState | undefined) => FlowState)
+ | ((oldState: FlowState | undefined) => FlowState),
) => void;
nodes: Node[];
edges: Edge[];
@@ -94,11 +94,11 @@ export type FlowStoreType = {
onEdgesChange: OnEdgesChange;
setNodes: (
update: Node[] | ((oldState: Node[]) => Node[]),
- skipSave?: boolean
+ skipSave?: boolean,
) => void;
setEdges: (
update: Edge[] | ((oldState: Edge[]) => Edge[]),
- skipSave?: boolean
+ skipSave?: boolean,
) => void;
setNode: (id: string, update: Node | ((oldState: Node) => Node)) => void;
getNode: (id: string) => Node | undefined;
@@ -106,12 +106,12 @@ export type FlowStoreType = {
deleteEdge: (edgeId: string | Array) => void;
paste: (
selection: { nodes: any; edges: any },
- position: { x: number; y: number; paneX?: number; paneY?: number }
+ position: { x: number; y: number; paneX?: number; paneY?: number },
) => void;
lastCopiedSelection: { nodes: any; edges: any } | null;
setLastCopiedSelection: (
newSelection: { nodes: any; edges: any } | null,
- isCrop?: boolean
+ isCrop?: boolean,
) => void;
cleanFlow: () => void;
setFilterEdge: (newState) => void;
@@ -138,7 +138,7 @@ export type FlowStoreType = {
verticesLayers: VertexLayerElementType[][];
runId: string;
verticesToRun: string[];
- } | null
+ } | null,
) => void;
addToVerticesBuild: (vertices: string[]) => void;
removeFromVerticesBuild: (vertices: string[]) => void;
@@ -156,7 +156,7 @@ export type FlowStoreType = {
updateFlowPool: (
nodeId: string,
data: VertexBuildTypeAPI | ChatOutputType | ChatInputType,
- buildId?: string
+ buildId?: string,
) => void;
getNodePosition: (nodeId: string) => { x: number; y: number };
};
diff --git a/src/frontend/src/types/zustand/flowsManager/index.ts b/src/frontend/src/types/zustand/flowsManager/index.ts
index e0770626e..aaafebb7b 100644
--- a/src/frontend/src/types/zustand/flowsManager/index.ts
+++ b/src/frontend/src/types/zustand/flowsManager/index.ts
@@ -17,12 +17,12 @@ export type FlowsManagerStoreType = {
saveFlow: (flow: FlowType, silent?: boolean) => Promise | undefined;
saveFlowDebounce: (
flow: FlowType,
- silent?: boolean
+ silent?: boolean,
) => Promise | undefined;
autoSaveCurrentFlow: (
nodes: Node[],
edges: Edge[],
- viewport: Viewport
+ viewport: Viewport,
) => void;
uploadFlows: () => Promise;
uploadFlow: ({
@@ -41,13 +41,13 @@ export type FlowsManagerStoreType = {
flow?: FlowType,
override?: boolean,
position?: XYPosition,
- fromDragAndDrop?: boolean
+ fromDragAndDrop?: boolean,
) => Promise;
deleteComponent: (key: string) => Promise;
removeFlow: (id: string | string[]) => Promise;
saveComponent: (
component: any,
- override: boolean
+ override: boolean,
) => Promise;
undo: () => void;
redo: () => void;
diff --git a/src/frontend/src/types/zustand/globalVariables/index.ts b/src/frontend/src/types/zustand/globalVariables/index.ts
index 90817780f..4b178088c 100644
--- a/src/frontend/src/types/zustand/globalVariables/index.ts
+++ b/src/frontend/src/types/zustand/globalVariables/index.ts
@@ -21,7 +21,7 @@ export type GlobalVariablesStore = {
id: string,
type?: string,
default_fields?: string[],
- value?: string
+ value?: string,
) => void;
removeGlobalVariable: (name: string) => Promise;
getVariableId: (name: string) => string | undefined;
diff --git a/src/frontend/src/utils/buildUtils.ts b/src/frontend/src/utils/buildUtils.ts
index 8f008e149..0333954ed 100644
--- a/src/frontend/src/utils/buildUtils.ts
+++ b/src/frontend/src/utils/buildUtils.ts
@@ -17,7 +17,7 @@ type BuildVerticesParams = {
onBuildUpdate?: (
data: VertexBuildTypeAPI,
status: BuildStatus,
- buildId: string
+ buildId: string,
) => void; // Replace any with the actual type if it's not any
onBuildComplete?: (allNodesValid: boolean) => void;
onBuildError?: (title, list, idList: VertexLayerElementType[]) => void;
@@ -55,7 +55,7 @@ export async function updateVerticesOrder(
startNodeId?: string | null,
stopNodeId?: string | null,
nodes?: Node[],
- edges?: Edge[]
+ edges?: Edge[],
): Promise<{
verticesLayers: VertexLayerElementType[][];
verticesIds: string[];
@@ -71,7 +71,7 @@ export async function updateVerticesOrder(
startNodeId,
stopNodeId,
nodes,
- edges
+ edges,
);
} catch (error: any) {
setErrorData({
@@ -128,7 +128,7 @@ export async function buildVertices({
startNodeId,
stopNodeId,
nodes,
- edges
+ edges,
);
if (onValidateNodes) {
try {
@@ -191,14 +191,14 @@ export async function buildVertices({
onBuildUpdate(
getInactiveVertexData(element.id),
BuildStatus.INACTIVE,
- runId
+ runId,
);
}
if (element.reference) {
onBuildUpdate(
getInactiveVertexData(element.reference),
BuildStatus.INACTIVE,
- runId
+ runId,
);
}
buildResults.push(false);
@@ -224,7 +224,7 @@ export async function buildVertices({
if (stop) {
return;
}
- })
+ }),
);
// Once the current layer is built, move to the next layer
currentLayerIndex += 1;
@@ -269,7 +269,7 @@ async function buildVertex({
onBuildError!(
"Error Building Component",
buildData.data.logs.map((log) => log.message),
- verticesIds.map((id) => ({ id }))
+ verticesIds.map((id) => ({ id })),
);
stopBuild();
}
@@ -281,7 +281,7 @@ async function buildVertex({
onBuildError!(
"Error Building Component",
[(error as AxiosError).response?.data?.detail ?? "Unknown Error"],
- verticesIds.map((id) => ({ id }))
+ verticesIds.map((id) => ({ id })),
);
stopBuild();
}
diff --git a/src/frontend/src/utils/parameterUtils.ts b/src/frontend/src/utils/parameterUtils.ts
index a1d2f2154..d1d53dde7 100644
--- a/src/frontend/src/utils/parameterUtils.ts
+++ b/src/frontend/src/utils/parameterUtils.ts
@@ -21,7 +21,7 @@ export const handleUpdateValues = async (name: string, data: NodeDataType) => {
code,
template,
name,
- data.node?.template[name]?.value
+ data.node?.template[name]?.value,
);
if (res.status === 200 && data.node?.template) {
return res.data.template;
@@ -34,5 +34,5 @@ export const handleUpdateValues = async (name: string, data: NodeDataType) => {
export const debouncedHandleUpdateValues = debounce(
handleUpdateValues,
- SAVE_DEBOUNCE_TIME
+ SAVE_DEBOUNCE_TIME,
);
diff --git a/src/frontend/src/utils/storeUtils.ts b/src/frontend/src/utils/storeUtils.ts
index 637e4331a..c8391b211 100644
--- a/src/frontend/src/utils/storeUtils.ts
+++ b/src/frontend/src/utils/storeUtils.ts
@@ -7,7 +7,7 @@ export default function cloneFLowWithParent(
flow: FlowType,
parent: string,
is_component: boolean,
- keepId = false
+ keepId = false,
) {
let childFLow = cloneDeep(flow);
childFLow.parent = parent;
diff --git a/src/frontend/src/utils/styleUtils.ts b/src/frontend/src/utils/styleUtils.ts
index d9453641e..43e92bfe2 100644
--- a/src/frontend/src/utils/styleUtils.ts
+++ b/src/frontend/src/utils/styleUtils.ts
@@ -40,6 +40,7 @@ import {
Download,
DownloadCloud,
Edit,
+ Ellipsis,
Eraser,
ExternalLink,
Eye,
@@ -530,6 +531,7 @@ export const nodeIconsLucide: iconsType = {
ScreenShare,
Code,
Type,
+ Ellipsis,
Braces,
FlaskConical,
AlertCircle,
diff --git a/src/frontend/src/utils/utils.ts b/src/frontend/src/utils/utils.ts
index ac1d52d13..a03b37d25 100644
--- a/src/frontend/src/utils/utils.ts
+++ b/src/frontend/src/utils/utils.ts
@@ -56,7 +56,7 @@ export function normalCaseToSnakeCase(str: string): string {
export function toTitleCase(
str: string | undefined,
- isNodeField?: boolean
+ isNodeField?: boolean,
): string {
if (!str) return "";
let result = str
@@ -65,7 +65,7 @@ export function toTitleCase(
if (isNodeField) return word;
if (index === 0) {
return checkUpperWords(
- word[0].toUpperCase() + word.slice(1).toLowerCase()
+ word[0].toUpperCase() + word.slice(1).toLowerCase(),
);
}
return checkUpperWords(word.toLowerCase());
@@ -78,7 +78,7 @@ export function toTitleCase(
if (isNodeField) return word;
if (index === 0) {
return checkUpperWords(
- word[0].toUpperCase() + word.slice(1).toLowerCase()
+ word[0].toUpperCase() + word.slice(1).toLowerCase(),
);
}
return checkUpperWords(word.toLowerCase());
@@ -182,7 +182,7 @@ export function checkLocalStorageKey(key: string): boolean {
export function IncrementObjectKey(
object: object,
- key: string
+ key: string,
): { newKey: string; increment: number } {
let count = 1;
const type = removeCountFromString(key);
@@ -217,7 +217,7 @@ export function groupByFamily(
data: APIDataType,
baseClasses: string,
left: boolean,
- flow?: NodeType[]
+ flow?: NodeType[],
): groupedObjType[] {
const baseClassesSet = new Set(baseClasses.split("\n"));
let arrOfPossibleInputs: Array<{
@@ -243,7 +243,7 @@ export function groupByFamily(
baseClassesSet.has(template.type)) ||
(template.input_types &&
template.input_types.some((inputType) =>
- baseClassesSet.has(inputType)
+ baseClassesSet.has(inputType),
)))
);
};
@@ -263,7 +263,7 @@ export function groupByFamily(
hasBaseClassInBaseClasses:
foundNode?.hasBaseClassInBaseClasses ||
nodeData.node!.base_classes?.some((baseClass) =>
- baseClassesSet.has(baseClass)
+ baseClassesSet.has(baseClass),
), //seta como anterior ou verifica se o node tem base class
displayName: nodeData.node?.display_name,
});
@@ -280,10 +280,10 @@ export function groupByFamily(
if (!foundNode) {
foundNode = {
hasBaseClassInTemplate: Object.values(node!.template).some(
- checkBaseClass
+ checkBaseClass,
),
hasBaseClassInBaseClasses: node!.base_classes?.some((baseClass) =>
- baseClassesSet.has(baseClass)
+ baseClassesSet.has(baseClass),
),
displayName: node?.display_name,
};
@@ -355,7 +355,7 @@ export function isTimeStampString(str: string): boolean {
export function extractColumnsFromRows(
rows: object[],
mode: "intersection" | "union",
- excludeColumns?: Array
+ excludeColumns?: Array,
): (ColDef | ColGroupDef)[] {
let columnsKeys: { [key: string]: ColDef | ColGroupDef } = {};
if (rows.length === 0) {
diff --git a/src/frontend/tailwind.config.js b/src/frontend/tailwind.config.js
index 11e9c9d25..a97e4cec0 100644
--- a/src/frontend/tailwind.config.js
+++ b/src/frontend/tailwind.config.js
@@ -53,7 +53,6 @@ module.exports = {
connection: "var(--connection)",
"almost-dark-gray": "var(--almost-dark-gray)",
"almost-light-blue": "var(--almost-light-blue)",
- "almost-medium-blue": "var(--almost-medium-blue)",
"almost-medium-gray": "var(--almost-medium-gray)",
"almost-medium-green": "var(--almost-medium-green)",
"almost-medium-red": "var(--almost-medium-red)",
@@ -213,14 +212,14 @@ module.exports = {
height: "8px",
},
"&::-webkit-scrollbar-track": {
- backgroundColor: "#f1f1f1",
+ backgroundColor: "hsl(var(--muted))",
},
"&::-webkit-scrollbar-thumb": {
- backgroundColor: "#ccc",
+ backgroundColor: "hsl(var(--border))",
borderRadius: "999px",
},
"&::-webkit-scrollbar-thumb:hover": {
- backgroundColor: "#bbb",
+ backgroundColor: "hsl(var(--ring))",
},
cursor: "auto",
},
diff --git a/src/frontend/tests/end-to-end/actionsMainPage.spec.ts b/src/frontend/tests/end-to-end/actionsMainPage.spec.ts
index e2635cf57..9ebc39753 100644
--- a/src/frontend/tests/end-to-end/actionsMainPage.spec.ts
+++ b/src/frontend/tests/end-to-end/actionsMainPage.spec.ts
@@ -153,6 +153,8 @@ test("user should be able to download a flow or a component", async ({
await page.getByRole("heading", { name: "Basic Prompting" }).click();
await page.getByText("Chat Input", { exact: true }).click();
+ await page.getByTestId("more-options-modal").click();
+
await page.getByTestId("icon-SaveAll").first().click();
await page.waitForTimeout(3000);
@@ -223,6 +225,8 @@ test("user should be able to duplicate a flow or a component", async ({
await page.getByRole("heading", { name: "Basic Prompting" }).click();
await page.getByText("Chat Input", { exact: true }).click();
+ await page.getByTestId("more-options-modal").click();
+
await page.getByTestId("icon-SaveAll").first().click();
await page.waitForTimeout(3000);
diff --git a/src/frontend/tests/end-to-end/chatInputOutput.spec.ts b/src/frontend/tests/end-to-end/chatInputOutput.spec.ts
index a1429ddec..66044f25f 100644
--- a/src/frontend/tests/end-to-end/chatInputOutput.spec.ts
+++ b/src/frontend/tests/end-to-end/chatInputOutput.spec.ts
@@ -24,7 +24,7 @@ test("chat_io_teste", async ({ page }) => {
const jsonContent = readFileSync(
"src/frontend/tests/end-to-end/assets/ChatTest.json",
- "utf-8"
+ "utf-8",
);
await page.getByTestId("blank-flow").click();
@@ -47,7 +47,7 @@ test("chat_io_teste", async ({ page }) => {
"drop",
{
dataTransfer,
- }
+ },
);
await page.getByLabel("fit view").click();
await page.getByText("Playground", { exact: true }).click();
diff --git a/src/frontend/tests/end-to-end/chatInputOutputUser.spec.ts b/src/frontend/tests/end-to-end/chatInputOutputUser.spec.ts
index c3e24018a..178c5cbfe 100644
--- a/src/frontend/tests/end-to-end/chatInputOutputUser.spec.ts
+++ b/src/frontend/tests/end-to-end/chatInputOutputUser.spec.ts
@@ -52,13 +52,11 @@ test("user must interact with chat with Input/Output", async ({ page }) => {
expect(valueUser).toBe("User");
expect(valueAI).toBe("AI");
- await page.keyboard.press("Escape");
-
await page
.getByTestId("textarea-input_value")
.nth(1)
.fill(
- "testtesttesttesttesttestte;.;.,;,.;,.;.,;,..,;;;;;;;;;;;;;;;;;;;;;,;.;,.;,.,;.,;.;.,~~çççççççççççççççççççççççççççççççççççççççisdajfdasiopjfaodisjhvoicxjiovjcxizopjviopasjioasfhjaiohf23432432432423423sttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttestççççççççççççççççççççççççççççççççç,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,!"
+ "testtesttesttesttesttestte;.;.,;,.;,.;.,;,..,;;;;;;;;;;;;;;;;;;;;;,;.;,.;,.,;.,;.;.,~~çççççççççççççççççççççççççççççççççççççççisdajfdasiopjfaodisjhvoicxjiovjcxizopjviopasjioasfhjaiohf23432432432423423sttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttestççççççççççççççççççççççççççççççççç,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,!",
);
await page.getByTestId("icon-LucideSend").click();
await page.getByText("Close", { exact: true }).click();
@@ -89,9 +87,9 @@ test("user must interact with chat with Input/Output", async ({ page }) => {
await page
.getByText(
"testtesttesttesttesttestte;.;.,;,.;,.;.,;,..,;;;;;;;;;;;;;;;;;;;;;,;.;,.;,.,;.,;.;.,~~çççççççççççççççççççççççççççççççççççççççisdajfdasiopjfaodisjhvoicxjiovjcxizopjviopasjioasfhjaiohf23432432432423423sttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttestççççççççççççççççççççççççççççççççç,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,!",
- { exact: true }
+ { exact: true },
)
- .isVisible()
+ .isVisible(),
);
});
@@ -195,17 +193,13 @@ test("user must be able to send an image on chat", async ({ page }) => {
await page.getByText("Chat Input", { exact: true }).click();
await page.getByTestId("more-options-modal").click();
await page.getByTestId("edit-button-modal").click();
- await page.getByTestId("toggle-edit-return_record").click();
- expect(
- await page.getByTestId("toggle-edit-return_record").isChecked()
- ).toBeTruthy();
await page.getByText("Save Changes").click();
await page.getByText("Playground", { exact: true }).click();
const jsonContent = readFileSync(
"src/frontend/tests/end-to-end/assets/chain.png",
- "utf-8"
+ "utf-8",
);
// Create the DataTransfer and File
diff --git a/src/frontend/tests/end-to-end/curl_api_generation.spec.ts b/src/frontend/tests/end-to-end/curl_api_generation.spec.ts
index 406ecf268..396962afe 100644
--- a/src/frontend/tests/end-to-end/curl_api_generation.spec.ts
+++ b/src/frontend/tests/end-to-end/curl_api_generation.spec.ts
@@ -21,9 +21,9 @@ test("curl_api_generation", async ({ page, context }) => {
await page.waitForTimeout(2000);
await page.getByText("API", { exact: true }).click();
await page.getByRole("tab", { name: "cURL" }).click();
- await page.getByRole("button", { name: "Copy Code" }).click();
+ await page.getByTestId("icon-Copy").last().click();
const handle = await page.evaluateHandle(() =>
- navigator.clipboard.readText()
+ navigator.clipboard.readText(),
);
const clipboardContent = await handle.jsonValue();
expect(clipboardContent.length).toBeGreaterThan(0);
diff --git a/src/frontend/tests/end-to-end/dragAndDrop.spec.ts b/src/frontend/tests/end-to-end/dragAndDrop.spec.ts
index 3e760901d..03d11aaf7 100644
--- a/src/frontend/tests/end-to-end/dragAndDrop.spec.ts
+++ b/src/frontend/tests/end-to-end/dragAndDrop.spec.ts
@@ -27,7 +27,7 @@ test.describe("drag and drop test", () => {
// Read your file into a buffer.
const jsonContent = readFileSync(
"src/frontend/tests/end-to-end/assets/collection.json",
- "utf-8"
+ "utf-8",
);
// Create the DataTransfer and File
@@ -47,7 +47,7 @@ test.describe("drag and drop test", () => {
"drop",
{
dataTransfer,
- }
+ },
);
const genericNoda = page.getByTestId("div-generic-node");
diff --git a/src/frontend/tests/end-to-end/dropdownComponent.spec.ts b/src/frontend/tests/end-to-end/dropdownComponent.spec.ts
index 0152ca7ed..6c0a7dd9e 100644
--- a/src/frontend/tests/end-to-end/dropdownComponent.spec.ts
+++ b/src/frontend/tests/end-to-end/dropdownComponent.spec.ts
@@ -80,32 +80,32 @@ test("dropDownComponent", async ({ page }) => {
await page.locator('//*[@id="showcredentials_profile_name"]').click();
expect(
- await page.locator('//*[@id="showcredentials_profile_name"]').isChecked()
+ await page.locator('//*[@id="showcredentials_profile_name"]').isChecked(),
).toBeFalsy();
await page.locator('//*[@id="showcredentials_profile_name"]').click();
expect(
- await page.locator('//*[@id="showcredentials_profile_name"]').isChecked()
+ await page.locator('//*[@id="showcredentials_profile_name"]').isChecked(),
).toBeTruthy();
await page.locator('//*[@id="showendpoint_url"]').click();
expect(
- await page.locator('//*[@id="showendpoint_url"]').isChecked()
+ await page.locator('//*[@id="showendpoint_url"]').isChecked(),
).toBeFalsy();
await page.locator('//*[@id="showendpoint_url"]').click();
expect(
- await page.locator('//*[@id="showendpoint_url"]').isChecked()
+ await page.locator('//*[@id="showendpoint_url"]').isChecked(),
).toBeTruthy();
await page.locator('//*[@id="showregion_name"]').click();
expect(
- await page.locator('//*[@id="showregion_name"]').isChecked()
+ await page.locator('//*[@id="showregion_name"]').isChecked(),
).toBeFalsy();
await page.locator('//*[@id="showregion_name"]').click();
expect(
- await page.locator('//*[@id="showregion_name"]').isChecked()
+ await page.locator('//*[@id="showregion_name"]').isChecked(),
).toBeTruthy();
// showmodel_id
@@ -115,7 +115,7 @@ test("dropDownComponent", async ({ page }) => {
// showmodel_id
await page.locator('//*[@id="showmodel_id"]').click();
expect(
- await page.locator('//*[@id="showmodel_id"]').isChecked()
+ await page.locator('//*[@id="showmodel_id"]').isChecked(),
).toBeTruthy();
await page.locator('//*[@id="showcache"]').click();
@@ -126,32 +126,32 @@ test("dropDownComponent", async ({ page }) => {
await page.locator('//*[@id="showcredentials_profile_name"]').click();
expect(
- await page.locator('//*[@id="showcredentials_profile_name"]').isChecked()
+ await page.locator('//*[@id="showcredentials_profile_name"]').isChecked(),
).toBeFalsy();
await page.locator('//*[@id="showcredentials_profile_name"]').click();
expect(
- await page.locator('//*[@id="showcredentials_profile_name"]').isChecked()
+ await page.locator('//*[@id="showcredentials_profile_name"]').isChecked(),
).toBeTruthy();
await page.locator('//*[@id="showendpoint_url"]').click();
expect(
- await page.locator('//*[@id="showendpoint_url"]').isChecked()
+ await page.locator('//*[@id="showendpoint_url"]').isChecked(),
).toBeFalsy();
await page.locator('//*[@id="showendpoint_url"]').click();
expect(
- await page.locator('//*[@id="showendpoint_url"]').isChecked()
+ await page.locator('//*[@id="showendpoint_url"]').isChecked(),
).toBeTruthy();
await page.locator('//*[@id="showregion_name"]').click();
expect(
- await page.locator('//*[@id="showregion_name"]').isChecked()
+ await page.locator('//*[@id="showregion_name"]').isChecked(),
).toBeFalsy();
await page.locator('//*[@id="showregion_name"]').click();
expect(
- await page.locator('//*[@id="showregion_name"]').isChecked()
+ await page.locator('//*[@id="showregion_name"]').isChecked(),
).toBeTruthy();
// showmodel_id
@@ -161,7 +161,7 @@ test("dropDownComponent", async ({ page }) => {
// showmodel_id
await page.locator('//*[@id="showmodel_id"]').click();
expect(
- await page.locator('//*[@id="showmodel_id"]').isChecked()
+ await page.locator('//*[@id="showmodel_id"]').isChecked(),
).toBeTruthy();
await page.getByTestId("dropdown-edit-model_id").click();
diff --git a/src/frontend/tests/end-to-end/fileUploadComponent.spec.ts b/src/frontend/tests/end-to-end/fileUploadComponent.spec.ts
index 93b471c43..00f761dea 100644
--- a/src/frontend/tests/end-to-end/fileUploadComponent.spec.ts
+++ b/src/frontend/tests/end-to-end/fileUploadComponent.spec.ts
@@ -64,7 +64,7 @@ test("dropDownComponent", async ({ page }) => {
// Click and hold on the first element
await page
.locator(
- '//*[@id="react-flow-id"]/div/div[1]/div[1]/div/div[2]/div[1]/div/div[2]/div[6]/button/div/div'
+ '//*[@id="react-flow-id"]/div/div[1]/div[1]/div/div[2]/div[1]/div/div[2]/div[6]/button/div/div',
)
.hover();
await page.mouse.down();
@@ -72,7 +72,7 @@ test("dropDownComponent", async ({ page }) => {
// Move to the second element
await page
.locator(
- '//*[@id="react-flow-id"]/div/div[1]/div[1]/div/div[2]/div[2]/div/div[2]/div[3]/div/button/div/div'
+ '//*[@id="react-flow-id"]/div/div[1]/div[1]/div/div[2]/div[2]/div/div[2]/div[3]/div/button/div/div',
)
.hover();
diff --git a/src/frontend/tests/end-to-end/filterEdge.spec.ts b/src/frontend/tests/end-to-end/filterEdge.spec.ts
index 9cb5a567e..7edbc0436 100644
--- a/src/frontend/tests/end-to-end/filterEdge.spec.ts
+++ b/src/frontend/tests/end-to-end/filterEdge.spec.ts
@@ -40,7 +40,7 @@ test("LLMChain - Tooltip", async ({ page }) => {
await page
.locator(
- '//*[@id="react-flow-id"]/div[1]/div[1]/div/div/div[2]/div/div/div[2]/div[3]/div/button/div/div'
+ '//*[@id="react-flow-id"]/div[1]/div[1]/div/div/div[2]/div/div/div[2]/div[3]/div/button/div/div',
)
.hover()
.then(async () => {
@@ -60,17 +60,17 @@ test("LLMChain - Tooltip", async ({ page }) => {
await page.getByTitle("zoom out").click();
await page
.locator(
- '//*[@id="react-flow-id"]/div[1]/div[1]/div/div/div[2]/div/div/div[2]/div[4]/div/button/div/div'
+ '//*[@id="react-flow-id"]/div[1]/div[1]/div/div/div[2]/div/div/div[2]/div[4]/div/button/div/div',
)
.hover()
.then(async () => {
await expect(
- page.getByTestId("tooltip-Model Specs").first()
+ page.getByTestId("tooltip-Model Specs").first(),
).toBeVisible();
await page.waitForTimeout(2000);
await expect(
- page.getByTestId("tooltip-Model Specs").first()
+ page.getByTestId("tooltip-Model Specs").first(),
).toBeVisible();
await page.getByTestId("icon-Search").click();
@@ -81,12 +81,12 @@ test("LLMChain - Tooltip", async ({ page }) => {
await page
.locator(
- '//*[@id="react-flow-id"]/div[1]/div[1]/div/div/div[2]/div/div/div[2]/div[5]/div/button/div/div'
+ '//*[@id="react-flow-id"]/div[1]/div[1]/div/div/div[2]/div/div/div[2]/div[5]/div/button/div/div',
)
.hover()
.then(async () => {
await expect(
- page.getByTestId("empty-tooltip-filter").first()
+ page.getByTestId("empty-tooltip-filter").first(),
).toBeVisible();
});
});
@@ -113,7 +113,7 @@ test("LLMChain - Filter", async ({ page }) => {
await page.waitForTimeout(1000);
await page.getByTestId(
- "input-list-plus-btn-edit_metadata_indexing_include-2"
+ "input-list-plus-btn-edit_metadata_indexing_include-2",
);
await page.getByTestId("blank-flow").click();
@@ -136,7 +136,7 @@ test("LLMChain - Filter", async ({ page }) => {
await page
.locator(
- '//*[@id="react-flow-id"]/div/div[1]/div[1]/div/div[2]/div/div/div[2]/div[4]/div/button/div/div'
+ '//*[@id="react-flow-id"]/div/div[1]/div[1]/div/div[2]/div/div/div[2]/div[4]/div/button/div/div',
)
.click();
@@ -149,14 +149,14 @@ test("LLMChain - Filter", async ({ page }) => {
await expect(page.getByTestId("model_specsChatOpenAI")).toBeVisible();
await expect(page.getByTestId("model_specsChatVertexAI")).toBeVisible();
await expect(
- page.getByTestId("model_specsGoogle Generative AI")
+ page.getByTestId("model_specsGoogle Generative AI"),
).toBeVisible();
await expect(
- page.getByTestId("model_specsHugging Face Inference API")
+ page.getByTestId("model_specsHugging Face Inference API"),
).toBeVisible();
await expect(page.getByTestId("model_specsOllama")).toBeVisible();
await expect(
- page.getByTestId("model_specsQianfanChatEndpoint")
+ page.getByTestId("model_specsQianfanChatEndpoint"),
).toBeVisible();
await expect(page.getByTestId("model_specsQianfanLLMEndpoint")).toBeVisible();
await expect(page.getByTestId("model_specsVertexAI")).toBeVisible();
@@ -168,7 +168,7 @@ test("LLMChain - Filter", async ({ page }) => {
await expect(page.getByTestId("model_specsAmazon Bedrock")).not.toBeVisible();
await expect(page.getByTestId("modelsAzure OpenAI")).not.toBeVisible();
await expect(
- page.getByTestId("model_specsAzureChatOpenAI")
+ page.getByTestId("model_specsAzureChatOpenAI"),
).not.toBeVisible();
await expect(page.getByTestId("model_specsChatAnthropic")).not.toBeVisible();
await expect(page.getByTestId("model_specsChatLiteLLM")).not.toBeVisible();
@@ -178,13 +178,13 @@ test("LLMChain - Filter", async ({ page }) => {
await page
.locator(
- '//*[@id="react-flow-id"]/div/div[1]/div[1]/div/div[2]/div/div/div[2]/div[7]/button/div/div'
+ '//*[@id="react-flow-id"]/div/div[1]/div[1]/div/div[2]/div/div/div[2]/div[7]/button/div/div',
)
.click();
await page
.locator(
- '//*[@id="react-flow-id"]/div/div[1]/div[1]/div/div[2]/div/div/div[2]/div[7]/button/div/div'
+ '//*[@id="react-flow-id"]/div/div[1]/div[1]/div/div[2]/div/div/div[2]/div[7]/button/div/div',
)
.click();
diff --git a/src/frontend/tests/end-to-end/floatComponent.spec.ts b/src/frontend/tests/end-to-end/floatComponent.spec.ts
index dfac6ec1b..581d426c0 100644
--- a/src/frontend/tests/end-to-end/floatComponent.spec.ts
+++ b/src/frontend/tests/end-to-end/floatComponent.spec.ts
@@ -71,32 +71,37 @@ test("FloatComponent", async ({ page }) => {
await page.getByTestId("showmirostat").click();
expect(
- await page.locator('//*[@id="showmirostat"]').isChecked()
+ await page.locator('//*[@id="showmirostat"]').isChecked(),
).toBeTruthy();
await page.getByTestId("showmirostat_eta").click();
expect(
- await page.locator('//*[@id="showmirostat"]').isChecked()
+ await page.locator('//*[@id="showmirostat"]').isChecked(),
).toBeTruthy();
await page.getByTestId("showmirostat_eta").click();
expect(
- await page.locator('//*[@id="showmirostat_eta"]').isChecked()
+ await page.locator('//*[@id="showmirostat"]').isChecked(),
).toBeTruthy();
await page.getByTestId("showmirostat_eta").click();
expect(
- await page.locator('//*[@id="showmirostat_eta"]').isChecked()
+ await page.locator('//*[@id="showmirostat_eta"]').isChecked(),
+ ).toBeTruthy();
+
+ await page.getByTestId("showmirostat_eta").click();
+ expect(
+ await page.locator('//*[@id="showmirostat_eta"]').isChecked(),
).toBeFalsy();
await page.getByTestId("showmirostat_tau").click();
expect(
- await page.locator('//*[@id="showmirostat_tau"]').isChecked()
+ await page.locator('//*[@id="showmirostat_tau"]').isChecked(),
).toBeTruthy();
await page.getByTestId("showmirostat_tau").click();
expect(
- await page.locator('//*[@id="showmirostat_tau"]').isChecked()
+ await page.locator('//*[@id="showmirostat_tau"]').isChecked(),
).toBeFalsy();
await page.getByTestId("showmodel").click();
@@ -119,22 +124,22 @@ test("FloatComponent", async ({ page }) => {
await page.getByTestId("shownum_thread").click();
expect(
- await page.locator('//*[@id="shownum_thread"]').isChecked()
+ await page.locator('//*[@id="shownum_thread"]').isChecked(),
).toBeTruthy();
await page.getByTestId("shownum_thread").click();
expect(
- await page.locator('//*[@id="shownum_thread"]').isChecked()
+ await page.locator('//*[@id="shownum_thread"]').isChecked(),
).toBeFalsy();
await page.getByTestId("showrepeat_last_n").click();
expect(
- await page.locator('//*[@id="showrepeat_last_n"]').isChecked()
+ await page.locator('//*[@id="showrepeat_last_n"]').isChecked(),
).toBeTruthy();
await page.getByTestId("showrepeat_last_n").click();
expect(
- await page.locator('//*[@id="showrepeat_last_n"]').isChecked()
+ await page.locator('//*[@id="showrepeat_last_n"]').isChecked(),
).toBeFalsy();
await page.getByText("Save Changes", { exact: true }).click();
@@ -150,7 +155,7 @@ test("FloatComponent", async ({ page }) => {
// showtemperature
await page.locator('//*[@id="showtemperature"]').click();
expect(
- await page.locator('//*[@id="showtemperature"]').isChecked()
+ await page.locator('//*[@id="showtemperature"]').isChecked(),
).toBeTruthy();
await page.getByText("Save Changes", { exact: true }).click();
diff --git a/src/frontend/tests/end-to-end/flowSettings.spec.ts b/src/frontend/tests/end-to-end/flowSettings.spec.ts
index a2e9f25c0..25807ed88 100644
--- a/src/frontend/tests/end-to-end/flowSettings.spec.ts
+++ b/src/frontend/tests/end-to-end/flowSettings.spec.ts
@@ -29,7 +29,7 @@ test("flowSettings", async ({ page }) => {
await page
.getByPlaceholder("Flow name")
.fill(
- "Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test"
+ "Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test",
);
await page.getByText("Character limit reached").isVisible();
@@ -41,7 +41,7 @@ test("flowSettings", async ({ page }) => {
await page
.getByPlaceholder("Flow description")
.fill(
- "Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test"
+ "Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test Flow Name Test",
);
await page.getByTestId("save-flow-settings").click();
diff --git a/src/frontend/tests/end-to-end/folders.spec.ts b/src/frontend/tests/end-to-end/folders.spec.ts
index 70bdf6bca..99ed07669 100644
--- a/src/frontend/tests/end-to-end/folders.spec.ts
+++ b/src/frontend/tests/end-to-end/folders.spec.ts
@@ -58,7 +58,7 @@ test("add folder by drag and drop", async ({ page }) => {
const jsonContent = readFileSync(
"src/frontend/tests/end-to-end/assets/collection.json",
- "utf-8"
+ "utf-8",
);
// Create the DataTransfer and File
@@ -78,7 +78,7 @@ test("add folder by drag and drop", async ({ page }) => {
"drop",
{
dataTransfer,
- }
+ },
);
await page.getByText("Getting Started").first().isVisible();
diff --git a/src/frontend/tests/end-to-end/inputComponent.spec.ts b/src/frontend/tests/end-to-end/inputComponent.spec.ts
index d944cffe5..3e6936b43 100644
--- a/src/frontend/tests/end-to-end/inputComponent.spec.ts
+++ b/src/frontend/tests/end-to-end/inputComponent.spec.ts
@@ -60,69 +60,69 @@ test("InputComponent", async ({ page }) => {
expect(
await page
.locator('//*[@id="showchroma_server_cors_allow_origins"]')
- .isChecked()
+ .isChecked(),
).toBeTruthy();
await page.locator('//*[@id="showchroma_server_grpc_port"]').click();
expect(
- await page.locator('//*[@id="showchroma_server_grpc_port"]').isChecked()
+ await page.locator('//*[@id="showchroma_server_grpc_port"]').isChecked(),
).toBeTruthy();
await page.locator('//*[@id="showchroma_server_host"]').click();
expect(
- await page.locator('//*[@id="showchroma_server_host"]').isChecked()
+ await page.locator('//*[@id="showchroma_server_host"]').isChecked(),
).toBeTruthy();
await page.locator('//*[@id="showchroma_server_http_port"]').click();
expect(
- await page.locator('//*[@id="showchroma_server_http_port"]').isChecked()
+ await page.locator('//*[@id="showchroma_server_http_port"]').isChecked(),
).toBeTruthy();
await page.locator('//*[@id="showchroma_server_ssl_enabled"]').click();
expect(
- await page.locator('//*[@id="showchroma_server_ssl_enabled"]').isChecked()
+ await page.locator('//*[@id="showchroma_server_ssl_enabled"]').isChecked(),
).toBeTruthy();
await page.locator('//*[@id="showcollection_name"]').click();
expect(
- await page.locator('//*[@id="showcollection_name"]').isChecked()
+ await page.locator('//*[@id="showcollection_name"]').isChecked(),
).toBeFalsy();
await page.locator('//*[@id="showindex_directory"]').click();
expect(
- await page.locator('//*[@id="showindex_directory"]').isChecked()
+ await page.locator('//*[@id="showindex_directory"]').isChecked(),
).toBeFalsy();
await page.locator('//*[@id="showchroma_server_cors_allow_origins"]').click();
expect(
await page
.locator('//*[@id="showchroma_server_cors_allow_origins"]')
- .isChecked()
+ .isChecked(),
).toBeFalsy();
await page.locator('//*[@id="showchroma_server_grpc_port"]').click();
expect(
- await page.locator('//*[@id="showchroma_server_grpc_port"]').isChecked()
+ await page.locator('//*[@id="showchroma_server_grpc_port"]').isChecked(),
).toBeFalsy();
await page.locator('//*[@id="showchroma_server_host"]').click();
expect(
- await page.locator('//*[@id="showchroma_server_host"]').isChecked()
+ await page.locator('//*[@id="showchroma_server_host"]').isChecked(),
).toBeFalsy();
await page.locator('//*[@id="showchroma_server_http_port"]').click();
expect(
- await page.locator('//*[@id="showchroma_server_http_port"]').isChecked()
+ await page.locator('//*[@id="showchroma_server_http_port"]').isChecked(),
).toBeFalsy();
await page.locator('//*[@id="showchroma_server_ssl_enabled"]').click();
expect(
- await page.locator('//*[@id="showchroma_server_ssl_enabled"]').isChecked()
+ await page.locator('//*[@id="showchroma_server_ssl_enabled"]').isChecked(),
).toBeFalsy();
await page.locator('//*[@id="showindex_directory"]').click();
expect(
- await page.locator('//*[@id="showindex_directory"]').isChecked()
+ await page.locator('//*[@id="showindex_directory"]').isChecked(),
).toBeTruthy();
let valueEditNode = await page
@@ -152,7 +152,7 @@ test("InputComponent", async ({ page }) => {
await page.locator('//*[@id="showcollection_name"]').click();
expect(
- await page.locator('//*[@id="showcollection_name"]').isChecked()
+ await page.locator('//*[@id="showcollection_name"]').isChecked(),
).toBeTruthy();
await page.getByText("Save Changes", { exact: true }).click();
diff --git a/src/frontend/tests/end-to-end/intComponent.spec.ts b/src/frontend/tests/end-to-end/intComponent.spec.ts
index 9b4ed14e2..aa54ac5b4 100644
--- a/src/frontend/tests/end-to-end/intComponent.spec.ts
+++ b/src/frontend/tests/end-to-end/intComponent.spec.ts
@@ -87,77 +87,77 @@ test("IntComponent", async ({ page }) => {
await page.locator('//*[@id="showmodel_kwargs"]').click();
expect(
- await page.locator('//*[@id="showmodel_kwargs"]').isChecked()
+ await page.locator('//*[@id="showmodel_kwargs"]').isChecked(),
).toBeTruthy();
await page.locator('//*[@id="showmodel_name"]').click();
expect(
- await page.locator('//*[@id="showmodel_name"]').isChecked()
+ await page.locator('//*[@id="showmodel_name"]').isChecked(),
).toBeFalsy();
await page.locator('//*[@id="showopenai_api_base"]').click();
expect(
- await page.locator('//*[@id="showopenai_api_base"]').isChecked()
- ).toBeFalsy();
+ await page.locator('//*[@id="showopenai_api_base"]').isChecked(),
+ ).toBeTruthy();
await page.locator('//*[@id="showopenai_api_key"]').click();
expect(
- await page.locator('//*[@id="showopenai_api_key"]').isChecked()
+ await page.locator('//*[@id="showopenai_api_key"]').isChecked(),
).toBeFalsy();
await page.locator('//*[@id="showtemperature"]').click();
expect(
- await page.locator('//*[@id="showtemperature"]').isChecked()
+ await page.locator('//*[@id="showtemperature"]').isChecked(),
).toBeFalsy();
await page.locator('//*[@id="showmodel_kwargs"]').click();
expect(
- await page.locator('//*[@id="showmodel_kwargs"]').isChecked()
+ await page.locator('//*[@id="showmodel_kwargs"]').isChecked(),
).toBeFalsy();
await page.locator('//*[@id="showmodel_name"]').click();
expect(
- await page.locator('//*[@id="showmodel_name"]').isChecked()
+ await page.locator('//*[@id="showmodel_name"]').isChecked(),
).toBeTruthy();
await page.locator('//*[@id="showopenai_api_base"]').click();
expect(
- await page.locator('//*[@id="showopenai_api_base"]').isChecked()
- ).toBeTruthy();
+ await page.locator('//*[@id="showopenai_api_base"]').isChecked(),
+ ).toBeFalsy();
await page.locator('//*[@id="showopenai_api_key"]').click();
expect(
- await page.locator('//*[@id="showopenai_api_key"]').isChecked()
+ await page.locator('//*[@id="showopenai_api_key"]').isChecked(),
).toBeTruthy();
await page.locator('//*[@id="showtemperature"]').click();
expect(
- await page.locator('//*[@id="showtemperature"]').isChecked()
+ await page.locator('//*[@id="showtemperature"]').isChecked(),
).toBeTruthy();
await page.locator('//*[@id="showmodel_kwargs"]').click();
expect(
- await page.locator('//*[@id="showmodel_kwargs"]').isChecked()
+ await page.locator('//*[@id="showmodel_kwargs"]').isChecked(),
).toBeTruthy();
await page.locator('//*[@id="showmodel_name"]').click();
expect(
- await page.locator('//*[@id="showmodel_name"]').isChecked()
+ await page.locator('//*[@id="showmodel_name"]').isChecked(),
).toBeFalsy();
await page.locator('//*[@id="showopenai_api_base"]').click();
expect(
- await page.locator('//*[@id="showopenai_api_base"]').isChecked()
- ).toBeFalsy();
+ await page.locator('//*[@id="showopenai_api_base"]').isChecked(),
+ ).toBeTruthy();
await page.locator('//*[@id="showopenai_api_key"]').click();
expect(
- await page.locator('//*[@id="showopenai_api_key"]').isChecked()
+ await page.locator('//*[@id="showopenai_api_key"]').isChecked(),
).toBeFalsy();
await page.locator('//*[@id="showtemperature"]').click();
expect(
- await page.locator('//*[@id="showtemperature"]').isChecked()
+ await page.locator('//*[@id="showtemperature"]').isChecked(),
).toBeFalsy();
await page.getByText("Save Changes", { exact: true }).click();
@@ -172,7 +172,7 @@ test("IntComponent", async ({ page }) => {
await page.locator('//*[@id="showtimeout"]').click();
expect(
- await page.locator('//*[@id="showtimeout"]').isChecked()
+ await page.locator('//*[@id="showtimeout"]').isChecked(),
).toBeTruthy();
const valueEditNode = await page
diff --git a/src/frontend/tests/end-to-end/keyPairListComponent.spec.ts b/src/frontend/tests/end-to-end/keyPairListComponent.spec.ts
index 165dd685b..31a4521ae 100644
--- a/src/frontend/tests/end-to-end/keyPairListComponent.spec.ts
+++ b/src/frontend/tests/end-to-end/keyPairListComponent.spec.ts
@@ -81,7 +81,7 @@ test("KeypairListComponent", async ({ page }) => {
expect(await page.locator('//*[@id="showcache"]').isChecked()).toBeFalsy();
await page.locator('//*[@id="showcredentials_profile_name"]').click();
expect(
- await page.locator('//*[@id="showcredentials_profile_name"]').isChecked()
+ await page.locator('//*[@id="showcredentials_profile_name"]').isChecked(),
).toBeFalsy();
await page.getByText("Save Changes", { exact: true }).click();
@@ -96,7 +96,7 @@ test("KeypairListComponent", async ({ page }) => {
await page.locator('//*[@id="showcredentials_profile_name"]').click();
expect(
- await page.locator('//*[@id="showcredentials_profile_name"]').isChecked()
+ await page.locator('//*[@id="showcredentials_profile_name"]').isChecked(),
).toBeTruthy();
await page.locator('//*[@id="showcache"]').click();
expect(await page.locator('//*[@id="showcache"]').isChecked()).toBeTruthy();
diff --git a/src/frontend/tests/end-to-end/langflowShortcuts.spec.ts b/src/frontend/tests/end-to-end/langflowShortcuts.spec.ts
index 58615dd55..42b8744d1 100644
--- a/src/frontend/tests/end-to-end/langflowShortcuts.spec.ts
+++ b/src/frontend/tests/end-to-end/langflowShortcuts.spec.ts
@@ -61,7 +61,7 @@ test("LangflowShortcuts", async ({ page }) => {
await page
.locator(
- '//*[@id="react-flow-id"]/div[1]/div[1]/div[1]/div/div[2]/div[2]/div/div[1]/div/div[1]/div/div/div[1]'
+ '//*[@id="react-flow-id"]/div[1]/div[1]/div[1]/div/div[2]/div[2]/div/div[1]/div/div[1]/div/div/div[1]',
)
.click();
await page.keyboard.press("Backspace");
@@ -84,7 +84,7 @@ test("LangflowShortcuts", async ({ page }) => {
await page
.locator(
- '//*[@id="react-flow-id"]/div[1]/div[1]/div[1]/div/div[2]/div[2]/div/div[1]/div/div[1]/div/div/div[1]'
+ '//*[@id="react-flow-id"]/div[1]/div[1]/div[1]/div/div[2]/div[2]/div/div[1]/div/div[1]/div/div/div[1]',
)
.click();
await page.keyboard.press("Backspace");
diff --git a/src/frontend/tests/end-to-end/logs.spec.ts b/src/frontend/tests/end-to-end/logs.spec.ts
index 24abd96bf..38310e2e3 100644
--- a/src/frontend/tests/end-to-end/logs.spec.ts
+++ b/src/frontend/tests/end-to-end/logs.spec.ts
@@ -30,8 +30,6 @@ test("should able to see and interact with logs", async ({ page }) => {
await page.getByText("No Data Available", { exact: true }).isVisible();
await page.keyboard.press("Escape");
- await page.getByText("Close").last().click();
-
await page
.getByTestId("popover-anchor-input-openai_api_key")
.fill(process.env.OPENAI_API_KEY ?? "");
diff --git a/src/frontend/tests/end-to-end/nestedComponent.spec.ts b/src/frontend/tests/end-to-end/nestedComponent.spec.ts
index 3cd319576..2df9c1b7b 100644
--- a/src/frontend/tests/end-to-end/nestedComponent.spec.ts
+++ b/src/frontend/tests/end-to-end/nestedComponent.spec.ts
@@ -41,7 +41,7 @@ test("NestedComponent", async ({ page }) => {
await page.locator('//*[@id="showpool_threads"]').click();
expect(
- await page.locator('//*[@id="showpool_threads"]').isChecked()
+ await page.locator('//*[@id="showpool_threads"]').isChecked(),
).toBeTruthy();
//showtext_key
@@ -53,140 +53,140 @@ test("NestedComponent", async ({ page }) => {
await page.locator('//*[@id="showindex_name"]').click();
expect(
- await page.locator('//*[@id="showindex_name"]').isChecked()
+ await page.locator('//*[@id="showindex_name"]').isChecked(),
).toBeFalsy();
// shownamespace
await page.locator('//*[@id="shownamespace"]').click();
expect(
- await page.locator('//*[@id="shownamespace"]').isChecked()
+ await page.locator('//*[@id="shownamespace"]').isChecked(),
).toBeFalsy();
// showpinecone_api_key
await page.locator('//*[@id="showpinecone_api_key"]').click();
expect(
- await page.locator('//*[@id="showpinecone_api_key"]').isChecked()
+ await page.locator('//*[@id="showpinecone_api_key"]').isChecked(),
).toBeFalsy();
// showindex_name
await page.locator('//*[@id="showindex_name"]').click();
expect(
- await page.locator('//*[@id="showindex_name"]').isChecked()
+ await page.locator('//*[@id="showindex_name"]').isChecked(),
).toBeTruthy();
// shownamespace
await page.locator('//*[@id="shownamespace"]').click();
expect(
- await page.locator('//*[@id="shownamespace"]').isChecked()
+ await page.locator('//*[@id="shownamespace"]').isChecked(),
).toBeTruthy();
// showpinecone_api_key
await page.locator('//*[@id="showpinecone_api_key"]').click();
expect(
- await page.locator('//*[@id="showpinecone_api_key"]').isChecked()
+ await page.locator('//*[@id="showpinecone_api_key"]').isChecked(),
).toBeTruthy();
// showindex_name
await page.locator('//*[@id="showindex_name"]').click();
expect(
- await page.locator('//*[@id="showindex_name"]').isChecked()
+ await page.locator('//*[@id="showindex_name"]').isChecked(),
).toBeFalsy();
// shownamespace
await page.locator('//*[@id="shownamespace"]').click();
expect(
- await page.locator('//*[@id="shownamespace"]').isChecked()
+ await page.locator('//*[@id="shownamespace"]').isChecked(),
).toBeFalsy();
// showpinecone_api_key
await page.locator('//*[@id="showpinecone_api_key"]').click();
expect(
- await page.locator('//*[@id="showpinecone_api_key"]').isChecked()
+ await page.locator('//*[@id="showpinecone_api_key"]').isChecked(),
).toBeFalsy();
// showindex_name
await page.locator('//*[@id="showindex_name"]').click();
expect(
- await page.locator('//*[@id="showindex_name"]').isChecked()
+ await page.locator('//*[@id="showindex_name"]').isChecked(),
).toBeTruthy();
// shownamespace
await page.locator('//*[@id="shownamespace"]').click();
expect(
- await page.locator('//*[@id="shownamespace"]').isChecked()
+ await page.locator('//*[@id="shownamespace"]').isChecked(),
).toBeTruthy();
// showpinecone_api_key
await page.locator('//*[@id="showpinecone_api_key"]').click();
expect(
- await page.locator('//*[@id="showpinecone_api_key"]').isChecked()
+ await page.locator('//*[@id="showpinecone_api_key"]').isChecked(),
).toBeTruthy();
// showindex_name
await page.locator('//*[@id="showindex_name"]').click();
expect(
- await page.locator('//*[@id="showindex_name"]').isChecked()
+ await page.locator('//*[@id="showindex_name"]').isChecked(),
).toBeFalsy();
// shownamespace
await page.locator('//*[@id="shownamespace"]').click();
expect(
- await page.locator('//*[@id="shownamespace"]').isChecked()
+ await page.locator('//*[@id="shownamespace"]').isChecked(),
).toBeFalsy();
// showpinecone_api_key
await page.locator('//*[@id="showpinecone_api_key"]').click();
expect(
- await page.locator('//*[@id="showpinecone_api_key"]').isChecked()
+ await page.locator('//*[@id="showpinecone_api_key"]').isChecked(),
).toBeFalsy();
// showindex_name
await page.locator('//*[@id="showindex_name"]').click();
expect(
- await page.locator('//*[@id="showindex_name"]').isChecked()
+ await page.locator('//*[@id="showindex_name"]').isChecked(),
).toBeTruthy();
// shownamespace
await page.locator('//*[@id="shownamespace"]').click();
expect(
- await page.locator('//*[@id="shownamespace"]').isChecked()
+ await page.locator('//*[@id="shownamespace"]').isChecked(),
).toBeTruthy();
// showpinecone_api_key
await page.locator('//*[@id="showpinecone_api_key"]').click();
expect(
- await page.locator('//*[@id="showpinecone_api_key"]').isChecked()
+ await page.locator('//*[@id="showpinecone_api_key"]').isChecked(),
).toBeTruthy();
//showpool_threads
await page.locator('//*[@id="showpool_threads"]').click();
expect(
- await page.locator('//*[@id="showpool_threads"]').isChecked()
+ await page.locator('//*[@id="showpool_threads"]').isChecked(),
).toBeFalsy();
//showtext_key
await page.locator('//*[@id="showtext_key"]').click();
expect(
- await page.locator('//*[@id="showtext_key"]').isChecked()
+ await page.locator('//*[@id="showtext_key"]').isChecked(),
).toBeTruthy();
await page.getByText("Save Changes", { exact: true }).click();
diff --git a/src/frontend/tests/end-to-end/promptModalComponent.spec.ts b/src/frontend/tests/end-to-end/promptModalComponent.spec.ts
index ed8162a4e..af40522a5 100644
--- a/src/frontend/tests/end-to-end/promptModalComponent.spec.ts
+++ b/src/frontend/tests/end-to-end/promptModalComponent.spec.ts
@@ -72,6 +72,8 @@ test("PromptTemplateComponent", async ({ page }) => {
expect(false).toBeTruthy();
}
+ await page.getByTestId("more-options-modal").click();
+
await page.getByTestId("save-button-modal").click();
const replace = await page.getByTestId("replace-button").isVisible();
@@ -138,7 +140,7 @@ test("PromptTemplateComponent", async ({ page }) => {
await page.locator('//*[@id="showtemplate"]').click();
expect(
- await page.locator('//*[@id="showtemplate"]').isChecked()
+ await page.locator('//*[@id="showtemplate"]').isChecked(),
).toBeTruthy();
await page.locator('//*[@id="showprompt"]').click();
@@ -158,7 +160,7 @@ test("PromptTemplateComponent", async ({ page }) => {
await page.locator('//*[@id="showtemplate"]').click();
expect(
- await page.locator('//*[@id="showtemplate"]').isChecked()
+ await page.locator('//*[@id="showtemplate"]').isChecked(),
).toBeTruthy();
await page.locator('//*[@id="showprompt"]').click();
diff --git a/src/frontend/tests/end-to-end/python_api_generation.spec.ts b/src/frontend/tests/end-to-end/python_api_generation.spec.ts
index d75dd2c5e..849c4e9a9 100644
--- a/src/frontend/tests/end-to-end/python_api_generation.spec.ts
+++ b/src/frontend/tests/end-to-end/python_api_generation.spec.ts
@@ -21,9 +21,9 @@ test("python_api_generation", async ({ page, context }) => {
await page.waitForTimeout(2000);
await page.getByText("API", { exact: true }).click();
await page.getByRole("tab", { name: "Python API" }).click();
- await page.getByRole("button", { name: "Copy Code" }).click();
+ await page.getByTestId("icon-Copy").click();
const handle = await page.evaluateHandle(() =>
- navigator.clipboard.readText()
+ navigator.clipboard.readText(),
);
const clipboardContent = await handle.jsonValue();
expect(clipboardContent.length).toBeGreaterThan(0);
diff --git a/src/frontend/tests/end-to-end/saveComponents.spec.ts b/src/frontend/tests/end-to-end/saveComponents.spec.ts
index 94fab8f39..fa9dbbc00 100644
--- a/src/frontend/tests/end-to-end/saveComponents.spec.ts
+++ b/src/frontend/tests/end-to-end/saveComponents.spec.ts
@@ -27,7 +27,7 @@ test.describe("save component tests", () => {
// Read your file into a buffer.
const jsonContent = readFileSync(
"src/frontend/tests/end-to-end/assets/flow_group_test.json",
- "utf-8"
+ "utf-8",
);
// Create the DataTransfer and File
@@ -49,7 +49,7 @@ test.describe("save component tests", () => {
"drop",
{
dataTransfer,
- }
+ },
);
const genericNoda = page.getByTestId("div-generic-node");
@@ -84,6 +84,8 @@ test.describe("save component tests", () => {
}
await page.getByTestId("title-Group").click();
+ await page.getByTestId("more-options-modal").click();
+
await page.getByTestId("icon-SaveAll").click();
const replaceButton = await page.getByTestId("replace-button").isVisible();
diff --git a/src/frontend/tests/end-to-end/store.spec.ts b/src/frontend/tests/end-to-end/store.spec.ts
index 13963d698..8e443ecdd 100644
--- a/src/frontend/tests/end-to-end/store.spec.ts
+++ b/src/frontend/tests/end-to-end/store.spec.ts
@@ -262,7 +262,7 @@ test("should share component with share button", async ({ page }) => {
await page.getByText("Set workflow status to public").isVisible();
await page
.getByText(
- "Attention: API keys in specified fields are automatically removed upon sharing."
+ "Attention: API keys in specified fields are automatically removed upon sharing.",
)
.isVisible();
await page.getByText("Export").first().isVisible();
diff --git a/src/frontend/tests/end-to-end/textAreaModalComponent.spec.ts b/src/frontend/tests/end-to-end/textAreaModalComponent.spec.ts
index fa4248a63..9443586e6 100644
--- a/src/frontend/tests/end-to-end/textAreaModalComponent.spec.ts
+++ b/src/frontend/tests/end-to-end/textAreaModalComponent.spec.ts
@@ -51,7 +51,7 @@ test("TextAreaModalComponent", async ({ page }) => {
await page
.getByTestId("textarea-text")
.fill(
- "test test test test test test test test test test test !@#%*)( 123456789101010101010101111111111 !!!!!!!!!!"
+ "test test test test test test test test test test test !@#%*)( 123456789101010101010101111111111 !!!!!!!!!!",
);
await page.getByTestId("textarea-text-ExternalLink").click();
diff --git a/src/frontend/tests/end-to-end/textInputOutput.spec.ts b/src/frontend/tests/end-to-end/textInputOutput.spec.ts
index 94804d956..2d75db5d3 100644
--- a/src/frontend/tests/end-to-end/textInputOutput.spec.ts
+++ b/src/frontend/tests/end-to-end/textInputOutput.spec.ts
@@ -60,7 +60,7 @@ test("TextInputOutputComponent", async ({ page }) => {
// Click and hold on the first element
await page
.locator(
- '//*[@id="react-flow-id"]/div/div[1]/div[1]/div/div[2]/div[1]/div/div[2]/div[6]/button/div/div'
+ '//*[@id="react-flow-id"]/div/div[1]/div[1]/div/div[2]/div[1]/div/div[2]/div[6]/button/div/div',
)
.hover();
await page.mouse.down();
@@ -68,7 +68,7 @@ test("TextInputOutputComponent", async ({ page }) => {
// Move to the second element
await page
.locator(
- '//*[@id="react-flow-id"]/div/div[1]/div[1]/div/div[2]/div[2]/div/div[2]/div[9]/div/button/div/div'
+ '//*[@id="react-flow-id"]/div/div[1]/div[1]/div/div[2]/div[2]/div/div[2]/div[9]/div/button/div/div',
)
.hover();
@@ -92,7 +92,7 @@ test("TextInputOutputComponent", async ({ page }) => {
// Click and hold on the first element
await page
.locator(
- '//*[@id="react-flow-id"]/div/div[1]/div[1]/div/div[2]/div[2]/div/div[2]/div[13]/button/div/div'
+ '//*[@id="react-flow-id"]/div/div[1]/div[1]/div/div[2]/div[2]/div/div[2]/div[13]/button/div/div',
)
.hover();
await page.mouse.down();
@@ -100,7 +100,7 @@ test("TextInputOutputComponent", async ({ page }) => {
// Move to the second element
await page
.locator(
- '//*[@id="react-flow-id"]/div/div[1]/div[1]/div/div[2]/div[3]/div/div[2]/div[3]/div/button/div/div'
+ '//*[@id="react-flow-id"]/div/div[1]/div[1]/div/div[2]/div[3]/div/div[2]/div[3]/div/button/div/div',
)
.hover();
@@ -137,8 +137,6 @@ test("TextInputOutputComponent", async ({ page }) => {
await page.keyboard.press("Escape");
- await page.getByText("Close", { exact: true }).last().click();
-
await page
.getByTestId("popover-anchor-input-input_value")
.nth(0)
diff --git a/src/frontend/tests/end-to-end/toggleComponent.spec.ts b/src/frontend/tests/end-to-end/toggleComponent.spec.ts
index 5a8d9a36a..58d909af4 100644
--- a/src/frontend/tests/end-to-end/toggleComponent.spec.ts
+++ b/src/frontend/tests/end-to-end/toggleComponent.spec.ts
@@ -45,7 +45,7 @@ test("ToggleComponent", async ({ page }) => {
await page.locator('//*[@id="showload_hidden"]').click();
expect(
- await page.locator('//*[@id="showload_hidden"]').isChecked()
+ await page.locator('//*[@id="showload_hidden"]').isChecked(),
).toBeTruthy();
await page.getByText("Save Changes", { exact: true }).click();
@@ -81,12 +81,12 @@ test("ToggleComponent", async ({ page }) => {
await page.locator('//*[@id="showload_hidden"]').click();
expect(
- await page.locator('//*[@id="showload_hidden"]').isChecked()
+ await page.locator('//*[@id="showload_hidden"]').isChecked(),
).toBeFalsy();
await page.locator('//*[@id="showmax_concurrency"]').click();
expect(
- await page.locator('//*[@id="showmax_concurrency"]').isChecked()
+ await page.locator('//*[@id="showmax_concurrency"]').isChecked(),
).toBeTruthy();
await page.locator('//*[@id="showpath"]').click();
@@ -94,22 +94,22 @@ test("ToggleComponent", async ({ page }) => {
await page.locator('//*[@id="showrecursive"]').click();
expect(
- await page.locator('//*[@id="showrecursive"]').isChecked()
+ await page.locator('//*[@id="showrecursive"]').isChecked(),
).toBeTruthy();
await page.locator('//*[@id="showsilent_errors"]').click();
expect(
- await page.locator('//*[@id="showsilent_errors"]').isChecked()
+ await page.locator('//*[@id="showsilent_errors"]').isChecked(),
).toBeTruthy();
await page.locator('//*[@id="showuse_multithreading"]').click();
expect(
- await page.locator('//*[@id="showuse_multithreading"]').isChecked()
+ await page.locator('//*[@id="showuse_multithreading"]').isChecked(),
).toBeTruthy();
await page.locator('//*[@id="showmax_concurrency"]').click();
expect(
- await page.locator('//*[@id="showmax_concurrency"]').isChecked()
+ await page.locator('//*[@id="showmax_concurrency"]').isChecked(),
).toBeFalsy();
await page.locator('//*[@id="showpath"]').click();
@@ -117,17 +117,17 @@ test("ToggleComponent", async ({ page }) => {
await page.locator('//*[@id="showrecursive"]').click();
expect(
- await page.locator('//*[@id="showrecursive"]').isChecked()
+ await page.locator('//*[@id="showrecursive"]').isChecked(),
).toBeFalsy();
await page.locator('//*[@id="showsilent_errors"]').click();
expect(
- await page.locator('//*[@id="showsilent_errors"]').isChecked()
+ await page.locator('//*[@id="showsilent_errors"]').isChecked(),
).toBeFalsy();
await page.locator('//*[@id="showuse_multithreading"]').click();
expect(
- await page.locator('//*[@id="showuse_multithreading"]').isChecked()
+ await page.locator('//*[@id="showuse_multithreading"]').isChecked(),
).toBeFalsy();
await page.getByText("Save Changes", { exact: true }).click();
@@ -144,38 +144,38 @@ test("ToggleComponent", async ({ page }) => {
await page.locator('//*[@id="showload_hidden"]').click();
expect(
- await page.locator('//*[@id="showload_hidden"]').isChecked()
+ await page.locator('//*[@id="showload_hidden"]').isChecked(),
).toBeTruthy();
expect(
- await page.getByTestId("toggle-edit-load_hidden").isChecked()
+ await page.getByTestId("toggle-edit-load_hidden").isChecked(),
).toBeTruthy();
await page.getByText("Save Changes", { exact: true }).click();
await page.getByTestId("toggle-load_hidden").click();
expect(
- await page.getByTestId("toggle-load_hidden").isChecked()
+ await page.getByTestId("toggle-load_hidden").isChecked(),
).toBeFalsy();
await page.getByTestId("toggle-load_hidden").click();
expect(
- await page.getByTestId("toggle-load_hidden").isChecked()
+ await page.getByTestId("toggle-load_hidden").isChecked(),
).toBeTruthy();
await page.getByTestId("toggle-load_hidden").click();
expect(
- await page.getByTestId("toggle-load_hidden").isChecked()
+ await page.getByTestId("toggle-load_hidden").isChecked(),
).toBeFalsy();
await page.getByTestId("toggle-load_hidden").click();
expect(
- await page.getByTestId("toggle-load_hidden").isChecked()
+ await page.getByTestId("toggle-load_hidden").isChecked(),
).toBeTruthy();
await page.getByTestId("toggle-load_hidden").click();
expect(
- await page.getByTestId("toggle-load_hidden").isChecked()
+ await page.getByTestId("toggle-load_hidden").isChecked(),
).toBeFalsy();
}
});
diff --git a/src/frontend/tests/end-to-end/tweaks_test.spec.ts b/src/frontend/tests/end-to-end/tweaks_test.spec.ts
index 0006456af..2d85cc8dc 100644
--- a/src/frontend/tests/end-to-end/tweaks_test.spec.ts
+++ b/src/frontend/tests/end-to-end/tweaks_test.spec.ts
@@ -22,9 +22,9 @@ test("curl_api_generation", async ({ page, context }) => {
await page.waitForTimeout(2000);
await page.getByText("API", { exact: true }).click();
await page.getByRole("tab", { name: "cURL" }).click();
- await page.getByRole("button", { name: "Copy Code" }).click();
+ await page.getByTestId("icon-Copy").click();
const handle = await page.evaluateHandle(() =>
- navigator.clipboard.readText()
+ navigator.clipboard.readText(),
);
const clipboardContent = await handle.jsonValue();
const oldValue = clipboardContent;
@@ -48,9 +48,9 @@ test("curl_api_generation", async ({ page, context }) => {
.first()
.fill("teste");
await page.getByRole("tab", { name: "cURL" }).click();
- await page.getByRole("button", { name: "Copy Code" }).click();
+ await page.getByTestId("icon-Copy").click();
const handle2 = await page.evaluateHandle(() =>
- navigator.clipboard.readText()
+ navigator.clipboard.readText(),
);
const clipboardContent2 = await handle2.jsonValue();
const newValue = clipboardContent2;
diff --git a/src/frontend/tests/end-to-end/userSettings.spec.ts b/src/frontend/tests/end-to-end/userSettings.spec.ts
index 1228fffb4..df760cbca 100644
--- a/src/frontend/tests/end-to-end/userSettings.spec.ts
+++ b/src/frontend/tests/end-to-end/userSettings.spec.ts
@@ -108,8 +108,8 @@ test("should interact with API Keys", async ({ page }) => {
await page.waitForTimeout(2000);
await page.getByTestId("user-profile-settings").click();
await page.getByText("Settings").click();
- await page.getByText("API Keys").click();
- await page.getByText("API Keys", { exact: true }).nth(1).isVisible();
+ await page.getByText("Langflow API").click();
+ await page.getByText("Langflow API", { exact: true }).nth(1).isVisible();
await page.getByText("Add New").click();
await page.getByPlaceholder("Insert a name for your API Key").isVisible();
diff --git a/tests/test_endpoints.py b/tests/test_endpoints.py
index 98fc2d613..ab016ab17 100644
--- a/tests/test_endpoints.py
+++ b/tests/test_endpoints.py
@@ -4,7 +4,6 @@ from uuid import UUID, uuid4
import pytest
from fastapi import status
from fastapi.testclient import TestClient
-
from langflow.custom.directory_reader.directory_reader import DirectoryReader
from langflow.services.deps import get_settings_service