[Dashboard bug] Fix Cache status and dttm information display for each slice (#3833)

This commit is contained in:
Grace Guo
2017-11-11 21:51:25 -08:00
committed by GitHub
parent 8459347bdc
commit b4c9402737
3 changed files with 51 additions and 37 deletions

View File

@@ -11,6 +11,8 @@ const propTypes = {
exploreChartUrl: PropTypes.string,
exportCSVUrl: PropTypes.string,
isExpanded: PropTypes.bool,
isCached: PropTypes.bool,
cachedDttm: PropTypes.number,
formDataExtra: PropTypes.object,
removeSlice: PropTypes.func,
updateSliceName: PropTypes.func,
@@ -40,9 +42,9 @@ class SliceHeader extends React.PureComponent {
render() {
const slice = this.props.slice;
const isCached = slice.is_cached;
const isCached = this.props.isCached;
const isExpanded = !!this.props.isExpanded;
const cachedWhen = moment.utc(slice.cached_dttm).fromNow();
const cachedWhen = moment.utc(this.props.cachedDttm).fromNow();
const refreshTooltip = isCached ?
t('Served from data cached %s . Click to force refresh.', cachedWhen) :
t('Force refresh data');