diff --git a/packages/grafana-ui/src/components/Table/CellActions.tsx b/packages/grafana-ui/src/components/Table/CellActions.tsx index b6a4326e22e..52f7e4ca3ae 100644 --- a/packages/grafana-ui/src/components/Table/CellActions.tsx +++ b/packages/grafana-ui/src/components/Table/CellActions.tsx @@ -15,14 +15,14 @@ interface CellActionProps extends TableCellProps { interface CommonButtonProps { size: IconSize; + showFilters?: boolean; tooltipPlacement: TooltipPlacement; } -export function CellActions({ field, cell, previewMode, onCellFilterAdded }: CellActionProps) { +export function CellActions({ field, cell, previewMode, showFilters, onCellFilterAdded }: CellActionProps) { const [isInspecting, setIsInspecting] = useState(false); const isRightAligned = getTextAlign(field) === 'flex-end'; - const showFilters = Boolean(field.config.filterable) && cell.value !== undefined; const inspectEnabled = Boolean((field.config.custom as TableFieldOptions)?.inspect); const commonButtonProps: CommonButtonProps = { size: 'sm', diff --git a/packages/grafana-ui/src/components/Table/DefaultCell.tsx b/packages/grafana-ui/src/components/Table/DefaultCell.tsx index 7f134b3056a..9bfcdc1e675 100644 --- a/packages/grafana-ui/src/components/Table/DefaultCell.tsx +++ b/packages/grafana-ui/src/components/Table/DefaultCell.tsx @@ -28,7 +28,7 @@ export const DefaultCell: FC = (props) => { value = formattedValueToString(displayValue); } - const showFilters = field.config.filterable; + const showFilters = props.onCellFilterAdded && field.config.filterable; const showActions = (showFilters && cell.value !== undefined) || inspectEnabled; const cellOptions = getCellOptions(field); const cellStyle = getCellStyle(tableStyles, cellOptions, displayValue, inspectEnabled); @@ -56,7 +56,7 @@ export const DefaultCell: FC = (props) => { )} - {showActions && } + {showActions && } ); };