Commit graph

4,849 commits

Author SHA1 Message Date
anovazzi1
d9073aba39 refactor(tabsContext.tsx): rename processFlowEdges and processFlowNodes functions to processDataFromFlow to improve clarity and consistency
refactor(tabsContext.tsx): remove console.log statement for old edges
refactor(tabsContext.tsx): add comments to indicate updating edges colors and baseclasses in edges
refactor(tabsContext.tsx): add comments to indicate updating baseclasses in edges
refactor(tabsContext.tsx): add comments to indicate adding animation to text type edges
refactor(tabsContext.tsx): update updateIds function to handle GroupNode type nodes
refactor(reactflowUtils.ts): update updateIds function to handle GroupNode type nodes
refactor(reactflowUtils.ts): update updateIds function to handle sourceHandle and targetHandle ids in edges
2023-09-21 10:56:50 -03:00
anovazzi1
bf1597a9f4 refactor(tabsContext.tsx): simplify code in TabsProvider component
The changes in this commit simplify the code in the TabsProvider component in the tabsContext.tsx file. Here's a summary of the changes:

- In the `createNewFlow` function, the `flowData` parameter is now of type `ReactFlowJsonObject | null` instead of `{ data: ReactFlowJsonObject | null; description: string }`. This simplifies the function signature and removes the need for destructuring the `flowData` object.
- The `extractDataFromFlow` function has been renamed to `processDataFromFlow` to better reflect its purpose. The function now returns only the `data` property from the `flow` object instead of an object with `data` and `description` properties.
- The `description` property in the `createNewFlow` function is now set to `flow.description ?? getRandomDescription()`. This ensures that if the `flow` object has a `description` property, it is used, otherwise a random description is generated.
- The `processFlowEdges` and `processFlowNodes` functions are no longer called in the `createNewFlow` function. It seems that these functions are defined elsewhere and are not necessary in this context.

