Skip to content

Commit

Permalink
Disable panel header menu
Browse files Browse the repository at this point in the history
  • Loading branch information
Spikatrix committed Oct 13, 2023
1 parent 18df68d commit 64104b3
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { css, cx } from '@emotion/css';
import { Box } from '@mui/material';
import React from 'react';

import { DataLink, GrafanaTheme2, PanelData } from '@grafana/data';
Expand All @@ -12,7 +13,6 @@ import { getPanelLinksSupplier } from 'app/features/panel/panellinks/linkSupplie
import PanelHeaderCorner from './PanelHeaderCorner';
import { PanelHeaderLoadingIndicator } from './PanelHeaderLoadingIndicator';
import { PanelHeaderMenuTrigger } from './PanelHeaderMenuTrigger';
import { PanelHeaderMenuWrapper } from './PanelHeaderMenuWrapper';
import { PanelHeaderNotices } from './PanelHeaderNotices';

export interface Props {
Expand Down Expand Up @@ -49,7 +49,7 @@ export function PanelHeader({ panel, error, isViewing, isEditing, data, alertSta
links={getPanelLinksSupplier(panel)}
error={error}
/>
<div className={className}>
<Box className={className} sx={{ '&:hover': { backgroundColor: 'transparent !important' } }}>
<PanelHeaderMenuTrigger data-testid={selectors.components.Panels.Panel.title(title)} onOpenMenu={onOpenMenu}>
{({ closeMenu, panelMenuOpen }) => {
return (
Expand All @@ -67,8 +67,8 @@ export function PanelHeader({ panel, error, isViewing, isEditing, data, alertSta
<h2 className={styles.titleText}>{title}</h2>
{!dashboard.meta.publicDashboardAccessToken && (
<div data-testid="panel-dropdown">
<Icon name="angle-down" className="panel-menu-toggle" />
{panelMenuOpen ? <PanelHeaderMenuWrapper panel={panel} dashboard={dashboard} /> : null}
{/* <Icon name="angle-down" className="panel-menu-toggle" />
{panelMenuOpen ? <PanelHeaderMenuWrapper panel={panel} dashboard={dashboard} /> : null} */}
</div>
)}
{data.request && data.request.timeInfo && (
Expand All @@ -81,7 +81,7 @@ export function PanelHeader({ panel, error, isViewing, isEditing, data, alertSta
);
}}
</PanelHeaderMenuTrigger>
</div>
</Box>
</>
);
}
Expand All @@ -93,7 +93,6 @@ const panelStyles = (theme: GrafanaTheme2) => {
overflow: hidden;
white-space: nowrap;
max-width: calc(100% - 38px);
cursor: pointer;
font-weight: ${theme.typography.fontWeightMedium};
font-size: ${theme.typography.body.fontSize};
margin: 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,13 @@ export function PanelHeaderMenuTrigger({ children, onOpenMenu, ...divProps }: Pr
return (
// TODO: fix keyboard a11y
// eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-static-element-interactions
<header {...divProps} className="panel-title-container" onClick={onMenuToggle} onMouseDown={onMouseDown}>
<header
{...divProps}
className="panel-title-container"
onClick={onMenuToggle}
onMouseDown={onMouseDown}
style={{ cursor: 'unset' }}
>
{children({ panelMenuOpen, closeMenu: () => setPanelMenuOpen(false) })}
</header>
);
Expand Down

0 comments on commit 64104b3

Please sign in to comment.