- {chatFirstInitialText} {" "}
+ {chatFirstInitialText}{" "}
{
const onKeyDown = (event: KeyboardEvent) => {
const selectedNode = nodes.filter((obj) => obj.selected);
- if ((event.ctrlKey || event.metaKey) && event.key === "p" && selectedNode.length > 0) {
+ if (
+ (event.ctrlKey || event.metaKey) &&
+ event.key === "p" &&
+ selectedNode.length > 0
+ ) {
event.preventDefault();
setNode(selectedNode[0].id, (old) => ({
...old,
@@ -104,12 +113,19 @@ export default function Page({
},
}));
}
- if ((event.ctrlKey || event.metaKey) && event.key === "d" && selectedNode.length > 0) {
+ if (
+ (event.ctrlKey || event.metaKey) &&
+ event.key === "d" &&
+ selectedNode.length > 0
+ ) {
event.preventDefault();
- paste({nodes: selectedNode, edges: []}, {
- x: position.current.x,
- y: position.current.y,
- });
+ paste(
+ { nodes: selectedNode, edges: [] },
+ {
+ x: position.current.x,
+ y: position.current.y,
+ }
+ );
}
if (!isWrappedWithClass(event, "noundo")) {
if (
diff --git a/src/frontend/src/pages/FlowPage/components/extraSidebarComponent/index.tsx b/src/frontend/src/pages/FlowPage/components/extraSidebarComponent/index.tsx
index a756ae8c3..fe78895c0 100644
--- a/src/frontend/src/pages/FlowPage/components/extraSidebarComponent/index.tsx
+++ b/src/frontend/src/pages/FlowPage/components/extraSidebarComponent/index.tsx
@@ -4,6 +4,7 @@ import ShadTooltip from "../../../../components/ShadTooltipComponent";
import IconComponent from "../../../../components/genericIconComponent";
import { Input } from "../../../../components/ui/input";
import { Separator } from "../../../../components/ui/separator";
+import { UPLOAD_ERROR_ALERT } from "../../../../constants/alerts_constants";
import ApiModal from "../../../../modals/ApiModal";
import ExportModal from "../../../../modals/exportModal";
import ShareModal from "../../../../modals/shareModal";
@@ -25,7 +26,6 @@ import {
} from "../../../../utils/utils";
import DisclosureComponent from "../DisclosureComponent";
import SidebarDraggableComponent from "./sideBarDraggableComponent";
-import { UPLOAD_ERROR_ALERT } from "../../../../constants/alerts_constants";
export default function ExtraSidebar(): JSX.Element {
const data = useTypesStore((state) => state.data);
diff --git a/src/frontend/src/pages/FlowPage/components/nodeToolbarComponent/index.tsx b/src/frontend/src/pages/FlowPage/components/nodeToolbarComponent/index.tsx
index 3fa1ddefa..812eb9ed1 100644
--- a/src/frontend/src/pages/FlowPage/components/nodeToolbarComponent/index.tsx
+++ b/src/frontend/src/pages/FlowPage/components/nodeToolbarComponent/index.tsx
@@ -90,12 +90,16 @@ export default function NodeToolbarComponent({
}, [showModalAdvanced]);
const updateNodeInternals = useUpdateNodeInternals();
- const openCodeModalWShortcut = useFlowStore(state => state.openCodeModalWShortcut);
- const handleModalWShortcut = useFlowStore(state => state.handleModalWShortcut);
+ const openCodeModalWShortcut = useFlowStore(
+ (state) => state.openCodeModalWShortcut
+ );
+ const handleModalWShortcut = useFlowStore(
+ (state) => state.handleModalWShortcut
+ );
useEffect(() => {
- setOpenModal(openCodeModalWShortcut)
- }, [openCodeModalWShortcut, handleModalWShortcut])
+ setOpenModal(openCodeModalWShortcut);
+ }, [openCodeModalWShortcut, handleModalWShortcut]);
const setLastCopiedSelection = useFlowStore(
(state) => state.setLastCopiedSelection
diff --git a/src/frontend/src/pages/MainPage/components/components/index.tsx b/src/frontend/src/pages/MainPage/components/components/index.tsx
index d93811d5b..6e971b635 100644
--- a/src/frontend/src/pages/MainPage/components/components/index.tsx
+++ b/src/frontend/src/pages/MainPage/components/components/index.tsx
@@ -6,10 +6,14 @@ import CardsWrapComponent from "../../../../components/cardsWrapComponent";
import IconComponent from "../../../../components/genericIconComponent";
import { SkeletonCardComponent } from "../../../../components/skeletonCardComponent";
import { Button } from "../../../../components/ui/button";
+import {
+ CONSOLE_ERROR_MSG,
+ UPLOAD_ALERT_LIST,
+ WRONG_FILE_ERROR_ALERT,
+} from "../../../../constants/alerts_constants";
import useAlertStore from "../../../../stores/alertStore";
import useFlowsManagerStore from "../../../../stores/flowsManagerStore";
import { FlowType } from "../../../../types/flow";
-import { CONSOLE_ERROR_MSG, UPLOAD_ALERT_LIST, WRONG_FILE_ERROR_ALERT } from "../../../../constants/alerts_constants";
export default function ComponentsComponent({
is_component = true,
diff --git a/src/frontend/src/pages/MainPage/index.tsx b/src/frontend/src/pages/MainPage/index.tsx
index e8f0f4136..2cddf4273 100644
--- a/src/frontend/src/pages/MainPage/index.tsx
+++ b/src/frontend/src/pages/MainPage/index.tsx
@@ -6,11 +6,14 @@ import IconComponent from "../../components/genericIconComponent";
import PageLayout from "../../components/pageLayout";
import SidebarNav from "../../components/sidebarComponent";
import { Button } from "../../components/ui/button";
-import { USER_PROJECTS_HEADER, myCollectionDesc } from "../../constants/constants";
+import { CONSOLE_ERROR_MSG } from "../../constants/alerts_constants";
+import {
+ USER_PROJECTS_HEADER,
+ myCollectionDesc,
+} from "../../constants/constants";
import useAlertStore from "../../stores/alertStore";
import useFlowsManagerStore from "../../stores/flowsManagerStore";
import { downloadFlows } from "../../utils/reactflowUtils";
-import { CONSOLE_ERROR_MSG } from "../../constants/alerts_constants";
export default function HomePage(): JSX.Element {
const addFlow = useFlowsManagerStore((state) => state.addFlow);
const uploadFlow = useFlowsManagerStore((state) => state.uploadFlow);
diff --git a/src/frontend/src/pages/ProfileSettingsPage/index.tsx b/src/frontend/src/pages/ProfileSettingsPage/index.tsx
index 4ee66139e..a7af7c86a 100644
--- a/src/frontend/src/pages/ProfileSettingsPage/index.tsx
+++ b/src/frontend/src/pages/ProfileSettingsPage/index.tsx
@@ -6,6 +6,12 @@ import GradientChooserComponent from "../../components/gradientChooserComponent"
import Header from "../../components/headerComponent";
import InputComponent from "../../components/inputComponent";
import { Button } from "../../components/ui/button";
+import {
+ EDIT_PASSWORD_ALERT_LIST,
+ EDIT_PASSWORD_ERROR_ALERT,
+ SAVE_ERROR_ALERT,
+ SAVE_SUCCESS_ALERT,
+} from "../../constants/alerts_constants";
import { CONTROL_PATCH_USER_STATE } from "../../constants/constants";
import { AuthContext } from "../../contexts/authContext";
import { resetPassword, updateUser } from "../../controllers/API";
@@ -16,7 +22,6 @@ import {
patchUserInputStateType,
} from "../../types/components";
import { gradients } from "../../utils/styleUtils";
-import { EDIT_PASSWORD_ALERT_LIST, EDIT_PASSWORD_ERROR_ALERT, SAVE_ERROR_ALERT, SAVE_SUCCESS_ALERT } from "../../constants/alerts_constants";
export default function ProfileSettingsPage(): JSX.Element {
const setCurrentFlowId = useFlowsManagerStore(
(state) => state.setCurrentFlowId
diff --git a/src/frontend/src/pages/StorePage/index.tsx b/src/frontend/src/pages/StorePage/index.tsx
index b824cf7f1..57cebf693 100644
--- a/src/frontend/src/pages/StorePage/index.tsx
+++ b/src/frontend/src/pages/StorePage/index.tsx
@@ -20,6 +20,13 @@ import {
SelectTrigger,
SelectValue,
} from "../../components/ui/select";
+import {
+ APIKEY_ERROR_ALERT,
+ COMPONENTS_ERROR_ALERT,
+ INVALID_API_ERROR_ALERT,
+ NOAPI_ERROR_ALERT,
+} from "../../constants/alerts_constants";
+import { storeDesc, storeTitle } from "../../constants/constants";
import { AuthContext } from "../../contexts/authContext";
import { getStoreComponents, getStoreTags } from "../../controllers/API";
import StoreApiKeyModal from "../../modals/StoreApiKeyModal";
@@ -28,8 +35,6 @@ import useFlowsManagerStore from "../../stores/flowsManagerStore";
import { useStoreStore } from "../../stores/storeStore";
import { storeComponent } from "../../types/store";
import { cn } from "../../utils/utils";
-import { APIKEY_ERROR_ALERT, COMPONENTS_ERROR_ALERT, INVALID_API_ERROR_ALERT, NOAPI_ERROR_ALERT } from "../../constants/alerts_constants";
-import { storeDesc, storeTitle } from "../../constants/constants";
export default function StorePage(): JSX.Element {
const hasApiKey = useStoreStore((state) => state.hasApiKey);
@@ -65,17 +70,13 @@ export default function StorePage(): JSX.Element {
if (!hasApiKey) {
setErrorData({
title: APIKEY_ERROR_ALERT,
- list: [
- NOAPI_ERROR_ALERT,
- ],
+ list: [NOAPI_ERROR_ALERT],
});
setLoading(false);
} else if (!validApiKey) {
setErrorData({
title: APIKEY_ERROR_ALERT,
- list: [
- INVALID_API_ERROR_ALERT,
- ],
+ list: [INVALID_API_ERROR_ALERT],
});
}
}
diff --git a/src/frontend/src/pages/loginPage/index.tsx b/src/frontend/src/pages/loginPage/index.tsx
index f0d77ba9f..2d9ea59c9 100644
--- a/src/frontend/src/pages/loginPage/index.tsx
+++ b/src/frontend/src/pages/loginPage/index.tsx
@@ -4,6 +4,7 @@ import { Link, useNavigate } from "react-router-dom";
import InputComponent from "../../components/inputComponent";
import { Button } from "../../components/ui/button";
import { Input } from "../../components/ui/input";
+import { SIGNIN_ERROR_ALERT } from "../../constants/alerts_constants";
import { CONTROL_LOGIN_STATE } from "../../constants/constants";
import { AuthContext } from "../../contexts/authContext";
import { onLogin } from "../../controllers/API";
@@ -13,7 +14,6 @@ import {
inputHandlerEventType,
loginInputStateType,
} from "../../types/components";
-import { SIGNIN_ERROR_ALERT } from "../../constants/alerts_constants";
export default function LoginPage(): JSX.Element {
const [inputState, setInputState] =
diff --git a/src/frontend/src/pages/signUpPage/index.tsx b/src/frontend/src/pages/signUpPage/index.tsx
index 932ed67e4..1cdad3d59 100644
--- a/src/frontend/src/pages/signUpPage/index.tsx
+++ b/src/frontend/src/pages/signUpPage/index.tsx
@@ -4,6 +4,7 @@ import { Link, useNavigate } from "react-router-dom";
import InputComponent from "../../components/inputComponent";
import { Button } from "../../components/ui/button";
import { Input } from "../../components/ui/input";
+import { SIGNUP_ERROR_ALERT } from "../../constants/alerts_constants";
import {
CONTROL_INPUT_STATE,
SIGN_UP_SUCCESS,
@@ -15,7 +16,6 @@ import {
inputHandlerEventType,
signUpInputStateType,
} from "../../types/components";
-import { SIGNUP_ERROR_ALERT } from "../../constants/alerts_constants";
export default function SignUp(): JSX.Element {
const [inputState, setInputState] =
diff --git a/src/frontend/src/stores/flowStore.ts b/src/frontend/src/stores/flowStore.ts
index 473b51b09..1f4a494bb 100644
--- a/src/frontend/src/stores/flowStore.ts
+++ b/src/frontend/src/stores/flowStore.ts
@@ -57,15 +57,15 @@ const useFlowStore = create((set, get) => ({
inputs: [],
outputs: [],
openCodeModalWShortcut: false,
- handleModalWShortcut: ((modal) => {
+ handleModalWShortcut: (modal) => {
switch (modal) {
case "code":
set((state) => ({
openCodeModalWShortcut: !state.openCodeModalWShortcut,
}));
- break
+ break;
}
- }),
+ },
setFlowPool: (flowPool) => {
set({ flowPool });
},
@@ -494,7 +494,12 @@ const useFlowStore = create((set, get) => ({
};
},
updateVerticesBuild: (
- vertices: { verticesIds: string[], verticesOrder: string[][], verticesLayers: string[][], runId: string } | null
+ vertices: {
+ verticesIds: string[];
+ verticesOrder: string[][];
+ verticesLayers: string[][];
+ runId: string;
+ } | null
) => {
set({ verticesBuild: vertices });
},
diff --git a/src/frontend/src/types/zustand/flow/index.ts b/src/frontend/src/types/zustand/flow/index.ts
index 9ed8d3215..75044f921 100644
--- a/src/frontend/src/types/zustand/flow/index.ts
+++ b/src/frontend/src/types/zustand/flow/index.ts
@@ -25,7 +25,10 @@ export type FlowPoolObjectType = {
timestamp: string;
valid: boolean;
params: any;
- data: { artifacts: any | ChatOutputType | chatInputType; results: any | ChatOutputType | chatInputType };
+ data: {
+ artifacts: any | ChatOutputType | chatInputType;
+ results: any | ChatOutputType | chatInputType;
+ };
duration?: string;
progress?: number;
id: string;
@@ -38,7 +41,7 @@ export type FlowPoolType = {
export type FlowStoreType = {
openCodeModalWShortcut: boolean;
- handleModalWShortcut: (modal: string) => void
+ handleModalWShortcut: (modal: string) => void;
flowPool: FlowPoolType;
inputs: Array<{ type: string; id: string }>;
outputs: Array<{ type: string; id: string }>;
@@ -88,13 +91,35 @@ export type FlowStoreType = {
getFilterEdge: any[];
onConnect: (connection: Connection) => void;
unselectAll: () => void;
- buildFlow: ({nodeId, input_value}: {nodeId?: string, input_value?: string}) => Promise;
+ buildFlow: ({
+ nodeId,
+ input_value,
+ }: {
+ nodeId?: string;
+ input_value?: string;
+ }) => Promise;
getFlow: () => { nodes: Node[]; edges: Edge[]; viewport: Viewport };
- updateVerticesBuild: (vertices: {verticesIds: string[], verticesLayers: string[][], verticesOrder: string[][], runId: string} | null) => void;
- removeFromVerticesBuild: (vertices: string[]) => void;
- verticesBuild: {verticesIds: string[], verticesLayers: string[][], verticesOrder: string[][], runId: string} | null;
+ updateVerticesBuild: (
+ vertices: {
+ verticesIds: string[];
+ verticesLayers: string[][];
+ verticesOrder: string[][];
+ runId: string;
+ } | null
+ ) => void;
+ removeFromVerticesBuild: (vertices: string[]) => void;
+ verticesBuild: {
+ verticesIds: string[];
+ verticesLayers: string[][];
+ verticesOrder: string[][];
+ runId: string;
+ } | null;
updateBuildStatus: (nodeId: string[], status: BuildStatus) => void;
revertBuiltStatusFromBuilding: () => void;
flowBuildStatus: { [key: string]: BuildStatus };
- updateFlowPool: (nodeId:string, data:FlowPoolObjectType | ChatOutputType | chatInputType,buildId?:string) => void;
+ updateFlowPool: (
+ nodeId: string,
+ data: FlowPoolObjectType | ChatOutputType | chatInputType,
+ buildId?: string
+ ) => void;
};
diff --git a/src/frontend/src/utils/buildUtils.ts b/src/frontend/src/utils/buildUtils.ts
index b50c90b23..e5003caf2 100644
--- a/src/frontend/src/utils/buildUtils.ts
+++ b/src/frontend/src/utils/buildUtils.ts
@@ -39,7 +39,15 @@ function getInactiveVertexData(vertexId: string): VertexBuildTypeAPI {
return inactiveVertexData;
}
-export async function updateVerticesOrder(flowId: string, nodeId: string | null): Promise<{ verticesLayers: string[][], verticesIds: string[], verticesOrder: string[][], runId: string }> {
+export async function updateVerticesOrder(
+ flowId: string,
+ nodeId: string | null
+): Promise<{
+ verticesLayers: string[][];
+ verticesIds: string[];
+ verticesOrder: string[][];
+ runId: string;
+}> {
return new Promise(async (resolve, reject) => {
const setErrorData = useAlertStore.getState().setErrorData;
let orderResponse;
@@ -79,7 +87,12 @@ export async function updateVerticesOrder(flowId: string, nodeId: string | null)
const verticesIds = verticesLayers.flat();
useFlowStore
.getState()
- .updateVerticesBuild({ verticesLayers, verticesIds, verticesOrder, runId });
+ .updateVerticesBuild({
+ verticesLayers,
+ verticesIds,
+ verticesOrder,
+ runId,
+ });
resolve({ verticesLayers, verticesIds, verticesOrder, runId });
});
}
@@ -106,7 +119,7 @@ export async function buildVertices({
let stop = false;
if (onGetOrderSuccess) onGetOrderSuccess();
-
+
if (validateNodes) {
try {
validateNodes(verticesOrder.flatMap((id) => id));
diff --git a/src/frontend/src/utils/styleUtils.ts b/src/frontend/src/utils/styleUtils.ts
index 2cd74d6d1..3be951214 100644
--- a/src/frontend/src/utils/styleUtils.ts
+++ b/src/frontend/src/utils/styleUtils.ts
@@ -280,7 +280,7 @@ export const nodeIconsLucide: iconsType = {
Meta: MetaIcon,
Midjorney: MidjourneyIcon,
MongoDBAtlasVectorSearch: MongoDBIcon,
- MongoDB:MongoDBIcon,
+ MongoDB: MongoDBIcon,
MongoDBChatMessageHistory: MongoDBIcon,
NotionDirectoryLoader: NotionIcon,
ChatOpenAI: OpenAiIcon,