Просмотр исходного кода

Minor react graph panel refactorings and fixes

Torkel Ödegaard 7 лет назад
Родитель
Сommit
0fe452ec26

+ 1 - 1
public/app/core/components/Switch/Switch.tsx

@@ -32,7 +32,7 @@ export class Switch extends PureComponent<Props, State> {
     const switchClassName = `gf-form-switch ${switchClass} ${transparent ? 'gf-form-switch--transparent' : ''}`;
 
     return (
-      <label htmlFor={labelId} className="gf-form-switch-container">
+      <label htmlFor={labelId} className="gf-form gf-form-switch-container">
         {label && <div className={labelClassName}>{label}</div>}
         <div className={switchClassName}>
           <input id={labelId} type="checkbox" checked={checked} onChange={this.internalOnChange} />

+ 10 - 19
public/app/plugins/panel/graph2/GraphOptions.tsx

@@ -27,26 +27,17 @@ export class GraphOptions extends PureComponent<PanelOptionsProps<Options>> {
 
     return (
       <div>
-        <div className="form-option-box">
-          <div className="form-option-box__header">Display Options</div>
-          <div className="section gf-form-group">
-            <h5 className="section-heading">Draw Modes</h5>
-            <Switch label="Lines" labelClass="width-5" checked={showLines} onChange={this.onToggleLines} />
-            <Switch label="Bars" labelClass="width-5" checked={showBars} onChange={this.onToggleBars} />
-            <Switch label="Points" labelClass="width-5" checked={showPoints} onChange={this.onTogglePoints} />
-          </div>
-          <div className="section gf-form-group">
-            <h5 className="section-heading">Test Options</h5>
-            <Switch label="Lines" labelClass="width-5" checked={showLines} onChange={this.onToggleLines} />
-            <Switch label="Bars" labelClass="width-5" checked={showBars} onChange={this.onToggleBars} />
-            <Switch label="Points" labelClass="width-5" checked={showPoints} onChange={this.onTogglePoints} />
-          </div>
+        <div className="section gf-form-group">
+          <h5 className="section-heading">Draw Modes</h5>
+          <Switch label="Lines" labelClass="width-5" checked={showLines} onChange={this.onToggleLines} />
+          <Switch label="Bars" labelClass="width-5" checked={showBars} onChange={this.onToggleBars} />
+          <Switch label="Points" labelClass="width-5" checked={showPoints} onChange={this.onTogglePoints} />
         </div>
-        <div className="form-option-box">
-          <div className="form-option-box__header">Axes</div>
-        </div>
-        <div className="form-option-box">
-          <div className="form-option-box__header">Thresholds</div>
+        <div className="section gf-form-group">
+          <h5 className="section-heading">Test Options</h5>
+          <Switch label="Lines" labelClass="width-5" checked={showLines} onChange={this.onToggleLines} />
+          <Switch label="Bars" labelClass="width-5" checked={showBars} onChange={this.onToggleBars} />
+          <Switch label="Points" labelClass="width-5" checked={showPoints} onChange={this.onTogglePoints} />
         </div>
       </div>
     );