diff --git a/x-pack/plugins/uptime/common/translations.ts b/x-pack/plugins/uptime/common/translations.ts index aa2574c9cbe90..2b95732badafb 100644 --- a/x-pack/plugins/uptime/common/translations.ts +++ b/x-pack/plugins/uptime/common/translations.ts @@ -21,7 +21,7 @@ export const VALUE_MUST_BE_AN_INTEGER = i18n.translate('xpack.uptime.settings.in export const MonitorStatusTranslations = { defaultActionMessage: i18n.translate('xpack.uptime.alerts.monitorStatus.defaultActionMessage', { defaultMessage: - 'Monitor {monitorName} with url {monitorUrl} from {observerLocation} {statusMessage}. The latest error message is {latestErrorMessage}', + 'Monitor {monitorName} with url {monitorUrl} from {observerLocation} {statusMessage} The latest error message is {latestErrorMessage}', values: { monitorName: '{{state.monitorName}}', monitorUrl: '{{{state.monitorUrl}}}', diff --git a/x-pack/plugins/uptime/public/lib/alert_types/monitor_status.test.ts b/x-pack/plugins/uptime/public/lib/alert_types/monitor_status.test.ts index af2fec78098a7..2f67219ac1ae5 100644 --- a/x-pack/plugins/uptime/public/lib/alert_types/monitor_status.test.ts +++ b/x-pack/plugins/uptime/public/lib/alert_types/monitor_status.test.ts @@ -202,7 +202,7 @@ describe('monitor status alert type', () => { }) ).toMatchInlineSnapshot(` Object { - "defaultActionMessage": "Monitor {{state.monitorName}} with url {{{state.monitorUrl}}} from {{state.observerLocation}} {{{state.statusMessage}}}. The latest error message is {{{state.latestErrorMessage}}}", + "defaultActionMessage": "Monitor {{state.monitorName}} with url {{{state.monitorUrl}}} from {{state.observerLocation}} {{{state.statusMessage}}} The latest error message is {{{state.latestErrorMessage}}}", "description": "Alert when a monitor is down or an availability threshold is breached.", "documentationUrl": [Function], "format": [Function], diff --git a/x-pack/plugins/uptime/public/state/api/alert_actions.test.ts b/x-pack/plugins/uptime/public/state/api/alert_actions.test.ts index 8ca934392fd43..16c49d7c3afcb 100644 --- a/x-pack/plugins/uptime/public/state/api/alert_actions.test.ts +++ b/x-pack/plugins/uptime/public/state/api/alert_actions.test.ts @@ -50,7 +50,7 @@ describe('Alert Actions factory', () => { eventAction: 'trigger', severity: 'error', summary: - 'Monitor {{state.monitorName}} with url {{{state.monitorUrl}}} from {{state.observerLocation}} {{{state.statusMessage}}}. The latest error message is {{{state.latestErrorMessage}}}', + 'Monitor {{state.monitorName}} with url {{{state.monitorUrl}}} from {{state.observerLocation}} {{{state.statusMessage}}} The latest error message is {{{state.latestErrorMessage}}}', }, id: 'f2a3b195-ed76-499a-805d-82d24d4eeba9', }, @@ -75,7 +75,7 @@ describe('Alert Actions factory', () => { eventAction: 'trigger', severity: 'error', summary: - 'Monitor {{state.monitorName}} with url {{{state.monitorUrl}}} from {{state.observerLocation}} {{{state.statusMessage}}}. The latest error message is {{{state.latestErrorMessage}}}', + 'Monitor {{state.monitorName}} with url {{{state.monitorUrl}}} from {{state.observerLocation}} {{{state.statusMessage}}} The latest error message is {{{state.latestErrorMessage}}}', }, }, ]); @@ -93,7 +93,7 @@ describe('Alert Actions factory', () => { eventAction: 'trigger', severity: 'error', summary: - 'Monitor {{state.monitorName}} with url {{{state.monitorUrl}}} from {{state.observerLocation}} {{{state.statusMessage}}}. The latest error message is {{{state.latestErrorMessage}}}', + 'Monitor {{state.monitorName}} with url {{{state.monitorUrl}}} from {{state.observerLocation}} {{{state.statusMessage}}} The latest error message is {{{state.latestErrorMessage}}}', }, id: 'f2a3b195-ed76-499a-805d-82d24d4eeba9', }, @@ -118,7 +118,7 @@ describe('Alert Actions factory', () => { eventAction: 'trigger', severity: 'error', summary: - 'Monitor {{state.monitorName}} with url {{{state.monitorUrl}}} from {{state.observerLocation}} {{{state.statusMessage}}}. The latest error message is {{{state.latestErrorMessage}}}', + 'Monitor {{state.monitorName}} with url {{{state.monitorUrl}}} from {{state.observerLocation}} {{{state.statusMessage}}} The latest error message is {{{state.latestErrorMessage}}}', }, }, ]); diff --git a/x-pack/plugins/uptime/server/lib/alerts/status_check.ts b/x-pack/plugins/uptime/server/lib/alerts/status_check.ts index f1f5dbe6cad6a..0056a90f22551 100644 --- a/x-pack/plugins/uptime/server/lib/alerts/status_check.ts +++ b/x-pack/plugins/uptime/server/lib/alerts/status_check.ts @@ -177,26 +177,26 @@ export const getStatusMessage = ( ) => { let statusMessage = ''; if (downMonParams?.info) { - statusMessage = `${statusCheckTranslations.downMonitorsLabel( + statusMessage = statusCheckTranslations.downMonitorsLabel( downMonParams.count!, downMonParams.interval!, downMonParams.numTimes - )}.`; + ); } let availabilityMessage = ''; if (availMonInfo) { - availabilityMessage = `${statusCheckTranslations.availabilityBreachLabel( + availabilityMessage = statusCheckTranslations.availabilityBreachLabel( (availMonInfo.availabilityRatio! * 100).toFixed(2), availability?.threshold!, getInterval(availability?.range!, availability?.rangeUnit!) - )}.`; + ); } if (availMonInfo && downMonParams?.info) { - return `${statusCheckTranslations.downMonitorsAndAvailabilityBreachLabel( + return statusCheckTranslations.downMonitorsAndAvailabilityBreachLabel( statusMessage, availabilityMessage - )}`; + ); } return statusMessage + availabilityMessage; }; diff --git a/x-pack/plugins/uptime/server/lib/alerts/translations.ts b/x-pack/plugins/uptime/server/lib/alerts/translations.ts index 1dcadb3db29cb..f80fb7e69e2d3 100644 --- a/x-pack/plugins/uptime/server/lib/alerts/translations.ts +++ b/x-pack/plugins/uptime/server/lib/alerts/translations.ts @@ -331,7 +331,7 @@ export const durationAnomalyTranslations = { export const statusCheckTranslations = { downMonitorsLabel: (count: number, interval: string, numTimes: number) => i18n.translate('xpack.uptime.alerts.monitorStatus.actionVariables.down', { - defaultMessage: `failed {count} times in the last {interval}. Alert when > {numTimes}`, + defaultMessage: `failed {count} times in the last {interval}. Alert when > {numTimes}.`, values: { count, interval, @@ -345,7 +345,7 @@ export const statusCheckTranslations = { ) => i18n.translate('xpack.uptime.alerts.monitorStatus.actionVariables.availabilityMessage', { defaultMessage: - '{interval} availability is {availabilityRatio}%. Alert when < {expectedAvailability}%', + '{interval} availability is {availabilityRatio}%. Alert when < {expectedAvailability}%.', values: { availabilityRatio, expectedAvailability, diff --git a/x-pack/test/functional_with_es_ssl/apps/uptime/simple_down_alert.ts b/x-pack/test/functional_with_es_ssl/apps/uptime/simple_down_alert.ts index af3cc52627970..597b5eb38379d 100644 --- a/x-pack/test/functional_with_es_ssl/apps/uptime/simple_down_alert.ts +++ b/x-pack/test/functional_with_es_ssl/apps/uptime/simple_down_alert.ts @@ -107,7 +107,7 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => { group: 'xpack.uptime.alerts.actionGroups.monitorStatus', params: { message: - 'Monitor {{state.monitorName}} with url {{{state.monitorUrl}}} from {{state.observerLocation}} {{{state.statusMessage}}}. The latest error message is {{{state.latestErrorMessage}}}', + 'Monitor {{state.monitorName}} with url {{{state.monitorUrl}}} from {{state.observerLocation}} {{{state.statusMessage}}} The latest error message is {{{state.latestErrorMessage}}}', }, id: 'my-slack1', },