Merging dev into main #49
@@ -9,5 +9,5 @@ export const GoalNodeDefaults: GoalNodeData = {
|
||||
description: "",
|
||||
achieved: false,
|
||||
hasReduce: true,
|
||||
can_fail: true,
|
||||
can_fail: false,
|
||||
};
|
||||
@@ -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<GoalNode>) {
|
||||
</div>
|
||||
{data.plan && (<div className={"flex-row gap-md align-center " + (planIterate ? "" : styles.planNoIterate)}>
|
||||
{planIterate ? "" : <s></s>}
|
||||
<label htmlFor={checkbox_id}>Try this plan only once (allow critical abortion):</label>
|
||||
<label htmlFor={checkbox_id}>{!planIterate ? "This plan always succeeds!" : ("We " + (data.can_fail ? "will " : "wont ") + "check if this plan fails")}:</label>
|
||||
<input
|
||||
id={checkbox_id}
|
||||
type={"checkbox"}
|
||||
disabled={!planIterate}
|
||||
checked={!planIterate || data.can_fail}
|
||||
onChange={(e) => planIterate ? setFailable(e.target.checked) : undefined}
|
||||
onChange={(e) => planIterate ? setFailable(e.target.checked) : setFailable(false)}
|
||||
/>
|
||||
</div>
|
||||
)}
|
||||
@@ -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) : "",
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user