Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/quick-banks-tap.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@openworkflowspec/diagram-editor": minor
---

Outer try catch task shows same panel as inner as it is all considered one task
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ export const NODE_TYPE_TO_DEF: Readonly<Record<string, string>> = {
[GraphNodeType.Set]: "setTask",
[GraphNodeType.Switch]: "switchTask",
[GraphNodeType.Try]: "tryTask",
// The outer TRY…CATCH frame shows the same form as its inner Try / Catch frames.
[GraphNodeType.TryCatch]: "tryTask",
[GraphNodeType.Wait]: "waitTask",
[GraphNodeType.Catch]: "tryTask",
[CATCH_CONTAINER_NODE_TYPE]: "tryTask",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,12 @@
*/

import { describe, expect, it } from "vitest";
import { getFormFieldsForNodeType, partitionTaskBaseFields } from "../../src/core/schemaWalker";
import { GraphNodeType } from "@openworkflowspec/sdk";
import {
CATCH_CONTAINER_NODE_TYPE,
getFormFieldsForNodeType,
partitionTaskBaseFields,
} from "../../src/core/schemaWalker";
import { getTaskBaseKeys } from "../../src/core/schemaFilter";
import { TASK_TYPE_KEYS } from "../../src/core/taskTypes";
import {
Expand Down Expand Up @@ -54,6 +59,17 @@ describe("taskBase partition", () => {
);
});

describe("try task frames", () => {
it.each([GraphNodeType.TryCatch, GraphNodeType.Catch, CATCH_CONTAINER_NODE_TYPE])(
"%s shows the same form as the Try frame",
(type) => {
expect(JSON.stringify(getFormFieldsForNodeType(type))).toBe(
JSON.stringify(getFormFieldsForNodeType(GraphNodeType.Try)),
);
},
);
});

describe("partitionTaskBaseFields", () => {
const str = (path: string, label = path): FormFieldDescriptor => ({
kind: "string",
Expand Down
Loading