-
-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added a custom file object node and added graceful handling of comple…
…ted procedures
- Loading branch information
Showing
5 changed files
with
47 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
38 changes: 38 additions & 0 deletions
38
src/frontend/src/components/node_editor/customFileObjectNode.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import React, {memo} from 'react'; | ||
import {Handle, NodeProps, Position, Connection} from '@xyflow/react'; | ||
import {run_sequence} from "../../utils/node_editor/run_sequence"; | ||
|
||
function CustomFileObjectNode(props: { id: string, data: Record<string, string> }) { | ||
// Custom connection validation function for `file_object` handle | ||
const isValidConnection = () => { | ||
console.log("isValidConnection"); | ||
return true; | ||
}; | ||
// console.log("ProcedureNode data:", data); | ||
return ( | ||
<div className="bg-gray-200 text-gray-800 rounded-md min-w-24"> | ||
{/* Header Row */} | ||
<div className="flex justify-center items-center mb-4"> | ||
<div className="font-bold text-center text-xs">"{props.data.label}"</div> | ||
</div> | ||
|
||
{/* Handle Rows */} | ||
<div className="flex flex-col"> | ||
{/* File Object Source Handle Row */} | ||
<div className={"flex flex-row items-center"}> | ||
<span className={"m-auto relative"}> | ||
<Handle | ||
type="source" | ||
id="file_object_out" | ||
position={Position.Bottom} | ||
style={{position: "absolute", background: '#555'}} | ||
isConnectable={true} | ||
/> | ||
</span> | ||
</div> | ||
</div> | ||
</div> | ||
); | ||
} | ||
|
||
export default memo(CustomFileObjectNode); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters