diff --git a/public/app/core/components/Page/Page.tsx b/public/app/core/components/Page/Page.tsx index df666b44ed9..67cb493f3da 100644 --- a/public/app/core/components/Page/Page.tsx +++ b/public/app/core/components/Page/Page.tsx @@ -24,7 +24,6 @@ export const Page: PageType = ({ className, info, layout = PageLayoutType.Standard, - toolbar, scrollTop, scrollRef, ...otherProps @@ -70,18 +69,10 @@ export const Page: PageType = ({ )} {layout === PageLayoutType.Canvas && ( -
- {toolbar} - {children} -
+
{children}
)} - {layout === PageLayoutType.Custom && ( - <> - {toolbar} - {children} - - )} + {layout === PageLayoutType.Custom && children} ); }; diff --git a/public/app/core/components/Page/types.ts b/public/app/core/components/Page/types.ts index 64b8ba7ba0d..6b9264324e6 100644 --- a/public/app/core/components/Page/types.ts +++ b/public/app/core/components/Page/types.ts @@ -19,8 +19,6 @@ export interface PageProps extends HTMLAttributes { subTitle?: React.ReactNode; /** Control the page layout. */ layout?: PageLayoutType; - /** Something we can remove when we remove the old nav. */ - toolbar?: React.ReactNode; /** Can be used to get the scroll container element to access scroll position */ scrollRef?: RefCallback; /** Can be used to update the current scroll position */ diff --git a/public/app/features/dashboard/components/PanelEditor/PanelEditor.tsx b/public/app/features/dashboard/components/PanelEditor/PanelEditor.tsx index de45e2a6f12..772301165aa 100644 --- a/public/app/features/dashboard/components/PanelEditor/PanelEditor.tsx +++ b/public/app/features/dashboard/components/PanelEditor/PanelEditor.tsx @@ -429,12 +429,6 @@ export class PanelEditorUnconnected extends PureComponent { this.setState({ showSaveLibraryPanelModal: false }); }; - renderToolbar() { - return ( - {this.renderEditorActions()}} /> - ); - } - render() { const { initDone, uiState, theme, sectionNav, pageNav, className, updatePanelEditorUIState } = this.props; const styles = getStyles(theme, this.props); @@ -449,9 +443,11 @@ export class PanelEditorUnconnected extends PureComponent { pageNav={pageNav} aria-label={selectors.components.PanelEditor.General.content} layout={PageLayoutType.Custom} - toolbar={this.renderToolbar()} className={className} > + {this.renderEditorActions()}} + />
{!uiState.isPanelOptionsVisible ? ( diff --git a/public/app/features/dashboard/containers/DashboardPage.tsx b/public/app/features/dashboard/containers/DashboardPage.tsx index e0c5cd3091b..cab687ff7e5 100644 --- a/public/app/features/dashboard/containers/DashboardPage.tsx +++ b/public/app/features/dashboard/containers/DashboardPage.tsx @@ -419,20 +419,7 @@ export class UnthemedDashboardPage extends PureComponent { const inspectPanel = this.getInspectPanel(); const showSubMenu = !editPanel && !kioskMode && !this.props.queryParams.editview; - const toolbar = kioskMode !== KioskMode.Full && !queryParams.editview && ( -
- -
- ); + const showToolbar = kioskMode !== KioskMode.Full && !queryParams.editview; const pageClassName = cx({ 'panel-in-fullscreen': Boolean(viewPanel), @@ -453,11 +440,24 @@ export class UnthemedDashboardPage extends PureComponent { navModel={sectionNav} pageNav={pageNav} layout={PageLayoutType.Canvas} - toolbar={toolbar} className={pageClassName} scrollRef={this.setScrollRef} scrollTop={updateScrollTop} > + {showToolbar && ( +
+ +
+ )} {initError && } {showSubMenu && ( diff --git a/public/app/features/dashboard/containers/PublicDashboardPage.tsx b/public/app/features/dashboard/containers/PublicDashboardPage.tsx index 12e5fa6cda8..861f7b6dd70 100644 --- a/public/app/features/dashboard/containers/PublicDashboardPage.tsx +++ b/public/app/features/dashboard/containers/PublicDashboardPage.tsx @@ -104,12 +104,8 @@ const PublicDashboardPage = (props: Props) => { } return ( - } - data-testid={selectors.page} - > + + {dashboardState.initError && }
diff --git a/public/app/features/scenes/dashboard/DashboardScene.tsx b/public/app/features/scenes/dashboard/DashboardScene.tsx index 2f0d2967dc7..b3132a98e51 100644 --- a/public/app/features/scenes/dashboard/DashboardScene.tsx +++ b/public/app/features/scenes/dashboard/DashboardScene.tsx @@ -36,10 +36,10 @@ function DashboardSceneRenderer({ model }: SceneComponentProps) /> ); } - const pageToolbar = ; return ( - + + {controls && (
{controls.map((control) => (