Skip to content

Commit 44c7cc3

Browse files
committed
improvement(workflow): refine canvas interactions and rendering
1 parent 90f6708 commit 44c7cc3

53 files changed

Lines changed: 4597 additions & 620 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

apps/realtime/src/database/operations.ts

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -734,6 +734,33 @@ async function handleBlockOperationTx(
734734
break
735735
}
736736

737+
case BLOCK_OPERATIONS.UPDATE_ERROR_ENABLED: {
738+
if (!payload.id || payload.errorEnabled === undefined) {
739+
throw new Error('Missing required fields for update error enabled operation')
740+
}
741+
742+
const updateResult = await tx
743+
.update(workflowBlocks)
744+
.set({
745+
data: sql`jsonb_set(
746+
coalesce(${workflowBlocks.data}, '{}'::jsonb),
747+
'{errorEnabled}',
748+
${JSON.stringify(payload.errorEnabled)}::jsonb,
749+
true
750+
)`,
751+
updatedAt: new Date(),
752+
})
753+
.where(and(eq(workflowBlocks.id, payload.id), eq(workflowBlocks.workflowId, workflowId)))
754+
.returning({ id: workflowBlocks.id })
755+
756+
if (updateResult.length === 0) {
757+
throw new Error(`Block ${payload.id} not found in workflow ${workflowId}`)
758+
}
759+
760+
logger.debug(`Updated block error output: ${payload.id} -> ${payload.errorEnabled}`)
761+
break
762+
}
763+
737764
case BLOCK_OPERATIONS.UPDATE_CANONICAL_MODE: {
738765
if (!payload.id || !payload.canonicalId || !payload.canonicalMode) {
739766
throw new Error('Missing required fields for update canonical mode operation')

apps/realtime/src/middleware/permissions.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ const WRITE_OPERATIONS: string[] = [
2727
BLOCK_OPERATIONS.TOGGLE_ENABLED,
2828
BLOCK_OPERATIONS.UPDATE_PARENT,
2929
BLOCK_OPERATIONS.UPDATE_ADVANCED_MODE,
30+
BLOCK_OPERATIONS.UPDATE_ERROR_ENABLED,
3031
BLOCK_OPERATIONS.UPDATE_CANONICAL_MODE,
3132
BLOCK_OPERATIONS.REPLACE_CANONICAL_MODES,
3233
BLOCK_OPERATIONS.TOGGLE_HANDLES,

0 commit comments

Comments
 (0)