Merge pull request #3341 from influxdata/bugfix/decimalplaces-backend

Fix backend defaults for decimal places
pull/10616/head
Deniz Kusefoglu 2018-05-01 13:05:35 -07:00 committed by GitHub
commit 2611b9a549
4 changed files with 12 additions and 3 deletions

View File

@ -465,6 +465,9 @@ func UnmarshalDashboard(data []byte, d *chronograf.Dashboard) error {
if c.DecimalPlaces != nil {
decimalPlaces.IsEnforced = c.DecimalPlaces.IsEnforced
decimalPlaces.Digits = c.DecimalPlaces.Digits
} else {
decimalPlaces.IsEnforced = false
decimalPlaces.Digits = 3
}
// FIXME: this is merely for legacy cells and

View File

@ -163,11 +163,11 @@ const propTypes = {
wrapping: string.isRequired,
fixFirstColumn: bool.isRequired,
}),
timeFormat: string.isRequired,
timeFormat: string,
decimalPlaces: shape({
isEnforced: bool.isRequired,
digits: number.isRequired,
}).isRequired,
}),
fieldOptions: arrayOf(
shape({
internalName: string.isRequired,

View File

@ -173,7 +173,7 @@ LayoutRenderer.propTypes = {
i: string.isRequired,
name: string.isRequired,
type: string.isRequired,
timeFormat: string.isRequired,
timeFormat: string,
tableOptions: shape({
verticalTimeAxis: bool.isRequired,
sortBy: shape({

View File

@ -13,6 +13,10 @@ import TableGraph from 'shared/components/TableGraph'
import {colorsStringSchema} from 'shared/schemas'
import {setHoverTime} from 'src/dashboards/actions'
import {
DEFAULT_TIME_FORMAT,
DEFAULT_DECIMAL_PLACES,
} from 'src/dashboards/constants'
const RefreshingLineGraph = AutoRefresh(LineGraph)
const RefreshingSingleStat = AutoRefresh(SingleStat)
@ -203,6 +207,8 @@ RefreshingGraph.defaultProps = {
manualRefresh: 0,
staticLegend: false,
inView: true,
timeFormat: DEFAULT_TIME_FORMAT,
decimalPlaces: DEFAULT_DECIMAL_PLACES,
}
const mapStateToProps = ({dashboardUI, annotations: {mode}}) => ({