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 2022/05/20 16:44:38 UTC

[GitHub] [superset] villebro commented on a diff in pull request #20111: feat(dashboard): Chart title click redirects to Explore in new tab

villebro commented on code in PR #20111:
URL: https://github.com/apache/superset/pull/20111#discussion_r878345295


##########
superset-frontend/src/dashboard/components/SliceHeader/index.tsx:
##########
@@ -104,9 +104,18 @@ const SliceHeader: FC<SliceHeaderProps> = ({
     [crossFilterValue],
   );
 
+  const handleClickTitle =
+    !editMode && supersetCanExplore ? onExploreChart : undefined;
+
   useEffect(() => {
     const headerElement = headerRef.current;
-    if (
+    if (handleClickTitle) {
+      setHeaderTooltip(
+        sliceName
+          ? t('Click to edit %s in a new tab', sliceName)
+          : t('Click to edit chart in a new tab'),

Review Comment:
   I'm kind of surprised by `sliceName` being optional:
   <img width="611" alt="image" src="https://user-images.githubusercontent.com/33317356/169573939-b6b98b97-dfb9-4f53-a726-6a82b5bb43b6.png">
   Not a blocker, but would be interesting to see if it really should be optional.



-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

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