Skip to content

Commit

Permalink
fix: lint error
Browse files Browse the repository at this point in the history
  • Loading branch information
lexmin0412 committed Jan 8, 2024
1 parent 7196303 commit c0ecb47
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/App.test.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {render, screen} from "@testing-library/react";
import "@testing-library/jest-dom";
import Home from './pages/home'
import Home from './pages/node-selected'

describe("test", () => {
test("first unit test", () => {
Expand Down
4 changes: 3 additions & 1 deletion src/pages/flow-edit/index.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// @ts-nocheck
import {
BasicNode,
EditNode,
Expand Down Expand Up @@ -26,7 +27,7 @@ const ProFlowEdit = () => {
const {styles} = useStyles();
const [open, setOpen] = useState(false);

const onDragOver = useCallback((event) => {
const onDragOver = useCallback((event: any) => {
event.preventDefault();
event.dataTransfer.dropEffect = "move";
}, []);
Expand All @@ -41,6 +42,7 @@ const ProFlowEdit = () => {
return;
}

// @ts-ignore
const position = editor.screenToFlowPosition({
x: event.clientX,
y: event.clientY,
Expand Down
8 changes: 4 additions & 4 deletions src/pages/flow-edit/sidebar.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import useStyles from "./css/sidebar.style.ts";
import useStyles from "./css/sidebar.style";

export default () => {
const {styles, cx} = useStyles();

const onDragStart = (event, nodeType) => {
const onDragStart = (event: any, nodeType: any) => {
event.dataTransfer.setData("application/reactflow", nodeType);
event.dataTransfer.effectAllowed = "move";
};
Expand All @@ -12,7 +12,7 @@ export default () => {
<div className={styles.aside}>
<div className={styles.description}>您可以将这些节点拖到上面的画布中</div>
<div
className={cx(styles.dndnode, styles.input)}
className={cx(styles.dndnode)}
onDragStart={(event) => onDragStart(event, "StringNode")}
draggable
>
Expand All @@ -26,7 +26,7 @@ export default () => {
BasicNode Node
</div>
<div
className={cx(styles.dndnode, styles.output)}
className={cx(styles.dndnode)}
onDragStart={(event) => onDragStart(event, "EditNode")}
draggable
>
Expand Down
5 changes: 2 additions & 3 deletions src/pages/node-selected/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,18 @@ import {
useFlowViewer,
} from "@ant-design/pro-flow";
import {useState} from "react";
import PageWrapper from "../../components/layout/page-wrapper";
import useStyles from "./css/index.style";
import {edges, nodes} from "./data";

function App() {
const {selectNode, selectEdges, selectNodes} = useFlowViewer();
const [node, setNode] = useState(null);
const [node, setNode] = useState<any>(null);
const {styles} = useStyles();

return (
<div className={styles.container}>
<FlowView
onNodeClick={(e, node) => {
onNodeClick={(_e, node) => {
setNode(node);
selectNodes(["a1", "a2", "a3"], SelectType.SUB_SELECT);
selectNode(node.id, SelectType.SELECT);
Expand Down

0 comments on commit c0ecb47

Please sign in to comment.