Skip to content

Commit be72f73

Browse files
authored
fix(editor): Fix Paired item error message (#15171)
1 parent abb8225 commit be72f73

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

cypress/e2e/39-projects.cy.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -299,11 +299,7 @@ describe('Projects', { disableAutoLogin: true }, () => {
299299
workflowPage.actions.saveWorkflowOnButtonClick();
300300
workflowPage.actions.addNodeToCanvas('Execute Workflow', true, true);
301301

302-
cy.window().then((win) => {
303-
cy.stub(win, 'open').callsFake((url) => {
304-
cy.visit(url);
305-
});
306-
});
302+
cy.window().then((win) => cy.stub(win, 'open').callsFake((url) => cy.visit(url)));
307303

308304
selectResourceLocatorItem('workflowId', 0, 'Create a');
309305
// Need to wait for the trigger node to auto-open after a delay

cypress/e2e/5-ndv.cy.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ describe('NDV', () => {
117117
.nodeRunErrorMessage()
118118
.should(
119119
'have.text',
120-
"Using the item method doesn't work with pinned data in this scenario. Please unpin 'Break pairedItem chain' and try again.",
120+
"Paired item data for item from node 'Break pairedItem chain' is unavailable. Ensure 'Break pairedItem chain' is providing the required output.",
121121
);
122122
ndv.getters
123123
.nodeRunErrorDescription()

packages/workflow/src/WorkflowDataProxy.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -792,7 +792,11 @@ export class WorkflowDataProxy {
792792
nodeCause: string,
793793
usedMethodName: 'itemMatching' | 'pairedItem' | 'item' | '$getPairedItem' = 'pairedItem',
794794
) => {
795-
const message = `Using the ${usedMethodName} method doesn't work with pinned data in this scenario. Please unpin '${nodeCause}' and try again.`;
795+
const pinData = getPinDataIfManualExecution(that.workflow, nodeCause, that.mode);
796+
const message = pinData
797+
? `Using the ${usedMethodName} method doesn't work with pinned data in this scenario. Please unpin '${nodeCause}' and try again.`
798+
: `Paired item data for ${usedMethodName} from node '${nodeCause}' is unavailable. Ensure '${nodeCause}' is providing the required output.`;
799+
796800
return new ExpressionError(message, {
797801
runIndex: that.runIndex,
798802
itemIndex: that.itemIndex,

packages/workflow/test/WorkflowDataProxy.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,7 @@ describe('WorkflowDataProxy', () => {
339339
expect(error).toBeInstanceOf(ExpressionError);
340340
const exprError = error as ExpressionError;
341341
expect(exprError.message).toEqual(
342-
"Using the item method doesn't work with pinned data in this scenario. Please unpin 'Break pairedItem chain' and try again.",
342+
"Paired item data for item from node 'Break pairedItem chain' is unavailable. Ensure 'Break pairedItem chain' is providing the required output.",
343343
);
344344
expect(exprError.context.type).toEqual('paired_item_no_info');
345345
done();

0 commit comments

Comments
 (0)