Dashboards: Wrap MakeEditable in the new Page layout (#60311)

Wrap MakeEditable in the new Page layout
This commit is contained in:
Josh Hunt 2022-12-14 13:32:29 +00:00 committed by GitHub
parent c75ed8fa69
commit 495fceeeef
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -6,6 +6,7 @@ import { locationUtil, NavModel, NavModelItem } from '@grafana/data';
import { locationService } from '@grafana/runtime'; import { locationService } from '@grafana/runtime';
import { Button, PageToolbar } from '@grafana/ui'; import { Button, PageToolbar } from '@grafana/ui';
import { AppChromeUpdate } from 'app/core/components/AppChrome/AppChromeUpdate'; import { AppChromeUpdate } from 'app/core/components/AppChrome/AppChromeUpdate';
import { Page } from 'app/core/components/PageNew/Page';
import config from 'app/core/config'; import config from 'app/core/config';
import { contextSrv } from 'app/core/services/context_srv'; import { contextSrv } from 'app/core/services/context_srv';
import { AccessControlAction } from 'app/types'; import { AccessControlAction } from 'app/types';
@ -204,7 +205,7 @@ function getSectionNav(
}; };
} }
function MakeEditable({ dashboard }: SettingsPageProps) { function MakeEditable({ dashboard, sectionNav }: SettingsPageProps) {
const onMakeEditable = () => { const onMakeEditable = () => {
dashboard.editable = true; dashboard.editable = true;
dashboard.meta.canMakeEditable = false; dashboard.meta.canMakeEditable = false;
@ -214,12 +215,12 @@ function MakeEditable({ dashboard }: SettingsPageProps) {
}; };
return ( return (
<div> <Page navModel={sectionNav}>
<div className="dashboard-settings__header">Dashboard not editable</div> <div className="dashboard-settings__header">Dashboard not editable</div>
<Button type="submit" onClick={onMakeEditable}> <Button type="submit" onClick={onMakeEditable}>
Make editable Make editable
</Button> </Button>
</div> </Page>
); );
} }