Commit 1093f9da by praveensastry

refactoring after review comments

parent b74e7629
...@@ -87,7 +87,7 @@ export class DashboardRow extends React.Component<DashboardRowProps, any> { ...@@ -87,7 +87,7 @@ export class DashboardRow extends React.Component<DashboardRowProps, any> {
const title = templateSrv.replaceWithText(this.props.panel.title, this.props.panel.scopedVars); const title = templateSrv.replaceWithText(this.props.panel.title, this.props.panel.scopedVars);
const count = this.props.panel.panels ? this.props.panel.panels.length : 0; const count = this.props.panel.panels ? this.props.panel.panels.length : 0;
const panels = count === 1 ? 'panel' : 'panels'; const panels = count === 1 ? 'panel' : 'panels';
const editModeEnabled = this.dashboard.meta.canEdit === true; const canEdit = this.dashboard.meta.canEdit === true;
return ( return (
<div className={classes}> <div className={classes}>
...@@ -98,7 +98,7 @@ export class DashboardRow extends React.Component<DashboardRowProps, any> { ...@@ -98,7 +98,7 @@ export class DashboardRow extends React.Component<DashboardRowProps, any> {
({count} {panels}) ({count} {panels})
</span> </span>
</a> </a>
{this.dashboard.meta.canEdit === true && ( {canEdit && (
<div className="dashboard-row__actions"> <div className="dashboard-row__actions">
<a className="pointer" onClick={this.openSettings}> <a className="pointer" onClick={this.openSettings}>
<i className="fa fa-cog" /> <i className="fa fa-cog" />
...@@ -113,7 +113,7 @@ export class DashboardRow extends React.Component<DashboardRowProps, any> { ...@@ -113,7 +113,7 @@ export class DashboardRow extends React.Component<DashboardRowProps, any> {
&nbsp; &nbsp;
</div> </div>
)} )}
{editModeEnabled && <div className="dashboard-row__drag grid-drag-handle" />} {canEdit && <div className="dashboard-row__drag grid-drag-handle" />}
</div> </div>
); );
} }
......
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