The changes were made to improve consistency and ensure that the displayed node name and description are always in sync with the data received from the API response. By using the `data.node?.display_name` and `data.node?.description` properties, we can dynamically update the node name and description without relying on local variables. This also allows for easier maintenance and reduces the risk of displaying outdated or incorrect information.
The code in the updateGroupNodeTemplate function has been modified to include a condition that checks if the type is "code" and if the template's proxy ID includes "CustomComponent". If both conditions are met, the show property of the template is set to false. This change was made to hide the code template with the CustomComponent proxy in the React Flow application.
fix(reactflowUtils.ts): update mergeNodeTemplates function to include truncated display name and extracted id in template key
feat(utils.ts): add utility functions to extract id from long id and truncate display name
fix(reactflowUtils.ts): fix typo in function name scapedJSONStringfy to escapedJSONStringify
fix(reactflowUtils.ts): fix typo in function name customStringify to escapedJSONStringify
feat(reactflowUtils.ts): add inputTypes property to targetHandleType to improve functionality and accuracy of handle connection check
fix(GenericNode): remove console.log statement
fix(codeAreaComponent): add readonly prop to CodeAreaModal
fix(codeTabsComponent): add readonly prop to CodeAreaComponent and PromptAreaComponent
fix(promptComponent): add readonly prop to GenericModal
fix(EditNodeModal): add readonly prop to CodeAreaComponent
fix(codeAreaModal): add readonly prop to AceEditor in CodeAreaModal
fix(genericModal): add readonly prop to Textarea in GenericModal
fix(reactflowUtils): remove unnecessary code in updateGroupNodeTemplate function
fix(types): add 'selected' property to NodeType to indicate if a node is selected
fix(reactflowUtils): change 'dynamic' property to 'readonly' when updating group node template
fix(reactflowUtils): update group node template fields with correct values and set 'selected' property to false
fix(tabsContext): change parameter order in addFlow function signature to match the implementation
fix(tabsContext): change parameter order in addFlow function call to match the implementation
fix(communityPage): change parameter order in addFlow function call to match the implementation
fix(mainPage): remove unnecessary parameter in addFlow function call to improve code readability
fix(tabs): change parameter order in addFlow function signature to match the implementation
The changes in this commit add logic to deselect a group node when it is expanded in the ReactFlowUtils file. This is done by setting the 'selected' property of the group node to false. The purpose of this change is to ensure that when a group node is expanded, it is not selected by default.
fix(codeAreaModal): remove unused isTweakPage variable from useContext
fix(reactflowUtils): remove unnecessary null assertion in unselectAllNodes function
feat(GenericNode): add support for editing node name and description
fix(InputComponent): add autoFocus and onBlur props
fix(tabsContext): update sourceHandle object in edge data
fix(PageComponent): generate random name for new group node
fix(reactflowUtils): update handleKeyDown function to accept HTMLTextAreaElement
feat(GenericNode): add position prop to GenericNode component to pass the position of the node
fix(nodeToolbarComponent): import updateFlowPosition from reactflowUtils to fix reference error
feat(nodeToolbarComponent): add position prop to NodeToolbarComponent to pass the position of the node
fix(components): import XYPosition from reactflow to fix type error
feat(components): add position prop to nodeToolbarPropsType to pass the position of the node
feat(reactflowUtils): add expandGroupNode function to expand a group node and update the flow
The property name `display_name` was incorrectly used instead of `name` in the template rendering logic. This has been fixed to correctly display the name of the template parameter.
feat(utils/reactflowUtils): add 'toTitleCase' function to convert strings to title case
refactor(utils/reactflowUtils): update function names and comments
refactor(utils/reactflowUtils): update 'updateGroupNodeTemplate' function to handle 'dynamic' property
refactor(utils/reactflowUtils): update 'mergeNodeTemplates' function to handle 'display_name' and 'dynamic' properties
refactor(utils/reactflowUtils): update 'isHandleConnected' function to handle 'proxy' property
refactor(utils/reactflowUtils): update 'generateNodeFromFlow' function to set 'type' as 'genericNode' instead of 'groupNode'
feat(PageComponent/index.tsx): add functionality to generate a new flow and node from a selection and update the nodes and edges accordingly
feat(PageComponent/index.tsx): add validation for selection and display error message if selection is invalid
feat(SelectionMenuComponent): create SelectionMenu component to display a toolbar with a "Group" button for node selection
fix(styleUtils): import Group icon from lucide-react to use in SelectionMenuComponent
The `connectedInputNodesOnHandle` function is added to retrieve the nodes connected to the input handle of a given node. It takes the `nodeId`, `handleId`, `nodes`, and `edges` as parameters and returns an array of connected nodes.
The `ungroupNode` function is added to ungroup a group node. It takes the `groupNode` and `BaseFlow` as parameters and updates the edges and nodes in the `BaseFlow` to redirect the edges to the correct proxy node.
The `processFLow` function is added to process the flow object recursively. It clones the flow object and iterates through the nodes to ungroup any group nodes and update the edges and nodes accordingly.
Note: No newline at the end of the file.
fix(utils/reactflowUtils.ts): import TemplateVariableType from types/api
feat(utils/reactflowUtils.ts): add mergeNodeTemplates function to merge node templates and update display names
feat(utils/reactflowUtils.ts): add isHandleConnected function to check if a handle is connected to an edge
refactor(utils/reactflowUtils.ts): remove TODO comments and update comments for mergeNodeTemplates and isHandleConnected functions
feat(utils/reactflowUtils.ts): add generateNodeTemplate function to generate node templates from a flow
feat(reactflowUtils.ts): add function to update group node template to set visibility of basic types to advanced true
feat(reactflowUtils.ts): add function to generate node template for group node based on flow data
feat(reactflowUtils.ts): add function to generate node from flow data
feat(reactflowUtils.ts): add concatFlows function to concatenate nodes and edges from a FlowType object to a ReactFlowInstance
feat(reactflowUtils.ts): add generateNodeFromFlow function to generate a NodeType object from a FlowType object
feat(reactflowUtils.ts): add filterFlow function to filter out selected nodes and edges from the flow
feat(reactflowUtils.ts): add updateFlowPosition function to update the position of nodes in the flow based on a new position
fix(reactflowUtils.ts): fix return type of generateFlow function to use generateFlowType type instead of inline type definition
The getMiddlePoint function calculates the average position of multiple nodes by summing up the x and y coordinates of each node and dividing them by the total number of nodes. This allows us to find the middle point or center of a group of nodes. This function can be used to determine the position of a new node based on the average position of existing nodes.