Commit 827ffacc by Johannes Schill

Pass some panel props down as strings to trigger render #14333

parent ed034b42
...@@ -95,7 +95,16 @@ export class PanelChrome extends PureComponent<Props, State> { ...@@ -95,7 +95,16 @@ export class PanelChrome extends PureComponent<Props, State> {
return ( return (
<div className="panel-container panel-container--absolute"> <div className="panel-container panel-container--absolute">
<PanelHeader panel={panel} dashboard={dashboard} timeInfo={timeInfo} /> <PanelHeader
panel={panel}
dashboard={dashboard}
timeInfo={timeInfo}
title={panel.title}
description={panel.description}
scopedVars={panel.scopedVars}
links={panel.links}
/>
<DataPanel <DataPanel
datasource={datasource} datasource={datasource}
queries={targets} queries={targets}
......
import React, { PureComponent } from 'react'; import React, { Component } from 'react';
import classNames from 'classnames'; import classNames from 'classnames';
import PanelHeaderCorner from './PanelHeaderCorner'; import PanelHeaderCorner from './PanelHeaderCorner';
...@@ -12,13 +12,17 @@ export interface Props { ...@@ -12,13 +12,17 @@ export interface Props {
panel: PanelModel; panel: PanelModel;
dashboard: DashboardModel; dashboard: DashboardModel;
timeInfo: string; timeInfo: string;
title?: string;
description?: string;
scopedVars?: string;
links?: [];
} }
interface State { interface State {
panelMenuOpen: boolean; panelMenuOpen: boolean;
} }
export class PanelHeader extends PureComponent<Props, State> { export class PanelHeader extends Component<Props, State> {
state = { state = {
panelMenuOpen: false, panelMenuOpen: false,
}; };
...@@ -44,7 +48,13 @@ export class PanelHeader extends PureComponent<Props, State> { ...@@ -44,7 +48,13 @@ export class PanelHeader extends PureComponent<Props, State> {
const { panel, dashboard, timeInfo } = this.props; const { panel, dashboard, timeInfo } = this.props;
return ( return (
<> <>
<PanelHeaderCorner panel={panel} /> <PanelHeaderCorner
panel={panel}
title={panel.title}
description={panel.description}
scopedVars={panel.scopedVars}
links={panel.links}
/>
<div className={panelHeaderClass}> <div className={panelHeaderClass}>
{isLoading && ( {isLoading && (
<span className="panel-loading"> <span className="panel-loading">
......
...@@ -14,6 +14,10 @@ enum InfoModes { ...@@ -14,6 +14,10 @@ enum InfoModes {
interface Props { interface Props {
panel: PanelModel; panel: PanelModel;
title?: string;
description?: string;
scopedVars?: string;
links?: [];
} }
export class PanelHeaderCorner extends PureComponent<Props> { export class PanelHeaderCorner extends PureComponent<Props> {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment