Skip to content

Commit

Permalink
removing unecessary code
Browse files Browse the repository at this point in the history
  • Loading branch information
simianhacker committed Jul 30, 2020
1 parent 340f01a commit 0e6d9b8
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 26 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import { ManageAlertsContextMenuItem } from './manage_alerts_context_menu_item';
export const InventoryAlertDropdown = () => {
const [popoverOpen, setPopoverOpen] = useState(false);
const [flyoutVisible, setFlyoutVisible] = useState(false);
const kibana = useKibana();

const { inventoryPrefill } = useAlertPrefillContext();
const { nodeType, metric, filterQuery } = inventoryPrefill;
Expand All @@ -28,18 +27,12 @@ export const InventoryAlertDropdown = () => {
setPopoverOpen(true);
}, [setPopoverOpen]);

const menuItems = useMemo(() => {
return [
<EuiContextMenuItem icon="bell" key="createLink" onClick={() => setFlyoutVisible(true)}>
<FormattedMessage
id="xpack.infra.alerting.createAlertButton"
defaultMessage="Create alert"
/>
</EuiContextMenuItem>,
<ManageAlertsContextMenuItem />,
];
/* eslint-disable-next-line react-hooks/exhaustive-deps */
}, [kibana.services]);
const menuItems = [
<EuiContextMenuItem icon="bell" key="createLink" onClick={() => setFlyoutVisible(true)}>
<FormattedMessage id="xpack.infra.alerting.createAlertButton" defaultMessage="Create alert" />
</EuiContextMenuItem>,
<ManageAlertsContextMenuItem />,
];

return (
<>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import { ManageAlertsContextMenuItem } from '../../inventory/components/manage_a
export const MetricsAlertDropdown = () => {
const [popoverOpen, setPopoverOpen] = useState(false);
const [flyoutVisible, setFlyoutVisible] = useState(false);
const kibana = useKibana();

const { metricThresholdPrefill } = useAlertPrefillContext();
const { groupBy, filterQuery, metrics } = metricThresholdPrefill;
Expand All @@ -28,18 +27,12 @@ export const MetricsAlertDropdown = () => {
setPopoverOpen(true);
}, [setPopoverOpen]);

const menuItems = useMemo(() => {
return [
<EuiContextMenuItem icon="bell" key="createLink" onClick={() => setFlyoutVisible(true)}>
<FormattedMessage
id="xpack.infra.alerting.createAlertButton"
defaultMessage="Create alert"
/>
</EuiContextMenuItem>,
<ManageAlertsContextMenuItem />,
];
/* eslint-disable-next-line react-hooks/exhaustive-deps */
}, [kibana.services]);
const menuItems = [
<EuiContextMenuItem icon="bell" key="createLink" onClick={() => setFlyoutVisible(true)}>
<FormattedMessage id="xpack.infra.alerting.createAlertButton" defaultMessage="Create alert" />
</EuiContextMenuItem>,
<ManageAlertsContextMenuItem />,
];

return (
<>
Expand Down

0 comments on commit 0e6d9b8

Please sign in to comment.