simchaNielsen commented on a change in pull request #11880:
URL:
https://github.com/apache/incubator-superset/pull/11880#discussion_r534705132
##########
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:

It's only emulation of 2 queries, by code changes, in real case:
1. if all queries have same cache time they will be squashed to one
notification like it was before my change
2. if queries will have different time it will be shown like here
----------------------------------------------------------------
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]