Page: Remove toolbar prop as it's no longer needed (#67734)

This commit is contained in:
Torkel Ödegaard
2023-05-03 16:07:43 +02:00
committed by GitHub
parent 3a6f162cc6
commit 2ecc1802e7
6 changed files with 24 additions and 43 deletions

View File

@@ -429,12 +429,6 @@ export class PanelEditorUnconnected extends PureComponent<Props> {
this.setState({ showSaveLibraryPanelModal: false });
};
renderToolbar() {
return (
<AppChromeUpdate actions={<ToolbarButtonRow alignment="right">{this.renderEditorActions()}</ToolbarButtonRow>} />
);
}
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<Props> {
pageNav={pageNav}
aria-label={selectors.components.PanelEditor.General.content}
layout={PageLayoutType.Custom}
toolbar={this.renderToolbar()}
className={className}
>
<AppChromeUpdate
actions={<ToolbarButtonRow alignment="right">{this.renderEditorActions()}</ToolbarButtonRow>}
/>
<div className={styles.wrapper}>
<div className={styles.verticalSplitPanesWrapper}>
{!uiState.isPanelOptionsVisible ? (

View File

@@ -419,20 +419,7 @@ export class UnthemedDashboardPage extends PureComponent<Props, State> {
const inspectPanel = this.getInspectPanel();
const showSubMenu = !editPanel && !kioskMode && !this.props.queryParams.editview;
const toolbar = kioskMode !== KioskMode.Full && !queryParams.editview && (
<header data-testid={selectors.pages.Dashboard.DashNav.navV2}>
<DashNav
dashboard={dashboard}
title={dashboard.title}
folderTitle={dashboard.meta.folderTitle}
isFullscreen={!!viewPanel}
onAddPanel={this.onAddPanel}
kioskMode={kioskMode}
hideTimePicker={dashboard.timepicker.hidden}
shareModalActiveTab={this.props.queryParams.shareView}
/>
</header>
);
const showToolbar = kioskMode !== KioskMode.Full && !queryParams.editview;
const pageClassName = cx({
'panel-in-fullscreen': Boolean(viewPanel),
@@ -453,11 +440,24 @@ export class UnthemedDashboardPage extends PureComponent<Props, State> {
navModel={sectionNav}
pageNav={pageNav}
layout={PageLayoutType.Canvas}
toolbar={toolbar}
className={pageClassName}
scrollRef={this.setScrollRef}
scrollTop={updateScrollTop}
>
{showToolbar && (
<header data-testid={selectors.pages.Dashboard.DashNav.navV2}>
<DashNav
dashboard={dashboard}
title={dashboard.title}
folderTitle={dashboard.meta.folderTitle}
isFullscreen={!!viewPanel}
onAddPanel={this.onAddPanel}
kioskMode={kioskMode}
hideTimePicker={dashboard.timepicker.hidden}
shareModalActiveTab={this.props.queryParams.shareView}
/>
</header>
)}
<DashboardPrompt dashboard={dashboard} />
{initError && <DashboardFailed />}
{showSubMenu && (

View File

@@ -104,12 +104,8 @@ const PublicDashboardPage = (props: Props) => {
}
return (
<Page
pageNav={{ text: dashboard.title }}
layout={PageLayoutType.Custom}
toolbar={<Toolbar dashboard={dashboard} />}
data-testid={selectors.page}
>
<Page pageNav={{ text: dashboard.title }} layout={PageLayoutType.Custom} data-testid={selectors.page}>
<Toolbar dashboard={dashboard} />
{dashboardState.initError && <DashboardFailed initError={dashboardState.initError} />}
<div className={styles.gridContainer}>
<DashboardGrid dashboard={dashboard} isEditable={false} viewPanel={null} editPanel={null} hidePanelMenus />