Skip to content

Commit

Permalink
[Lens] Add toast notification when visualization is saved - Add singl…
Browse files Browse the repository at this point in the history
…e invocation of toast notification
  • Loading branch information
lykims committed Oct 16, 2020
1 parent 97b117c commit 0470e94
Showing 1 changed file with 9 additions and 16 deletions.
25 changes: 9 additions & 16 deletions x-pack/plugins/lens/public/app_plugin/app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -411,6 +411,15 @@ export function App({
return;
}

notifications.toasts.addSuccess(
i18n.translate('visualize.topNavMenu.saveVisualization.successNotificationText', {
defaultMessage: `Saved '{visTitle}'`,
values: {
visTitle: docToSave.title,
},
})
);

if (
attributeService.inputIsRefType(newInput) &&
newInput.savedObjectId !== originalSavedObjectId
Expand All @@ -425,14 +434,6 @@ export function App({
isSaveModalVisible: false,
isLinkedToOriginatingApp: false,
}));
notifications.toasts.addSuccess(
i18n.translate('visualize.topNavMenu.saveVisualization.successNotificationText', {
defaultMessage: `Saved '{visTitle}'`,
values: {
visTitle: docToSave.title,
},
})
);
redirectTo(newInput.savedObjectId);
return;
}
Expand All @@ -448,14 +449,6 @@ export function App({
isSaveModalVisible: false,
isLinkedToOriginatingApp: false,
}));
notifications.toasts.addSuccess(
i18n.translate('visualize.topNavMenu.saveVisualization.successNotificationText', {
defaultMessage: `Saved '{visTitle}'`,
values: {
visTitle: newDoc.title,
},
})
);
} catch (e) {
// eslint-disable-next-line no-console
console.dir(e);
Expand Down

0 comments on commit 0470e94

Please sign in to comment.