Apply Prettier formatting

This commit is contained in:
ogabrielluiz 2024-06-19 13:02:41 +00:00 • committed by github-actions[bot]
commit c62acbb80d
21 changed files with 302 additions and 115 deletions

View file

@ -40,12 +40,12 @@ export default function OutputComponent({
if (types.length < 2) { if (types.length < 2) {
return displayProxy( return displayProxy(
<span className={cn(frozen ? " text-ice" : "")}>{name}</span>, <span className={cn(frozen ? "text-ice" : "")}>{name}</span>,
); );
} }
return ( return (
<div className="nocopy nopan nodelete nodrag noundo flex items-center gap-2 "> <div className="nocopy nopan nodelete nodrag noundo flex items-center gap-2">
<DropdownMenu> <DropdownMenu>
<DropdownMenuTrigger asChild> <DropdownMenuTrigger asChild>
<Button <Button

View file

@ -1,3 +1,4 @@
import { title } from "process";
import { Handle, Position } from "reactflow"; import { Handle, Position } from "reactflow";
import ShadTooltip from "../../../../components/shadTooltipComponent"; import ShadTooltip from "../../../../components/shadTooltipComponent";
import { Button } from "../../../../components/ui/button"; import { Button } from "../../../../components/ui/button";
@ -7,7 +8,6 @@ import {
} from "../../../../utils/reactflowUtils"; } from "../../../../utils/reactflowUtils";
import { classNames, cn, groupByFamily } from "../../../../utils/utils"; import { classNames, cn, groupByFamily } from "../../../../utils/utils";
import HandleTooltips from "../HandleTooltipComponent"; import HandleTooltips from "../HandleTooltipComponent";
import { title } from "process";
export default function HandleRenderComponent({ export default function HandleRenderComponent({
left, left,
@ -21,8 +21,7 @@ export default function HandleRenderComponent({
colors, colors,
setFilterEdge, setFilterEdge,
showNode, showNode,
} : }: {
{
left: boolean; left: boolean;
nodes: any; nodes: any;
tooltipTitle?: string; tooltipTitle?: string;
@ -34,8 +33,7 @@ export default function HandleRenderComponent({
colors: string[]; colors: string[];
setFilterEdge: any; setFilterEdge: any;
showNode: any; showNode: any;
} }) {
) {
return ( return (
<Button <Button
unstyled unstyled
@ -79,14 +77,17 @@ export default function HandleRenderComponent({
style={{ style={{
background: background:
"conic-gradient(" + "conic-gradient(" +
colors.concat(colors[0]) colors
.concat(colors[0])
.map( .map(
(color, index) => (color, index) =>
color + color +
" " + " " +
((360 / colors.length) * (index) - (360 / (colors.length * 4))) + ((360 / colors.length) * index -
360 / (colors.length * 4)) +
"deg " + "deg " +
(((360 / colors.length) * (index))+ (360 / (colors.length * 4))) + ((360 / colors.length) * index +
360 / (colors.length * 4)) +
"deg", "deg",
) )
.join(" ,") + .join(" ,") +

View file

@ -1,16 +1,19 @@
import { useEffect } from "react"; import { useEffect } from "react";
import { LogType, VertexBuildTypeAPI } from "../../types/api"; import { LogType, VertexBuildTypeAPI } from "../../types/api";
const useValidationStatusString = (validationStatus: VertexBuildTypeAPI, setValidationString) => { const useValidationStatusString = (
validationStatus: VertexBuildTypeAPI,
setValidationString,
) => {
useEffect(() => { useEffect(() => {
if (validationStatus?.data?.logs) { if (validationStatus?.data?.logs) {
// if it is not a string turn it into a string // if it is not a string turn it into a string
console.log("validationStatus", validationStatus); console.log("validationStatus", validationStatus);
let newValidationString = ""; let newValidationString = "";
Object.values(validationStatus?.data?.logs).forEach((log: any) => { Object.values(validationStatus?.data?.logs).forEach((log: any) => {
if (log.type === "error" || log.type === "ValueError") { if (log.type === "error" || log.type === "ValueError") {
newValidationString += `${log.message}\n`; newValidationString += `${log.message}\n`;
} }
}); });
setValidationString(newValidationString); setValidationString(newValidationString);
} }

View file

@ -2,9 +2,9 @@ import React, { ChangeEvent, useState } from "react";
import { Input } from "../../components/ui/input"; import { Input } from "../../components/ui/input";
import { Label } from "../../components/ui/label"; import { Label } from "../../components/ui/label";
import { Textarea } from "../../components/ui/textarea"; import { Textarea } from "../../components/ui/textarea";
import useFlowsManagerStore from "../../stores/flowsManagerStore";
import { InputProps } from "../../types/components"; import { InputProps } from "../../types/components";
import { cn } from "../../utils/utils"; import { cn } from "../../utils/utils";
import useFlowsManagerStore from "../../stores/flowsManagerStore";
export const EditFlowSettings: React.FC<InputProps> = ({ export const EditFlowSettings: React.FC<InputProps> = ({
name, name,
@ -33,11 +33,11 @@ export const EditFlowSettings: React.FC<InputProps> = ({
if (value === invalidNameList![i]) { if (value === invalidNameList![i]) {
invalid = true; invalid = true;
break; break;
} }
if (value === currentFlow?.name) { if (value === currentFlow?.name) {
invalid = true; invalid = true;
break; break;
} }
invalid = false; invalid = false;
} }
setIsInvalidName(invalid); setIsInvalidName(invalid);

View file

@ -32,7 +32,7 @@ export default function InputListComponent({
<div <div
className={classNames( className={classNames(
value.length > 1 && editNode ? "my-1" : "", value.length > 1 && editNode ? "my-1" : "",
"flex flex-col gap-3 w-full", "flex w-full flex-col gap-3",
)} )}
> >
{value.map((singleValue, idx) => { {value.map((singleValue, idx) => {

View file

@ -1,10 +1,10 @@
import { useEffect, useRef, useState } from "react"; import { useEffect, useRef, useState } from "react";
import { KeyPairListComponentType } from "../../types/components"; import { KeyPairListComponentType } from "../../types/components";
import { cloneDeep } from "lodash";
import { classNames } from "../../utils/utils"; import { classNames } from "../../utils/utils";
import IconComponent from "../genericIconComponent"; import IconComponent from "../genericIconComponent";
import { Input } from "../ui/input"; import { Input } from "../ui/input";
import { cloneDeep } from "lodash";
export default function KeypairListComponent({ export default function KeypairListComponent({
value, value,

View file

@ -9,5 +9,5 @@ export default function StringReader({
<TextModal value={string}> <TextModal value={string}>
<span className="truncate">{string}</span> <span className="truncate">{string}</span>
</TextModal> </TextModal>
) );
} }

View file

@ -1,6 +1,7 @@
import "ag-grid-community/styles/ag-grid.css"; // Mandatory CSS required by the grid import "ag-grid-community/styles/ag-grid.css"; // Mandatory CSS required by the grid
import "ag-grid-community/styles/ag-theme-quartz.css"; // Optional Theme applied to the grid import "ag-grid-community/styles/ag-theme-quartz.css"; // Optional Theme applied to the grid
import { AgGridReact, AgGridReactProps } from "ag-grid-react"; import { AgGridReact, AgGridReactProps } from "ag-grid-react";
import cloneDeep from "lodash";
import { ElementRef, forwardRef, useRef, useState } from "react"; import { ElementRef, forwardRef, useRef, useState } from "react";
import { import {
DEFAULT_TABLE_ALERT_MSG, DEFAULT_TABLE_ALERT_MSG,
@ -13,7 +14,6 @@ import ForwardedIconComponent from "../genericIconComponent";
import { Alert, AlertDescription, AlertTitle } from "../ui/alert"; import { Alert, AlertDescription, AlertTitle } from "../ui/alert";
import TableOptions from "./components/TableOptions"; import TableOptions from "./components/TableOptions";
import resetGrid from "./utils/reset-grid-columns"; import resetGrid from "./utils/reset-grid-columns";
import cloneDeep from "lodash";
interface TableComponentProps extends AgGridReactProps { interface TableComponentProps extends AgGridReactProps {
columnDefs: NonNullable<AgGridReactProps["columnDefs"]>; columnDefs: NonNullable<AgGridReactProps["columnDefs"]>;
@ -98,7 +98,9 @@ const TableComponent = forwardRef<
if (props.onGridReady) props.onGridReady(params); if (props.onGridReady) props.onGridReady(params);
}; };
const onColumnMoved = (params) => { const onColumnMoved = (params) => {
const updatedColumnDefs = cloneDeep(params.columnApi.getAllGridColumns().map((col) => col.getColDef())); const updatedColumnDefs = cloneDeep(
params.columnApi.getAllGridColumns().map((col) => col.getColDef()),
);
params.api.setGridOption("columnDefs", updatedColumnDefs); params.api.setGridOption("columnDefs", updatedColumnDefs);
if (props.onColumnMoved) props.onColumnMoved(params); if (props.onColumnMoved) props.onColumnMoved(params);
}; };
@ -165,4 +167,3 @@ const TableComponent = forwardRef<
); );
export default TableComponent; export default TableComponent;

View file

@ -76,7 +76,9 @@ const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(
<> <>
<Comp <Comp
className={ className={
!unstyled ? buttonVariants({ variant, size, className }) : cn(className, "nocopy nowheel nopan nodelete nodrag noundo") !unstyled
? buttonVariants({ variant, size, className })
: cn(className, "nocopy nowheel nopan nodelete nodrag noundo")
} }
disabled={loading || disabled} disabled={loading || disabled}
{...(asChild ? {} : { type: type || "button" })} {...(asChild ? {} : { type: type || "button" })}
@ -89,7 +91,7 @@ const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(
<span className="absolute inset-0"> <span className="absolute inset-0">
<ForwardedIconComponent <ForwardedIconComponent
name={"Loader2"} name={"Loader2"}
className={"animate-spin m-auto h-full"} className={"m-auto h-full animate-spin"}
/> />
</span> </span>
</span> </span>

View file

@ -1,4 +1,4 @@
import React from 'react'; import React from "react";
const UpstashIcon = (props) => ( const UpstashIcon = (props) => (
<svg <svg

View file

@ -1,8 +1,9 @@
import React, { forwardRef } from "react"; import React, { forwardRef } from "react";
import UpstashIcon from "./UpstashIcon"; import UpstashIcon from "./UpstashIcon";
export const UpstashSvgIcon = forwardRef<SVGSVGElement, React.PropsWithChildren<{}>>( export const UpstashSvgIcon = forwardRef<
(props, ref) => { SVGSVGElement,
return <UpstashIcon ref={ref} {...props} />; React.PropsWithChildren<{}>
}, >((props, ref) => {
); return <UpstashIcon ref={ref} {...props} />;
});

View file

@ -1,35 +1,197 @@
const SvgMistralIcon = (props) => ( const SvgMistralIcon = (props) => (
<svg version="1.1" width="32px" height="32px" viewBox="0 0 256 233" xmlns="http://www.w3.org/2000/svg" preserveAspectRatio="xMidYMid"> <svg
<title>Mistral AI</title> version="1.1"
<g> width="32px"
<rect fill="#000000" x="186.181818" y="0" width="46.5454545" height="46.5454545"></rect> height="32px"
<rect fill="#F7D046" x="209.454545" y="0" width="46.5454545" height="46.5454545"></rect> viewBox="0 0 256 233"
<rect fill="#000000" x="0" y="0" width="46.5454545" height="46.5454545"></rect> xmlns="http://www.w3.org/2000/svg"
<rect fill="#000000" x="0" y="46.5454545" width="46.5454545" height="46.5454545"></rect> preserveAspectRatio="xMidYMid"
<rect fill="#000000" x="0" y="93.0909091" width="46.5454545" height="46.5454545"></rect> >
<rect fill="#000000" x="0" y="139.636364" width="46.5454545" height="46.5454545"></rect> <title>Mistral AI</title>
<rect fill="#000000" x="0" y="186.181818" width="46.5454545" height="46.5454545"></rect> <g>
<rect fill="#F7D046" x="23.2727273" y="0" width="46.5454545" height="46.5454545"></rect> <rect
<rect fill="#F2A73B" x="209.454545" y="46.5454545" width="46.5454545" height="46.5454545"></rect> fill="#000000"
<rect fill="#F2A73B" x="23.2727273" y="46.5454545" width="46.5454545" height="46.5454545"></rect> x="186.181818"
<rect fill="#000000" x="139.636364" y="46.5454545" width="46.5454545" height="46.5454545"></rect> y="0"
<rect fill="#F2A73B" x="162.909091" y="46.5454545" width="46.5454545" height="46.5454545"></rect> width="46.5454545"
<rect fill="#F2A73B" x="69.8181818" y="46.5454545" width="46.5454545" height="46.5454545"></rect> height="46.5454545"
<rect fill="#EE792F" x="116.363636" y="93.0909091" width="46.5454545" height="46.5454545"></rect> ></rect>
<rect fill="#EE792F" x="162.909091" y="93.0909091" width="46.5454545" height="46.5454545"></rect> <rect
<rect fill="#EE792F" x="69.8181818" y="93.0909091" width="46.5454545" height="46.5454545"></rect> fill="#F7D046"
<rect fill="#000000" x="93.0909091" y="139.636364" width="46.5454545" height="46.5454545"></rect> x="209.454545"
<rect fill="#EB5829" x="116.363636" y="139.636364" width="46.5454545" height="46.5454545"></rect> y="0"
<rect fill="#EE792F" x="209.454545" y="93.0909091" width="46.5454545" height="46.5454545"></rect> width="46.5454545"
<rect fill="#EE792F" x="23.2727273" y="93.0909091" width="46.5454545" height="46.5454545"></rect> height="46.5454545"
<rect fill="#000000" x="186.181818" y="139.636364" width="46.5454545" height="46.5454545"></rect> ></rect>
<rect fill="#EB5829" x="209.454545" y="139.636364" width="46.5454545" height="46.5454545"></rect> <rect
<rect fill="#000000" x="186.181818" y="186.181818" width="46.5454545" height="46.5454545"></rect> fill="#000000"
<rect fill="#EB5829" x="23.2727273" y="139.636364" width="46.5454545" height="46.5454545"></rect> x="0"
<rect fill="#EA3326" x="209.454545" y="186.181818" width="46.5454545" height="46.5454545"></rect> y="0"
<rect fill="#EA3326" x="23.2727273" y="186.181818" width="46.5454545" height="46.5454545"></rect> width="46.5454545"
</g> height="46.5454545"
</svg> ></rect>
); <rect
export default SvgMistralIcon; fill="#000000"
x="0"
y="46.5454545"
width="46.5454545"
height="46.5454545"
></rect>
<rect
fill="#000000"
x="0"
y="93.0909091"
width="46.5454545"
height="46.5454545"
></rect>
<rect
fill="#000000"
x="0"
y="139.636364"
width="46.5454545"
height="46.5454545"
></rect>
<rect
fill="#000000"
x="0"
y="186.181818"
width="46.5454545"
height="46.5454545"
></rect>
<rect
fill="#F7D046"
x="23.2727273"
y="0"
width="46.5454545"
height="46.5454545"
></rect>
<rect
fill="#F2A73B"
x="209.454545"
y="46.5454545"
width="46.5454545"
height="46.5454545"
></rect>
<rect
fill="#F2A73B"
x="23.2727273"
y="46.5454545"
width="46.5454545"
height="46.5454545"
></rect>
<rect
fill="#000000"
x="139.636364"
y="46.5454545"
width="46.5454545"
height="46.5454545"
></rect>
<rect
fill="#F2A73B"
x="162.909091"
y="46.5454545"
width="46.5454545"
height="46.5454545"
></rect>
<rect
fill="#F2A73B"
x="69.8181818"
y="46.5454545"
width="46.5454545"
height="46.5454545"
></rect>
<rect
fill="#EE792F"
x="116.363636"
y="93.0909091"
width="46.5454545"
height="46.5454545"
></rect>
<rect
fill="#EE792F"
x="162.909091"
y="93.0909091"
width="46.5454545"
height="46.5454545"
></rect>
<rect
fill="#EE792F"
x="69.8181818"
y="93.0909091"
width="46.5454545"
height="46.5454545"
></rect>
<rect
fill="#000000"
x="93.0909091"
y="139.636364"
width="46.5454545"
height="46.5454545"
></rect>
<rect
fill="#EB5829"
x="116.363636"
y="139.636364"
width="46.5454545"
height="46.5454545"
></rect>
<rect
fill="#EE792F"
x="209.454545"
y="93.0909091"
width="46.5454545"
height="46.5454545"
></rect>
<rect
fill="#EE792F"
x="23.2727273"
y="93.0909091"
width="46.5454545"
height="46.5454545"
></rect>
<rect
fill="#000000"
x="186.181818"
y="139.636364"
width="46.5454545"
height="46.5454545"
></rect>
<rect
fill="#EB5829"
x="209.454545"
y="139.636364"
width="46.5454545"
height="46.5454545"
></rect>
<rect
fill="#000000"
x="186.181818"
y="186.181818"
width="46.5454545"
height="46.5454545"
></rect>
<rect
fill="#EB5829"
x="23.2727273"
y="139.636364"
width="46.5454545"
height="46.5454545"
></rect>
<rect
fill="#EA3326"
x="209.454545"
y="186.181818"
width="46.5454545"
height="46.5454545"
></rect>
<rect
fill="#EA3326"
x="23.2727273"
y="186.181818"
width="46.5454545"
height="46.5454545"
></rect>
</g>
</svg>
);
export default SvgMistralIcon;

View file

@ -188,7 +188,12 @@ export default function ChatMessage({
<Markdown <Markdown
remarkPlugins={[remarkGfm, remarkMath]} remarkPlugins={[remarkGfm, remarkMath]}
rehypePlugins={[rehypeMathjax]} rehypePlugins={[rehypeMathjax]}
className={cn("markdown prose flex flex-col word-break-break-word dark:prose-invert",chatMessage === "" ? "text-chat-trigger-disabled" : "text-primary")} className={cn(
"markdown prose flex flex-col word-break-break-word dark:prose-invert",
chatMessage === ""
? "text-chat-trigger-disabled"
: "text-primary",
)}
components={{ components={{
pre({ node, ...props }) { pre({ node, ...props }) {
return <>{props.children}</>; return <>{props.children}</>;
@ -235,7 +240,7 @@ export default function ChatMessage({
}, },
]} ]}
activeTab={"0"} activeTab={"0"}
setActiveTab={() => { }} setActiveTab={() => {}}
/> />
) : ( ) : (
<code className={className} {...props}> <code className={className} {...props}>
@ -245,7 +250,9 @@ export default function ChatMessage({
}, },
}} }}
> >
{chatMessage===""?EMPTY_INPUT_SEND_MESSAGE:chatMessage} {chatMessage === ""
? EMPTY_INPUT_SEND_MESSAGE
: chatMessage}
</Markdown> </Markdown>
), ),
[chat.message, chatMessage], [chat.message, chatMessage],
@ -274,52 +281,63 @@ export default function ChatMessage({
} }
/> />
</button> </button>
<span className={cn("prose word-break-break-word dark:prose-invert",(chatMessage!==""?EMPTY_INPUT_SEND_MESSAGE:chatMessage?"text-primary":"text-chat-trigger-disabled"))}> <span
className={cn(
"prose word-break-break-word dark:prose-invert",
chatMessage !== ""
? EMPTY_INPUT_SEND_MESSAGE
: chatMessage
? "text-primary"
: "text-chat-trigger-disabled",
)}
>
{promptOpen {promptOpen
? template?.split("\n")?.map((line, index) => { ? template?.split("\n")?.map((line, index) => {
const regex = /{([^}]+)}/g; const regex = /{([^}]+)}/g;
let match; let match;
let parts: Array<JSX.Element | string> = []; let parts: Array<JSX.Element | string> = [];
let lastIndex = 0; let lastIndex = 0;
while ((match = regex.exec(line)) !== null) { while ((match = regex.exec(line)) !== null) {
// Push text up to the match // Push text up to the match
if (match.index !== lastIndex) { if (match.index !== lastIndex) {
parts.push(line.substring(lastIndex, match.index)); parts.push(line.substring(lastIndex, match.index));
} }
// Push div with matched text // Push div with matched text
if (chat.message[match[1]]) { if (chat.message[match[1]]) {
parts.push( parts.push(
<span className="chat-message-highlight"> <span className="chat-message-highlight">
{chat.message[match[1]]} {chat.message[match[1]]}
</span>, </span>,
); );
} }
// Update last index // Update last index
lastIndex = regex.lastIndex; lastIndex = regex.lastIndex;
} }
// Push text after the last match // Push text after the last match
if (lastIndex !== line.length) { if (lastIndex !== line.length) {
parts.push(line.substring(lastIndex)); parts.push(line.substring(lastIndex));
} }
return <p>{parts}</p>; return <p>{parts}</p>;
}) })
: (chatMessage === "" ? EMPTY_INPUT_SEND_MESSAGE : chatMessage) : chatMessage === ""
} ? EMPTY_INPUT_SEND_MESSAGE
: chatMessage}
</span> </span>
</> </>
) : ( ) : (
<div className="flex flex-col"> <div className="flex flex-col">
<span <span
className={`prose word-break-break-word dark:prose-invert ${chatMessage === "" className={`prose word-break-break-word dark:prose-invert ${
chatMessage === ""
? "text-chat-trigger-disabled" ? "text-chat-trigger-disabled"
: "text-primary" : "text-primary"
}`} }`}
data-testid={ data-testid={
"chat-message-" + chat.sender_name + "-" + chatMessage "chat-message-" + chat.sender_name + "-" + chatMessage
} }
> >
{(chatMessage === "" ? EMPTY_INPUT_SEND_MESSAGE : chatMessage)} {chatMessage === "" ? EMPTY_INPUT_SEND_MESSAGE : chatMessage}
</span> </span>
{chat.files && ( {chat.files && (
<div className="my-2 flex flex-col gap-5"> <div className="my-2 flex flex-col gap-5">

View file

@ -32,7 +32,7 @@ export default function TextModal({
<BaseModal size="medium-h-full" open={open} setOpen={setOpen}> <BaseModal size="medium-h-full" open={open} setOpen={setOpen}>
<BaseModal.Trigger className="h-full">{children}</BaseModal.Trigger> <BaseModal.Trigger className="h-full">{children}</BaseModal.Trigger>
<BaseModal.Header description={""}> <BaseModal.Header description={""}>
<span className="pr-2">View Text</span> <span className="pr-2">View Text</span>
<IconComponent <IconComponent
name="Type" name="Type"
className="h-6 w-6 pl-1 text-primary" className="h-6 w-6 pl-1 text-primary"
@ -42,7 +42,7 @@ export default function TextModal({
<BaseModal.Content> <BaseModal.Content>
<div className="flex h-full w-full flex-col transition-all"> <div className="flex h-full w-full flex-col transition-all">
<div className="h-[370px]"> <div className="h-[370px]">
<TextOutputView value={value} left={false} /> <TextOutputView value={value} left={false} />
</div> </div>
</div> </div>
</BaseModal.Content> </BaseModal.Content>

View file

@ -194,8 +194,8 @@ export default function Page({
function handleGroup(e: KeyboardEvent) { function handleGroup(e: KeyboardEvent) {
if (selectionMenuVisible) { if (selectionMenuVisible) {
e.preventDefault(); e.preventDefault();
(e as unknown as Event).stopImmediatePropagation(); (e as unknown as Event).stopImmediatePropagation();
handleGroupNode(); handleGroupNode();
} }
} }

View file

@ -1,10 +1,10 @@
import { useEffect, useState } from "react"; import { useEffect, useState } from "react";
import { useHotkeys } from "react-hotkeys-hook";
import { NodeToolbar } from "reactflow"; import { NodeToolbar } from "reactflow";
import { Button } from "../../../../components/ui/button"; import { Button } from "../../../../components/ui/button";
import { GradientGroup } from "../../../../icons/GradientSparkles"; import { GradientGroup } from "../../../../icons/GradientSparkles";
import useFlowStore from "../../../../stores/flowStore"; import useFlowStore from "../../../../stores/flowStore";
import { validateSelection } from "../../../../utils/reactflowUtils"; import { validateSelection } from "../../../../utils/reactflowUtils";
import { useHotkeys } from "react-hotkeys-hook";
export default function SelectionMenu({ export default function SelectionMenu({
onClick, onClick,
nodes, nodes,

View file

@ -528,7 +528,6 @@ const useFlowStore = create<FlowStoreType>((set, get) => ({
(id) => newFlowBuildStatus[id]?.status !== BuildStatus.BUILT, (id) => newFlowBuildStatus[id]?.status !== BuildStatus.BUILT,
); );
if (verticesToUpdate) { if (verticesToUpdate) {
useFlowStore.getState().updateBuildStatus(verticesToUpdate, status); useFlowStore.getState().updateBuildStatus(verticesToUpdate, status);
} }
@ -628,7 +627,6 @@ const useFlowStore = create<FlowStoreType>((set, get) => ({
}); });
}, },
updateBuildStatus: (nodeIdList: string[], status: BuildStatus) => { updateBuildStatus: (nodeIdList: string[], status: BuildStatus) => {
const newFlowBuildStatus = { ...get().flowBuildStatus }; const newFlowBuildStatus = { ...get().flowBuildStatus };
nodeIdList.forEach((id) => { nodeIdList.forEach((id) => {
newFlowBuildStatus[id] = { newFlowBuildStatus[id] = {

View file

@ -262,17 +262,18 @@ const useFlowsManagerStore = create<FlowsManagerStoreType>((set, get) => ({
// Return the id // Return the id
return id; return id;
} catch (error:any) { } catch (error: any) {
if(error.response?.data?.detail){ if (error.response?.data?.detail) {
useAlertStore.getState().setErrorData({ useAlertStore.getState().setErrorData({
title: "Could not load flows from database", title: "Could not load flows from database",
list: [error.response?.data?.detail], list: [error.response?.data?.detail],
}); });
} } else {
else{
useAlertStore.getState().setErrorData({ useAlertStore.getState().setErrorData({
title: "Could not load flows from database", title: "Could not load flows from database",
list: [error.message?? "An unexpected error occurred, please try again"], list: [
error.message ?? "An unexpected error occurred, please try again",
],
}); });
} }
throw error; // Re-throw the error so the caller can handle it if needed throw error; // Re-throw the error so the caller can handle it if needed

View file

@ -124,7 +124,7 @@ export type FlowStoreType = {
input_value, input_value,
files, files,
silent, silent,
setLockChat setLockChat,
}: { }: {
setLockChat: (lock: boolean) => void; setLockChat: (lock: boolean) => void;
startNodeId?: string; startNodeId?: string;

View file

@ -140,7 +140,7 @@ export async function buildVertices({
onValidateNodes(verticesOrderResponse.verticesToRun); onValidateNodes(verticesOrderResponse.verticesToRun);
} catch (e) { } catch (e) {
useFlowStore.getState().setIsBuilding(false); useFlowStore.getState().setIsBuilding(false);
setLockChat(false) setLockChat(false);
return; return;
} }
} }

View file

@ -1452,7 +1452,7 @@ export const createNewFlow = (
id: "", id: "",
is_component: flow?.is_component ?? false, is_component: flow?.is_component ?? false,
folder_id: folderId, folder_id: folderId,
endpoint_name:flow?.endpoint_name ?? undefined, endpoint_name: flow?.endpoint_name ?? undefined,
}; };
}; };