From 508fa48be67c4256f79409f7753d0e0ee6cdf923 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Otgaar?= Date: Tue, 6 Jan 2026 14:47:56 +0100 Subject: [PATCH] fix: fix the goal node's "can_fail" to have the correct property. --- .../visualProgrammingUI/nodes/GoalNode.default.ts | 2 +- .../visualProgrammingUI/nodes/GoalNode.tsx | 11 ++++++----- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/pages/VisProgPage/visualProgrammingUI/nodes/GoalNode.default.ts b/src/pages/VisProgPage/visualProgrammingUI/nodes/GoalNode.default.ts index 4cf314c..88e4951 100644 --- a/src/pages/VisProgPage/visualProgrammingUI/nodes/GoalNode.default.ts +++ b/src/pages/VisProgPage/visualProgrammingUI/nodes/GoalNode.default.ts @@ -9,5 +9,5 @@ export const GoalNodeDefaults: GoalNodeData = { description: "", achieved: false, hasReduce: true, - can_fail: true, + can_fail: false, }; \ No newline at end of file diff --git a/src/pages/VisProgPage/visualProgrammingUI/nodes/GoalNode.tsx b/src/pages/VisProgPage/visualProgrammingUI/nodes/GoalNode.tsx index ad48a7d..42f9bde 100644 --- a/src/pages/VisProgPage/visualProgrammingUI/nodes/GoalNode.tsx +++ b/src/pages/VisProgPage/visualProgrammingUI/nodes/GoalNode.tsx @@ -17,6 +17,8 @@ import PlanEditorDialog from '../components/PlanEditor'; * @param droppable: whether this node is droppable from the drop bar (initialized as true) * @param desciption: description of the goal * @param hasReduce: whether this node has reducing functionality (true by default) + * @param can_fail: whether this plan should be checked- this plan could possible fail + * @param plan: The (possible) attached plan to this goal */ export type GoalNodeData = { label: string; @@ -69,13 +71,13 @@ export default function GoalNode({id, data}: NodeProps) { {data.plan && (
{planIterate ? "" : } - + planIterate ? setFailable(e.target.checked) : undefined} + onChange={(e) => planIterate ? setFailable(e.target.checked) : setFailable(false)} />
)} @@ -107,9 +109,8 @@ export function GoalReduce(node: Node, _nodes: Node[]) { const data = node.data as GoalNodeData; return { id: node.id, - name: data.label, - description: data.description, - can_fail: data.can_fail, + name: data.description, + can_fail: data.can_fail, plan: data.plan ? PlanReduce(data.plan) : "", } }