Commit 14d8a942 by Torkel Ödegaard Committed by GitHub

Merge pull request #15521 from grafana/hugoh/bug-type-error-in-thresholds

Fixes #15505
parents 104e656b 7f04848d
...@@ -159,8 +159,6 @@ export class ThresholdsEditor extends PureComponent<Props, State> { ...@@ -159,8 +159,6 @@ export class ThresholdsEditor extends PureComponent<Props, State> {
}; };
renderInput = (threshold: Threshold) => { renderInput = (threshold: Threshold) => {
const value = threshold.index === 0 ? 'Base' : threshold.value;
return ( return (
<div className="thresholds-row-input-inner"> <div className="thresholds-row-input-inner">
<span className="thresholds-row-input-inner-arrow" /> <span className="thresholds-row-input-inner-arrow" />
...@@ -171,21 +169,28 @@ export class ThresholdsEditor extends PureComponent<Props, State> { ...@@ -171,21 +169,28 @@ export class ThresholdsEditor extends PureComponent<Props, State> {
</div> </div>
)} )}
</div> </div>
<div className="thresholds-row-input-inner-value"> {threshold.index === 0 && (
<input <div className="thresholds-row-input-inner-value">
type="number" <input type="text" value="Base" readOnly />
step="0.0001"
onChange={event => this.onChangeThresholdValue(event, threshold)}
value={value}
onBlur={this.onBlur}
readOnly={threshold.index === 0}
/>
</div>
{threshold.index > 0 && (
<div className="thresholds-row-input-inner-remove" onClick={() => this.onRemoveThreshold(threshold)}>
<i className="fa fa-times" />
</div> </div>
)} )}
{threshold.index > 0 && (
<>
<div className="thresholds-row-input-inner-value">
<input
type="number"
step="0.0001"
onChange={event => this.onChangeThresholdValue(event, threshold)}
value={threshold.value}
onBlur={this.onBlur}
readOnly={threshold.index === 0}
/>
</div>
<div className="thresholds-row-input-inner-remove" onClick={() => this.onRemoveThreshold(threshold)}>
<i className="fa fa-times" />
</div>
</>
)}
</div> </div>
); );
}; };
......
...@@ -43,7 +43,7 @@ ...@@ -43,7 +43,7 @@
} }
.thresholds-row-input { .thresholds-row-input {
margin-top: 49px; margin-top: 44px;
margin-left: 2px; margin-left: 2px;
} }
......
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