diff --git a/public/app/features/alerting/unified/components/receivers/ReceiversTable.tsx b/public/app/features/alerting/unified/components/receivers/ReceiversTable.tsx index 4e344582c5e..9a2937f9286 100644 --- a/public/app/features/alerting/unified/components/receivers/ReceiversTable.tsx +++ b/public/app/features/alerting/unified/components/receivers/ReceiversTable.tsx @@ -3,10 +3,10 @@ import React, { useMemo, useState } from 'react'; import { dateTime, dateTimeFormat } from '@grafana/data'; import { Stack } from '@grafana/experimental'; -import { Button, ConfirmModal, Modal, useStyles2, Badge, Icon } from '@grafana/ui'; +import { Badge, Button, ConfirmModal, Icon, Modal, useStyles2 } from '@grafana/ui'; import { contextSrv } from 'app/core/services/context_srv'; import { AlertManagerCortexConfig } from 'app/plugins/datasource/alertmanager/types'; -import { useDispatch, AccessControlAction, ContactPointsState, NotifiersState, ReceiversState } from 'app/types'; +import { AccessControlAction, ContactPointsState, NotifiersState, ReceiversState, useDispatch } from 'app/types'; import { useGetContactPointsState } from '../../api/receiversApi'; import { Authorize } from '../../components/Authorize'; @@ -84,11 +84,13 @@ interface ReceiverErrorProps { errorCount: number; errorDetail?: string; showErrorCount: boolean; + tooltip?: string; } -function ReceiverError({ errorCount, errorDetail, showErrorCount }: ReceiverErrorProps) { +function ReceiverError({ errorCount, errorDetail, showErrorCount, tooltip }: ReceiverErrorProps) { const text = showErrorCount ? `${errorCount} ${pluralize('error', errorCount)}` : 'Error'; - return ; + const tooltipToRender = tooltip ?? errorDetail ?? 'Error'; + return ; } interface NotifierHealthProps { errorsByNotifier: number; @@ -115,7 +117,11 @@ function ReceiverHealth({ errorsByReceiver, someWithNoAttempt }: ReceiverHealthP const noErrorsColor = someWithNoAttempt ? 'orange' : 'green'; const noErrorsText = someWithNoAttempt ? 'No attempts' : 'OK'; return errorsByReceiver > 0 ? ( - + ) : ( );