mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Logs: Position LogRowMenu sticky to be able to use it in scrollable containers (#65502)
* fix logrowmenu * remove comment * add comment * get rid of absolute positions * remove `inExplore` check
This commit is contained in:
parent
d4397fae25
commit
07d960ac26
@ -109,7 +109,6 @@ export class LogRowMessage extends PureComponent<Props> {
|
||||
wrapLogMessage,
|
||||
prettifyLogMessage,
|
||||
onToggleContext,
|
||||
app,
|
||||
logsSortOrder,
|
||||
showContextToggle,
|
||||
getLogRowContextUi,
|
||||
@ -118,7 +117,6 @@ export class LogRowMessage extends PureComponent<Props> {
|
||||
const { hasAnsi, raw } = row;
|
||||
const restructuredEntry = restructureLog(raw, prettifyLogMessage);
|
||||
const shouldShowContextToggle = showContextToggle ? showContextToggle(row) : false;
|
||||
const inExplore = app === CoreApp.Explore;
|
||||
|
||||
return (
|
||||
<>
|
||||
@ -161,13 +159,7 @@ export class LogRowMessage extends PureComponent<Props> {
|
||||
</div>
|
||||
</td>
|
||||
{showRowMenu && (
|
||||
<td
|
||||
className={cx('log-row-menu-cell', styles.logRowMenuCell, {
|
||||
[styles.logRowMenuCellDefaultPosition]: !inExplore,
|
||||
[styles.logRowMenuCellExplore]: inExplore && !shouldShowContextToggle,
|
||||
[styles.logRowMenuCellExploreWithContextButton]: inExplore && shouldShowContextToggle,
|
||||
})}
|
||||
>
|
||||
<td className={cx('log-row-menu-cell', styles.logRowMenuCell)}>
|
||||
<span
|
||||
className={cx('log-row-menu', styles.rowMenu, {
|
||||
[styles.rowMenuWithContextButton]: shouldShowContextToggle,
|
||||
|
@ -70,6 +70,7 @@ export const getLogRowStyles = memoizeOne((theme: GrafanaTheme2) => {
|
||||
font-family: ${theme.typography.fontFamilyMonospace};
|
||||
font-size: ${theme.typography.bodySmall.fontSize};
|
||||
width: 100%;
|
||||
margin-bottom: ${theme.spacing(2.25)}; /* This is to make sure the last row's LogRowMenu is not cut off. */
|
||||
`,
|
||||
contextBackground: css`
|
||||
background: ${hoverBgColor};
|
||||
@ -241,17 +242,14 @@ export const getLogRowStyles = memoizeOne((theme: GrafanaTheme2) => {
|
||||
width: ${theme.spacing(10)};
|
||||
`,
|
||||
logRowMenuCell: css`
|
||||
position: absolute;
|
||||
position: sticky;
|
||||
z-index: ${theme.zIndex.dropdown};
|
||||
margin-top: -${theme.spacing(0.125)};
|
||||
`,
|
||||
logRowMenuCellDefaultPosition: css`
|
||||
right: 40px;
|
||||
`,
|
||||
logRowMenuCellExplore: css`
|
||||
right: calc(115px + ${theme.spacing(1)});
|
||||
`,
|
||||
logRowMenuCellExploreWithContextButton: css`
|
||||
right: calc(155px + ${theme.spacing(1)});
|
||||
right: 0px;
|
||||
|
||||
& > span {
|
||||
transform: translateX(-100%);
|
||||
}
|
||||
`,
|
||||
logLine: css`
|
||||
background-color: transparent;
|
||||
|
Loading…
Reference in New Issue
Block a user