From 8118c1906e9f86a1e00e921ff25bda0304c200e0 Mon Sep 17 00:00:00 2001 From: mvdbeek Date: Thu, 26 Jan 2023 15:54:11 +0100 Subject: [PATCH] Don't display tooltip of connection is acceptable --- .../src/components/Workflow/Editor/modules/terminals.test.ts | 2 ++ client/src/components/Workflow/Editor/modules/terminals.ts | 5 +++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/client/src/components/Workflow/Editor/modules/terminals.test.ts b/client/src/components/Workflow/Editor/modules/terminals.test.ts index 4d41492bc86..5abb667c019 100644 --- a/client/src/components/Workflow/Editor/modules/terminals.test.ts +++ b/client/src/components/Workflow/Editor/modules/terminals.test.ts @@ -205,6 +205,8 @@ describe("canAccept", () => { const integerInputParam = terminals["multi data"]["advanced|advanced_threshold"] as InputParameterTerminal; const integerOutputParam = terminals["integer parameter input"]["output"] as OutputParameterTerminal; expect(integerInputParam.canAccept(integerOutputParam).canAccept).toBe(true); + // regression test for https://github.com/galaxyproject/galaxy/issues/15417 + expect(integerInputParam.canAccept(integerOutputParam).reason).toBe(null); }); it("rejects text to integer parameter connection", () => { const integerInputParam = terminals["multi data"]["advanced|advanced_threshold"] as InputParameterTerminal; diff --git a/client/src/components/Workflow/Editor/modules/terminals.ts b/client/src/components/Workflow/Editor/modules/terminals.ts index 4efe198c526..eff12488333 100644 --- a/client/src/components/Workflow/Editor/modules/terminals.ts +++ b/client/src/components/Workflow/Editor/modules/terminals.ts @@ -465,9 +465,10 @@ export class InputParameterTerminal extends BaseInputTerminal { const effectiveThisType = this.effectiveType(this.type); const otherType = ("type" in other && other.type) || "data"; const effectiveOtherType = this.effectiveType(otherType); + const canAccept = effectiveThisType === effectiveOtherType return new ConnectionAcceptable( - effectiveThisType == effectiveOtherType, - `Cannot attach a ${effectiveOtherType} parameter to a ${effectiveThisType} input` + canAccept, + canAccept ? null: `Cannot attach a ${effectiveOtherType} parameter to a ${effectiveThisType} input` ); } }