Skip to content

Commit

Permalink
fix:remove new alert rule button
Browse files Browse the repository at this point in the history
  • Loading branch information
dhodgsonintergral committed Dec 11, 2024
1 parent cbdc49c commit abbeacc
Showing 1 changed file with 0 additions and 15 deletions.
15 changes: 0 additions & 15 deletions public/app/features/dashboard-scene/scene/PanelMenuBehavior.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,13 @@ import {
PanelPlugin,
PluginExtensionPanelContext,
PluginExtensionPoints,
urlUtil,
} from '@grafana/data';
import { config, getPluginLinkExtensions, locationService } from '@grafana/runtime';
import { LocalValueVariable, sceneGraph, SceneGridRow, VizPanel, VizPanelMenu } from '@grafana/scenes';
import { DataQuery, OptionsWithLegend } from '@grafana/schema';
import appEvents from 'app/core/app_events';
import { t } from 'app/core/internationalization';
import { contextSrv } from 'app/core/services/context_srv';
import { scenesPanelToRuleFormValues } from 'app/features/alerting/unified/utils/rule-form';
import { shareDashboardType } from 'app/features/dashboard/components/ShareModal/utils';
import { InspectTab } from 'app/features/inspector/types';
import { getScenePanelLinksSupplier } from 'app/features/panel/panellinks/linkSuppliers';
Expand Down Expand Up @@ -214,11 +212,6 @@ export function panelMenuBehavior(menu: VizPanelMenu, isRepeat = false) {
}
}

moreSubMenu.push({
text: t('panel.header-menu.new-alert-rule', `New alert rule`),
iconClassName: 'bell',
onClick: (e) => onCreateAlert(panel),
});

if (hasLegendOptions(panel.state.options) && !isEditingPanel) {
moreSubMenu.push({
Expand Down Expand Up @@ -481,14 +474,6 @@ export function onRemovePanel(dashboard: DashboardScene, panel: VizPanel) {
);
}

const onCreateAlert = async (panel: VizPanel) => {
const formValues = await scenesPanelToRuleFormValues(panel);
const ruleFormUrl = urlUtil.renderUrl('/alerting/new', {
defaults: JSON.stringify(formValues),
returnTo: location.pathname + location.search,
});
locationService.push(ruleFormUrl);
};

export function toggleVizPanelLegend(vizPanel: VizPanel): void {
const options = vizPanel.state.options;
Expand Down

0 comments on commit abbeacc

Please sign in to comment.