mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Dashboard: When dashboard is not found show message instead of empty page (#65508)
* setup page when dashboard is not found * reuse ErrorPage for not found dashboard
This commit is contained in:
@@ -19,6 +19,7 @@ import { selectors } from '@grafana/e2e-selectors';
|
||||
import { config, locationService } from '@grafana/runtime';
|
||||
import { Icon, Themeable2, withTheme2 } from '@grafana/ui';
|
||||
import { notifyApp } from 'app/core/actions';
|
||||
import ErrorPage from 'app/core/components/ErrorPage/ErrorPage';
|
||||
import { Page } from 'app/core/components/Page/Page';
|
||||
import { GrafanaContext, GrafanaContextType } from 'app/core/context/GrafanaContext';
|
||||
import { createErrorNotification } from 'app/core/copy/appNotification';
|
||||
@@ -440,6 +441,10 @@ export class UnthemedDashboardPage extends PureComponent<Props, State> {
|
||||
>
|
||||
<DashboardPrompt dashboard={dashboard} />
|
||||
{initError && <DashboardFailed />}
|
||||
{dashboard.meta.dashboardNotFound ? (
|
||||
<ErrorPage />
|
||||
) : (
|
||||
<>
|
||||
{showSubMenu && (
|
||||
<section aria-label={selectors.pages.Dashboard.SubMenu.submenu}>
|
||||
<SubMenu dashboard={dashboard} annotations={dashboard.annotations.list} links={dashboard.links} />
|
||||
@@ -481,6 +486,8 @@ export class UnthemedDashboardPage extends PureComponent<Props, State> {
|
||||
/>
|
||||
)}
|
||||
{inspectPanel && <PanelInspector dashboard={dashboard} panel={inspectPanel} />}
|
||||
</>
|
||||
)}
|
||||
</Page>
|
||||
{editPanel && (
|
||||
<PanelEditor
|
||||
|
Reference in New Issue
Block a user