simchaNielsen commented on a change in pull request #11880:
URL:
https://github.com/apache/incubator-superset/pull/11880#discussion_r534185852
##########
File path: superset-frontend/src/dashboard/components/SliceHeaderControls.jsx
##########
@@ -171,11 +171,18 @@ class SliceHeaderControls extends React.PureComponent {
addDangerToast,
isFullSize,
} = this.props;
- const cachedWhen = moment.utc(cachedDttm).fromNow();
+ const cachedWhen = cachedDttm.map(itemCachedDttm =>
+ moment.utc(itemCachedDttm).fromNow(),
+ );
const updatedWhen = updatedDttm ? moment.utc(updatedDttm).fromNow() : '';
- const refreshTooltip = isCached
- ? t('Cached %s', cachedWhen)
- : (updatedWhen && t('Fetched %s', updatedWhen)) || '';
+ const getCachedTitle = itemCached => {
+ return itemCached
+ ? t('Cached %s', cachedWhen)
+ : updatedWhen && t('Fetched %s', updatedWhen);
+ };
+ let refreshTooltip = isCached.map(getCachedTitle) || '';
+ // If all queries have same cache time we can unit them to one
+ refreshTooltip = [...new Set(refreshTooltip)].join(', ');
Review comment:
1. updated
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]