mirror of
https://github.com/grafana/grafana.git
synced 2025-01-04 13:17:16 -06:00
Allow alert tab, heart icon in all panel types, and not show warning in DashobardPicker panels
This commit is contained in:
parent
3693af3723
commit
225da3f60e
@ -117,7 +117,7 @@ export class PanelPlugin<
|
||||
noPadding?: boolean;
|
||||
dataSupport: PanelPluginDataSupport = {
|
||||
annotations: false,
|
||||
alertStates: false,
|
||||
alertStates: true,
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -146,7 +146,6 @@ export const DashboardPicker = ({ dashboardUid, panelId, isOpen, onChange, onDis
|
||||
const panel = filteredPanels[index];
|
||||
const panelTitle = panel.title || '<No title>';
|
||||
const isSelected = panel.id && selectedPanelId === panel.id?.toString();
|
||||
const isAlertingCompatible = panel.type === 'graph' || panel.type === 'timeseries';
|
||||
const disabled = !isValidPanelIdentifier(panel);
|
||||
|
||||
return (
|
||||
@ -163,11 +162,6 @@ export const DashboardPicker = ({ dashboardUid, panelId, isOpen, onChange, onDis
|
||||
<div className={styles.rowButtonTitle} title={panelTitle}>
|
||||
{panelTitle}
|
||||
</div>
|
||||
{!isAlertingCompatible && !disabled && (
|
||||
<Tooltip content="Alert tab will be disabled for this panel. It is only supported on graph and timeseries panels">
|
||||
<Icon name="exclamation-triangle" className={styles.warnIcon} data-testid="warning-icon" />
|
||||
</Tooltip>
|
||||
)}
|
||||
{disabled && (
|
||||
<Tooltip content="This panel does not have a valid identifier.">
|
||||
<Icon name="info-circle" data-testid="info-icon" />
|
||||
|
@ -43,10 +43,7 @@ export const getPanelEditorTabs = memoizeOne((tab?: string, plugin?: PanelPlugin
|
||||
const hasRuleReadPermissions = contextSrv.hasPermission(getRulesPermissions(GRAFANA_RULES_SOURCE_NAME).read);
|
||||
const isAlertingAvailable = alertingEnabled || (unifiedAlertingEnabled && hasRuleReadPermissions);
|
||||
|
||||
const isGraph = plugin.meta.id === 'graph';
|
||||
const isTimeseries = plugin.meta.id === 'timeseries';
|
||||
|
||||
if ((isAlertingAvailable && isGraph) || isTimeseries) {
|
||||
if (isAlertingAvailable) {
|
||||
tabs.push({
|
||||
id: PanelEditorTabId.Alert,
|
||||
text: 'Alert',
|
||||
|
Loading…
Reference in New Issue
Block a user