mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
TablePanel: Fix table cells overflowing when there are multiple data links (#65711)
* Fix table cells overflowing when there are multiple data links
This commit is contained in:
parent
d96b0a71d3
commit
06ea490cc2
@ -7,7 +7,7 @@ import { TableCellBackgroundDisplayMode, TableCellOptions } from '@grafana/schem
|
||||
|
||||
import { useStyles2 } from '../../themes';
|
||||
import { getCellLinks, getTextColorForAlphaBackground } from '../../utils';
|
||||
import { Button, clearLinkButtonStyles } from '../Button';
|
||||
import { clearLinkButtonStyles } from '../Button';
|
||||
import { DataLinksContextMenu } from '../DataLinks/DataLinksContextMenu';
|
||||
|
||||
import { CellActions } from './CellActions';
|
||||
@ -42,15 +42,17 @@ export const DefaultCell = (props: TableCellProps) => {
|
||||
{hasLinks && (
|
||||
<DataLinksContextMenu links={() => getCellLinks(field, row) || []}>
|
||||
{(api) => {
|
||||
const content = <div className={getLinkStyle(tableStyles, cellOptions, api.targetClassName)}>{value}</div>;
|
||||
if (api.openMenu) {
|
||||
return (
|
||||
<Button className={cx(clearButtonStyle)} onClick={api.openMenu}>
|
||||
{content}
|
||||
</Button>
|
||||
<button
|
||||
className={cx(clearButtonStyle, getLinkStyle(tableStyles, cellOptions, api.targetClassName))}
|
||||
onClick={api.openMenu}
|
||||
>
|
||||
{value}
|
||||
</button>
|
||||
);
|
||||
} else {
|
||||
return content;
|
||||
return <div className={getLinkStyle(tableStyles, cellOptions, api.targetClassName)}>{value}</div>;
|
||||
}
|
||||
}}
|
||||
</DataLinksContextMenu>
|
||||
|
@ -175,6 +175,7 @@ export function useTableStyles(theme: GrafanaTheme2, cellHeightOption: TableCell
|
||||
font-weight: ${theme.typography.fontWeightMedium};
|
||||
&:hover {
|
||||
text-decoration: underline;
|
||||
color: ${theme.colors.text.link};
|
||||
}
|
||||
`,
|
||||
cellLinkForColoredCell: css`
|
||||
|
Loading…
Reference in New Issue
Block a user