Skip to content
Merged
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
24 changes: 5 additions & 19 deletions src/plugins/dashboard/public/application/legacy_app.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ import { createDashboardEditUrl, DashboardConstants } from '../dashboard_constan
import {
createKbnUrlStateStorage,
redirectWhenMissing,
InvalidJSONProperty,
SavedObjectNotFound,
} from '../../../kibana_utils/public';
import { DashboardListing, EMPTY_FILTER } from './listing/dashboard_listing';
Expand Down Expand Up @@ -206,13 +205,6 @@ export function initDashboardApp(app, deps) {
return savedDashboard;
})
.catch(error => {
// A corrupt dashboard was detected (e.g. with invalid JSON properties)
if (error instanceof InvalidJSONProperty) {
deps.core.notifications.toasts.addDanger(error.message);
history.push(DashboardConstants.LANDING_PAGE_PATH);
return;
}

// Preserve BWC of v5.3.0 links for new, unsaved dashboards.
// See https://github.com/elastic/kibana/issues/10951 for more context.
if (error instanceof SavedObjectNotFound && id === 'create') {
Expand All @@ -230,18 +222,12 @@ export function initDashboardApp(app, deps) {
);
return new Promise(() => {});
} else {
throw error;
// E.g. a corrupt or deleted dashboard
deps.core.notifications.toasts.addDanger(error.message);
history.push(DashboardConstants.LANDING_PAGE_PATH);
return new Promise(() => {});
}
})
.catch(
redirectWhenMissing({
history,
mapping: {
dashboard: DashboardConstants.LANDING_PAGE_PATH,
},
toastNotifications: deps.core.notifications.toasts,
})
);
});
},
},
})
Expand Down