From 3a47e98ec39adc7f464c8b5064d340c857ecb84b Mon Sep 17 00:00:00 2001 From: Mike Cote Date: Fri, 27 Mar 2020 15:47:02 -0400 Subject: [PATCH 1/2] Rename some alert types --- .../notifications/rules_notification_alert_type.ts | 2 +- .../detection_engine/signals/signal_rule_alert_type.ts | 2 +- .../lib/alert_types/__tests__/monitor_status.test.ts | 2 +- .../uptime/public/lib/alert_types/monitor_status.tsx | 2 +- .../alert_types/index_threshold/alert_type.test.ts | 2 +- .../server/alert_types/index_threshold/alert_type.ts | 2 +- x-pack/plugins/apm/common/alert_types.ts | 4 ++-- .../alerting/metrics/metric_threshold_alert_type.ts | 2 +- .../register_metric_threshold_alert_type.ts | 2 +- x-pack/plugins/triggers_actions_ui/README.md | 2 +- .../server/lib/alerts/__tests__/status_check.test.ts | 2 +- .../plugins/uptime/server/lib/alerts/status_check.ts | 2 +- .../apps/triggers_actions_ui/alerts.ts | 10 +++++----- 13 files changed, 18 insertions(+), 18 deletions(-) diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/notifications/rules_notification_alert_type.ts b/x-pack/legacy/plugins/siem/server/lib/detection_engine/notifications/rules_notification_alert_type.ts index 32e64138ff6e0..bc30bfdb6d45c 100644 --- a/x-pack/legacy/plugins/siem/server/lib/detection_engine/notifications/rules_notification_alert_type.ts +++ b/x-pack/legacy/plugins/siem/server/lib/detection_engine/notifications/rules_notification_alert_type.ts @@ -20,7 +20,7 @@ export const rulesNotificationAlertType = ({ logger: Logger; }): NotificationAlertTypeDefinition => ({ id: NOTIFICATIONS_ID, - name: 'SIEM Notifications', + name: 'SIEM Notification', actionGroups: siemRuleActionGroups, defaultActionGroupId: 'default', validate: { diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/signals/signal_rule_alert_type.ts b/x-pack/legacy/plugins/siem/server/lib/detection_engine/signals/signal_rule_alert_type.ts index ab9def14bef65..ee6fb02faf88a 100644 --- a/x-pack/legacy/plugins/siem/server/lib/detection_engine/signals/signal_rule_alert_type.ts +++ b/x-pack/legacy/plugins/siem/server/lib/detection_engine/signals/signal_rule_alert_type.ts @@ -42,7 +42,7 @@ export const signalRulesAlertType = ({ }): SignalRuleAlertTypeDefinition => { return { id: SIGNALS_ID, - name: 'SIEM Signals', + name: 'SIEM Signal', actionGroups: siemRuleActionGroups, defaultActionGroupId: 'default', validate: { diff --git a/x-pack/legacy/plugins/uptime/public/lib/alert_types/__tests__/monitor_status.test.ts b/x-pack/legacy/plugins/uptime/public/lib/alert_types/__tests__/monitor_status.test.ts index 6323ee3951e21..82ae8ca9c4a74 100644 --- a/x-pack/legacy/plugins/uptime/public/lib/alert_types/__tests__/monitor_status.test.ts +++ b/x-pack/legacy/plugins/uptime/public/lib/alert_types/__tests__/monitor_status.test.ts @@ -173,7 +173,7 @@ describe('monitor status alert type', () => { {{context.completeIdList}}", "iconClass": "uptimeApp", "id": "xpack.uptime.alerts.monitorStatus", - "name": "Uptime Monitor Status", + "name": "Uptime monitor status", "validate": [Function], } `); diff --git a/x-pack/legacy/plugins/uptime/public/lib/alert_types/monitor_status.tsx b/x-pack/legacy/plugins/uptime/public/lib/alert_types/monitor_status.tsx index effbb59539d16..32c11dd415980 100644 --- a/x-pack/legacy/plugins/uptime/public/lib/alert_types/monitor_status.tsx +++ b/x-pack/legacy/plugins/uptime/public/lib/alert_types/monitor_status.tsx @@ -61,7 +61,7 @@ export const initMonitorStatusAlertType: AlertTypeInitializer = ({ autocomplete, }): AlertTypeModel => ({ id: 'xpack.uptime.alerts.monitorStatus', - name: 'Uptime Monitor Status', + name: 'Uptime monitor status', iconClass: 'uptimeApp', alertParamsExpression: params => { return ; diff --git a/x-pack/plugins/alerting_builtins/server/alert_types/index_threshold/alert_type.test.ts b/x-pack/plugins/alerting_builtins/server/alert_types/index_threshold/alert_type.test.ts index 5c15c398dbdcd..315e4800d4c73 100644 --- a/x-pack/plugins/alerting_builtins/server/alert_types/index_threshold/alert_type.test.ts +++ b/x-pack/plugins/alerting_builtins/server/alert_types/index_threshold/alert_type.test.ts @@ -20,7 +20,7 @@ describe('alertType', () => { it('alert type creation structure is the expected value', async () => { expect(alertType.id).toBe('.index-threshold'); - expect(alertType.name).toBe('Index Threshold'); + expect(alertType.name).toBe('Index threshold'); expect(alertType.actionGroups).toEqual([{ id: 'threshold met', name: 'Threshold Met' }]); expect(alertType.actionVariables).toMatchInlineSnapshot(` diff --git a/x-pack/plugins/alerting_builtins/server/alert_types/index_threshold/alert_type.ts b/x-pack/plugins/alerting_builtins/server/alert_types/index_threshold/alert_type.ts index 6d27f8a99dd4b..4d79efc7c9478 100644 --- a/x-pack/plugins/alerting_builtins/server/alert_types/index_threshold/alert_type.ts +++ b/x-pack/plugins/alerting_builtins/server/alert_types/index_threshold/alert_type.ts @@ -22,7 +22,7 @@ export function getAlertType(service: Service): AlertType { const { logger } = service; const alertTypeName = i18n.translate('xpack.alertingBuiltins.indexThreshold.alertTypeTitle', { - defaultMessage: 'Index Threshold', + defaultMessage: 'Index threshold', }); const actionGroupName = i18n.translate( diff --git a/x-pack/plugins/apm/common/alert_types.ts b/x-pack/plugins/apm/common/alert_types.ts index 51e1f88512965..8a342fab71e66 100644 --- a/x-pack/plugins/apm/common/alert_types.ts +++ b/x-pack/plugins/apm/common/alert_types.ts @@ -14,7 +14,7 @@ export enum AlertType { export const ALERT_TYPES_CONFIG = { [AlertType.ErrorRate]: { name: i18n.translate('xpack.apm.errorRateAlert.name', { - defaultMessage: 'Error rate threshold' + defaultMessage: 'Error rate' }), actionGroups: [ { @@ -28,7 +28,7 @@ export const ALERT_TYPES_CONFIG = { }, [AlertType.TransactionDuration]: { name: i18n.translate('xpack.apm.transactionDurationAlert.name', { - defaultMessage: 'Transaction duration threshold' + defaultMessage: 'Transaction duration' }), actionGroups: [ { diff --git a/x-pack/plugins/infra/public/components/alerting/metrics/metric_threshold_alert_type.ts b/x-pack/plugins/infra/public/components/alerting/metrics/metric_threshold_alert_type.ts index d3b5aaa7c8796..b11cbbc2b56c7 100644 --- a/x-pack/plugins/infra/public/components/alerting/metrics/metric_threshold_alert_type.ts +++ b/x-pack/plugins/infra/public/components/alerting/metrics/metric_threshold_alert_type.ts @@ -15,7 +15,7 @@ export function getAlertType(): AlertTypeModel { return { id: METRIC_THRESHOLD_ALERT_TYPE_ID, name: i18n.translate('xpack.infra.metrics.alertFlyout.alertName', { - defaultMessage: 'Alert Trigger', + defaultMessage: 'Metric threshold', }), iconClass: 'bell', alertParamsExpression: Expressions, diff --git a/x-pack/plugins/infra/server/lib/alerting/metric_threshold/register_metric_threshold_alert_type.ts b/x-pack/plugins/infra/server/lib/alerting/metric_threshold/register_metric_threshold_alert_type.ts index ed3a9b2f4fe36..fe9e0bda3f2f0 100644 --- a/x-pack/plugins/infra/server/lib/alerting/metric_threshold/register_metric_threshold_alert_type.ts +++ b/x-pack/plugins/infra/server/lib/alerting/metric_threshold/register_metric_threshold_alert_type.ts @@ -51,7 +51,7 @@ export async function registerMetricThresholdAlertType(alertingPlugin: PluginSet alertingPlugin.registerType({ id: METRIC_THRESHOLD_ALERT_TYPE_ID, - name: 'Metric Alert - Threshold', + name: 'Metric threshold', validate: { params: schema.object({ criteria: schema.arrayOf(schema.oneOf([countCriterion, nonCountCriterion])), diff --git a/x-pack/plugins/triggers_actions_ui/README.md b/x-pack/plugins/triggers_actions_ui/README.md index 3b6ca4f9da7cc..40a43f20d44f5 100644 --- a/x-pack/plugins/triggers_actions_ui/README.md +++ b/x-pack/plugins/triggers_actions_ui/README.md @@ -67,7 +67,7 @@ AlertTypeModel: export function getAlertType(): AlertTypeModel { return { id: '.index-threshold', - name: 'Index Threshold', + name: 'Index threshold', iconClass: 'alert', alertParamsExpression: IndexThresholdAlertTypeExpression, validate: validateAlertType, diff --git a/x-pack/plugins/uptime/server/lib/alerts/__tests__/status_check.test.ts b/x-pack/plugins/uptime/server/lib/alerts/__tests__/status_check.test.ts index 609d84cb521fc..05f712e912f02 100644 --- a/x-pack/plugins/uptime/server/lib/alerts/__tests__/status_check.test.ts +++ b/x-pack/plugins/uptime/server/lib/alerts/__tests__/status_check.test.ts @@ -302,7 +302,7 @@ describe('status check alert', () => { it('contains the expected static fields like id, name, etc.', () => { expect(alert.id).toBe('xpack.uptime.alerts.monitorStatus'); - expect(alert.name).toBe('Uptime Monitor Status'); + expect(alert.name).toBe('Uptime monitor status'); expect(alert.defaultActionGroupId).toBe('xpack.uptime.alerts.actionGroups.monitorStatus'); expect(alert.actionGroups).toMatchInlineSnapshot(` Array [ 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 d999f0fda3937..ce018427a322e 100644 --- a/x-pack/plugins/uptime/server/lib/alerts/status_check.ts +++ b/x-pack/plugins/uptime/server/lib/alerts/status_check.ts @@ -172,7 +172,7 @@ const DEFAULT_MAX_MESSAGE_ROWS = 3; export const statusCheckAlertFactory: UptimeAlertTypeFactory = (server, libs) => ({ id: 'xpack.uptime.alerts.monitorStatus', name: i18n.translate('xpack.uptime.alerts.monitorStatus', { - defaultMessage: 'Uptime Monitor Status', + defaultMessage: 'Uptime monitor status', }), validate: { params: schema.object({ diff --git a/x-pack/test/functional_with_es_ssl/apps/triggers_actions_ui/alerts.ts b/x-pack/test/functional_with_es_ssl/apps/triggers_actions_ui/alerts.ts index beedd6390388d..347eb5e14d0a8 100644 --- a/x-pack/test/functional_with_es_ssl/apps/triggers_actions_ui/alerts.ts +++ b/x-pack/test/functional_with_es_ssl/apps/triggers_actions_ui/alerts.ts @@ -92,7 +92,7 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => { { name: alertName, tagsText: '', - alertType: 'Index Threshold', + alertType: 'Index threshold', interval: '1m', }, ]); @@ -154,7 +154,7 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => { { name: createdAlert.name, tagsText: 'foo, bar', - alertType: 'Index Threshold', + alertType: 'Index threshold', interval: '1m', }, ]); @@ -179,7 +179,7 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => { { name: updatedAlertName, tagsText: 'foo, bar', - alertType: 'Index Threshold', + alertType: 'Index threshold', interval: '1m', }, ]); @@ -210,7 +210,7 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => { { name: createdAlert.name, tagsText: 'foo, bar', - alertType: 'Index Threshold', + alertType: 'Index threshold', interval: '1m', }, ]); @@ -260,7 +260,7 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => { { name: createdAlert.name, tagsText: 'foo, bar', - alertType: 'Index Threshold', + alertType: 'Index threshold', interval: '1m', }, ]); From 02b41efa5225a9fb58307d730392f60ff9142405 Mon Sep 17 00:00:00 2001 From: Mike Cote Date: Tue, 31 Mar 2020 13:54:39 -0400 Subject: [PATCH 2/2] Use sentence case for remaining changes + fix jest test --- .../notifications/rules_notification_alert_type.ts | 2 +- .../lib/detection_engine/signals/signal_rule_alert_type.ts | 2 +- x-pack/plugins/alerting_builtins/server/plugin.test.ts | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/notifications/rules_notification_alert_type.ts b/x-pack/legacy/plugins/siem/server/lib/detection_engine/notifications/rules_notification_alert_type.ts index bc30bfdb6d45c..e74da583e9193 100644 --- a/x-pack/legacy/plugins/siem/server/lib/detection_engine/notifications/rules_notification_alert_type.ts +++ b/x-pack/legacy/plugins/siem/server/lib/detection_engine/notifications/rules_notification_alert_type.ts @@ -20,7 +20,7 @@ export const rulesNotificationAlertType = ({ logger: Logger; }): NotificationAlertTypeDefinition => ({ id: NOTIFICATIONS_ID, - name: 'SIEM Notification', + name: 'SIEM notification', actionGroups: siemRuleActionGroups, defaultActionGroupId: 'default', validate: { diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/signals/signal_rule_alert_type.ts b/x-pack/legacy/plugins/siem/server/lib/detection_engine/signals/signal_rule_alert_type.ts index 1adcb72e32864..91905722fbca3 100644 --- a/x-pack/legacy/plugins/siem/server/lib/detection_engine/signals/signal_rule_alert_type.ts +++ b/x-pack/legacy/plugins/siem/server/lib/detection_engine/signals/signal_rule_alert_type.ts @@ -41,7 +41,7 @@ export const signalRulesAlertType = ({ }): SignalRuleAlertTypeDefinition => { return { id: SIGNALS_ID, - name: 'SIEM Signal', + name: 'SIEM signal', actionGroups: siemRuleActionGroups, defaultActionGroupId: 'default', validate: { diff --git a/x-pack/plugins/alerting_builtins/server/plugin.test.ts b/x-pack/plugins/alerting_builtins/server/plugin.test.ts index 6bcf0379d5abe..f93041fa3c142 100644 --- a/x-pack/plugins/alerting_builtins/server/plugin.test.ts +++ b/x-pack/plugins/alerting_builtins/server/plugin.test.ts @@ -37,7 +37,7 @@ describe('AlertingBuiltins Plugin', () => { }, ], "id": ".index-threshold", - "name": "Index Threshold", + "name": "Index threshold", } `); });