Skip to content

Commit c7a99e8

Browse files
committed
Add success toasts
1 parent 67e7f16 commit c7a99e8

File tree

2 files changed

+34
-0
lines changed
  • x-pack/plugins/ingest_manager/public/applications/ingest_manager/sections/agent_config

2 files changed

+34
-0
lines changed

x-pack/plugins/ingest_manager/public/applications/ingest_manager/sections/agent_config/create_datasource_page/index.tsx

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,23 @@ export const CreateDatasourcePage: React.FunctionComponent = () => {
173173
const { error } = await saveDatasource();
174174
if (!error) {
175175
history.push(`${AGENT_CONFIG_DETAILS_PATH}${agentConfig ? agentConfig.id : configId}`);
176+
notifications.toasts.addSuccess({
177+
title: i18n.translate('xpack.ingestManager.createDatasource.addedNotificationTitle', {
178+
defaultMessage: `Successfully added '{datasourceName}'`,
179+
values: {
180+
datasourceName: datasource.name,
181+
},
182+
}),
183+
text:
184+
agentCount && agentConfig
185+
? i18n.translate('xpack.ingestManager.createDatasource.addedNotificationMessage', {
186+
defaultMessage: `Fleet will deploy updates to all agents that use the '{agentConfigName}' configuration`,
187+
values: {
188+
agentConfigName: agentConfig.name,
189+
},
190+
})
191+
: undefined,
192+
});
176193
} else {
177194
notifications.toasts.addError(error, {
178195
title: 'Error',

x-pack/plugins/ingest_manager/public/applications/ingest_manager/sections/agent_config/edit_datasource_page/index.tsx

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,23 @@ export const EditDatasourcePage: React.FunctionComponent = () => {
187187
const { error } = await saveDatasource();
188188
if (!error) {
189189
history.push(`${AGENT_CONFIG_DETAILS_PATH}${configId}`);
190+
notifications.toasts.addSuccess({
191+
title: i18n.translate('xpack.ingestManager.editDatasource.updatedNotificationTitle', {
192+
defaultMessage: `Successfully updated '{datasourceName}'`,
193+
values: {
194+
datasourceName: datasource.name,
195+
},
196+
}),
197+
text:
198+
agentCount && agentConfig
199+
? i18n.translate('xpack.ingestManager.editDatasource.updatedNotificationMessage', {
200+
defaultMessage: `Fleet will deploy updates to all agents that use the '{agentConfigName}' configuration`,
201+
values: {
202+
agentConfigName: agentConfig.name,
203+
},
204+
})
205+
: undefined,
206+
});
190207
} else {
191208
notifications.toasts.addError(error, {
192209
title: 'Error',

0 commit comments

Comments
 (0)