chore: correct reducing
This commit is contained in:
@@ -27,7 +27,6 @@ export type ActionTypes = "speech" | "gesture" | "llm";
|
|||||||
export function PlanReduce(plan?: Plan) {
|
export function PlanReduce(plan?: Plan) {
|
||||||
if (!plan) return ""
|
if (!plan) return ""
|
||||||
return {
|
return {
|
||||||
name: plan.name,
|
|
||||||
id: plan.id,
|
id: plan.id,
|
||||||
steps: plan.steps.map((x) => StepReduce(x))
|
steps: plan.steps.map((x) => StepReduce(x))
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -129,7 +129,7 @@ export function GoalReduce(node: Node, _nodes: Node[]) {
|
|||||||
const data = node.data as GoalNodeData;
|
const data = node.data as GoalNodeData;
|
||||||
return {
|
return {
|
||||||
id: node.id,
|
id: node.id,
|
||||||
name: data.label,
|
name: data.name,
|
||||||
description: data.description,
|
description: data.description,
|
||||||
can_fail: data.can_fail,
|
can_fail: data.can_fail,
|
||||||
plan: data.plan ? PlanReduce(data.plan) : "",
|
plan: data.plan ? PlanReduce(data.plan) : "",
|
||||||
|
|||||||
@@ -470,7 +470,6 @@ describe('PlanEditorDialog', () => {
|
|||||||
it('should correctly reduce the plan given the elements of the plan', () => {
|
it('should correctly reduce the plan given the elements of the plan', () => {
|
||||||
const testplan = extendedPlan
|
const testplan = extendedPlan
|
||||||
const expectedResult = {
|
const expectedResult = {
|
||||||
name: "extended test plan",
|
|
||||||
id: "extended-plan-1",
|
id: "extended-plan-1",
|
||||||
steps: [
|
steps: [
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -98,7 +98,6 @@ describe('TriggerNode', () => {
|
|||||||
keyword: "",
|
keyword: "",
|
||||||
},
|
},
|
||||||
plan: {
|
plan: {
|
||||||
name: "Default Plan",
|
|
||||||
id: expect.anything(),
|
id: expect.anything(),
|
||||||
steps: [],
|
steps: [],
|
||||||
},});
|
},});
|
||||||
|
|||||||
Reference in New Issue
Block a user