diff --git a/src/core_plugins/kibana/public/dashboard/dashboard.js b/src/core_plugins/kibana/public/dashboard/dashboard.js index 5949c58a31669..75135095b5912 100644 --- a/src/core_plugins/kibana/public/dashboard/dashboard.js +++ b/src/core_plugins/kibana/public/dashboard/dashboard.js @@ -157,10 +157,12 @@ app.directive('dashboardApp', function (Notifier, courier, AppState, timefilter, }; // called by the saved-object-finder when a user clicks a vis - $scope.addVis = function (hit) { + $scope.addVis = function (hit, showToast = true) { pendingVisCount++; dashboardState.addNewPanel(hit.id, 'visualization'); - notify.info(`Visualization successfully added to your dashboard`); + if (showToast) { + notify.info(`Visualization successfully added to your dashboard`); + } }; $scope.addSearch = function (hit) { @@ -293,7 +295,11 @@ app.directive('dashboardApp', function (Notifier, courier, AppState, timefilter, }); if ($route.current.params && $route.current.params[DashboardConstants.NEW_VISUALIZATION_ID_PARAM]) { - $scope.addVis({ id: $route.current.params[DashboardConstants.NEW_VISUALIZATION_ID_PARAM] }); + // Hide the toast message since they will already see a notification from saving the visualization, + // and one is sufficient (especially given how the screen jumps down a bit for each unique notification). + const showToast = false; + $scope.addVis({ id: $route.current.params[DashboardConstants.NEW_VISUALIZATION_ID_PARAM] }, showToast); + kbnUrl.removeParam(DashboardConstants.ADD_VISUALIZATION_TO_DASHBOARD_MODE_PARAM); kbnUrl.removeParam(DashboardConstants.NEW_VISUALIZATION_ID_PARAM); } diff --git a/test/functional/apps/dashboard/_dashboard.js b/test/functional/apps/dashboard/_dashboard.js index b7ca0025dcc7d..f18bba503563e 100644 --- a/test/functional/apps/dashboard/_dashboard.js +++ b/test/functional/apps/dashboard/_dashboard.js @@ -135,7 +135,6 @@ export default function ({ getService, getPageObjects }) { await PageObjects.visualize.clickNewSearch(); await PageObjects.visualize.saveVisualization('visualization from add new link'); await PageObjects.header.clickToastOK(); - await PageObjects.header.clickToastOK(); const visualizations = PageObjects.dashboard.getTestVisualizations(); return retry.tryForTime(10000, async function () { diff --git a/test/functional/apps/dashboard/_view_edit.js b/test/functional/apps/dashboard/_view_edit.js index 196514324e676..d9549fe64239f 100644 --- a/test/functional/apps/dashboard/_view_edit.js +++ b/test/functional/apps/dashboard/_view_edit.js @@ -206,7 +206,6 @@ export default function ({ getService, getPageObjects }) { await PageObjects.visualize.clickNewSearch(); await PageObjects.visualize.saveVisualization('new viz panel'); await PageObjects.header.clickToastOK(); - await PageObjects.header.clickToastOK(); await PageObjects.dashboard.clickCancelOutOfEditMode();