You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by GitBox <gi...@apache.org> on 2020/12/02 13:06:08 UTC

[GitHub] [incubator-superset] simchaNielsen commented on a change in pull request #11880: feat: Support multiple queries per request

simchaNielsen commented on a change in pull request #11880:
URL: https://github.com/apache/incubator-superset/pull/11880#discussion_r534151585



##########
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:
       @villebro So basically if all requests will have same time it will look like"
   ![Screen Shot 2020-12-02 at 15 04 00](https://user-images.githubusercontent.com/56388545/100876256-d1e06f80-34af-11eb-8aeb-9ecd1af71c49.png)
   And if different then like this:
   ![Screen Shot 2020-12-02 at 15 05 37](https://user-images.githubusercontent.com/56388545/100876280-d9a01400-34af-11eb-9101-a00560d32b94.png)
   
   




----------------------------------------------------------------
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org