Skip to content

Commit

Permalink
[Stack Monitoring] fix Alerts and Rules menu persisting to other apps (
Browse files Browse the repository at this point in the history
…#124291)

* use shared component for header context menu

* removed unused component
  • Loading branch information
neptunian authored Feb 2, 2022
1 parent 67430f9 commit 2957036
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 39 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,9 @@ import {
} from '../../lib/setup_mode';
import { SetupModeFeature } from '../../../common/enums';
import { AlertsDropdown } from '../../alerts/alerts_dropdown';
import { ActionMenu } from '../../components/action_menu';
import { useRequestErrorHandler } from '../hooks/use_request_error_handler';
import { HeaderMenuPortal } from '../../../../observability/public';
import { HeaderActionMenuContext } from '../../application/contexts/header_action_menu_context';

export interface TabMenuItem {
id: string;
Expand Down Expand Up @@ -53,6 +54,7 @@ export const PageTemplate: React.FC<PageTemplateProps> = ({
const history = useHistory();
const [hasError, setHasError] = useState(false);
const handleRequestError = useRequestErrorHandler();
const { setHeaderActionMenu, theme$ } = useContext(HeaderActionMenuContext);

const getPageDataResponseHandler = useCallback(
(result: any) => {
Expand Down Expand Up @@ -104,9 +106,11 @@ export const PageTemplate: React.FC<PageTemplateProps> = ({

return (
<div className="app-container" data-test-subj="monitoringAppContainer">
<ActionMenu>
<AlertsDropdown />
</ActionMenu>
{setHeaderActionMenu && theme$ && (
<HeaderMenuPortal setHeaderActionMenu={setHeaderActionMenu} theme$={theme$}>
<AlertsDropdown />
</HeaderMenuPortal>
)}
<MonitoringToolbar pageTitle={pageTitle} onRefresh={onRefresh} />
{tabs && (
<EuiTabs>
Expand Down
35 changes: 0 additions & 35 deletions x-pack/plugins/monitoring/public/components/action_menu/index.tsx

This file was deleted.

0 comments on commit 2957036

Please sign in to comment.