diff --git a/x-pack/plugins/alerts/server/lib/license_state.ts b/x-pack/plugins/alerts/server/lib/license_state.ts index 8d11ab72eb9fd..8ce58b4da628f 100644 --- a/x-pack/plugins/alerts/server/lib/license_state.ts +++ b/x-pack/plugins/alerts/server/lib/license_state.ts @@ -15,6 +15,7 @@ import { PLUGIN } from '../constants/plugin'; import { getAlertTypeFeatureUsageName } from './get_alert_type_feature_usage_name'; import { AlertType } from '../types'; import { AlertTypeDisabledError } from './errors/alert_type_disabled'; +import { capitalize } from 'lodash'; export type ILicenseState = PublicMethodsOf; @@ -167,8 +168,8 @@ export class LicenseState { throw new AlertTypeDisabledError( i18n.translate('xpack.alerts.serverSideErrors.invalidLicenseErrorMessage', { defaultMessage: - 'Alert {alertTypeId} is disabled because it requires a Gold license. Contact your administrator to upgrade your license.', - values: { alertTypeId: alertType.id, licenseType: this.license!.type }, + 'Alert {alertTypeId} is disabled because it requires a {licenseType} license. Contact your administrator to upgrade your license.', + values: { alertTypeId: alertType.id, licenseType: capitalize(this.license!.type) }, }), 'license_invalid' ); diff --git a/x-pack/plugins/triggers_actions_ui/public/application/sections/alert_details/components/alert_details.tsx b/x-pack/plugins/triggers_actions_ui/public/application/sections/alert_details/components/alert_details.tsx index 85d228345376d..5bb8d47988eed 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/sections/alert_details/components/alert_details.tsx +++ b/x-pack/plugins/triggers_actions_ui/public/application/sections/alert_details/components/alert_details.tsx @@ -26,6 +26,7 @@ import { EuiButton, } from '@elastic/eui'; import { FormattedMessage } from '@kbn/i18n/react'; +import { AlertExecutionStatusErrorReasons } from '../../../../../../alerts/common'; import { hasAllPrivilege, hasExecuteActionsCapability } from '../../../lib/capabilities'; import { getAlertingSectionBreadcrumb, getAlertDetailsBreadcrumb } from '../../../lib/breadcrumb'; import { getCurrentDocTitle } from '../../../lib/doc_title'; @@ -66,6 +67,7 @@ export const AlertDetails: React.FunctionComponent = ({ actionTypeRegistry, setBreadcrumbs, chrome, + http, } = useKibana().services; const [{}, dispatch] = useReducer(alertReducer, { alert }); const setInitialAlert = (value: Alert) => { @@ -273,12 +275,31 @@ export const AlertDetails: React.FunctionComponent = ({ {alert.executionStatus.error?.message} - setDissmissAlertErrors(true)}> - - + + + setDissmissAlertErrors(true)}> + + + + {alert.executionStatus.error?.reason === + AlertExecutionStatusErrorReasons.License && ( + + + + + + )} +