Change dataExists to a bool and handle instances of Autorefresh where grabdatafordownload is not defined

pull/10616/head
deniz kusefoglu 2017-10-16 09:55:03 -07:00
parent 921bf66dc8
commit 84c8945ff4
3 changed files with 6 additions and 4 deletions

View File

@ -156,7 +156,9 @@ const AutoRefresh = ComposedComponent => {
lastQuerySuccessful, lastQuerySuccessful,
isFetching: false, isFetching: false,
}) })
grabDataForDownload(timeSeries) if (grabDataForDownload) {
grabDataForDownload(timeSeries)
}
}) })
}, },

View File

@ -59,7 +59,7 @@ class LayoutCell extends Component {
<div className="dash-graph"> <div className="dash-graph">
<LayoutCellMenu <LayoutCellMenu
cell={cell} cell={cell}
dataExists={celldata.length} dataExists={!!celldata.length}
isDeleting={isDeleting} isDeleting={isDeleting}
isEditable={isEditable} isEditable={isEditable}
onDelete={this.handleDeleteCell} onDelete={this.handleDeleteCell}

View File

@ -53,7 +53,7 @@ const LayoutCellMenuContainer = props => {
return <LayoutCellMenu {...props} /> return <LayoutCellMenu {...props} />
} }
const {bool, func, shape, number} = PropTypes const {bool, func, shape} = PropTypes
LayoutCellMenuContainer.propTypes = { LayoutCellMenuContainer.propTypes = {
isDeleting: bool, isDeleting: bool,
@ -62,7 +62,7 @@ LayoutCellMenuContainer.propTypes = {
onDeleteClick: func, onDeleteClick: func,
cell: shape(), cell: shape(),
isEditable: bool, isEditable: bool,
dataExists: number, dataExists: bool,
} }
LayoutCellMenu.propTypes = LayoutCellMenuContainer.propTypes LayoutCellMenu.propTypes = LayoutCellMenuContainer.propTypes