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/18 13:15:12 UTC

[GitHub] [superset] kgabryje opened a new pull request, #20111: feat(dashboard): Chart title click redirects to Explore in new tab

kgabryje opened a new pull request, #20111:
URL: https://github.com/apache/superset/pull/20111

   ### SUMMARY
   This PR makes the chart title in dashboard clickable - redirects to Explore on click. It's basically a shortcut for clicking options -> Edit chart.
   On hover the title gets underlined + tooltip appears with prompt to click "Click to edit _chart name_ in a new tab".
   This effect is active only in non edit mode and when user has access to Explore
   
   ### BEFORE/AFTER SCREENSHOTS
   
   https://user-images.githubusercontent.com/15073128/169046626-aa1ab0e6-cf6c-43fe-b329-202cc3d78a1a.mov
   
   ### TESTING INSTRUCTIONS
   Flow 1
   1. Go to dashboard
   2. Hover over a chart title - it should get underlined and a tooltip should appear
   3. Click and verify that you got redirected to Explore in a new tab
   
   Flow 2
   1. Go to dashboard's edit mode
   2. Hover over chart title - no underline or tooltip should appear
   3. Click chart title - you should be able to edit the title, click doesn't redirect to Explore
   
   Flow 3
   1. Login as a user without access to Explore and go to dashboard
   2. Nothing should happen when you hover over a chart title
   
   ### ADDITIONAL INFORMATION
   <!--- Check any relevant boxes with "x" -->
   <!--- HINT: Include "Fixes #nnn" if you are fixing an existing issue -->
   - [ ] Has associated issue:
   - [ ] Required feature flags:
   - [ ] Changes UI
   - [ ] Includes DB Migration (follow approval process in [SIP-59](https://github.com/apache/superset/issues/13351))
     - [ ] Migration is atomic, supports rollback & is backwards-compatible
     - [ ] Confirm DB migration upgrade and downgrade tested
     - [ ] Runtime estimates and downtime expectations provided
   - [ ] Introduces new feature or API
   - [ ] Removes existing feature or API
   


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


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

Posted by GitBox <gi...@apache.org>.
stephenLYZ commented on code in PR #20111:
URL: https://github.com/apache/superset/pull/20111#discussion_r876049255


##########
superset-frontend/src/dashboard/components/SliceHeader/index.tsx:
##########
@@ -104,9 +104,18 @@ const SliceHeader: FC<SliceHeaderProps> = ({
     [crossFilterValue],
   );
 
+  const handleClickTitle =

Review Comment:
   Can we use useCallback/useMemo to keep the same function reference?



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


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

Posted by GitBox <gi...@apache.org>.
codecov[bot] commented on PR #20111:
URL: https://github.com/apache/superset/pull/20111#issuecomment-1130053761

   # [Codecov](https://codecov.io/gh/apache/superset/pull/20111?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
   > Merging [#20111](https://codecov.io/gh/apache/superset/pull/20111?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (9160d7d) into [master](https://codecov.io/gh/apache/superset/commit/9cdaa280429ec297db16d56c94fd77b5d2aff107?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (9cdaa28) will **increase** coverage by `0.00%`.
   > The diff coverage is `86.36%`.
   
   > :exclamation: Current head 9160d7d differs from pull request most recent head 9da3d82. Consider uploading reports for the commit 9da3d82 to get more accurate results
   
   ```diff
   @@           Coverage Diff           @@
   ##           master   #20111   +/-   ##
   =======================================
     Coverage   66.46%   66.46%           
   =======================================
     Files        1721     1721           
     Lines       64463    64471    +8     
     Branches     6794     6799    +5     
   =======================================
   + Hits        42844    42850    +6     
   - Misses      19891    19892    +1     
   - Partials     1728     1729    +1     
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | javascript | `51.36% <75.00%> (+<0.01%)` | :arrow_up: |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   | [Impacted Files](https://codecov.io/gh/apache/superset/pull/20111?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [...end/src/dashboard/components/SliceHeader/index.tsx](https://codecov.io/gh/apache/superset/pull/20111/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9jb21wb25lbnRzL1NsaWNlSGVhZGVyL2luZGV4LnRzeA==) | `86.27% <60.00%> (-0.96%)` | :arrow_down: |
   | [superset/databases/commands/test\_connection.py](https://codecov.io/gh/apache/superset/pull/20111/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvZGF0YWJhc2VzL2NvbW1hbmRzL3Rlc3RfY29ubmVjdGlvbi5weQ==) | `98.64% <92.85%> (-1.36%)` | :arrow_down: |
   | [...et-frontend/src/components/EditableTitle/index.tsx](https://codecov.io/gh/apache/superset/pull/20111/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbXBvbmVudHMvRWRpdGFibGVUaXRsZS9pbmRleC50c3g=) | `70.00% <100.00%> (ø)` | |
   | [superset-frontend/src/components/Modal/Modal.tsx](https://codecov.io/gh/apache/superset/pull/20111/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbXBvbmVudHMvTW9kYWwvTW9kYWwudHN4) | `86.15% <100.00%> (+0.21%)` | :arrow_up: |
   | [...nd/src/views/CRUD/data/dataset/AddDatasetModal.tsx](https://codecov.io/gh/apache/superset/pull/20111/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL3ZpZXdzL0NSVUQvZGF0YS9kYXRhc2V0L0FkZERhdGFzZXRNb2RhbC50c3g=) | `41.66% <100.00%> (ø)` | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/superset/pull/20111?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/superset/pull/20111?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [9cdaa28...9da3d82](https://codecov.io/gh/apache/superset/pull/20111?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   


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


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

Posted by GitBox <gi...@apache.org>.
ktmud commented on PR #20111:
URL: https://github.com/apache/superset/pull/20111#issuecomment-1155666343

   The hover link isn't very discoverable so I don't think we can remove the link in 3 dots menu. I'm also curious, why do we decide to open the link in new tab when clicking from title but changed the link in the menu to open in the same tab? 
   
   This kind of back and forth and inconsistency would be confusing to users, too.


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


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

Posted by GitBox <gi...@apache.org>.
kgabryje commented on PR #20111:
URL: https://github.com/apache/superset/pull/20111#issuecomment-1134546152

   > I wonder if we couldn't just remove the old menu item as it's now kinda redundant
   
   The purpose of keeping the "Edit chart" action item is to avoid confusion among current users who are used to going to explore via the chart menu
   CC @kasiazjc
   


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


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

Posted by GitBox <gi...@apache.org>.
kgabryje commented on code in PR #20111:
URL: https://github.com/apache/superset/pull/20111#discussion_r878369665


##########
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 think those checks are for the edge case where sliceName is an empty string (not sure if it's possible to achieve such state)



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


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

Posted by GitBox <gi...@apache.org>.
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


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

Posted by GitBox <gi...@apache.org>.
kgabryje commented on code in PR #20111:
URL: https://github.com/apache/superset/pull/20111#discussion_r876884452


##########
superset-frontend/src/dashboard/components/SliceHeader/index.tsx:
##########
@@ -104,9 +104,18 @@ const SliceHeader: FC<SliceHeaderProps> = ({
     [crossFilterValue],
   );
 
+  const handleClickTitle =

Review Comment:
   It actually is the same reference! We don't create a new function here, only either assign the one from props or undefined. So unless `onExploreChart` changes on every render (and if it does, we should fix it there), the reference will stay the same



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


[GitHub] [superset] kgabryje merged pull request #20111: feat(dashboard): Chart title click redirects to Explore in new tab

Posted by GitBox <gi...@apache.org>.
kgabryje merged PR #20111:
URL: https://github.com/apache/superset/pull/20111


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


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

Posted by GitBox <gi...@apache.org>.
kgabryje commented on PR #20111:
URL: https://github.com/apache/superset/pull/20111#issuecomment-1157632338

   Yeah, it should be consistent... I think we should stay on the same tab in both cases


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