From df2ea0f5ecc9d748d2cb9d897558c3a5df1cfadb Mon Sep 17 00:00:00 2001 From: Alex Grozav Date: Mon, 3 Apr 2023 16:04:59 +0300 Subject: [PATCH] fix: Add optional chaining for 'isArtificalRecoveredEventItem' (no-changelog) (#5860) * fix: add optional chaining for isArtificalRecoveredEventItem * fix: fix isArtificalRecoveredEventItem typo --- .../cli/src/eventbus/MessageEventBus/recoverEvents.ts | 2 +- packages/editor-ui/src/components/RunData.vue | 10 ++++++---- packages/editor-ui/src/mixins/pushConnection.ts | 2 +- packages/editor-ui/src/utils/nodeViewUtils.ts | 10 +++++----- packages/editor-ui/src/views/NodeView.vue | 4 ++-- 5 files changed, 15 insertions(+), 13 deletions(-) diff --git a/packages/cli/src/eventbus/MessageEventBus/recoverEvents.ts b/packages/cli/src/eventbus/MessageEventBus/recoverEvents.ts index af95df2e88..310d455e64 100644 --- a/packages/cli/src/eventbus/MessageEventBus/recoverEvents.ts +++ b/packages/cli/src/eventbus/MessageEventBus/recoverEvents.ts @@ -108,7 +108,7 @@ export async function recoverExecutionDataFromEventLogMessages( [ { json: { - isArtificalRecoveredEventItem: true, + isArtificialRecoveredEventItem: true, }, pairedItem: undefined, }, diff --git a/packages/editor-ui/src/components/RunData.vue b/packages/editor-ui/src/components/RunData.vue index 2682cac027..984ce5709c 100644 --- a/packages/editor-ui/src/components/RunData.vue +++ b/packages/editor-ui/src/components/RunData.vue @@ -162,7 +162,9 @@
@@ -216,7 +218,7 @@
-
+
@@ -681,8 +683,8 @@ export default mixins(externalHooks, genericHelpers, nodeHelpers, pinData).exten this.hasPinData), ); }, - isArtificalRecoveredEventItem(): boolean { - return this.inputData?.[0]?.json?.isArtificalRecoveredEventItem !== undefined ?? false; + isArtificialRecoveredEventItem(): boolean { + return this.inputData?.[0]?.json?.isArtificialRecoveredEventItem !== undefined ?? false; }, subworkflowExecutionError(): Error | null { return this.workflowsStore.subWorkflowExecutionError; diff --git a/packages/editor-ui/src/mixins/pushConnection.ts b/packages/editor-ui/src/mixins/pushConnection.ts index d9478184bb..44da3de6c3 100644 --- a/packages/editor-ui/src/mixins/pushConnection.ts +++ b/packages/editor-ui/src/mixins/pushConnection.ts @@ -295,7 +295,7 @@ export const pushConnection = mixins( for (const key of Object.keys(activeRunData)) { if ( pushData.data.data.resultData.runData[key]?.[0]?.data?.main?.[0]?.[0]?.json - .isArtificalRecoveredEventItem === true && + ?.isArtificialRecoveredEventItem === true && activeRunData[key].length > 0 ) pushData.data.data.resultData.runData[key] = activeRunData[key]; diff --git a/packages/editor-ui/src/utils/nodeViewUtils.ts b/packages/editor-ui/src/utils/nodeViewUtils.ts index 9388ecc550..a626537ed1 100644 --- a/packages/editor-ui/src/utils/nodeViewUtils.ts +++ b/packages/editor-ui/src/utils/nodeViewUtils.ts @@ -544,7 +544,7 @@ export const getOutputSummary = (data: ITaskData[], nodeConnections: NodeInputCo [targetInputIndex: string]: { total: number; iterations: number; - isArtificalRecoveredEventItem?: boolean; + isArtificialRecoveredEventItem?: boolean; }; }; }; @@ -558,10 +558,10 @@ export const getOutputSummary = (data: ITaskData[], nodeConnections: NodeInputCo run.data.main.forEach((output: INodeExecutionData[] | null, i: number) => { const sourceOutputIndex = i; - // executionData that was recovered by recoverEvents in the CLI will have an isArtificalRecoveredEventItem property + // executionData that was recovered by recoverEvents in the CLI will have an isArtificialRecoveredEventItem property // to indicate that it was not part of the original executionData // we do not want to count these items in the summary - // if (output?.[0]?.json?.isArtificalRecoveredEventItem) { + // if (output?.[0]?.json?.isArtificialRecoveredEventItem) { // return outputMap; // } @@ -600,10 +600,10 @@ export const getOutputSummary = (data: ITaskData[], nodeConnections: NodeInputCo }; } - if (output?.[0]?.json?.isArtificalRecoveredEventItem) { + if (output?.[0]?.json?.isArtificialRecoveredEventItem) { outputMap[sourceOutputIndex][targetNodeName][ targetInputIndex - ].isArtificalRecoveredEventItem = true; + ].isArtificialRecoveredEventItem = true; outputMap[sourceOutputIndex][targetNodeName][targetInputIndex].total = 0; } else { outputMap[sourceOutputIndex][targetNodeName][targetInputIndex].total += output diff --git a/packages/editor-ui/src/views/NodeView.vue b/packages/editor-ui/src/views/NodeView.vue index 1083ba92b0..9ec1750225 100644 --- a/packages/editor-ui/src/views/NodeView.vue +++ b/packages/editor-ui/src/views/NodeView.vue @@ -2953,9 +2953,9 @@ export default mixins( if (connection) { const output = outputMap[sourceOutputIndex][targetNodeName][targetInputIndex]; - if (output.isArtificalRecoveredEventItem) { + if (output.isArtificialRecoveredEventItem) { NodeViewUtils.recoveredConnection(connection); - } else if ((!output || !output.total) && !output.isArtificalRecoveredEventItem) { + } else if ((!output || !output.total) && !output.isArtificialRecoveredEventItem) { NodeViewUtils.resetConnection(connection); } else { NodeViewUtils.addConnectionOutputSuccess(connection, output);