fix: Add optional chaining for 'isArtificalRecoveredEventItem' (no-changelog) (#5860)

* fix: add optional chaining for isArtificalRecoveredEventItem

* fix: fix isArtificalRecoveredEventItem typo
This commit is contained in:
Alex Grozav 2023-04-03 16:04:59 +03:00 committed by कारतोफ्फेलस्क्रिप्ट™
parent de58fb9860
commit 35cf783e83
5 changed files with 15 additions and 13 deletions

View file

@ -108,7 +108,7 @@ export async function recoverExecutionDataFromEventLogMessages(
[
{
json: {
isArtificalRecoveredEventItem: true,
isArtificialRecoveredEventItem: true,
},
pairedItem: undefined,
},

View file

@ -162,7 +162,9 @@
</div>
<div
v-else-if="hasNodeRun && dataCount > 0 && maxRunIndex === 0 && !isArtificalRecoveredEventItem"
v-else-if="
hasNodeRun && dataCount > 0 && maxRunIndex === 0 && !isArtificialRecoveredEventItem
"
v-show="!editMode.enabled"
:class="$style.itemsCount"
>
@ -216,7 +218,7 @@
</n8n-text>
</div>
<div v-else-if="hasNodeRun && isArtificalRecoveredEventItem" :class="$style.center">
<div v-else-if="hasNodeRun && isArtificialRecoveredEventItem" :class="$style.center">
<slot name="recovered-artifical-output-data"></slot>
</div>
@ -680,8 +682,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;

View file

@ -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];

View file

@ -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

View file

@ -2934,9 +2934,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);