Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions src/core_plugins/kibana/public/dashboard/dashboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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);
}
Expand Down
1 change: 0 additions & 1 deletion test/functional/apps/dashboard/_dashboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,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 () {
Expand Down
1 change: 0 additions & 1 deletion test/functional/apps/dashboard/_view_edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down