From 87eebbbfcfded222cd4efe41098287caa093a9b1 Mon Sep 17 00:00:00 2001 From: Alexandru Luca Date: Mon, 2 Mar 2026 14:20:52 +0200 Subject: [PATCH 1/3] #40477-improving-data-test-ids-for-actions --- src/components/ContextMenu/ContextMenu.tsx | 2 +- src/components/ContextMenu/IAction.ts | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/components/ContextMenu/ContextMenu.tsx b/src/components/ContextMenu/ContextMenu.tsx index 63a9f59..4d8357f 100644 --- a/src/components/ContextMenu/ContextMenu.tsx +++ b/src/components/ContextMenu/ContextMenu.tsx @@ -93,7 +93,7 @@ export class ContextMenu extends React.Component 0)}> {visibleActions.map((action: IAction) => { - const key = visibleActions.indexOf(action); + const key = (action.key instanceof Function ? action.key({ ...this.props.paramsForAction }) : action.key) || visibleActions.indexOf(action); return (!action.renderInMenu ? boolean, icon?: SemanticShorthandItem, label?: string | ((param: IActionParam) => string), + key?: string | ((param: IActionParam) => string), /** * Function that will be called when user will click this menu entry. Will receives as parameter the current selected items */ From faaaa21e72548d4c17b62a46515babe26c19e93f Mon Sep 17 00:00:00 2001 From: Alexandru Luca Date: Mon, 2 Mar 2026 14:33:29 +0200 Subject: [PATCH 2/3] #40477-adding-entry-in-changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 940f07d..a87601d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,5 @@ ## Unreleased +* [Improving data-testids for actions](https://github.com/flower-platform/react-timeline-10000/pull/109) ## v2.12.0 From ecaeeab5a2016b5c82d84f6f52a850264d6c171e Mon Sep 17 00:00:00 2001 From: Alexandru Luca Date: Mon, 2 Mar 2026 14:38:46 +0200 Subject: [PATCH 3/3] #40477-adding-suggestion-ai --- src/components/ContextMenu/ContextMenu.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/ContextMenu/ContextMenu.tsx b/src/components/ContextMenu/ContextMenu.tsx index 4d8357f..ffe89ab 100644 --- a/src/components/ContextMenu/ContextMenu.tsx +++ b/src/components/ContextMenu/ContextMenu.tsx @@ -109,7 +109,7 @@ export class ContextMenu extends React.Component - : React.cloneElement(action.renderInMenu({ ...this.props.paramsForAction, closeContextMenu: this.close }), { key: visibleActions.indexOf(action), "data-testid": testids.menuItem + "_" + key }) + : React.cloneElement(action.renderInMenu({ ...this.props.paramsForAction, closeContextMenu: this.close }), { key: key, "data-testid": testids.menuItem + "_" + key }) ); }) }