From 1b2e712056e6c22be49d85088cc3ecb554893a0e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alejandro=20Fern=C3=A1ndez=20G=C3=B3mez?= Date: Tue, 27 Jul 2021 13:38:56 +0200 Subject: [PATCH] Pass `reason` from the alert fields --- .../alerting/inventory/rule_data_formatters.ts | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/x-pack/plugins/infra/public/alerting/inventory/rule_data_formatters.ts b/x-pack/plugins/infra/public/alerting/inventory/rule_data_formatters.ts index 1d8414d6abd23..7dd8f119405cb 100644 --- a/x-pack/plugins/infra/public/alerting/inventory/rule_data_formatters.ts +++ b/x-pack/plugins/infra/public/alerting/inventory/rule_data_formatters.ts @@ -5,20 +5,12 @@ * 2.0. */ -import { i18n } from '@kbn/i18n'; -import { ALERT_ID } from '@kbn/rule-data-utils'; +import { ALERT_REASON } from '@kbn/rule-data-utils'; import { ObservabilityRuleTypeFormatter } from '../../../../observability/public'; export const formatReason: ObservabilityRuleTypeFormatter = ({ fields }) => { - const groupName = fields[ALERT_ID]; - const reason = i18n.translate('xpack.infra.metrics.alerting.inventory.alertReasonDescription', { - defaultMessage: 'Inventory alert for {groupName}.', // TEMP reason message, will be deleted once we index the reason field - values: { - groupName, - }, - }); - - const link = '/app/metrics/inventory'; + const reason = fields[ALERT_REASON] ?? ''; + const link = '/app/metrics/inventory'; // FIXME? Not sure if we need to do something with this link return { reason,