TableNG: Fix interpolation for actions (#104577)

This commit is contained in:
Adela Almasan 2025-04-30 09:42:15 -05:00 committed by GitHub
parent 85344e30c0
commit 6c0250dde2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 8 additions and 2 deletions

View File

@ -45,6 +45,7 @@ export function TableCellNG(props: TableCellNGProps) {
getActions,
rowBg,
onCellFilterAdded,
replaceVariables,
} = props;
const cellInspect = field.config?.custom?.inspect ?? false;
@ -75,8 +76,8 @@ export function TableCellNG(props: TableCellNGProps) {
const [isHovered, setIsHovered] = useState(false);
const actions = useMemo(
() => (getActions ? getActions(frame, field, rowIdx) : []),
[getActions, frame, field, rowIdx]
() => (getActions ? getActions(frame, field, rowIdx, replaceVariables) : []),
[getActions, frame, field, rowIdx, replaceVariables]
);
useLayoutEffect(() => {

View File

@ -75,6 +75,7 @@ export function TableNG(props: TableNGProps) {
data,
enableSharedCrosshair,
showTypeIcons,
replaceVariables,
} = props;
const initialSortColumns = useMemo<SortColumn[]>(() => {
@ -456,6 +457,7 @@ export function TableNG(props: TableNGProps) {
styles,
theme,
showTypeIcons,
replaceVariables,
...props,
},
handlers: {
@ -667,6 +669,7 @@ export function mapFrameToDataGrid({
timeRange,
getActions,
showTypeIcons,
replaceVariables,
} = options;
const { onCellExpand, onColumnResize } = handlers;
@ -815,6 +818,7 @@ export function mapFrameToDataGrid({
getActions={getActions}
rowBg={rowBg}
onCellFilterAdded={onCellFilterAdded}
replaceVariables={replaceVariables}
/>
);
},

View File

@ -157,6 +157,7 @@ export interface TableCellNGProps {
value: TableCellValue;
rowBg: Function | undefined;
onCellFilterAdded?: TableFilterActionCallback;
replaceVariables?: InterpolateFunction;
}
/* ------------------------- Specialized Cell Props ------------------------- */