From 7f04848dea98282a97f6f6a9227dc2d96f05cbf4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugo=20H=C3=A4ggmark?= Date: Tue, 19 Feb 2019 07:48:54 +0100 Subject: [PATCH] Fixes #15505 --- .../ThresholdsEditor/ThresholdsEditor.tsx | 35 +++++++++++-------- .../ThresholdsEditor/_ThresholdsEditor.scss | 2 +- 2 files changed, 21 insertions(+), 16 deletions(-) diff --git a/packages/grafana-ui/src/components/ThresholdsEditor/ThresholdsEditor.tsx b/packages/grafana-ui/src/components/ThresholdsEditor/ThresholdsEditor.tsx index 475e69b4de8..d613a911b03 100644 --- a/packages/grafana-ui/src/components/ThresholdsEditor/ThresholdsEditor.tsx +++ b/packages/grafana-ui/src/components/ThresholdsEditor/ThresholdsEditor.tsx @@ -159,8 +159,6 @@ export class ThresholdsEditor extends PureComponent { }; renderInput = (threshold: Threshold) => { - const value = threshold.index === 0 ? 'Base' : threshold.value; - return (
@@ -171,21 +169,28 @@ export class ThresholdsEditor extends PureComponent {
)} -
- this.onChangeThresholdValue(event, threshold)} - value={value} - onBlur={this.onBlur} - readOnly={threshold.index === 0} - /> -
- {threshold.index > 0 && ( -
this.onRemoveThreshold(threshold)}> - + {threshold.index === 0 && ( +
+
)} + {threshold.index > 0 && ( + <> +
+ this.onChangeThresholdValue(event, threshold)} + value={threshold.value} + onBlur={this.onBlur} + readOnly={threshold.index === 0} + /> +
+
this.onRemoveThreshold(threshold)}> + +
+ + )}
); }; diff --git a/packages/grafana-ui/src/components/ThresholdsEditor/_ThresholdsEditor.scss b/packages/grafana-ui/src/components/ThresholdsEditor/_ThresholdsEditor.scss index 8ef59bf08af..af70fd86f7a 100644 --- a/packages/grafana-ui/src/components/ThresholdsEditor/_ThresholdsEditor.scss +++ b/packages/grafana-ui/src/components/ThresholdsEditor/_ThresholdsEditor.scss @@ -43,7 +43,7 @@ } .thresholds-row-input { - margin-top: 49px; + margin-top: 44px; margin-left: 2px; }