Fix styleUtils import and remove unnecessary lines
This commit is contained in:
parent
3a07ad38b0
commit
9cfb03fbc9
47 changed files with 219 additions and 574 deletions
|
|
@ -5,6 +5,7 @@ import Tooltip from "../../components/TooltipComponent";
|
|||
import IconComponent from "../../components/genericIconComponent";
|
||||
import InputComponent from "../../components/inputComponent";
|
||||
import { Button } from "../../components/ui/button";
|
||||
import Loading from "../../components/ui/loading";
|
||||
import { Textarea } from "../../components/ui/textarea";
|
||||
import { priorityFields } from "../../constants/constants";
|
||||
import { BuildStatus } from "../../constants/enums";
|
||||
|
|
@ -18,7 +19,6 @@ import { handleKeyDown, scapedJSONStringfy } from "../../utils/reactflowUtils";
|
|||
import { nodeColors, nodeIconsLucide } from "../../utils/styleUtils";
|
||||
import { classNames, cn, getFieldTitle } from "../../utils/utils";
|
||||
import ParameterComponent from "./components/parameterComponent";
|
||||
import Loading from "../../components/ui/loading";
|
||||
|
||||
export default function GenericNode({
|
||||
data,
|
||||
|
|
@ -166,7 +166,7 @@ export default function GenericNode({
|
|||
);
|
||||
|
||||
const getStatusClassName = (
|
||||
validationStatus: validationStatusType | null,
|
||||
validationStatus: validationStatusType | null
|
||||
) => {
|
||||
if (validationStatus && validationStatus.valid) {
|
||||
return "green-status";
|
||||
|
|
@ -181,10 +181,10 @@ export default function GenericNode({
|
|||
|
||||
const renderIconPlayOrPauseComponents = (
|
||||
buildStatus: BuildStatus | undefined,
|
||||
validationStatus: validationStatusType | null,
|
||||
validationStatus: validationStatusType | null
|
||||
) => {
|
||||
if (buildStatus === BuildStatus.BUILDING) {
|
||||
return <Loading/>
|
||||
return <Loading />;
|
||||
} else {
|
||||
const className = getStatusClassName(validationStatus);
|
||||
return <>{getIconPlayOrPauseComponent("Play", className)}</>;
|
||||
|
|
@ -446,7 +446,9 @@ export default function GenericNode({
|
|||
}));
|
||||
}}
|
||||
>
|
||||
<Tooltip title={<span>{pinned ? "Pin Output" : "Unpin Output"}</span>}>
|
||||
<Tooltip
|
||||
title={<span>{pinned ? "Pin Output" : "Unpin Output"}</span>}
|
||||
>
|
||||
<div className="generic-node-status-position flex items-center">
|
||||
<IconComponent
|
||||
name={"Pin"}
|
||||
|
|
@ -461,12 +463,12 @@ export default function GenericNode({
|
|||
)}
|
||||
{showNode && (
|
||||
<Button
|
||||
|
||||
variant="outline"
|
||||
className={"h-9 px-1.5"}
|
||||
onClick={() => {
|
||||
if(data?.build_status === BuildStatus.BUILDING || isBuilding) return;
|
||||
buildFlow(data.id)
|
||||
if (data?.build_status === BuildStatus.BUILDING || isBuilding)
|
||||
return;
|
||||
buildFlow(data.id);
|
||||
}}
|
||||
>
|
||||
<div>
|
||||
|
|
@ -499,7 +501,8 @@ export default function GenericNode({
|
|||
<div className="generic-node-status-position flex items-center justify-center">
|
||||
{renderIconPlayOrPauseComponents(
|
||||
data?.build_status,
|
||||
validationStatus)}
|
||||
validationStatus
|
||||
)}
|
||||
</div>
|
||||
</Tooltip>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@ export default function Chat({ flow }: ChatType): JSX.Element {
|
|||
{/* <BuildTrigger open={open} flow={flow} /> */}
|
||||
{hasIO && (
|
||||
<IOView open={open} setOpen={setOpen}>
|
||||
<ChatTrigger />
|
||||
<ChatTrigger />
|
||||
</IOView>
|
||||
)}
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -3,9 +3,6 @@ import IconComponent from "../../../components/genericIconComponent";
|
|||
import { Textarea } from "../../../components/ui/textarea";
|
||||
import { chatInputType } from "../../../types/components";
|
||||
import { classNames } from "../../../utils/utils";
|
||||
import { Button } from "../../ui/button";
|
||||
import { Input } from "../../ui/input";
|
||||
import { Popover, PopoverContent, PopoverTrigger } from "../../ui/popover";
|
||||
|
||||
export default function ChatInput({
|
||||
lockChat,
|
||||
|
|
@ -113,7 +110,8 @@ export default function ChatInput({
|
|||
)}
|
||||
</button>
|
||||
</div>
|
||||
</div>{/*
|
||||
</div>
|
||||
{/*
|
||||
<Popover>
|
||||
<PopoverTrigger asChild>
|
||||
<Button variant="primary" className="h-13 px-4">
|
||||
|
|
|
|||
|
|
@ -106,7 +106,7 @@ export default function newChatView(): JSX.Element {
|
|||
}, []);
|
||||
|
||||
async function sendMessage(count = 1): Promise<void> {
|
||||
if(isBuilding) return;
|
||||
if (isBuilding) return;
|
||||
const { nodes, edges } = getFlow();
|
||||
let nodeValidationErrors = validateNodes(nodes, edges);
|
||||
if (nodeValidationErrors.length === 0) {
|
||||
|
|
@ -114,7 +114,7 @@ export default function newChatView(): JSX.Element {
|
|||
setLockChat(true);
|
||||
setChatValue("");
|
||||
const chatInputId = inputIds.find((inputId) =>
|
||||
inputId.includes("ChatInput")
|
||||
inputId.includes("ChatInput")
|
||||
);
|
||||
const chatInput: NodeType = getNode(chatInputId!) as NodeType;
|
||||
if (chatInput) {
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@ const nodeTypes = {
|
|||
genericNode: GenericNode,
|
||||
};
|
||||
|
||||
export default function Page({
|
||||
export default function Page({
|
||||
flow,
|
||||
view,
|
||||
}: {
|
||||
|
|
@ -377,7 +377,7 @@ export default function Page({
|
|||
zoomOnPinch={!view}
|
||||
panOnDrag={!view}
|
||||
proOptions={{ hideAttribution: true }}
|
||||
onPaneClick={onPaneClick}
|
||||
onPaneClick={onPaneClick}
|
||||
>
|
||||
<Background className="" />
|
||||
{!view && (
|
||||
|
|
|
|||
|
|
@ -80,7 +80,6 @@ export default function NodeToolbarComponent({
|
|||
window.open(url, "_blank", "noreferrer");
|
||||
};
|
||||
|
||||
|
||||
useEffect(() => {
|
||||
if (!showModalAdvanced) {
|
||||
onCloseAdvancedModal!(false);
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@ import { cloneDeep } from "lodash";
|
|||
import {
|
||||
Edge,
|
||||
EdgeChange,
|
||||
MarkerType,
|
||||
Node,
|
||||
NodeChange,
|
||||
addEdge,
|
||||
|
|
@ -10,7 +9,6 @@ import {
|
|||
applyNodeChanges,
|
||||
} from "reactflow";
|
||||
import { create } from "zustand";
|
||||
import { INPUT_TYPES, OUTPUT_TYPES } from "../constants/constants";
|
||||
import { BuildStatus } from "../constants/enums";
|
||||
import { getFlowPool, updateFlowInDatabase } from "../controllers/API";
|
||||
import {
|
||||
|
|
@ -123,7 +121,7 @@ const useFlowStore = create<FlowStoreType>((set, get) => ({
|
|||
});
|
||||
|
||||
const flowsManager = useFlowsManagerStore.getState();
|
||||
if(!(get().isBuilding)){
|
||||
if (!get().isBuilding) {
|
||||
flowsManager.autoSaveCurrentFlow(
|
||||
newChange,
|
||||
newEdges,
|
||||
|
|
@ -139,7 +137,7 @@ const useFlowStore = create<FlowStoreType>((set, get) => ({
|
|||
});
|
||||
|
||||
const flowsManager = useFlowsManagerStore.getState();
|
||||
if(!(get().isBuilding)){
|
||||
if (!get().isBuilding) {
|
||||
flowsManager.autoSaveCurrentFlow(
|
||||
get().nodes,
|
||||
newChange,
|
||||
|
|
@ -345,7 +343,7 @@ const useFlowStore = create<FlowStoreType>((set, get) => ({
|
|||
sourceHandle: scapeJSONParse(connection.sourceHandle!),
|
||||
},
|
||||
style: { stroke: "#555" },
|
||||
className:"stroke-foreground stroke-connection",
|
||||
className: "stroke-foreground stroke-connection",
|
||||
},
|
||||
oldEdges
|
||||
);
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import { create } from "zustand";
|
||||
import { checkHasApiKey, checkHasStore } from "../controllers/API";
|
||||
import { checkHasStore } from "../controllers/API";
|
||||
import { StoreStoreType } from "../types/zustand/store";
|
||||
|
||||
export const useStoreStore = create<StoreStoreType>((set) => ({
|
||||
|
|
|
|||
|
|
@ -63,13 +63,15 @@ export async function buildVertices({
|
|||
onBuildError,
|
||||
verticesIds,
|
||||
buildResults,
|
||||
stopBuild:()=>{stop=true}
|
||||
stopBuild: () => {
|
||||
stop = true;
|
||||
},
|
||||
});
|
||||
if(stop){
|
||||
if (stop) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(stop){
|
||||
if (stop) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
@ -96,7 +98,7 @@ async function buildVertex({
|
|||
onBuildError?: (title, list, idList: string[]) => void;
|
||||
verticesIds: string[];
|
||||
buildResults: boolean[];
|
||||
stopBuild:()=>void;
|
||||
stopBuild: () => void;
|
||||
}) {
|
||||
try {
|
||||
const buildRes = await postBuildVertex(flowId, id);
|
||||
|
|
|
|||
|
|
@ -4,8 +4,8 @@ import {
|
|||
Bell,
|
||||
BookMarked,
|
||||
BookmarkPlus,
|
||||
Boxes,
|
||||
Bot,
|
||||
Boxes,
|
||||
Cable,
|
||||
Check,
|
||||
CheckCircle2,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue