Skip to content

Commit

Permalink
Add toast for newly created alerts (#89202)
Browse files Browse the repository at this point in the history
Co-authored-by: Kibana Machine <[email protected]>
  • Loading branch information
chrisronline and kibanamachine authored Jan 26, 2021
1 parent 1750fc2 commit da72cd4
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions x-pack/plugins/monitoring/public/alerts/lib/alerts_toast.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,24 @@ const showUnableToDisableWatcherClusterAlertsError = () => {
});
};

const showDisabledWatcherClusterAlertsError = () => {
Legacy.shims.toastNotifications.addWarning({
title: toMountPoint(
<FormattedMessage
id="xpack.monitoring.healthCheck.disabledWatches.title"
defaultMessage="New alerts created"
/>
),
text: toMountPoint(
<p>
{i18n.translate('xpack.monitoring.healthCheck.disabledWatches.text', {
defaultMessage: `Review the alert definition using Setup mode and configure additional action connectors to get notified via your favorite method.`,
})}
</p>
),
});
};

export const showAlertsToast = (response: EnableAlertResponse) => {
const {
isSufficientlySecure,
Expand All @@ -92,5 +110,7 @@ export const showAlertsToast = (response: EnableAlertResponse) => {
showTlsAndEncryptionError();
} else if (disabledWatcherClusterAlerts === false) {
showUnableToDisableWatcherClusterAlertsError();
} else if (disabledWatcherClusterAlerts === true) {
showDisabledWatcherClusterAlertsError();
}
};

0 comments on commit da72cd4

Please sign in to comment.