Refactoring all nodes functionality into their own files, create a modular framework for the visual programming. #21
Reference in New Issue
Block a user
Delete Branch "refactor/node-encapsulation"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
We should refactor the visual programming to make sure that all the nodes' functionality is encapsulated in their own files, and that through the use of polymorphism we can address the correct functionality from within the needed ReactFlow functions.
In order to test this merge, follow the steps and check the checklist:
npm ito install everything needed.Check which apply:
npx eslint --fixshows that there are no code style errors.npx jestshows that all tests pass. (Even though the Visual Prog tests are just placeholders.)N25B-294 Refactor the UI visual programming to encapsulate node's functionality.To test how modular the new refactor is, you can opt to test this by creating a new node and seeing if it completely works:
Node/,<Node>.jsxand<Node>.default.jsx.<Node>.default.tsto the data you defined in<Node>.tsxVisProg.module.cssfor.draggable-node-<your_type>and.node-<your_type>.Then check the following:
droppabledata to true (if you set it to false you should probably manually add it in the initial nodes inVisProgStores.tsx).export default function <Node>(props){}NodeRegistry's NodesInPhase.Additional comments:
In case you need any help understanding how to correctly setup a new node, you can message me. However, if it means the structure isn't clear enough, or, there needs to be more documentation, that means that the current implementation is not good enough.
ref: N25B-294 Refactor the UI visual programming to encapsulate node's functionality.
assigned to @9828273
added 4 commits
devf892db7b- Merge branch 'dev' into refactor/node-encapsulationCompare with previous version
changed the description
changed the description
marked the checklist item
npx eslint --fixshows that there are no code style errors. as completedmarked the checklist item
npx jestshows that all tests pass. (Even though the Visual Prog tests are just placeholders.) as completedmarked the checklist item This branch is up to date with dev. as completed
marked the checklist item All acceptance criteria are met in ticket
N25B-294 Refactor the UI visual programming to encapsulate node's functionality.as completedmarked the checklist item Booting up everything, shows that all normal functionality works. as completed
marked the checklist item Everything is well documented. as completed
marked the checklist item The new structure is clear, and clean. as completed
marked the checklist item In the visual programming page, all nodes have their correct functionality and style, and outputting a program to the console gives the correct format. as completed
requested review from @2584433
marked the checklist item The new node shows up in the toolbar if you set the
droppabledata to true (if you set it to false you should probably manually add it in the initial nodes inVisProgStores.tsx). as completedmarked the checklist item The new node shows up and can connect to other nodes in the way you specified at your
export default function <Node>(props){}as completedmarked the checklist item The new node will also already correctly reduce to the way you specified at your reduce function. as completed
marked the checklist item The new node will show up as its own type of data within phases when you reduce in case you didn't set the typing to return false in
NodeRegistry's NodesInPhase. as completedmarked the checklist item The new node will use the Connects(...) function when connected with any node. as completed
approved this merge request
This is not used
resolved all threads
changed this line in version 3 of the diff
added 1 commit
c84f7307- Apply 1 suggestion(s) to 1 file(s)Compare with previous version
Nice, thanks for applying the suggestion already.
I'll be working on this merge request for a while, will let you know when I'm done so that you can apply any further changes in one go.
The styles are no longer used after deleting the EditableName component. Also slight formatting change.
Here and in all other nodes, we should use the specific node type (here
GoalNode), then we don't need to useas. In general I think we should avoid usingas.All of the
.node-text-inputstyles are no longer used, can also be removed.changed this line in version 4 of the diff
added 1 commit
1dfc14ed- chore: remove unused style referenceCompare with previous version
resolved all threads
changed this line in version 5 of the diff
changed this file in version 5 of the diff
added 1 commit
79b645df- chore: apply suggestions from threads for merge.Compare with previous version
approved this merge request
mentioned in commit
f87c7fed03