mirror of
https://github.com/grafana/grafana.git
synced 2025-07-31 06:12:49 +08:00
TableNG: Follow-up style fixes (#107274)
* open cell inspect in code mode for JSON panels * increase opacity of TableCellActions background for legibility in overlap cases * fix nested grid width calculation * fix 'jumping' on hover overflow * route transparency through (needs a scenes update) * base row hover color on transparency * update the colors for table * remove console.log * reinstate header toggle for nested row transformation * fix #59474 - graceful handling when subtable has no rows * fix i18n * use TABLE.LINE_HEIGHT * change nestedData back to const
This commit is contained in:
@ -503,9 +503,13 @@ export function useRowHeight({
|
||||
return 0;
|
||||
}
|
||||
|
||||
// Ensure we have a minimum height (defaultHeight) for the nested table even if data is empty
|
||||
const rowCount = row.data?.length ?? 0;
|
||||
return Math.max(defaultHeight, defaultHeight * rowCount + headerHeight);
|
||||
if (rowCount === 0) {
|
||||
return TABLE.NESTED_NO_DATA_HEIGHT + TABLE.CELL_PADDING * 2;
|
||||
}
|
||||
|
||||
const nestedHeaderHeight = row.data?.meta?.custom?.noHeader ? 0 : defaultHeight;
|
||||
return Math.max(defaultHeight, defaultHeight * rowCount + nestedHeaderHeight + TABLE.CELL_PADDING * 2);
|
||||
}
|
||||
|
||||
// regular rows
|
||||
@ -519,7 +523,6 @@ export function useRowHeight({
|
||||
fields,
|
||||
hasNestedFrames,
|
||||
hasWrappedCols,
|
||||
headerHeight,
|
||||
maxWrapCellOptions,
|
||||
colWidths,
|
||||
]);
|
||||
|
Reference in New Issue
Block a user