Browse Source

Merge pull request #15789 from grafana/hide-time-info

Hide time info switch when no time options are specified
Torkel Ödegaard 6 years ago
parent
commit
a73663de41
1 changed files with 5 additions and 4 deletions
  1. 5 4
      public/app/features/dashboard/panel_editor/QueryOptions.tsx

+ 5 - 4
public/app/features/dashboard/panel_editor/QueryOptions.tsx

@@ -210,10 +210,11 @@ export class QueryOptions extends PureComponent<Props, State> {
             value={timeShift}
           />
         </div>
-
-        <div className="gf-form-inline">
-          <Switch label="Hide time info" checked={hideTimeOverride} onChange={this.onToggleTimeOverride} />
-        </div>
+        {(timeShift || relativeTime) && (
+          <div className="gf-form-inline">
+            <Switch label="Hide time info" checked={hideTimeOverride} onChange={this.onToggleTimeOverride} />
+          </div>
+        )}
       </div>
     );
   }