From 13f0fbc0081ba0dd372a646477f74ac161870580 Mon Sep 17 00:00:00 2001 From: Andreas Schultz Date: Tue, 12 May 2026 13:26:47 +0200 Subject: [PATCH 1/5] Add icon for rule blocks --- src/components/Icon/canonicalIconNames.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/src/components/Icon/canonicalIconNames.tsx b/src/components/Icon/canonicalIconNames.tsx index d253a0bd..d4f3fb75 100644 --- a/src/components/Icon/canonicalIconNames.tsx +++ b/src/components/Icon/canonicalIconNames.tsx @@ -63,6 +63,7 @@ const canonicalIcons = { "artefact-report": icons.Report, "artefact-task": icons.Script, "artefact-transform": icons.DataRefinery, + "artefact-ruleBlock": icons.Fragments, "artefact-uncategorized": icons.Unknown, "artefact-workflow": icons.ModelBuilder, From b92871f57b678636a661406dcda16983db118c2f Mon Sep 17 00:00:00 2001 From: Andreas Schultz Date: Tue, 12 May 2026 14:31:44 +0200 Subject: [PATCH 2/5] Fix icon key for rule blocks --- src/components/Icon/canonicalIconNames.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/Icon/canonicalIconNames.tsx b/src/components/Icon/canonicalIconNames.tsx index d4f3fb75..8c80b665 100644 --- a/src/components/Icon/canonicalIconNames.tsx +++ b/src/components/Icon/canonicalIconNames.tsx @@ -63,7 +63,7 @@ const canonicalIcons = { "artefact-report": icons.Report, "artefact-task": icons.Script, "artefact-transform": icons.DataRefinery, - "artefact-ruleBlock": icons.Fragments, + "artefact-ruleblock": icons.Fragments, "artefact-uncategorized": icons.Unknown, "artefact-workflow": icons.ModelBuilder, From e51fae6d8492a4ca1948663089c076c4f61475c7 Mon Sep 17 00:00:00 2001 From: Andreas Schultz Date: Fri, 5 Jun 2026 12:34:42 +0200 Subject: [PATCH 3/5] Fix extendedTooltip not shown when defined for a react flow handle --- CHANGELOG.md | 1 + .../react-flow/handles/HandleDefault.tsx | 37 ++++++++++--------- 2 files changed, 21 insertions(+), 17 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index af20b6b7..7f4c83a2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -23,6 +23,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this p - `` - border of the BlueprintJS `Tag` elements were fixed +- `extendedTooltip` of a handle in the ReactFlow (v12) component does not show the tooltip. ### Changed diff --git a/src/extensions/react-flow/handles/HandleDefault.tsx b/src/extensions/react-flow/handles/HandleDefault.tsx index 621bf9c9..09ddbf57 100644 --- a/src/extensions/react-flow/handles/HandleDefault.tsx +++ b/src/extensions/react-flow/handles/HandleDefault.tsx @@ -89,21 +89,15 @@ export const HandleDefault = memo( isOpen: extendedTooltipDisplayed, }; - const handleContentProps = React.useMemo( - () => ({ - ...data, - tooltipProps: { - ...handleContentTooltipProps, - ...data?.tooltipProps, - } as TooltipProps, - }), - [intent, category, handleProps.isConnectable], - ); + const handleContentProps = { + ...data, + tooltipProps: { + ...handleContentTooltipProps, + ...data?.tooltipProps, + } as TooltipProps, + }; - const handleContent = React.useMemo( - () => {children}, - [], - ); + const handleContent = {children}; let switchTooltipTimerOn: ReturnType; let switchToolsTimerOff: ReturnType; @@ -119,7 +113,7 @@ export const HandleDefault = memo( if (handleProps.onClick) { handleProps.onClick(e); } - if (toolsTarget.length > 0 && e.target === handleDefaultRef.current) { + if (toolsTarget.length > 0 && e.currentTarget === handleDefaultRef.current) { setExtendedTooltipDisplayed(false); (toolsTarget[0] as HTMLElement).click(); } @@ -127,7 +121,7 @@ export const HandleDefault = memo( "data-category": category, onMouseEnter: (e: React.MouseEvent) => { if (switchToolsTimerOff) clearTimeout(switchToolsTimerOff); - if (e.target === handleDefaultRef.current) { + if (e.currentTarget === handleDefaultRef.current) { switchTooltipTimerOn = setTimeout( () => setExtendedTooltipDisplayed(true), data?.tooltipProps?.hoverOpenDelay ?? 500, @@ -142,7 +136,16 @@ export const HandleDefault = memo( setExtendedTooltipDisplayed(false); }, }), - [intent, category, tooltip, handleProps.isConnectable, handleProps.style], + [ + intent, + category, + tooltip, + flowVersionCheck, + handleProps.isConnectable, + handleProps.style, + handleProps.onClick, + data?.tooltipProps?.hoverOpenDelay, + ], ); switch (flowVersionCheck) { From 340d662d86c8be24b61ec07d62a0378f811b1afb Mon Sep 17 00:00:00 2001 From: Andreas Schultz Date: Fri, 5 Jun 2026 12:35:49 +0200 Subject: [PATCH 4/5] Add regression test --- .../handles/tests/HandleDefault.test.tsx | 60 +++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 src/extensions/react-flow/handles/tests/HandleDefault.test.tsx diff --git a/src/extensions/react-flow/handles/tests/HandleDefault.test.tsx b/src/extensions/react-flow/handles/tests/HandleDefault.test.tsx new file mode 100644 index 00000000..53f2f563 --- /dev/null +++ b/src/extensions/react-flow/handles/tests/HandleDefault.test.tsx @@ -0,0 +1,60 @@ +import React from "react"; +import { fireEvent, render, screen } from "@testing-library/react"; +import { OverlaysProvider } from "@blueprintjs/core"; +import "@testing-library/jest-dom"; + +import { HandleDefault } from "../HandleDefault"; + +jest.mock("react-flow-renderer", () => { + const React = require("react"); + return { + Handle: React.forwardRef( + ({ children, isConnectable, position, type, ...props }: any, ref: React.Ref) => ( +
+ {children} +
+ ), + ), + }; +}); + +jest.mock("@xyflow/react", () => { + const React = require("react"); + return { + Handle: React.forwardRef( + ({ children, isConnectable, position, type, ...props }: any, ref: React.Ref) => ( +
+ {children} +
+ ), + ), + }; +}); + +jest.mock("../../versionsupport", () => ({ + useReactFlowVersion: () => "v9", +})); + +describe("HandleDefault", () => { + it("shows the extended tooltip on handle hover", async () => { + render( + + + , + ); + + fireEvent.mouseEnter(screen.getByTestId("handle")); + + expect(await screen.findByText("This is another Tooltip")).toBeVisible(); + }); +}); From 246b250278f2b2f98515b9c5454e2669ba531a1a Mon Sep 17 00:00:00 2001 From: Andreas Schultz Date: Mon, 8 Jun 2026 08:42:38 +0200 Subject: [PATCH 5/5] Support badge on activity control menu button --- CHANGELOG.md | 2 ++ .../ActivityControl/ActivityControlWidget.tsx | 11 ++++++++++ .../tests/ActivityControlWidget.test.tsx | 21 +++++++++++++++++++ 3 files changed, 34 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7f4c83a2..23325814 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,8 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this p - `searchListPredicate` property: Allows to filter the complete list of search options at once. - Following optional BlueprintJs properties are forwarded now to override default behaviour: `noResults`, `createNewItemRenderer` and `itemRenderer` - `isValidNewOption` property: Checks if an input string is or can be turned into a valid new option. +- `ActivityControlWidge` + - Support `badge` on activity control menu button. ### Fixed diff --git a/src/cmem/ActivityControl/ActivityControlWidget.tsx b/src/cmem/ActivityControl/ActivityControlWidget.tsx index 4663a108..c7fc36e1 100644 --- a/src/cmem/ActivityControl/ActivityControlWidget.tsx +++ b/src/cmem/ActivityControl/ActivityControlWidget.tsx @@ -93,6 +93,8 @@ export interface ActivityControlWidgetProps extends TestableComponent { interface IActivityContextMenu extends TestableComponent { // Tooltip for the context menu tooltip?: string; + // Optional badge shown on the context menu button. + badge?: string | number; // The entries of the context menu menuItems: IActivityMenuAction[]; } @@ -228,6 +230,15 @@ export function ActivityControlWidget(props: ActivityControlWidgetProps) { + } > {activityContextMenu.menuItems.map((menuAction, idx) => { return ( diff --git a/src/cmem/ActivityControl/tests/ActivityControlWidget.test.tsx b/src/cmem/ActivityControl/tests/ActivityControlWidget.test.tsx index 5df29c6d..b3a63dea 100644 --- a/src/cmem/ActivityControl/tests/ActivityControlWidget.test.tsx +++ b/src/cmem/ActivityControl/tests/ActivityControlWidget.test.tsx @@ -96,4 +96,25 @@ describe("ActivityControlWidget", () => { fireEvent.click(customButton); expect(mockAction).toHaveBeenCalledTimes(1); }); + + it("renders a badge on the context menu trigger", () => { + const { container } = render( + , + ); + + expect(container.querySelector("button[title='More options']")).toHaveTextContent("3"); + }); });