Allow alert tab, heart icon in all panel types, and not show warning in DashobardPicker panels

This commit is contained in:
Sonia Aguilar 2023-10-17 13:11:43 +02:00
parent 3693af3723
commit 225da3f60e
3 changed files with 2 additions and 11 deletions

View File

@ -117,7 +117,7 @@ export class PanelPlugin<
noPadding?: boolean;
dataSupport: PanelPluginDataSupport = {
annotations: false,
alertStates: false,
alertStates: true,
};
/**

View File

@ -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" />

View File

@ -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',