瀏覽代碼

refactoring after review comments

praveensastry 7 年之前
父節點
當前提交
1093f9da7e
共有 1 個文件被更改,包括 3 次插入3 次删除
  1. 3 3
      public/app/features/dashboard/dashgrid/DashboardRow.tsx

+ 3 - 3
public/app/features/dashboard/dashgrid/DashboardRow.tsx

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