Remove unused import and fix formatting in IOOutputView, MenuBar, RenameLabel, and PageComponent
This commit is contained in:
parent
0d15491d36
commit
8376cd1a5b
4 changed files with 8 additions and 20 deletions
|
|
@ -1,4 +1,3 @@
|
||||||
import { cloneDeep } from "lodash";
|
|
||||||
import useFlowStore from "../../stores/flowStore";
|
import useFlowStore from "../../stores/flowStore";
|
||||||
import { IOOutputProps } from "../../types/components";
|
import { IOOutputProps } from "../../types/components";
|
||||||
import { Textarea } from "../ui/textarea";
|
import { Textarea } from "../ui/textarea";
|
||||||
|
|
|
||||||
|
|
@ -41,17 +41,15 @@ export const MenuBar = ({
|
||||||
|
|
||||||
function handleAddFlow(duplicate?: boolean) {
|
function handleAddFlow(duplicate?: boolean) {
|
||||||
try {
|
try {
|
||||||
if(duplicate) {
|
if (duplicate) {
|
||||||
if (!currentFlow) {
|
if (!currentFlow) {
|
||||||
throw new Error("No flow to duplicate");
|
throw new Error("No flow to duplicate");
|
||||||
}
|
}
|
||||||
addFlow(true, currentFlow).then((id) => {
|
addFlow(true, currentFlow).then((id) => {
|
||||||
setSuccessData({title:"Flow duplicated successfully"});
|
setSuccessData({ title: "Flow duplicated successfully" });
|
||||||
navigate("/flow/" + id);
|
navigate("/flow/" + id);
|
||||||
});
|
});
|
||||||
}
|
} else {
|
||||||
else
|
|
||||||
{
|
|
||||||
addFlow(true).then((id) => {
|
addFlow(true).then((id) => {
|
||||||
navigate("/flow/" + id);
|
navigate("/flow/" + id);
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,7 @@ export default function RenameLabel(props) {
|
||||||
}
|
}
|
||||||
resizeInput();
|
resizeInput();
|
||||||
return () => {
|
return () => {
|
||||||
if(isRename) document.removeEventListener("keydown", () => {});
|
if (isRename) document.removeEventListener("keydown", () => {});
|
||||||
};
|
};
|
||||||
}, [isRename]);
|
}, [isRename]);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -104,29 +104,20 @@ export default function Page({
|
||||||
) {
|
) {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
takeSnapshot();
|
takeSnapshot();
|
||||||
if (
|
if (validateSelection(lastSelection!, edges).length === 0) {
|
||||||
validateSelection(lastSelection!, edges).length === 0
|
|
||||||
) {
|
|
||||||
const { newFlow, removedEdges } = generateFlow(
|
const { newFlow, removedEdges } = generateFlow(
|
||||||
lastSelection!,
|
lastSelection!,
|
||||||
nodes,
|
nodes,
|
||||||
edges,
|
edges,
|
||||||
getRandomName()
|
getRandomName()
|
||||||
);
|
);
|
||||||
const newGroupNode = generateNodeFromFlow(
|
const newGroupNode = generateNodeFromFlow(newFlow, getNodeId);
|
||||||
newFlow,
|
const newEdges = reconnectEdges(newGroupNode, removedEdges);
|
||||||
getNodeId
|
|
||||||
);
|
|
||||||
const newEdges = reconnectEdges(
|
|
||||||
newGroupNode,
|
|
||||||
removedEdges
|
|
||||||
);
|
|
||||||
setNodes((oldNodes) => [
|
setNodes((oldNodes) => [
|
||||||
...oldNodes.filter(
|
...oldNodes.filter(
|
||||||
(oldNodes) =>
|
(oldNodes) =>
|
||||||
!lastSelection?.nodes.some(
|
!lastSelection?.nodes.some(
|
||||||
(selectionNode) =>
|
(selectionNode) => selectionNode.id === oldNodes.id
|
||||||
selectionNode.id === oldNodes.id
|
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
newGroupNode,
|
newGroupNode,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue