Add toast for newly created alerts (#89202) (#89258)

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
This commit is contained in:
Chris Roberson 2021-01-26 01:21:57 -05:00 committed by GitHub
parent 5b13220762
commit 3fc8860a28
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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,
@ -92,5 +110,7 @@ export const showAlertsToast = (response: EnableAlertResponse) => {
showTlsAndEncryptionError();
} else if (disabledWatcherClusterAlerts === false) {
showUnableToDisableWatcherClusterAlertsError();
} else if (disabledWatcherClusterAlerts === true) {
showDisabledWatcherClusterAlertsError();
}
};