Files
Tsering Paljor 429847210a feat: Add Go to node type (#5582)
* Add Go to node

* Remove goto_ prefix from destination_node_*

* Move max dispatches check into _before_node_dispatch()

* Remove translations from backend errors

* move validate_goto_destination to a static method in the node type

* Move clearing goto links to node type

* Refactor cleared_goto_links to a more generic post_move_modifications

* Remove automation concepts from integration land

* Fix flakey service test

* Remove 'node' mentions in CoreGotoServiceType

* Implement new import_references() hook to avoid overriding import_formulas()

* Fix forward-jumps

* Fix test

* Rename goto_node to just goto

* Update comment

* Clean up old references to connectors (we now use badge)

* Refactor history handler's get_destination_labels() to get the destination from node type.

* Handle max dispatch error in the dispatch_node()

* Rename output_service_id to destination_service_id

* Remove simulate check from goto node type.

* Rename post_move_modifications to move_extra_data

* Rename revert_move_in_workflow and after_move_in_workflow to revert_move and after_move respectively.

* Rename import_references to post_import

* Make _condition_is_set more consistent

* Move CoreGottoServiceForm to integrations and refactor logic/imports.

* Make node history label more generic.

* Add afterMove() hook

* Max dispatch check should happen for simulations too

* Move _before_node_dispatch() error handling into the main try/except

* Move post_import() into EasyImportExportMixin

* Add a generic getDestinations() method to node types

* Simplify setting destination_service_id

* Use existing convention to inject registry

* Set limit to 2000 for max dispatch

* Add new skipped history status

* Dedupe queries for destination labels

* Ensure destination node validation considered deleted nodes.

* Ensure destination nodes are ordered per graph

* Set max dispatches default limit to 1000

* Only allow backward jumps.

* Fix ordering bug that caused non-default router branch nodes to not appear as a destination target.

* Fix migration

* Re-add lost commit from Jeremie - rename to after_import()
2026-07-23 20:57:19 +07:00

52 lines
1.3 KiB
JavaScript

import BaseGraphHandler from '@baserow/modules/core/graph/baseGraphHandler'
export default class NodeGraphHandler extends BaseGraphHandler {
constructor(workflow) {
super(workflow)
}
getPointMap() {
return this.container.nodeMap
}
getNode(nodeId) {
return this.getPoint(nodeId)
}
hasNodes() {
return this.hasPoints()
}
getFirstNode() {
return this.getFirstPoint()
}
getNodeAtPosition(referenceNode, position, output) {
return this.getPointAtPosition(referenceNode, position, output)
}
getNodePosition(node) {
return this.getPointPosition(node)
}
// Returns only the head of each slot (no next-chain traversal).
getChildren(targetNode) {
return super.getChildren(targetNode)
}
getNextNodes(targetNode, output = null) {
return this.getNextPoints(targetNode, output)
}
// Depth-first ordered flat list of all nodes, i.e. the order they're read in
// top to bottom in the editor. `workflow.nodes` is ordered by id (creation
// order) instead, so anything surfacing nodes as a list to the user (e.g. the
// "Go to node" destination dropdown) should go through this.
getOrderedNodes() {
return this.getPointsInDepthFirstOrder({
skipMissing: true,
skipChildrenOfMissing: true,
})
}
}