mirror of
https://github.com/grafana/grafana.git
synced 2025-02-11 08:05:43 -06:00
Table Panel: Fix image disappearing when datalinks applied (#84625)
* Fix link image disappearing * Prettier * i18n * Fix offset to compensate for padding * Prettier --------- Co-authored-by: nmarrs <nathanielmarrs@gmail.com>
This commit is contained in:
parent
dfe61db7a5
commit
154868e624
@ -8,6 +8,8 @@ import { DataLinksContextMenu } from '../DataLinks/DataLinksContextMenu';
|
||||
|
||||
import { TableCellProps } from './types';
|
||||
|
||||
const DATALINKS_HEIGHT_OFFSET = 10;
|
||||
|
||||
export const ImageCell = (props: TableCellProps) => {
|
||||
const { field, cell, tableStyles, row, cellProps } = props;
|
||||
|
||||
@ -20,7 +22,10 @@ export const ImageCell = (props: TableCellProps) => {
|
||||
<div {...cellProps} className={tableStyles.cellContainer}>
|
||||
{!hasLinks && <img src={displayValue.text} className={tableStyles.imageCell} alt="" />}
|
||||
{hasLinks && (
|
||||
<DataLinksContextMenu style={{ height: '100%' }} links={() => getCellLinks(field, row) || []}>
|
||||
<DataLinksContextMenu
|
||||
style={{ height: tableStyles.cellHeight - DATALINKS_HEIGHT_OFFSET, width: 'auto' }}
|
||||
links={() => getCellLinks(field, row) || []}
|
||||
>
|
||||
{(api) => {
|
||||
const img = <img src={displayValue.text} className={tableStyles.imageCell} alt="" />;
|
||||
if (api.openMenu) {
|
||||
|
Loading…
Reference in New Issue
Block a user