buildTweaks migration done
This commit is contained in:
parent
ffda93ee34
commit
28c0b35fd7
4 changed files with 11 additions and 9 deletions
|
|
@ -3,7 +3,8 @@
|
||||||
import { MessageSquare } from "lucide-react";
|
import { MessageSquare } from "lucide-react";
|
||||||
import { FlowType } from "./types/flow";
|
import { FlowType } from "./types/flow";
|
||||||
import { TabsState } from "./types/tabs";
|
import { TabsState } from "./types/tabs";
|
||||||
import { buildInputs, buildTweaks } from "./utils";
|
import { buildInputs } from "./utils";
|
||||||
|
import { buildTweaks } from "./utils/reactflowUtils";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* constants fpr programming languages box on chat form
|
* constants fpr programming languages box on chat form
|
||||||
|
|
|
||||||
|
|
@ -51,8 +51,8 @@ import {
|
||||||
import { darkContext } from "../../contexts/darkContext";
|
import { darkContext } from "../../contexts/darkContext";
|
||||||
import { TabsContext } from "../../contexts/tabsContext";
|
import { TabsContext } from "../../contexts/tabsContext";
|
||||||
import { FlowType } from "../../types/flow/index";
|
import { FlowType } from "../../types/flow/index";
|
||||||
import { buildTweaks, classNames } from "../../utils";
|
import { classNames } from "../../utils";
|
||||||
|
import { buildTweaks } from "../../utils/reactflowUtils";
|
||||||
export default function ApiModal({ flow }: { flow: FlowType }) {
|
export default function ApiModal({ flow }: { flow: FlowType }) {
|
||||||
const [open, setOpen] = useState(true);
|
const [open, setOpen] = useState(true);
|
||||||
const { dark } = useContext(darkContext);
|
const { dark } = useContext(darkContext);
|
||||||
|
|
|
||||||
|
|
@ -209,12 +209,6 @@ export function buildInputs(tabsState, id) {
|
||||||
: '{"input": "message"}';
|
: '{"input": "message"}';
|
||||||
}
|
}
|
||||||
|
|
||||||
export function buildTweaks(flow) {
|
|
||||||
return flow.data.nodes.reduce((acc, node) => {
|
|
||||||
acc[node.data.id] = {};
|
|
||||||
return acc;
|
|
||||||
}, {});
|
|
||||||
}
|
|
||||||
export function validateNode(
|
export function validateNode(
|
||||||
n: NodeType,
|
n: NodeType,
|
||||||
reactFlowInstance: ReactFlowInstance
|
reactFlowInstance: ReactFlowInstance
|
||||||
|
|
|
||||||
|
|
@ -159,3 +159,10 @@ export function updateIds(newFlow, getNodeId) {
|
||||||
e.targetHandle;
|
e.targetHandle;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function buildTweaks(flow) {
|
||||||
|
return flow.data.nodes.reduce((acc, node) => {
|
||||||
|
acc[node.data.id] = {};
|
||||||
|
return acc;
|
||||||
|
}, {});
|
||||||
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue