Add error details in notification error feedback tooltip (#56472)

pull/56475/head^2
Sonia Aguilar 3 years ago committed by GitHub
parent 66e8f39ce8
commit 01526d9053
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 12
      public/app/features/alerting/unified/components/receivers/ReceiversTable.tsx

@ -78,25 +78,27 @@ function ViewAction({ permissions, alertManagerName, receiverName }: ActionProps
}
interface ReceiverErrorProps {
errorCount: number;
errorDetail?: string;
}
function ReceiverError({ errorCount }: ReceiverErrorProps) {
function ReceiverError({ errorCount, errorDetail }: ReceiverErrorProps) {
return (
<Badge
color="orange"
icon="exclamation-triangle"
text={`${errorCount} ${pluralize('error', errorCount)}`}
tooltip={`${errorCount} ${pluralize('error', errorCount)} detected in this contact point`}
tooltip={errorDetail}
/>
);
}
interface ReceiverHealthProps {
errorsByReceiver: number;
errorDetail?: string;
}
function ReceiverHealth({ errorsByReceiver }: ReceiverHealthProps) {
function ReceiverHealth({ errorsByReceiver, errorDetail }: ReceiverHealthProps) {
return errorsByReceiver > 0 ? (
<ReceiverError errorCount={errorsByReceiver} />
<ReceiverError errorCount={errorsByReceiver} errorDetail={errorDetail} />
) : (
<Badge color="green" text="OK" tooltip="No errors detected" />
);
@ -157,7 +159,7 @@ function NotifiersTable({ notifiersState }: NotifiersTableProps) {
id: 'health',
label: 'Health',
renderCell: ({ data: { lastError } }) => {
return <ReceiverHealth errorsByReceiver={lastError ? 1 : 0} />;
return <ReceiverHealth errorsByReceiver={lastError ? 1 : 0} errorDetail={lastError ?? undefined} />;
},
size: 0.5,
},

Loading…
Cancel
Save