Merge pull request #15418 from mvdbeek/dont_display_tooltip

[23.0] Don't display tooltip if connection is acceptable
This commit is contained in:
Marius van den Beek
2023-01-26 17:12:37 +01:00
committed by GitHub
2 changed files with 5 additions and 2 deletions
@@ -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;
@@ -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`
);
}
}