Commit 0fe452ec by Torkel Ödegaard

Minor react graph panel refactorings and fixes

parent 0fd92ef6
...@@ -32,7 +32,7 @@ export class Switch extends PureComponent<Props, State> { ...@@ -32,7 +32,7 @@ export class Switch extends PureComponent<Props, State> {
const switchClassName = `gf-form-switch ${switchClass} ${transparent ? 'gf-form-switch--transparent' : ''}`; const switchClassName = `gf-form-switch ${switchClass} ${transparent ? 'gf-form-switch--transparent' : ''}`;
return ( 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>} {label && <div className={labelClassName}>{label}</div>}
<div className={switchClassName}> <div className={switchClassName}>
<input id={labelId} type="checkbox" checked={checked} onChange={this.internalOnChange} /> <input id={labelId} type="checkbox" checked={checked} onChange={this.internalOnChange} />
......
...@@ -27,26 +27,17 @@ export class GraphOptions extends PureComponent<PanelOptionsProps<Options>> { ...@@ -27,26 +27,17 @@ export class GraphOptions extends PureComponent<PanelOptionsProps<Options>> {
return ( return (
<div> <div>
<div className="form-option-box"> <div className="section gf-form-group">
<div className="form-option-box__header">Display Options</div> <h5 className="section-heading">Draw Modes</h5>
<div className="section gf-form-group"> <Switch label="Lines" labelClass="width-5" checked={showLines} onChange={this.onToggleLines} />
<h5 className="section-heading">Draw Modes</h5> <Switch label="Bars" labelClass="width-5" checked={showBars} onChange={this.onToggleBars} />
<Switch label="Lines" labelClass="width-5" checked={showLines} onChange={this.onToggleLines} /> <Switch label="Points" labelClass="width-5" checked={showPoints} onChange={this.onTogglePoints} />
<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> </div>
<div className="form-option-box"> <div className="section gf-form-group">
<div className="form-option-box__header">Axes</div> <h5 className="section-heading">Test Options</h5>
</div> <Switch label="Lines" labelClass="width-5" checked={showLines} onChange={this.onToggleLines} />
<div className="form-option-box"> <Switch label="Bars" labelClass="width-5" checked={showBars} onChange={this.onToggleBars} />
<div className="form-option-box__header">Thresholds</div> <Switch label="Points" labelClass="width-5" checked={showPoints} onChange={this.onTogglePoints} />
</div> </div>
</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