From 1486be5ec12e97899a62a3d877ee8782abe154c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B8ren=20Louv-Jansen?= Date: Tue, 13 Oct 2020 14:01:02 +0200 Subject: [PATCH 1/4] [Alerting] Improve toast when alert is created --- .../public/application/sections/alert_form/alert_add.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x-pack/plugins/triggers_actions_ui/public/application/sections/alert_form/alert_add.tsx b/x-pack/plugins/triggers_actions_ui/public/application/sections/alert_form/alert_add.tsx index 84726bc950ef2..556174351a1c1 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/sections/alert_form/alert_add.tsx +++ b/x-pack/plugins/triggers_actions_ui/public/application/sections/alert_form/alert_add.tsx @@ -134,7 +134,7 @@ export const AlertAdd = ({ const newAlert = await createAlert({ http, alert }); toastNotifications.addSuccess( i18n.translate('xpack.triggersActionsUI.sections.alertAdd.saveSuccessNotificationText', { - defaultMessage: "Saved '{alertName}'", + defaultMessage: 'Alert was created', values: { alertName: newAlert.name, }, From 6fb4cf74d311136c7bdf42bdccfe15f442a68107 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B8ren=20Louv-Jansen?= Date: Wed, 14 Oct 2020 13:21:50 +0200 Subject: [PATCH 2/4] Update toast text --- .../public/application/sections/alert_form/alert_add.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x-pack/plugins/triggers_actions_ui/public/application/sections/alert_form/alert_add.tsx b/x-pack/plugins/triggers_actions_ui/public/application/sections/alert_form/alert_add.tsx index 556174351a1c1..f7ae7feaa88ac 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/sections/alert_form/alert_add.tsx +++ b/x-pack/plugins/triggers_actions_ui/public/application/sections/alert_form/alert_add.tsx @@ -134,7 +134,7 @@ export const AlertAdd = ({ const newAlert = await createAlert({ http, alert }); toastNotifications.addSuccess( i18n.translate('xpack.triggersActionsUI.sections.alertAdd.saveSuccessNotificationText', { - defaultMessage: 'Alert was created', + defaultMessage: 'Created alert ({alertName})', values: { alertName: newAlert.name, }, From de69ba3947ce4e759bd2e4fd694fca5cf3ee1d5a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B8ren=20Louv-Jansen?= Date: Wed, 14 Oct 2020 13:22:42 +0200 Subject: [PATCH 3/4] Improved toast copy --- .../public/application/sections/alert_form/alert_add.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x-pack/plugins/triggers_actions_ui/public/application/sections/alert_form/alert_add.tsx b/x-pack/plugins/triggers_actions_ui/public/application/sections/alert_form/alert_add.tsx index f7ae7feaa88ac..7be7e60c2e19c 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/sections/alert_form/alert_add.tsx +++ b/x-pack/plugins/triggers_actions_ui/public/application/sections/alert_form/alert_add.tsx @@ -134,7 +134,7 @@ export const AlertAdd = ({ const newAlert = await createAlert({ http, alert }); toastNotifications.addSuccess( i18n.translate('xpack.triggersActionsUI.sections.alertAdd.saveSuccessNotificationText', { - defaultMessage: 'Created alert ({alertName})', + defaultMessage: 'Created alert "{alertName}"', values: { alertName: newAlert.name, }, From 0d391c5a9a411f6658cbc0177d0b17bf05a9ee92 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B8ren=20Louv-Jansen?= Date: Mon, 19 Oct 2020 21:06:44 +0200 Subject: [PATCH 4/4] fix test --- .../functional_with_es_ssl/apps/triggers_actions_ui/alerts.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 4dd7c9f3b3716..4a9ffbf870cb0 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 @@ -110,7 +110,7 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => { await testSubjects.click('saveAlertButton'); const toastTitle = await pageObjects.common.closeToast(); - expect(toastTitle).to.eql(`Saved '${alertName}'`); + expect(toastTitle).to.eql(`Created alert "${alertName}"`); await pageObjects.triggersActionsUI.searchAlerts(alertName); const searchResultsAfterSave = await pageObjects.triggersActionsUI.getAlertsList(); expect(searchResultsAfterSave).to.eql([ @@ -143,7 +143,7 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => { await testSubjects.missingOrFail('confirmAlertSaveModal'); const toastTitle = await pageObjects.common.closeToast(); - expect(toastTitle).to.eql(`Saved '${alertName}'`); + expect(toastTitle).to.eql(`Created alert "${alertName}"`); await pageObjects.triggersActionsUI.searchAlerts(alertName); const searchResultsAfterSave = await pageObjects.triggersActionsUI.getAlertsList(); expect(searchResultsAfterSave).to.eql([