Skip to content

Commit

Permalink
LogRowMessage: remove hardcoded true from condition (#72976)
Browse files Browse the repository at this point in the history
  • Loading branch information
matyax committed Aug 7, 2023
1 parent ba3cbbe commit 869d3fc
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions public/app/features/logs/components/LogRowMessage.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,11 @@ describe('LogRowMessage', () => {
expect(screen.queryByText('test123')).toBeInTheDocument();
});

it('should hide the menu if the mouse is not over', async () => {
setup({ showContextToggle: () => true, mouseIsOver: false });
expect(screen.queryByLabelText('Show context')).not.toBeInTheDocument();
});

describe('with show context', () => {
it('should show context button', async () => {
setup({ showContextToggle: () => true });
Expand Down
2 changes: 1 addition & 1 deletion public/app/features/logs/components/LogRowMessage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ export const LogRowMessage = React.memo((props: Props) => {
} = props;
const { hasAnsi, raw } = row;
const restructuredEntry = useMemo(() => restructureLog(raw, prettifyLogMessage), [raw, prettifyLogMessage]);
const shouldShowMenu = useMemo(() => mouseIsOver || pinned || true, [mouseIsOver, pinned]);
const shouldShowMenu = useMemo(() => mouseIsOver || pinned, [mouseIsOver, pinned]);
return (
<>
{
Expand Down

0 comments on commit 869d3fc

Please sign in to comment.