Skip to content

Commit 794ab14

Browse files
committed
improvement(workflow): refine canvas interactions and rendering
1 parent 06506bb commit 794ab14

53 files changed

Lines changed: 4596 additions & 619 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
@@ -736,6 +736,33 @@ async function handleBlockOperationTx(
736736
break
737737
}
738738

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