diff --git a/ui/src/dashboards/components/GaugeOptions.js b/ui/src/dashboards/components/GaugeOptions.js index 7d9edbad3..eb3881517 100644 --- a/ui/src/dashboards/components/GaugeOptions.js +++ b/ui/src/dashboards/components/GaugeOptions.js @@ -11,7 +11,7 @@ import Threshold from 'src/dashboards/components/Threshold' import { COLOR_TYPE_THRESHOLD, - GAUGE_COLORS, + THRESHOLD_COLORS, MAX_THRESHOLDS, MIN_THRESHOLDS, } from 'shared/constants/thresholds' @@ -27,7 +27,7 @@ class GaugeOptions extends Component { const sortedColors = _.sortBy(gaugeColors, color => color.value) if (sortedColors.length <= MAX_THRESHOLDS) { - const randomColor = _.random(0, GAUGE_COLORS.length - 1) + const randomColor = _.random(0, THRESHOLD_COLORS.length - 1) const maxValue = sortedColors[sortedColors.length - 1].value const minValue = sortedColors[0].value @@ -43,8 +43,8 @@ class GaugeOptions extends Component { type: COLOR_TYPE_THRESHOLD, id: uuid.v4(), value: randomValue, - hex: GAUGE_COLORS[randomColor].hex, - name: GAUGE_COLORS[randomColor].name, + hex: THRESHOLD_COLORS[randomColor].hex, + name: THRESHOLD_COLORS[randomColor].name, } const updatedColors = _.sortBy( diff --git a/ui/src/dashboards/components/Threshold.js b/ui/src/dashboards/components/Threshold.js index 29fe81963..8f34dbf1c 100644 --- a/ui/src/dashboards/components/Threshold.js +++ b/ui/src/dashboards/components/Threshold.js @@ -3,7 +3,7 @@ import PropTypes from 'prop-types' import ColorDropdown from 'shared/components/ColorDropdown' -import {GAUGE_COLORS} from 'shared/constants/thresholds' +import {THRESHOLD_COLORS} from 'shared/constants/thresholds' class Threshold extends Component { constructor(props) { @@ -99,7 +99,7 @@ class Threshold extends Component { ref={r => (this.thresholdInputRef = r)} />
Base Color
{ - const defaultColoring = {bgColor: null, textColor: GAUGE_COLORS[11].hex} + const defaultColoring = {bgColor: null, textColor: THRESHOLD_COLORS[11].hex} const lastValueNumber = Number(lastValue) || 0 if (!colors.length || !lastValue) { diff --git a/ui/src/shared/constants/thresholds.js b/ui/src/shared/constants/thresholds.js index 65f5bc78f..0d366ebcb 100644 --- a/ui/src/shared/constants/thresholds.js +++ b/ui/src/shared/constants/thresholds.js @@ -15,7 +15,7 @@ export const THRESHOLD_TYPE_BASE = 'base' export const TIME_FORMAT_DEFAULT = 'MM/DD/YYYY HH:mm:ss.ss' -export const GAUGE_COLORS = [ +export const THRESHOLD_COLORS = [ { hex: '#BF3D5E', name: 'ruby', @@ -97,16 +97,16 @@ export const GAUGE_COLORS = [ export const DEFAULT_GAUGE_COLORS = [ { type: COLOR_TYPE_MIN, - hex: GAUGE_COLORS[11].hex, + hex: THRESHOLD_COLORS[11].hex, id: '0', - name: GAUGE_COLORS[11].name, + name: THRESHOLD_COLORS[11].name, value: DEFAULT_VALUE_MIN, }, { type: COLOR_TYPE_MAX, - hex: GAUGE_COLORS[14].hex, + hex: THRESHOLD_COLORS[14].hex, id: '1', - name: GAUGE_COLORS[14].name, + name: THRESHOLD_COLORS[14].name, value: DEFAULT_VALUE_MAX, }, ] @@ -114,9 +114,9 @@ export const DEFAULT_GAUGE_COLORS = [ export const DEFAULT_THRESHOLDS_LIST_COLORS = [ { type: THRESHOLD_TYPE_TEXT, - hex: GAUGE_COLORS[11].hex, + hex: THRESHOLD_COLORS[11].hex, id: THRESHOLD_TYPE_BASE, - name: GAUGE_COLORS[11].name, + name: THRESHOLD_COLORS[11].name, value: -999999999999999999, }, ] @@ -124,9 +124,9 @@ export const DEFAULT_THRESHOLDS_LIST_COLORS = [ export const DEFAULT_TABLE_COLORS = [ { type: THRESHOLD_TYPE_BG, - hex: GAUGE_COLORS[18].hex, + hex: THRESHOLD_COLORS[18].hex, id: THRESHOLD_TYPE_BASE, - name: GAUGE_COLORS[18].name, + name: THRESHOLD_COLORS[18].name, value: 0, }, ]