Fix CEO error

pull/10616/head
Deniz Kusefoglu 2018-03-12 14:42:03 -07:00
parent 704901d093
commit f0c3f90f9e
3 changed files with 22 additions and 16 deletions

View File

@ -17,6 +17,7 @@ import ManualRefresh from 'src/shared/components/ManualRefresh'
import {errorThrown as errorThrownAction} from 'shared/actions/errors'
import {publishNotification} from 'shared/actions/notifications'
import idNormalizer, {TYPE_ID} from 'src/normalizers/id'
import {NULL_HOVER_TIME} from 'src/shared/constants/tableGraph'
import * as dashboardActionCreators from 'src/dashboards/actions'
import * as annotationActions from 'shared/actions/annotations'
@ -52,7 +53,7 @@ class DashboardPage extends Component {
zoomedTimeRange: {zoomedLower: null, zoomedUpper: null},
scrollTop: 0,
windowHeight: window.innerHeight,
hoverTime: '0',
hoverTime: NULL_HOVER_TIME,
}
}

View File

@ -198,18 +198,16 @@ class Dygraph extends Component {
}
handleMouseMove = e => {
const {onSetHoverTime} = this.props
const newTime = this.eventToTimestamp(e)
if (onSetHoverTime) {
onSetHoverTime(newTime)
if (this.props.onSetHoverTime) {
const newTime = this.eventToTimestamp(e)
this.props.onSetHoverTime(newTime)
}
this.setState({isNotHovering: false})
}
handleMouseOut = () => {
const {onSetHoverTime} = this.props
if (onSetHoverTime) {
onSetHoverTime(NULL_HOVER_TIME)
if (this.props.onSetHoverTime) {
this.props.onSetHoverTime(NULL_HOVER_TIME)
}
this.setState({isNotHovering: true})
}

View File

@ -32,16 +32,23 @@ class TableGraph extends Component {
}
handleHover = (columnIndex, rowIndex) => () => {
this.props.onSetHoverTime(this._data[rowIndex][0].toString())
this.setState({hoveredColumnIndex: columnIndex, hoveredRowIndex: rowIndex})
if (this.props.onSetHoverTime) {
this.props.onSetHoverTime(this._data[rowIndex][0].toString())
this.setState({
hoveredColumnIndex: columnIndex,
hoveredRowIndex: rowIndex,
})
}
}
handleMouseOut = () => {
this.props.onSetHoverTime(NULL_HOVER_TIME)
this.setState({
hoveredColumnIndex: NULL_COLUMN_INDEX,
hoveredRowIndex: NULL_ROW_INDEX,
})
if (this.props.onSetHoverTime) {
this.props.onSetHoverTime(NULL_HOVER_TIME)
this.setState({
hoveredColumnIndex: NULL_COLUMN_INDEX,
hoveredRowIndex: NULL_ROW_INDEX,
})
}
}
cellRenderer = ({columnIndex, rowIndex, key, style, parent}) => {
@ -59,7 +66,7 @@ class TableGraph extends Component {
rowIndex === parent.props.scrollToRow ||
(rowIndex === hoveredRowIndex && hoveredRowIndex !== 0) ||
(columnIndex === hoveredColumnIndex && hoveredColumnIndex !== 0)
const dataIsNumerical = typeof data[rowIndex][columnIndex] === 'number'
const dataIsNumerical = _.isNumber([rowIndex][columnIndex])
const cellClass = classnames('table-graph-cell', {
'table-graph-cell__fixed-row': isFixedRow,