These changes simplify the code and improve readability by removing unnecessary checks and simplifying function signatures.
2023-09-21 10:30:59 -03:00
anovazzi1
577046523a fix(tabsContext.tsx): change parameter type of newProject in uploadFlow function from optional boolean to required boolean to improve clarity and prevent potential bugs
fix(tabsContext.tsx): change parameter type of newProject in addFlow function from optional Boolean to required Boolean to improve clarity and prevent potential bugs
fix(extraSidebarComponent/index.tsx): change argument of uploadFlow function from undefined to false to fix a bug where uploadFlow was not being called correctly
fix(tabs/index.ts): change parameter type of newFlow in uploadFlow function from optional boolean to required boolean to improve clarity and prevent potential bugs
2023-09-21 10:08:12 -03:00
anovazzi1
fbb6f0839a skip groupNode from node update 2023-09-20 23:22:17 -03:00
anovazzi1
7bc3f9ed30 skip groupNode from node update 2023-09-20 23:19:53 -03:00
anovazzi1
6e609c8dd0 fix(PageComponent): fix initial state of selectionEnded to be true instead of false to prevent unnecessary re-rendering 2023-09-18 20:38:56 -03:00
anovazzi1
fda2047fec code format 2023-09-18 20:37:01 -03:00
anovazzi1
1a8d522236 fix(reactflowUtils.ts): update generated node id to include "GroupNode" prefix for better identification
fix(utils.ts): truncate component name and display name to 15 characters for better readability
2023-09-18 20:36:29 -03:00
anovazzi1
fe85435488 format 2023-09-18 20:26:32 -03:00
anovazzi1
9e01aa1580 fix(parameterComponent): import extractIdFromLongId function to fix missing reference error
feat(parameterComponent): add proxy prop to ParameterComponentType to pass proxy information to the component
feat(GenericNode): pass proxy information from node template to ParameterComponent
feat(types): add proxy field to proxy object in ParameterComponentType
fix(reactflowUtils): remove unnecessary code for extracting node id
2023-09-18 20:25:42 -03:00
anovazzi1
59cd201ad9 refactor(GenericNode/index.tsx): use data from API response to display node name and description instead of local variables
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.
2023-09-18 19:48:14 -03:00
anovazzi1
15a2c95351 fix(PageComponent): update validateSelection function to include edges in the selection if only nodes are selected 2023-09-18 19:32:24 -03:00
anovazzi1
3fc08cee93 chore(reactflowUtils.ts): add condition to hide code template with CustomComponent proxy in updateGroupNodeTemplate function
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.
2023-09-18 18:44:42 -03:00
anovazzi1
c61f622612 refactor(reactflowUtils.ts): import additional utility functions and update function calls to match new function names
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
2023-09-18 18:43:15 -03:00
anovazzi1
3305983cc4 refactor(reactflowUtils.ts): extract duplicated code into a helper function to improve readability and maintainability
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
2023-09-18 18:21:09 -03:00
anovazzi1
44b6171800 remove console.log 2023-09-14 22:31:59 -03:00
anovazzi1
be1ee757a4 fix(parameterComponent): add readonly prop to CodeAreaComponent and PromptAreaComponent based on dynamic property in template
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
2023-09-14 22:31:21 -03:00
anovazzi1
a273aab2cc fix(types): add 'readonly' property to TemplateVariableType to indicate if a variable is read-only
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
2023-09-14 21:51:55 -03:00
anovazzi1
9647fe0b69 fix bug on infinity icon 2023-09-14 21:17:23 -03:00
anovazzi1
b65b3ce89a fix(EditNodeModal): update the display of the node type in the modal header to use the display name instead of the type property for better clarity and accuracy 2023-09-14 20:58:31 -03:00
anovazzi1
c0befa83ac fix(reactflowUtils.ts): only add updated edges to the array if they are connected to the group node 2023-09-14 20:47:36 -03:00
anovazzi1
c5d9a390eb fix(reactflowUtils.ts): add missing assignment of newSourceHandle to newEdge.data.sourceHandle to ensure data consistency
fix(reactflowUtils.ts): add missing assignment of newTargetHandle to newEdge.data.targetHandle to ensure data consistency
2023-09-14 20:34:19 -03:00
anovazzi1
4cdd66d1d3 fix(reactflowUtils.ts): add missing assignment of newSourceHandle to newEdge.data.sourceHandle to ensure data consistency
fix(reactflowUtils.ts): add missing assignment of newTargetHandle to newEdge.data.targetHandle to ensure data consistency
2023-09-14 20:22:29 -03:00
anovazzi1
1868540a10 fix(menuBar): remove unnecessary parameter in addFlow function call to improve code readability
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
2023-09-14 20:14:37 -03:00
anovazzi1
4ddc65d5a9 removed dead code 2023-09-14 20:05:52 -03:00
anovazzi1
5013df0f3f feat(reactflowUtils.ts): add logic to deselect group node when expanding it
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.
2023-09-14 19:19:22 -03:00
anovazzi1
21827a29ef fix(codeTabsComponent): add condition to check if data is truthy before executing code block
fix(codeAreaModal): remove unused isTweakPage variable from useContext
fix(reactflowUtils): remove unnecessary null assertion in unselectAllNodes function
2023-09-14 19:16:51 -03:00
anovazzi1
f84df04f8a fix(GenericNode): import missing InputComponent and Textarea components
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
2023-09-14 19:01:09 -03:00
anovazzi1
7837de5343 update satus logic to comprehend group component 2023-09-14 17:44:21 -03:00
anovazzi1
95767c6594 fix(formModal): import processFlow function from reactflowUtils to fix compilation error
refactor(formModal): replace the usage of processFLow function with processFlow function to correctly process the flow object
2023-09-13 17:57:00 -03:00
anovazzi1
6d04f49443 fix(reactflowUtils.ts): fix nullability issues and improve variable names for better readability
refactor(reactflowUtils.ts): update targetHandle and sourceHandle to use JSON stringified values for better compatibility
2023-09-13 17:50:51 -03:00
anovazzi1
8e03d95df5 feat(GenericNode): add support for Proxy field in GenericNode component to enable customization of Proxy component for each template field 2023-09-13 17:21:51 -03:00
anovazzi1
07f5342aa8 migrate old edges id format to new edges id fromat on ungroup node 2023-09-13 17:04:07 -03:00
anovazzi1
a7b9cf2cc9 update position on node 2023-09-13 16:17:59 -03:00
anovazzi1
04f2941a7d fix(GenericNode): import XYPosition from reactflow to fix type error
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
2023-09-13 10:53:43 -03:00
anovazzi1
7de65ed709 feat(nodeToolbarComponent): add "Ungroup" button to the node toolbar when the node is a group
fix(styleUtils.ts): import the "Ungroup" icon from lucide-react to use it in the node toolbar component
2023-09-12 22:13:06 -03:00
anovazzi1
f33acd4685 fix(EditNodeModal): fix incorrect property name in template rendering logic
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.
2023-09-12 21:28:01 -03:00
anovazzi1
9d510e3e4b fix output string of custom component and truncate long Ids on display name 2023-09-12 21:00:42 -03:00
anovazzi1
e4471886e4 feat(types/api): add 'dynamic' and 'proxy' properties to TemplateVariableType to support dynamic and proxy fields in templates
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'
2023-09-12 18:15:32 -03:00
anovazzi1
42f7821002 fix(parameterComponent/index.tsx): remove unnecessary ts-ignore comments
fix(reactflowUtils.ts): add input_types variable to prevent error when checking for advanced types
2023-09-12 17:17:36 -03:00
anovazzi1
772bfbf1d3 fix(reactflowUtils.ts): fix null pointer error when accessing nested properties in connectedInputNodesOnHandle function 2023-09-10 23:57:22 -03:00
anovazzi1
5933c2cefc fix(PageComponent/index.tsx): fix typo in import statement for scapeJSONParse function
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
2023-09-10 23:37:13 -03:00
anovazzi1
7bdaa1bca6 copy package-lock from dev to avoid dependencie erro 2023-09-10 21:23:18 -03:00
anovazzi1
b72558db7c added coma 2023-09-10 19:54:39 -03:00
anovazzi1
db4bb0c822 Merge remote-tracking branch 'origin/dev' into newGroupNode 2023-09-10 19:54:28 -03:00
anovazzi1
e22f3acf8c fix(DisclosureComponent): remove commented out code and fix missing icon bug
feat(PageComponent): add selection menu component and onClick event handler for debugging purposes
2023-09-08 17:48:44 -03:00
anovazzi1
30ac706de1 feat(PageComponent): add SelectionMenu component to PageComponent to enable selection of nodes
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
2023-09-08 17:05:08 -03:00
anovazzi1
4d5447ed65 feat(reactflowUtils.ts): add functions to handle connected input nodes and ungroup nodes
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.
2023-09-08 16:16:01 -03:00
anovazzi1
056cf6f66d refactor(api/index.ts): remove unused variable property from APITemplateType
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
2023-09-08 12:24:04 -03:00
anovazzi1
8cdfb00af6 chore(reactflowUtils.ts): add TODO comment to update to new types
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
2023-09-08 12:17:28 -03:00